[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 06/01 2023 06:55 Ben Westover wrote:
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

Nice work!

The only thing that I can think of that might make the script slightly
better was if you used &device; for \grub, because this should default
to the current partition (where stage1 is on), and this is presumably
where GRUB is as well...

I.e., the line stating with ": bootgrub" would look like this:
: bootgrub " Loading GRUB..." .printf 100 ms load-base release-load-area
" &device;,\grub" $boot ;

I'll definitely use this when I get around to installing Linux on my
Clamshell...

Thanks!
Linux User #330250


Reply to: