After my successful installation on my WRAP I moved on to my PowerBook. Thanks to FileVault and HFS+ case-sensitive I had to reinstall OS X so I left some space for OpenBSD. Mac OS X is my primary workhorse for surfing, mailing and programming but I want to be able to develop and test OpenBSD ports locally.
In order to be able to dual-boot OpenBSD and Mac OS X you have to start with an OS X installation. After booting the Tiger DVD (or Panther CD) choose Disk Utility from the Menu. Partition your hard drive so that the first partition is for OS X. Left some unpartitioned space for OpenBSD. I left 4.5GB. Having a OS X partition as the first one is important as OpenBSD cannot boot alone on macppc. It needs a small HFS/HFS+ or MBR partition. More on the official README.
After finishing the normal OS X install, insert the second OpenBSD CD and reboot. Hold down the “c” key while the machine boots. After a quick glance at the OpenFirmware OpenBSD boots and you are confronted with the installer. If this does not happen, copy the files ofwboot and bsd.rd from macppc directory of the second CD to the root-directory on OS X. owfboot is used to boot OpenBSD because OpenFirmware is not able to boot OpenBSD directly. You need ofwboot on the HFS volume root anyway. bsd.rd is the ramdisk kernel of OpenBSD used for installations. After copying these files boot into OpenFirmware by pressing the keys Option, Command, O, F while booting. In the OpenFirmware command prompt enter:
boot cd:,ofwboot 3.7/macppc/bsd.rd
in order to try to boot from the CD or
boot hd:,ofwboot bsd.rd
in order to boot from the hard disk.
Continue the normal installation routines until you have to partition the drive (remember, I want to dual-boot). So when asked if OpenBSD should use the whole hard drive, or wd0 in my case, enter no. When asked for the labeling enter HSF as we want to be able to boot OS X.
You will get a command prompt from fdisk in order to create a partition. Enter “p” to print the current layout. You will see the MBR, an Apple partition and free space. This is different to Panther. Panther used some hidden partitions for drivers, these must now be incorporated into the Apple partition or be hidden in some other way. The columns length and base are important for us so lets see what they say. They describe on which block a partition begins and how large it is.
In order to create the OpenBSD partition enter “c”. You will be asked for the first sector. Enter the base number for the free space. Next enter the length column value for the length of the partition. When asked for a name for the partition just enter “OpenBSD” for example, this name does not matter.
When you have a look again at the partition table with “p” it should looks exactly like before just the free space should now be labeled “OpenBSD” or whatever name you chose. Enter “w” to write your changes and “q” for quitting this menu and continuing with the install.
The next program that will be launched is disklabel. Now we will be editing the real partitions as what we’ve edited before was known as slices in BSD land. You will see two partitions. Partition i is the HFS partition of OS X and c represents the whole disk. Now it’s time to be careful, because one can enter sectors from the OS X partition for our OpenBSD install and this will destroy OS X. Disklabel will report to you the free sectors but you can easily check it:
Free sectors = total sectors – length of OS X partition – OS X partition base
Now you can divide these free sectors between your partitions. The easiest setup for a second boot machine that is used only for testing and developing is one root partition and swap. But any other schema will do it. Lets say I want 256 MB swap or 524288 sectors (256 * 1024 * 1024 / 512). I have to subtract this number form my free space. What is left can be used for root.
Enter “a” to add a new partition, enter the offset of the root partition is the base from above because the root partition is our first partition of the OpenBSD slice (called OpenBSD partition in the beginning). The length is the calculated free sectors minus the swap sectors. Type is the default 4.2BSD and mount point should be /. Next enter “a” again to add the swap partition. The installer will guess the values right because it knows how many sectors are left. The offset should be the offset of / plus its length and the length of the swap partition should be 52488 sectors.
Press “w” and “q” to write the changes and exit. From now on it’s just a standard OpenBSD installation. Choose the sets and installation media, configure the network and reboot.
Remember that you need the ofwboot file on the OS X volume or OpenBSD will not boot. A normal boot sequence will boot OS X. If you want to boot OpenBSD hold down Option, Command, O, F during the boot and enter
boot hd:,ofwboot bsd
in OpenFirmware. Sometimes you need to enter /bsd instead of bsd. In the official install instructions you will find information how to setup OpenBSD as the default OS so that OpenFirmware normally boots OpenBSD instead of OS X. A detailed howto of an OpenBSD installation on an iBook can be found at bsdcow.net.
UPDATE:
See this post for a simple bootmanager for the Mac.
