Install Archlinux on an early 2011 Macbook Pro

Installing a os other than OS X on apple hardwares makes people miserable. I was trying to install archlinux on my early 2011 13' macbook pro (macbookpro8,1), but unable to install bootloader on the /boot partition last night. This morning I tried using grub2-bios, and it worked!

Note: these instruction works on my machine, and it's not the only way, so do your own homework ( I won't explain the details ).

0. Partition and prepare

Boot into Mac OS X, use disk utils to shrink OSX partition and create partitions that will be used to install linux (choose FAT for all partition will be used in linux). This is my partition scheme:

======  ==========  ====================================
Num     Size        Usage
======  ==========  ====================================
1       30GB        Mac OS X
2       1GB         /boot
3       30GB        /
4       250GB       /home
5       5GB         swap
======  ==========  ====================================

Download rEFIt, install it. Download archlinux cd, burn it.

1. Pre-install

Reboot the machine, when you see rEFIt menu, choose partition tools, sync partition table.

Reboot, hold option(alt) button. Insert archlinux install cd, an boot into it (it says windows on the screen).

2. Installation

Same as usual. When partitioning, just assign filesystem and mount point, ignore the cfdisk part.

Dont install grub to /dev/sda. And dont reboot.

When you're done, exit the installer, return to the console. What we'll do is chroot into the installed system and install Grub2 manually.

Chroot (the installer mount the hard disk while installing, so we just need to mount /proc and /dev)

mount -t proc none /mnt/proc
mount --rbind /dev /mnt/dev
chroot /mnt /bin/bash
export PS1="(chroot) $PS1"

Create /etc/mtab

grep -v rootfs /proc/mounts > /etc/mtab

Install grub2-bios (yes bios)

pacman install grub2-bios

cp /boot/grub/grub.cfg{.example,}

Double check the grub.cfg and grub-install on you /boot partition

grub-install --recheck --force --no-floppy /dev/sda4

If it tells you that you're missing some files, do ln -s /boot/grub /grub and install again, remove the symlink afterwards.

Umount everything and reboot, eject the cdrom, and you'll see linux in the refit menu this time.

3. Post-install

Wireless doesn't work (kernel 3.0), I don't care.

Speed up the fan, the limit is 6200

echo 1 > /sys/devices/platform/applesmc.768/fan1_manual
echo 5000 > /sys/devices/platform/applesmc.768/fan1_output

Install pommed to handle the control key.

For multitouch trackpad, use xf86-input-mtrack, works just like in OS X.