I'm curious as to how grub-install currently handles the blessing of the CoreServices
directory for different filesystems - does it only attempt to bless the folder if it
detects a HFS/HFS+ filesystem?
Seems so. See the grub-install source code.
Finally it may be worth noting that if you omit the partition number then the firmware
will locate the first bootable partition itself which is the default value that OpenBIOS
uses, e.g.
boot hd:,\\:tbxi
I'm just using the path provided by "opathname" as this way we can install onto any type
of media instead of just hard disks.
And, finally, GRUB's grub-install never substitutes the variable names "device"
and "partition" in the boot script [3] it installs. They just remain as is on
the disk which naturally means that grub-install currently cannot itself properly
install GRUB on a PowerMac which is obviously a bug.
This shouldn't be needed. Having a look at grub.chrp.in from your link and ofboot.b
on some old Fedora ISOs I have lying around, these files are all CHRP boot scripts
i.e. XML surrounded by <CHRP-BOOT>...</CHRP-BOOT> tags.
IIRC it is part of the CHRP boot specification that the firmware substitutes the values
for "&device;" and "&partition;" in <BOOT-SCRIPT>...</BOOT-SCRIPT> when reading the CHRP
boot script into memory, and that's certainly what OpenBIOS does.
Ah, I wasn't aware of that.
I guess the real question is does Apple's OF do the right thing here? My feeling is that it
does, since grub.chrp.in uses the hard-coded path \System\Library\CoreServices\grub.elf
which is a directory that only exists if grub is installed on a MacOS computer.
I can try removing the sed command from grub-installer again and see if that still works.
Currently, I have:
sed -i 's!&device;:&partition;!'"$ofpath"'!g' $ROOT/boot/grub/System/Library/CoreServices/BootX