A few instruction on how to make software suspend and wifi working on the C2D 2.0GHz macbook.

… or almost…

These instructions are about building the latest snapshot version of the madwifi driver (required for the macbook wireless card) against the fedora 7 developement kernel (required to make the suspend work). Since we are using developement quality software, this is going to give non predictable results and may lead to an instable system: be warned!

However I got positive results on both fronts in the last days.

First, you got to download the latest kernel packages from the testing repository for fedora 7. Point your browser to this location:

http://download.fedora.redhat.com/pub/fedora/linux/updates/testing/7/i386/

and get the files named

kernel-2.6.22.1-33.fc7.i686.rpm

and

kernel-devel-2.6.22.1-33.fc7.i686.rpm

(of course, the kernel version will change with time)

and install them with

rpm -i kernel-2.6.22.1-33.fc7.i686.rpm
rpm -i kernel-devel-2.6.22.1-33.fc7.i686.rpm

Then, get the latest snapshot of the madwifi drivers from this link

http://snapshots.madwifi.org/madwifi-ng-current.tar.gz

In order to compile the drivers the Fedora way, you got to rename the archive according to its version. To obtain the version string issue the following command:

tar -tvzf madwifi-ng-current.tar.gz

you will see several lines containing file names, with a common path (in my case, the last ones are)

-rw-r--r-- root/root 37164 2007-05-30 03:41:18 madwifi-ng-r2598-20070725/hal/ah.h
-rw-r--r-- root/root 9836 2007-05-30 03:41:18 madwifi-ng-r2598-20070725/hal/ah_desc.h
-rw-r--r-- root/root 2104 2007-03-19 15:19:02 madwifi-ng-r2598-20070725/release.h

so, we get that the file has to be renamed as madwifi-ng-r2598-20070725.tgz

after that, issue the following command to make the driver’s RPMs:

rpmbuild --define "kernel 2.6.22.1-33.fc7" -ta madwifi-ng-r2598-20070725.tar.gz

again, you have to replace both the “2.6.22.1-33.fc7” string and the “ng-r2598-20070725” with the current versions.

At the end of the process, it will tell you that he has wroted 4 RPMs called

madwifi-0.2598.20070725-6.src.rpm
madwifi-0.2598.20070725-6.i386.rpm
madwifi-module-0.2598.20070725-6_2.6.22.1_33.fc7.i386.rpm
madwifi-debuginfo-0.2598.20070725-6.i386.rpm

at this point all you need to do is install the new madwifi and madwifi-module RPMs, reboot and… cross your fingers!

update: it seems that there is a known bug in madwifi that hasn’t been solved yet. It will cause the wireless net to stop working after a while. The bug is tracked here. However reading through the comments I’ve found that issuing a

iwpriv ath0 bgscan 0

helps a lot, making the connection available for more time (or at least, it worked for me!)