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

Changing bootstrap method for NewWorld Power Macs

Dear Adrian, dear Mathieu,

so actually what I wrote earlier would be a major obstacle for supporting GRUB on NewWorld Power Macs...

I write "would be", because there is another way which lets us safely ignore any issues with HFS as bootstrap partition for NewWorld Power Macs:

Open Firmware (IEEE 1275) can actually also boot from FAT file systems and this is also supported on NewWorld Power Macs.

I think I first heard of this IEEE 1275 "feature" on some other mailing list (maybe debian-sparc) but didn't expect it to be implemented on Power Macs. But looking into the list of "packages" in OF (e.g. check with `dev /packages` and `ls`) on an 11,2 type G5 there is a package named "fat-files" beneath other packages like "mac-files", "hfs-plus-files" and "iso-9660-files". In addition also [1] seems to confirm that it works for Power Macs (check the part below "Sharing a disk with Mac OS"). And indeed I could boot my Mac mini G4 with OpenBSD 6.4 with `ofwboot` (second stage boot loader) on a FAT16 FS which was on the first partition of a MBR partitioned drive. Later I manually prepared a similar setup with GRUB on a FAT16 FS for Debian Sid and could also successfully boot from it.

[1]: https://ftp.openbsd.org/pub/OpenBSD/6.4/macppc/INSTALL.macppc

Using MBR partitioning and a FAT16 FS as OF bootstrap partition for NewWorld Power Macs has the advantage of not depending on HFS for the bootstrap partition (neither during OS installation nor OS operation). All bootstrap related operations are handled by d-i/partman-basicfilesystems and dosfstools-udeb during installation with FAT16 as bootstrap. Because of that it also simplifies the needed changes to support GRUB installations on NewWorld Power Macs massively as we don't need to handle the FS operations for HFS (neither in grub-installer nor in a new partman-hfs package plus new hfsprogs-udeb) and any other specifics like file blessing and special file type (i.e. tbxi).

All this would also save me a lot of time and hence I changed my plan a little bit and prepared the required changes for d-i to use MBR partitioning and a FAT16 FS as bootstrap for NewWorld Power Macs. For now I successfully tested the changes in expert installation mode with a Mac mini G4 (also tested successfully in normal installation mode) and a 11,2 Power Mac G5 .

Do you have time for reviewing my changes?

I updated the already existing MR by me for partman-auto ([2]) but added a `WIP:` prefix so it can't/won't be merged until we're pleased with the changes.

[2]: https://salsa.debian.org/installer-team/partman-auto/merge_requests/2

Additionally [3] changes to MBR partitioning, [4] corrects a problem with using the `blockdev` tool on NewWorld Power Macs during installation. It should provide the sector size which is used as logical sector size during creation of FAT file systems but just prints `-1`. Here I'm unsure if this problem only exists for Power Macs or if this not also affects other architectures and just wasn't noticed. So currently the change affects all architectures. And finally [5] provides the needed changes for the grub-installer script. As `grub-ofpathname` isn't yet available for powerpc/ppc64 Power Macs and I also haven't seen any test results from it yet, `grub-install` still uses `ofpathname` ([6]). As this tool gives a wrong OF path for disk devices for Power Macs, I just replace it with a symlink to `ofpath` before operation of `grub-install` and later restore it.

[3]: https://salsa.debian.org/frank-scheiner-guest/partman-partitioning/commit/9dcb0cabad9a83e2e80a8941b651ffb14cc9972d

[4]: https://salsa.debian.org/frank-scheiner-guest/partman-basicfilesystems/commit/35ad12507d661131d21f13b997c09473d927439e

[5]: https://salsa.debian.org/frank-scheiner-guest/grub-installer/commit/cfe145228adaa34aae780cbb527dce5408107083

[6]: https://salsa.debian.org/grub-team/grub/blob/master/grub-core/osdep/unix/platform.c#L41

What do you think?


BTW is this just happening on my machine, or did the diff colors on salsa.d.o change to extra-bright recently? Unfortunately the coloring now makes it really hard to read the actual changes.

Reply to: