Seems to work for me. It gives the same answers as ofpath (packaged
with yaboot 1.0.8), except for a usb floppy drive, which your script
can handle but ofpath cannot. The machine is a 466Mhz G4 Powermac
(Digital Audio) with an IDE harddrive and cdrom drive, and a usb
floppy drive...
$ ./ofpathname /dev/hda
/address@hidden/address@hidden/address@hidden/address@hidden
$ ./ofpathname /dev/hdc
/address@hidden/address@hidden/address@hidden/address@hidden
$ ./ofpathname /dev/sda
/address@hidden/address@hidden/address@hidden/address@hidden,0
(for comparison)
# ofpath /dev/hda
/address@hidden/address@hidden/address@hidden/address@hidden:
# ofpath /dev/hdc
/address@hidden/address@hidden/address@hidden/address@hidden:
# ofpath /dev/sdc
ofpath: /proc/device-tree is broken. Do not use BootX to boot, use
yaboot.
ofpath: The yaboot HOWTO can be found here:
http://www.alaska.net/~erbenson/doc
So your script seems better.