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

Re: Why it's so difficult to fix PowerMac booting for good



On 5/27/23 10:34 AM, Linux User #330250 wrote:
> ...
> 
> It seems, the only real convenient way to go remains HFS or HFS+. Which
> got me thinking...

The partition should be Apple_Bootstrap, type Apple_Bootstrap. That way
it's HFS but not normally accessed via Mac OS X.

> We could make a /binary image/ of a pre-configured HFS partition with a
> version of GRUB installed and configured to search for the real
> configfile to use for booting on any supported filesystem (not only
> ext2/3/4; only limited by available GRUB file system support modules).
> This image could be dd'ed to a target "NewWorld Bootblock" partition,

If it already exists, the size of the "NewWorld bootblock" partition
might not be the same size as the image that would be copied using dd.

> and OF would find and load the blessed GRUB on it (as pre-configured in
> the HFS image). This GRUB would then search for a pre-defined UUID
> filesystem with the real grub.cfg on it.
> 
> The only thing that would have to be done during installation is to make
> /boot the right pre-configured UUID, so grub from the HFS binary image
> will load grub.cfg from it.
> 
> 
> OF3+
>  --> HFS NewWorld Bootblock: blessed bootinfo-style GRUB, hardcoded UUID
>   --> finds grub.cfg on [ext2/3/4, xfs, btfs, etc. /boot] and loads it
>    --> boot selected OS
> 
> 
> Installation steps:
>  1. create NewWorld Bootblock anywhere on fresh or existing HDD
>  2. copy binary image of pre-configured image HFS+GRUB
>  3. create /boot of supported fs, with UUID used in image from step 2
>  4. Linux only ever needs to manage grub.cfg on /boot
> 
> 
> This would transfer the need to non-free HFS utilities to be used by the
> package maintainer only, who has to create the NewWorld Bootblock HFS
> image and bless the bootinfo/GRUB2 bootloader file. The target system
> installing the prepared image then doesn't need to use any HFS tools...
> 
> If GRUB would support something else instead of a filesystem UUID, we
> could also use a partition type or something similar in the
> pre-configured binary image for the NewWorld Bootblock HFS image...
> 
> BTW, apparently this guide uses such a way also, not blessing anything
> on ext2, as previously (wrongly) suggested in this discussion:
> https://wiki.gentoo.org/wiki/GRUB_on_Open_Firmware_(PowerPC)
> 
> IMHO for the OS Picker to work intuitively, an icon via a blessed
> bootinfo file is key... (to be included in the NewWorld Bootblock HFS
> image by the maintainer...)
> 
> Any thoughts?
> ...

It's not safe for a Linux distribution to mount the Apple_Bootstrap
partition except when it actually needs to write to it. Keeping it
mounted as /boot, or /boot/grub, leaves it vulnerable to corruption if
the system crashes (just like 64-bit Intel systems are vulnerable by
keeping the EFI partition mounted).

I'm not planning to use GRUB as long as I can't use it to pick Mac OS X
and Mac OS 9 volumes from the menu like I can with yaboot.

Perhaps GRUB could use whatever yaboot uses to create the
Apple_Bootstrap partition and bless it with ybin, or was yaboot
violating Debian license rules with its ybin and use of HFS? Similarly,
perhaps GRUB could be enabled to boot Mac OS X or Mac OS 9 volumes in
the same way that yaboot already does.

Either way (GRUB or yaboot), I will continue to have only a very basic
configuration, with one entry per partition, with the kernel always
vmlinux (or vmlinuz) and the initrd always initrd.img, with symbolic
links in /boot on the relevant partitions pointing to the real kernel
and initrd.img that I want to use. I don't need GRUB to maintain a list
of all the kernels that I keep in /boot, and this way I have a
consistent way to use GRUB (and make it work like yaboot) on all
architectures that support GRUB.

-Stan


Reply to: