Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

vasi

macrumors newbie
Original poster
Sep 14, 2025
12
4
I've become pretty frustrated with Yaboot and Grub, so I made my own tiny first-stage boot chooser called ofchooser.

It's based on the yaboot first-stage loader, but different! Some reasons I like it:
  • I can choose a custom key to boot each OS
  • I can have multiple Mac OS partitions or Linux partitions, not just one
  • I can hit an unused key to stop the timeout, if I need time to think
Check it out, and let me know what you think.
 
I've become pretty frustrated with Yaboot and Grub, so I made my own tiny first-stage boot chooser called ofchooser.

It's based on the yaboot first-stage loader, but different! Some reasons I like it:
  • I can choose a custom key to boot each OS
  • I can have multiple Mac OS partitions or Linux partitions, not just one
  • I can hit an unused key to stop the timeout, if I need time to think
Check it out, and let me know what you think.

Can it handle a case when initial boot is from one drive, and then it is redirected to another? Use case: I got a PCIe SSD card, which can support faster SSDs, but those are not bootable on a PowerMac. Not sure such a trick works with macOS, but if not, I could install OpenBSD there or something like that.
 
Can it handle a case when initial boot is from one drive, and then it is redirected to another?
This is just a first-stage boot-chooser, it doesn't really change what's bootable. Nevertheless, here's my advice.

There's two possible ways you could try to boot from your SSD:

1. It may be visible from Open Firmware. Boot into OF (holding down Cmd-Opt-O-F) and use the "dev / ls" and "dir ..." commands to see if your SSD device is visible. If so, you can probably boot directly off that device with the right boot string.

2. If it's not visible from Open Firmware, your bootloader (Grub, Yaboot), kernel and initrd will need to be on a visible device like your internal hard drive. But you may be able to boot that internal-HD kernel and tell it to use a root filesystem on your SSD, which would preserve most of the space and speed benefits of the SSD. You probably want to first try booting a live USB like the ArchPower one, to make sure the Linux kernel can actually see your SSD.
 
  • Like
Reactions: barracuda156
Seems to not function correctly, at least on my HR 17.

ofchooser will show up when invoked, but accepts no keyboard input and will simply boot to default after timeout.

Could possibly be due to USB-type keyboard vs ADB-type keyboard.
 
ofchooser will show up when invoked, but accepts no keyboard input and will simply boot to default after timeout.
Thank you for testing! Have you ever used yaboot, and did that work for you?
 
Thank you for testing! Have you ever used yaboot, and did that work for you?
You know what. I don't think I ever have on this machine.

I swapped SSDs with my old 15-in a while back, and it used to be that this SSD had what I believed to be some sort of Linux on it, and I think it's still there, but I've never been able to boot into it on this machine. I think it might've been Adelie or maybe Gentoo, since there's a grub.cfg sitting on the bootstrap partition, but no bootable file.

Yeah, I don't think I've ever use yaboot to boot a Linux on this machine. I can't particularly go and check either because I have no optical drive (it was bung when I got it).
 
Which machine do you have? If it has USB you can probably boot from that.
 
Can it handle a case when initial boot is from one drive, and then it is redirected to another? Use case: I got a PCIe SSD card, which can support faster SSDs, but those are not bootable on a PowerMac. Not sure such a trick works with macOS, but if not, I could install OpenBSD there or something like that.
I know xpostfacto is capable of doing this. It lets you pick a "helper" disk which is useful for old macs with an 8GB boot limitation and Mac OS X. But I feel like this would also work with what you're trying to do. I'm not sure how one would set it up though. If anyone knows what XPF is actually doing in that scenario, we could probably do it ourselves.
 
  • Like
Reactions: barracuda156
This does accept keyboard input on the only machine I have available to test it. Weird! ofchooser uses basically the same keyboard input as yaboot's first stage loader, so I don't really understand why one would work and not the other.
 
Found it. It is the probe-usb command on line 10. I'm not sure exactly what it does, but removing the line allows for keyboard input once more.
 
Found it. It is the probe-usb command on line 10. I'm not sure exactly what it does, but removing the line allows for keyboard input once more.
Nice catch! On my machine it's necessary to enable USB boot, but I guess it doesn't work on others.

Could you do me a favor and boot into Open Firmware, then type 'probe-usb' and tell me what the console reports back? If we're lucky, it might be possible to auto-detect whether it should be used.
 
Could you do me a favor and boot into Open Firmware, then type 'probe-usb' and tell me what the console reports back? If we're lucky, it might be possible to auto-detect whether it should be used.
This is actually how I found out this broke it.

OF waits a moment, then just says "ok", but then keyboard/trackpad (presumably) stops working.
 
Oh no, it's really annoying that it does know about the command, but it works wrong. Maybe I can change it to only probe once keyboard input is done.
 
Hmm so I think the next step is to see if "probe-usb" just messes with your keyboard, or actually breaks booting. If you type `probe-usb boot hd:4,\\:tbxi` all on one line, does it work correctly?
 
I tried this on the OpenBSD bootloader and it got me the prompt and it did boot but keyboard was still borked until I got in to OS proper (you cannot type anything into the loader prompt), when keyboard returned. I'm pretty sure it'd work this way with Mac OS X as well.


You could probably check for the specific model when compiling the boot script-- this issue (if it even is one) should realistically only affect machines with USB input, which will be:
  • Every desktop starting with the iMac and G3 Blue & White
  • PowerBooks G4 of A1106/A1107 or newer.
  • iBooks G4 of A1133/A1134
Anything older will have ADB-based input, which shouldn't be affected.
 
That's not a bad idea, but I do like compiling the boot script on a different box. I think I'll just make it an option, like timeout/default are now. Theoretically I could make the option per-loader, but I'm not sure it's that necessary.
 
Why not make it both and optional? Allow a user to force either probe-usb on or off, or if it's omitted use the default for the running machine.

I'm not familiar enough with Ruby to do this myself but it's an idea.
 
Ok, I've pushed a change that allows adding `probe-usb` as an option for each boot entry. That way we can add it when it's useful, but leave it off most of the time, and especially always off during the chooser screen.

I did consider your idea about checking the machine type! But it just feels too complex to figure out machine types on both Mac OS X and Linux; and also hard to decide what to do if you're compiling the boot script on a machine different from the one it will run on.
 
But it just feels too complex to figure out machine types on both Mac OS X and Linux
Isn't machine type just "model" from the root node of the device tree? You may want to check the first item of the "compatible" list.

There's like a 100 different possibilities and it's difficult to say whether probe-usb is useful in each case.


Power Mac 8600:
Code:
model                   Power Macintosh
compatible              AAPL,8500
                        MacRISC

Beige G3:
Code:
model                   Power Macintosh
compatible              AAPL,PowerMac G3
                        MacRISC

B&W G3:
Code:
model                   PowerMac1,1
compatible              PowerMac1,1
                        MacRISC
                        Power Macintosh

G4 Cube:
Code:
model                   PowerMac5,1
compatible              PowerMac5,1
                        MacRISC2
                        MacRISC
                        Power Macintosh

G4 FireWire 800:
Code:
model                   PowerMac3,6
compatible              PowerMac3,6
                        MacRISC3
                        Power Macintosh

Quad G5:
Code:
model                   PowerMac11,2
compatible              PowerMac11,2
                        MacRISC4
                        Power Macintosh
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.