On 5/31/23 10:20 AM, Ben Westover wrote:
AFAIR yaboot does its magic within the CHRP boot script. It would be
relatively easy to add an option to load GRUB, I guess. The "chain"
would then start by choosing Mac OS (Classic), Mac OS X, or GRUB, via
the yaboot CHRP script. But then, GRUB would be only managing Linux.
That makes a lot more sense now. The "first stage" of yaboot where you
select Linux, OS X, or CD Boot is actually a script run by Open
Firmware, > and that's how it can so easily chainload, since it's just
a script
selecting which binary for Open Firmware to load.
In that case, instead of trying to integrate chainloading functionality
into GRUB itself, we could just set a similar script to run before GRUB
that allows you to make that selection.
I have just tested this concept. I wiped my iMac G3, installed OS X and
Debian, and put a modified version of yaboot's stage 1 script in the
bootstrap partition and blessed it. Now I am greeted with a screen that
asks me if I'd like to boot into Linux, OS X, or whatever's in the CD
drive, and all of the options work, the Linux one loading right into
GRUB. If I don't select an option after a bit it defaults to GRUB.
This combines the convenience of yaboot with the versatility of GRUB,
and only requires a single (relatively) human readable and editable
file. The script is attached; the only change you should have to make is
of the partition numbers, as it currently assumes /boot/grub is on
partition 2 and OS X is on partition 3.
--
Ben Westover