A brief description of installing Debian Testing/Wheezy on a MacBookAir4,2 on 19th of January 2012. By Ulrik.

I wanted a Mac OS X/Debian dual-boot configuation so an EFI-only boot was fine. With inspiration from [0].

Summary

While the idea seemed simple to me, I don't know if this way of configuring EFI boot is recommendable in practice.

OS X Preparation

In Mac OS X: Resize boot partion (live and nondestructive) so that free space is left at the end of the drive using Disk Utility. It will automatically move OS X's rescue partition as well, which is just fine.

I installed gdisk [1] and added a linux partition out of the free space, not creating any file system.

I also made sure the latest firmware update (2.2 at the time) and OS X update (10.7.2 at the time) were applied, which they were from the factory.

Preparing Installation Medium

I downloaded the testing snapshot netinst iso for amd64 [2] and inserted a usb stick to erase and fill with the installation ISO. Using the instructions from [0], you simply copy the ISO onto the usb stick using dd.

I also prepared a second usb stick for firmware from [3], but in the end it did not work automatically (because of using double usb sticks?) and I copied the firmware in place manually. The files needed are brcm/bcm43xx-0.fw and brcm/bcm43xx_hdr-0.fw from the package firmware-brcm80211_0.28+squeeze1_all.deb

Boot

Plug in the usbstick with the installation medium and boot holding the option key. Select "Windows" in apple's boot selection screen. The debian installer should appear.

DSC_6361_small.JPG

Install

I chose non-graphical install and the installation flowed as normal until the firmware prompt. I used a second getty (Alt+F2) to manually mount the second usb stick and copy the two firmware files (see above) into /lib/firmware. With that, recognition of my local WPA network was fine.

For Partitioning, I created an ext4 file system manually using a second getty, and let the installer use that as root partition and only partition. No swap, nothing.

For the GRUB installation, do not install into the "MBR"! I installed GRUB into the linux root partition. Then follows a complicated operation to install grub's efi boot.

Installing grub-efi-amd64

Again, see [0] as source.

Before allowing the installer to finish and after it installed grub, using a second terminal:

mkdir /target/boot/efi
mount /dev/sda1 /target/boot/efi  # This is the EFI system partition
mkdir /target/boot/efi/EFI/grub
ln -s /target/boot/efi/EFI/grub /target/boot/grub

Set up and enter the installation target in chroot

mount -o bind /proc /target/proc
mount -o bind /sys /target/sys
mount -o bind /dev /target/dev
mount -o bind /dev/pts /target/dev/pts
chroot /target bash

Inside the chroot

apt-get install grub-efi-amd64

Finally you should have installed an EFI target called /boot/efi/EFI/debian/grubx64.efi now. To make this visible in Apple's boot selector, copy it to /boot/efi/EFI/boot/bootx64.efi which is the fallback location for EFI boot.

Reboot

Holding the option key at boot will now allow the choice "EFI Boot" which should start GRUB and allow debian to boot.

Post-install upgrades

The image I installed from was using Linux 3.1 and debian booted when installed into garbled graphics along the rim and too low resolution. Installing the 3.2 kernel from unstable immediately fixed it and no further configuration of resolutions was needed (not in X either).

For the trackpad to work with click-and-drags, I installed xserver-xorg-input-multitouch and made sure the synaptics driver was removed.