On 08/02/2021 00:00, John Paul Adrian Glaubitz wrote:

On 2/8/21 12:51 AM, Rick Thomas wrote:
# ofpathname /dev/sda2
/ht@0,f2000000/pci@5/k2-sata-root@c/@-1/@0:2

# nvram --print-config=boot-device
/ht@0,f2000000/pci@5/k2-sata-root@c/@-1/@0:2,\grub

# grub-install --macppc-directory=/boot/grub
Installing for powerpc-ieee1275 platform.
Installation finished. No error reported.

# export boot_device=$(nvram --print-config=boot-device)

#nvsetenv boot-device ${boot_device%%\\\\BootX}\\grub

This command does nothing because the boot-device string already
ends in "grub" and not "BootX".

# nvram --print-config=boot-device
/ht@0,f2000000/pci@5/k2-sata-root@c/@-1/@0:2,\grub

Still, when I rebooted without the installer CD, I got the folder icon with 
blinking question mark.

Try:

# nvram --update-config 
boot-device='/ht@0,f2000000/pci@5/k2-sata-root@c/@-1/@0:2,\\:grub'

or:

# nvsetenv boot-device "/ht@0,f2000000/pci@5/k2-sata-root@c/@-1/@0:2,\\:grub"
                                                              ^^^

This path looks wrong - according to the aliases listing at https://www.mail-archive.com/misc@openbsd.org/msg164291.html the unit address of the k2-sata device which is a child of the k2-sata-root device should be 0, whereas above it is given as -1? Perhaps something in ofpathname is subtracting 1 from the unit address of 0 when it shouldn't. Does the following alternative work?

nvsetenv boot-device "/ht@0,f2000000/pci@5/k2-sata-root@c/@0/@0:2,\grub"

Once your support for blessed files has been merged then there is no need to specify the path to the grub binary itself as it can be found like this:

nvsetenv boot-device "/ht@0,f2000000/pci@5/k2-sata-root@c/@0/@0:2,\\:tbxi"

where \\:tbxi is the magic which tells the firmware to search the filesystem on the given device for the blessed file and execute that rather than needing a full path. This is how OpenBIOS locates the bootloader under QEMU and so if you can boot an installation on one of the QEMU Mac machines then everything is working as it should.


ATB,

Mark.

Reply via email to