ofpath fails to detect the correct openfirmware path in some PowerMac g5
In Ubuntu Hardy (8.04) 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)
SOLUTION
There is a fix for the ofpath, that you can download here:
https://bugs.launchpad.net/ubuntu/+source/yaboot/+bug/122607
http://ubuntuforums.org/showthread.php?t=994882#2
(It was fixed in Ubuntu Intrepid 8.10 - thanks to PeterXw!)
If you download the ofpath.gz on your Desktop run
zcat Desktop/ofpath.gz > Desktop/ofpath
To overwrite the buggy utility with the fixed one just
sudo cp Desktop/ofpath /usr/sbin/ofpath
Now you can test if you get the right Open Firmware Path
ofpath /dev/sda2
You can now just run
sudo yabootconfig -v -b /dev/sda2 -r /dev/sda3
The -b option specifies where the bootloader is, the -r option is the 'root' device.
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