OpenBSD -current works pretty well on my Mid-2011 Macbook Air (A1370, SandyBridge). The new KMS code brings up the MBA's eDP display in 1366x768 with backlight control. ACPI works as expected for battery/AC status, CPU throttling, and full suspend/resume support. The Broadcom wireless card does not work, so for now I am using this tiny USB adapter (urtwn
) which is rather unobtrusive when plugged in.
Dual-booting with Mac OS X is fairly easy, but once FileVault is enabled for full-disk encryption of Mac OS, it clobbers the path to boot back into OpenBSD. Here's how to get both OSes working, each with its own disk encryption, without having to use rEFIt or anything else.
###Mac OS X Configuration
-
If FileVault is already enabled, turn it off and decrypt the SSD.
-
Use Boot Camp Assistant to partition the hard drive, slicing off a portion of the end of the drive for OpenBSD (I used 30Gb on a 256Gb SSD). If BCA just pukes up an error that it couldn't repartition the drive, reboot into the recovery partition, run Disk Utility, and use Repair Disk on the SSD. My drive had some hard-link errors that were fixable but were probably preventing BCA's automated verify+repartition process from working. Some defragmenting may also be required to move blocks around to clear up space at the end of the drive (I'm not sure if BCA does this, but I have a copy of iDefrag that I used). Also, BCA will probably complain that there is no Windows DVD, so I had a Windows 7 DVD mounted (from my isostick) so BCA would think it's installing Windows 7.
-
After BCA repartitions and reboots, it will try to boot to the Windows 7 DVD. Bail on that and boot to an OpenBSD CD (again, I used my isostick).
###OpenBSD Installation
-
When OpenBSD boots, choose
(S)hell
, runfdisk -e wd0
and there should be an MSDOS partition already sliced out from BCA. Change its type toA6
and quit.disklabel -E wd0
, create a new slice taking the defaults for the new OpenBSD partition, and useRAID
as the type. Write/quit. -
bioctl -cC -l /dev/wd0a softraid0
to create a new softraid encrypted disk from the just-added RAID partition, and enter a passphrase.sd1
should show up (my isostick's USB drive takessd0
). -
install
to get back to the installer, usesd1
as the root disk, proceed as normal. -
Reboot and it should boot to the OpenBSD bootloader as usual, prompting for the encryption passphrase. If it boots back to Mac OS X, reboot and hold down the Alt/Option key at the startup chime and it should let you arrow over to choose the "Windows" disk (which is OpenBSD).
-
Verify that things are working. Wireless won't, but otherwise everything else should.
###Mac OS X Encryption
-
Once OpenBSD is installed and working, reboot back into Mac OS X (using Alt/Option if it doesn't default back to Mac OS).
-
Enable FileVault, which will require a reboot. The previous Windows/Bootcamp boot option is now gone, but it's just temporary.
-
Let FileVault start encrypting, and run
gdisk /dev/disk0
from xterm/terminal. If you don't already have gdisk, download it, it's a lifesaver. -
In
gdisk
, first runp
to see the partition table. You should have an EFI partition, anAF05
Mac partition, anAB00
recovery partition, and your OpenBSD/Bootcamp partition (which may have a type ofFFFF
). -
Use
t
to change the type of your Bootcamp partition to0700
(a FAT partition). Enterr
to enter recovery menu, thenh
to build a Hybrid MBR. You will get a face full of warnings and then asked to enter a list of partitions. Enter2 3 4
to add your 3 real partitions, and answery
to adding the first EFI partition. -
Confirm the defaults for partitions 2 and 3, but change partition 4's type to
A6
for OpenBSD. Flag it to be bootable.w
to write and quit. -
When you reboot again (you can do it while FileVault is still encrypting, it'll resume itself at next boot) and hold down Alt/Option at the startup chime, you should now see the Windows disk again as a boot option. Confirm that it boots back to the OpenBSD bootloader, then make sure you can boot back into Mac OS.
-
Boot back into Mac OS and let FileVault finish encrypting.
-
To permanently set OpenBSD as the default boot partition, run
/usr/sbin/bless --device /dev/disk0s4 --setBoot --legacy
. Now booting into Mac OS will require holding down Alt. -
Boot back into OpenBSD and get some work done.
###TODO
-
Apply the backed-out AHCI diff to take the controller out of IDE mode so the SSD uses
sd
instead ofwd
. -
Disable
uvideo0
and other crap. -
Figure out how to disable startup chime from OpenBSD (StartupSound doesn't seem to work on Mountain Lion anymore, what is it doing anyway? Writing something to NVRAM?)