FedoraOnMacBook

From Mactel-Linux

Jump to: navigation, search

Note: See here for a more recent and more in-depth guide to installing Fedora 8 on a MacBook Santa Rosa (3,1 or 4,1)

I wanted to dual boot OS X and a recent version of Fedora on my MacBook. I found a number of the other tutorials on this site helpful, but also found different difficulties in my installation experience.

1. I reinstalled OS X to create space for the Linux partition. During installation, I used DiskUtility to leave about 33 mb of free space. After installing OS X, I applied the firmware updates as suggested in the dual booting guide. I also installed rEFIt.

2. I booted to the install DVD for Fedora. About half of the time, the keyboard did not work during the boot menu, but would work after the system loaded. I used Fedora's partitioning utility to create a swap drive and a ext3-formatted root drive. At this point, my partition table was:

sda1 210mb fat32 EFI System Partition (boot)
sda2 126gb hfs+ Apple_HFS_Untitled_1
sda3 33gb ext3 (boot)
sda4 1074mb swap

I also let Fedora install Grub as the boot loader on to the MBR of /dev/sda. This did no harm, but as is mentioned elsewhere, GRUB seems to have problems loading with the Mac partitioning scheme (GUID partition table).

After completing installation, on reboot, rEFIt may not show any system other than Mac OS X. The Fedora installer seems to write an MBR-style partition table, so you have to use rEFIt to synchronize the GPT table with the MBR table. Once this is done, rEFIt shows a Legacy OS present (if you installed GRUB on the MBR). I tried booting to this system, and got the error:

Missing operating system

3. I rebooted to rescue mode from the Fedora DVD. Once at the prompt, I switched root filesystems to the installed drive, downloaded the binary version of lilo, and installed it. There is no installation script, but copying all of the files in the included bin to /bin and the included sbin to /sbin seems to work. I also created a configuration file for lilo at /etc/lilo.conf with the contents:

lba32
boot=/dev/sda

image=/boot/vmlinuz
  root=/dev/sda3
  label=Linux
  read-only

I installed lilo to the MBR of /dev/sda by running lilo.

At this point, if you reboot, the Legacy OS icon in rEFIt should be replaced by the Linux penguin, lilo should begin loading the system, and then crash with:

Trying to resume from LABEL=SWAP-sda4
No suspend signature on swap, not resuming.
Creating root device.
Mounting root filesystem.
mount: could not find filesystem '/dev/root'
Setting up other filesystems.
Setting up new root fs
setuproot: moving /dev failed: No such file or directory
no fstab.sys, mounting internal defaults
setuproot: error mounting /proc: No such file or directory
setuproot: error mounting /sys: No such file or directory
Switching to new root and running init.
unmounting old /dev
unmounting old /proc
unmounting old /sys
switchroot: mount failed: No such file or directory
Booting has failed.
Kernel panic - not syncing: Attempted to kill init!

4. My suspicion is that the default Fedora boot scripts depend on disk labels that are not available through GPT. I was able to boot to Fedora only after creating a custom initrd. I found this to be a useful article about making an initrd (although for another purpose).

First, create an initrd file with mkinitrd.

extract initrd image

edit init:

change mkrootdev -t ext3 -o defaults,ro sda3 to mkrootdev -t ext3 -o defaults,ro /dev/sda3

and

mount /sysroot to mount -t ext3 -o defaults,ro /dev/sda3 /sysroot

recompress initrd

edit lilo

5. reboot to fedora!

6. extras

download snapshot tarball of madwifi and rpmbuild it

modprobe ath_pci

edit /etc/wpa-supplicant/wpa-supplicant.conf

wpa_supplicant -i ath0 -D madwifi -d -c /etc/wpa_supplicant/wpa_supplicant.conf

dhclient ath0

Personal tools