Monthly Archives: November 2013

Arch Linux – MacBook Air 2013

I found it very difficult to get Arch booting via EFI as all directions I found were inconsistent. You can also try REFind, as I was able to at least get that to boot up instead of my old broken grub prompt, but I got nowhere with Refind, so I went with reinstalling grub in this article. This is what my system currently uses. No MBR, grub is booted via EFI. For partitioning, you can use a 200MB HFS+ partition to store your EFI data, or you can use FAT32 (vfat). I went the VFAT route and it worked for me, so this guide assumes you have a VFAT partition for EFI, with the scheme like this:

[root@mac ~]# fdisk -l

Disk /dev/sda: 113 GiB, 121332826112 bytes, 236978176 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: xxxx

Device Start End Size Type
/dev/sda1 2048 411647 200M Microsoft basic data
/dev/sda2 411648 935935 256M Linux filesystem
/dev/sda3 935936 9324543 4G Linux swap
/dev/sda4 9324544 236978142 108.6G Linux filesystem

I used the following to setup the filesystems:

mkfs.vfat -F 32 /dev/sda1
mkfs.ext2 /dev/sda2
mkswap /dev/sda3
swapon /dev/sda3
mkfs.ext4 /dev/sda4

mount /dev/sda4 /mnt
mkdir /mnt/boot

mount /dev/sda2 /mnt/boot
mkdir /mnt/boot/efi

mount /dev/sda1 /mnt/boot/efi

Finish your installation according to the main guide (skipping anything after the bootloader), now chroot into your installation, and setup Grub:

arch-chroot /mnt

pacman -S grub efibootmgr

# The directory paths are everything here.
mount -t efivarfs efivarfs /sys/firmware/efi/efivars
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=grub --recheck --debug
grub-mkconfig -o /boot/efi/EFI/grub/grub.cfg
cp /boot/efi/EFI/grub/grub.cfg /boot/grub/grub.cfg

# Not necessary but hey, helped me out
cp /boot/efi/EFI/grub/grubx64.efi /boot/efi/EFI/boot/bootx64.efi

Note that above, –efi-directory means that grub will append a directory named “EFI” (caps, yes) to whatever you specify. As for –bootloader-id, this gets a directory created in the –efi-directory you specified, so in this example, it’d create the directory /boot/efi/EFI/grub.

If you need to wipe out your MBR for some reason, see this page: https://bbs.archlinux.org/viewtopic.php?id=119702


Wifi

Install broadcom-wl from the AUR: broadcom-wl

Then I installed wpa_supplicant and used netctl to configure my home wifi network, worked quickly and easily.


Sound

Speakers work perfectly with kernel 3.12.1 out of the box, no configuration needed. Just turn up the volume (I didn’t even use ALSA, just had pulseaudio). If you’ve read that they “still haven’t gotten audio working” on this macbook, ignore that. Linux kernel 3.12 fixes the inherent issues with this 2013 / 6.2 macbook air.