MacBook Wireless on Linux

I got the wireless working on my MacBook under Fedora rawhide. The MacBook includes an Atheros chipset which needs the [madwifi](http://madwifi.org) driver. The madwifi driver can’t be included in the base kernel or distribution because it includes a binary HAL which isn’t open-source.

Unfortunately, the madwifi driver did not compile cleanly on the Fedora development kernel. First, the Fedora kernels are currently 2.6.18-rc4 but they are versioned as 2.6.17. There is code in the driver which detects 2.6.18 but that doesn’t work with the mislabelled version. Also, madwifi uses the config.h header which was replaced by autoconf.h but is finally deprecated in 2.6.18. I submitted a [ticket with patch](http://madwifi.org/ticket/845) to get this fixed.

I wanted to install the kernel modules as RPMs instead of from source. [livna.org](http://rpm.livna.org) has madwifi packages for FC5. With some patching, they are suitable for building with the [kmod scheme](http://fedoraproject.org/wiki/Packaging/KernelModules). This involves building packages for each kernel release, variant, and architecture. I only build for the i686 standard variant. The command line looks like:

rpmbuild -ba –target=i686 –define “kversion 2.6.17-1.2586.fc6” –define ‘kvariants “”‘ madwifi-kmod.spec

I have put the packages I built at [my Fedora package directory](http://znark.com/fedora/). Installing the packages from the rpm command-line can be tricky because multiple versions are installed at once. Doing an upgrade will remove the version for an old kernel.
Upgrading the module versions requires installing the new version for installed kernels and then removing the old versions. Yum is supposed to handle this.

Getting the wireless working once the module was installed was a snap. I used NetworkManager and it just worked. It detected the wireless network and switched to it when the Ethernet cable is removed. It prompts for the WPA password.