This is a short how to, in order to understand how to fix your boot problems.
1. ofpath is a utility to determine the OpenFirmware path of a device. If you want to know the OpenFirmware path of a device, e.g. /dev/sda3, just run
2. A minimal PPC-Linux Partition Table (without any MacOS) on /dev/sda looks like this
You can edit a partition table in Linux with mac-fdisk
# type name length base ( size ) system
/dev/sda1 Apple_partition_map Apple 63 @ 1 ( 31.5k) Partition map
/dev/sda2 Apple_Bootstrap bootstrap 1600 @ 64 (800.0k) NewWorld bootblock
/dev/sda3 Apple_UNIX_SVR2 myLinux 85852160 @ 1664 ( 40.9G) Linux native
/dev/sda4 Apple_UNIX_SVR2 swap 8000820 @ 202238668 ( 3.8G) Linux swap
Yaboot is on the second partition, the Bootstrap Partition. Do not mount it!
3. There are three ways to install yaboot on a Apple_Bootstrap Partition:
ybin is the bootloader installer for PowerPC based machines
ybin installs the bootloader according to the parameters in /etc/yaboot.conf
ybin uses ofpath to find the path to the bootstrap partition and to any defined macos/macosx partitions.
is a symlink to ybin, with the difference that initializes the bootstrap partition prior to running ybin to install the bootloader on it
Yabootconfig creates a default configuration file and then runs mkofboot to complete the bootloader installation
4. The yaboot-configuration-file
A simple /etc/yaboot.conf in a dual-boot system with Linux and MacOSX looks like this
boot= the bootstrap partition
device= openfirmware path to the root partition
partition= number of the root partition
root= the device name of the root partition
timeout= Sets a timeout in seconds for keyboard input. If no key is pressed for the specified time, the first image is automatically booted.
macosx= device name of the MacOSX partition
There are more interesting options (for a complete list see 'man yaboot.conf') such as
macos= device name of the MacOS9 partition
password= to specify a password for starting the system
defaultos= to specify from wich os the computer starts
After any changes of the yaboot.conf file, in order to make yaboot aware of the new 'situation', you need to run always 5. MULTIBOOTING
For any other Linux-OS you install, the yaboot installer specifies in the yaboot.conf file following parameters:
image= the openfirmware path to the kernel-image (or to its symlink)
append="root=/dev/sda4 ro quiet splash"
label= the name of the Linux kernel to display at the second yaboot prompt
root= the openfirmware path to the root partition
append= any options to pass to the kernel before starting
initrd= the openfirmware path to initrd
When you start the computer, at the yaboot prompt, you can choose which OS you want to boot from (Linux, MacOSX, MacOS) or if you want to boot from a CD (if in yaboot.conf there is the option enablecdboot). After you choose to start from Linux, if you hit TAB, you will find a list of the different Linux-Kernels for each installed Linux Distro. With the option 'label' in the list above, you can specify the name for each of them.
Usually you do not need to configure your yaboot.conf file. But it can happens, that the Linux Installer fails to detect other Linux Distros installed on the computer (for me, by installing Fedora 10, the installer did not detect my Debian and Ubuntu partitions).
Since I never had a problem with the Debian Installer, if I want to install different Linux Distros, I run Debian after the Installation of the others - it detectes the other MacOS or LinuxOS's always correctly.
6. In Ubuntu Hardy (8.04) ofpath fails to detect the correct openfirmware path in some PowerMac g5
The problems for some PowerMac G5 come from the ofpath utility, because it fails sometimes to find the right openfirmware path (sometimes, not always: on my PowerMac G5 it works well).
Even if you set in the /etc/yaboot.conf the right Open Firmware path, yaboot will not work correctly, because ybin and mkofboot need to run again ofpath (that is buggy)
There is a fix for the ofpath, that you can download here:
(It was fixed in Ubuntu Intrepid 8.10 - thanks to PeterXw!)
If you download the ofpath.gz on your Desktop run
To overwrite the buggy utility with the fixed one just
zcat Desktop/ofpath.gz > Desktop/ofpath
Now you can test if you get the right Open Firmware Path
sudo cp Desktop/ofpath /usr/sbin/ofpath
You can now just run
The -b option specifies where the bootloader is, the -r option is the 'root' device.
sudo yabootconfig -b /dev/sda2 -r /dev/sda3
Change the bootloader and the root devices according to your Partition Map (actually you shouldn't need to specify the root device)
Say yes, when you are asked, if you want to run mkofboot
I hope I was quite clear (sorry, but english is not my first language). Feel free to suggest any corrections.