MacBook and MacBook Pro 4,1 + Fedora 9

I recently bought a new MacBook Pro and had some trouble getting it to work in Fedora - Here's how I did it :)

Before we start

I've discovered three useful tips from playing around and a bit of web research that I should share before we begin. The first is that no matter how many OSs you install on your Mac, you're going to have to put Windows on the last partition of the disk. I have no idea why, but XP SP2 seems to bug out if you don't.

The second useful tip is that because of the way the EFI+MBR overlap when booting multiple operating systems, no extended partitions are supported. Mac also takes its own partition as part of the MBR compatability scheme, so that leaves you with a maximum of 3 OS partitions.

Finally and most importantly, it's very difficult to change the partitioning scheme once it's been finalized/the OSs are installed. I would recommend that if you think you're going to triple-boot later on, you leave the empty partiton in between for Linux or at the end for Windows to save you lots of headaches later... I hope this can help someone, since I almost had to format the entire HD (at that point, Windows AND Mac OS X) when I realized it would be very difficult to repartition and preserve data.

Step 1: Resize your Macintosh HD (HFS+ partition)

If you'd like to dual boot, simply open up the Boot Camp assistant and use it to partition your Mac Drive. When asked to insert the Windows installation disk, simply insert a Linux one and it will do the rest (skip step 2a). I recommend a kernel >= 2.6.24.

If you'd like to triple boot, it would be a good move to create the three partitions ahead of time. Fortunately for us, HFS+ partitions support resizing so it's a breeze to shrink OSX and add two new partitions. Simply boot from your Mac OSX install CD and select Terminal from the Utilities menu once it boots. Resize Macintish HD with this command:

diskutil resizeVolume disk0s2 100G "MS-DOS FAT32" "FormatToLinux" 15G "MS-DOS FAT32" "Windows" 50G

Change the volume sizes to match your preferred setup and hard drive size. Since both Linux can read to NTFS and read HFS+ safely, I figured it didn't need to be that big and so I left the Mac and Windows partitions larger.

When you're done, quit Terminal and reboot back into OS X. Insert the Windows install CD, reboot and hold the left "alt/option" key as the Mac boots. This will offer you the choice of booting from the CD named "Windows".

Step 2a: Install Windows

When it comes to the partition selection, select the last FAT32 partition ("Partition 4"). It should be labelled "Windows" - format it to NTFS (Quick format) and install onto that partition. Hint: One of the two OS X installation disks included with the Mac has Windows drivers for the keyboard backlight, trackpad, graphics card and more. When you're done setting up Windows, reboot holding the left "alt/option" key and boot into Mac OS X.

Step 2b: Install Fedora 9

Since the new Intel CPUs in the Macs have the EM64T extension, they support 64bit operating systems (x86_64). I chose the x86_64 variant of Fedora, however the 32bit (i386) version would work just as well. The installation, either off DVD of live media, goes pretty smoothly until partitioning. You must select "Custom Partition Layout". You'll find /dev/sda3 is type vfat - This is the drive we made that we need to format to ext3. Select it mount as "/", formatting to ext3 as well (you can use xfs or whatever filesystem you prefer here as well, I just like ext3 since it's well supported and tested). From here on you can follow the rest of the installation as usual.

Step 3: Wireless & Sound

Wireless is actually pretty easy for the Mac. The drivers included on the installation disc work perfectly, but Dell offers a driver form the same card that's easier to install than extracting it off the exes. First, download these RPMs on anther computer and transfer them to your home:

32bit (i386):
kmod-ndiswrapper-1.52-30.lvn9.i686.rpm

kmod-ndiswrapper-2.6.25-14.fc9.i686-1.52-30.lvn9.i686.rpm
ndiswrapper-1.52-1.lvn9.i386.rpm
R151517.EXE

64it (x86_64):
kmod-ndiswrapper-1.52-30.lvn9.x86_64.rpm

kmod-ndiswrapper-2.6.25-14.fc9.x86_64-1.52-30.lvn9.x86_64.rpm
ndiswrapper-1.52-1.lvn9.x86_64.rpm
R151517.EXE


Next, run this to install the wifi driver:

mkdir wifidriver
unzip -a R151517.EXE -d wifidriver/
cd wifidriver/DRIVER/
su
# install ndiswrapper and the wifi driver
rpm -Uhv *ndiswrapper*rpm && rm -i *ndiswrapper*rpm
/sbin/modprobe ndiswrapper
ndiswrapper -i bcmwl5.inf && rm -rf wifidriver && rm -i R151517.EXE
echo "options snd_hda_intel model=mbp3" >> /etc/modprobe.d/soundcard
echo "blacklist bcm43xx" >> /etc/modprobe.d/blacklist
echo "blacklist ssb" >> /etc/modprobe.d/blacklist
echo "blacklist b43" >> /etc/modprobe.d/blacklist
# ndiswrapper is used for wlan0
echo "modprobe ndiswrapper" >> /etc/rc.d/rc.local
echo "alias wlan0 ndiswrapper" >> /etc/modprobe.d/ndiswrapper
/sbin/service NetworkManager restart 

Step 5: Akmods

Since we plan on upgrading the kernel in a second, let's install akmods so that the kernel modules (ie, for wireless and nvidia if you're on a Pro) will create themselves when we update the kernel:

su
rpm -Uhv http://rpm.livna.org/livna-release-9.rpm
yum install akmods-ndiswrapper

If you're on a MacBook Pro, install the nvidia driver as well:

yum install akmods-nvidia 

Step 6: Kernel

Kernels 2.6.25.4-35 and newer include a fix for the fn-keys, which enables you to control the current song, volume and backlight, etc. At the moment this kernel hasn't been released to updates or updates-testing so we can use the a more recent koji build here. When a newer kernel is released to updates, just do a "yum update" to update the system (or do it via PackageKit if you prefere a GUI) and skip this entire step.

For 32bit systems, download it with this command:

wget http://koji.fedoraproject.org/packages/kernel/2.6.25.4/39.fc9/i686/\
kernel-2.6.25.4-39.fc9.i686.rpm http://koji.fedoraproject.org/packages/kernel\
/2.6.25.4/39.fc9/i686/kernel-devel-2.6.25.4-39.fc9.i686.rpm

For 64bit systems, download it with this command:

wget http://koji.fedoraproject.org/packages/kernel/2.6.25.4/39.fc9/x86_64/\
kernel-2.6.25.4-39.fc9.x86_64.rpm http://koji.fedoraproject.org/packages/kernel/\
2.6.25.4/39.fc9/x86_64/kernel-devel-2.6.25.4-39.fc9.x86_64.rpm

Next, install it:

su
rpm -ihv kernel*2.6.25.4-39*.rpm 

Reboot and let the akmods work their magic. If you don't have the nVidia driver and wireless working the first try, reboot again and things should return to normal.

Step 7: Pommed

Pommed lets you control the LED and keyboard backlight, soundcard, infrared remote and more. It will (hopefully) soon be included in Fedora, but until then, if you'd like to install it run this:

su
wget http://downloads.diffingo.com/diffingo-repo/diffingo.repo -O \
/etc/yum.repos.d/diffingo.repo
yum install pommed

Enjoy Linux (and Windows if applicable) on your new MacBook!

Rating: