[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Current status on grub-installer on PowerMac


I have been working on getting the GRUB installation on PowerMacs fixed the
past days which turned out to be far more tricky than I expected. As can be
seen from the number of test images I have created so far [1], I have already
been through quite a number of image rebuilds to get the grub-installer work
correctly on PowerMac (ignore the timestamps in the folder names, the correct
timestamps of the images can be seen from the creation date in the folder view).

The latest image is in the folder "hfstest-20210411-8" which I created this
morning. This image is not tested yet, but it should actually work when looking
at the script code itself [2] but it doesn't which is most likely attributed to a
race condition.

The problem is that setting the correct file properties with the hattrib tool
fails at the first attempt of installing the bootloader but succeeds when just
reattempting to install the bootloader from the installer menu. So far, I have
not been able to find out why, that will require more debugging.

If anyone wants to give it a try themselves, please fetch the image from [1]
(so far I created a 32-bit image only) and see if it works for you.

Note: After selecting the partition layout, the partioning tool will present
an empty question dialog which should be answered with <NO>. It's a known issue
I will fix later, so just ignore it for now.

FWIW, I also found a number of bugs in GRUB on PowerMac itself while working
on the problem. It turns out that GRUB does not set the proper openfirmware
path in NVRAM pointing to the BootX script that it just installed. The script
gets installed into :System:Library:CoreServices:BootX but grub-install (the
upstream GRUB installation tool) just sets the path to :BootX.

Also, while GRUB's grub-install blesses the "CoreServices" folder, it does
not set the "tbxi" attribute which means it's not possible to boot the disk
with "boot hd:N,:\\tbxi" (N being the partition).

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.


> [1] https://cdimage.debian.org/cdimage/ports/tests/
> [2] https://people.debian.org/~glaubitz/grub-installer.20210414
> [3] http://git.savannah.gnu.org/cgit/grub.git/tree/grub-core/boot/powerpc/grub.chrp.in

 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaubitz@debian.org
`. `'   Freie Universitaet Berlin - glaubitz@physik.fu-berlin.de
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913

Reply to: