GRUB on Open Firmware (PowerPC)

This article covers the GRUB2 bootloader installation for. IEEE1275 is the offical standard for OpenFirmware, abbreviated OFW or OF.

Apple NewWorld Macs (PowerPC)
NewWorld Macs are Macs with OpenFirmware version 3 (OF3) or later (OF3+). NewWorld Macs will show a graphical boot selection when holding the key right after the chime, until a startup selection is shown on the screen. This will only work well when a CHRP script that includes an  is blessed (attribute :tbxi) on a HFS volume.


 * NewWorld Apple Mac computer (1999—2006)
 * /boot is a separate ext2 partition
 * Apple Partition Map (APM)
 * NewWorld Bootblock as
 * filesystem HFS
 * as any partition number (at the begin is preferred, but not required)
 * Apple specific

NewWorld Bootblock partition
First, a NewWorld Bootblock has to be created using :

At the interactive command prompt this partition can either be created manually e.g. by using the command for "create new partition, specifying the partition type", or semi-automatic by using the  command for "create new 800k Apple_Bootstrap partition (used by yaboot)". Either way you should get a bootable HFS partition of either the type  or.

CHRP boot script
Install the required tools:

In this example, a CHRP boot script will load the GRUB image, which will use an initial grub.cfg to find and load the actual grub.cfg configuration from the directory on the    partition.

Make sure that is mounted and create a new directory  (for NewWorld BootBlock):

Find out the UUID of the partition:

Alternative:

Create file and use the UUID from above to let GRUB find the correct  partition. Although it would also be possible to specify an absolute path, using the UUID will compensate automatically for small changes, like switching drives or adding/deleting partitions.

Install GRUB to (the default path). Option  prevents GRUB from setting the OpenFirmware   nvram variable. Since GRUB doesn't know about the CHRP script on the NewWorld Bootblock, it would set the wrong value anyway.

With this setup, the initial grub.cfg, GRUB will then look for on the actual  partition (i.e.  on the live system, since the boot partition is mounted) found via its UUID. Further updates to grub.cfg therefore go via the real grub.cfg the usual way, without the need to touch the NewWorld Bootblock anymore:

Now create a list of modules to be included in the GRUB image.

The command will create a minimal grub bootimage that includes these modules and the initial grub.cfg:

If  with grub-initial.cfg is ommited, it will be looked up as grub.cfg in the same directory where the grub.img will later be loaded on the NewWorld Bootblock HFS partition.

Now find the partition number of the NewWorld Bootblock, e.g. is partition. OpenFirmware notation is used in the CHRP script, so the command is  when the GRUB image is in   on the HFS NewWorld Bootblock. is an alias for the first disk drive.

.

Now copy all files to the NewWorld Bootblock HFS filesystem into and bless (attribute :tbxi) the CHRP boot script   and the  subdirectory:

Test and set as default boot-device
After a reboot, when holding the key right after the chime, a startup selection for the partition with GRUB should now be visible. If everything worked, from the  package may be used to set the default startup volume:

In the above commands the default startup volume was (in the example APM partition layout from above this is Tiger i.e. Mac OS X Tiger 10.4) and it is then set to, the GRUB CHRP boot script in this example.

External resources

 * Open Firmware Quick Reference from FirmWorks