running ybin (from yaboot) inside a chroot fails with HFS working directory error

If you are fixing the boot system of a linux powerpc machine, you may have occasion to need to run ybin or mkofboot to rebuild the boot setup.

However, if you are running from a live cd, you may get the following error:

Failed to initialize HFS working directories: No such file or directory
mkofboot: HFS filesystem creation failed!

I was able to overcome this by running mkofboot from outside my chroot (which was probably not enough of an independent environment to run such a low level tool)

so instead of

root@chrooted:/# mkofboot -v

do

root@notchrooted:/# /path/to/chroot/usr/sbin/mkofboot -C /path/to/chroot/etc/yaboot.conf -v

(-C tells it to look for it's yaboot config in a place you specify -- here inside the chroot)

worked for me.