BoneKracker
June 18th, 2006, 07:53 AM
How to dual-boot with BSD via Yaboot.
Yaboot doesn't dual-boot with BSD as advertised due to what I think is a simple path concatenation bug in the ybin shell script. If you want to dual-boot with BSD but don't want to have to boot into OpenFirmware and type a bootline every time, you can do the following.
I realize there might be like two people who care, but it's still worth documenting where it can be searched for and reused. I've tested this on OpenBSD and am pretty sure it applies to NetBSD (not sure about FreeBSD).
Edit a line in the OpenFirmware bootloader script that ybin creates in the bootstrap partition. The script is named "ofboot.b" and the offending line is near the top. Basically, it erroneously tacks a kernel path (in red) onto the end of the line.
Before (this is a single line):
: bootybsd " Booting BSD..." .printf 100 ms load-base release-load-area " /pci@f2000000/pci-bridge@d/mac-io@7/ata-4@1f000/disk@0:2,\\ofwboot :,/bsd" $boot ;
After: (shows additional optional changes)
: bootybsd " Booting BSD..." .printf 100 ms load-base release-load-area " hd:2,ofwboot" $boot ;
The bottom line is that you should replace the text between that second set of quotes with whatever command you can successfully boot with at the OpenFirmware prompt. For me this was simply "hd:2,ofwboot".
Also, there is a second bug that is only binding if you have "defaultos=bsd" in yaboot.conf. Toward the bottom of ofboot.b, after the line "drop" is the command referring to whichever bootline is your default (either "bootyaboot" or "bootbsd"). It should read "bootybsd", not "bootbsd".
Note: Running ybin over-writes any changes, so you may want to make a copy of the fixed ofboot.b in your home directory for reference.
Yaboot doesn't dual-boot with BSD as advertised due to what I think is a simple path concatenation bug in the ybin shell script. If you want to dual-boot with BSD but don't want to have to boot into OpenFirmware and type a bootline every time, you can do the following.
I realize there might be like two people who care, but it's still worth documenting where it can be searched for and reused. I've tested this on OpenBSD and am pretty sure it applies to NetBSD (not sure about FreeBSD).
Edit a line in the OpenFirmware bootloader script that ybin creates in the bootstrap partition. The script is named "ofboot.b" and the offending line is near the top. Basically, it erroneously tacks a kernel path (in red) onto the end of the line.
Before (this is a single line):
: bootybsd " Booting BSD..." .printf 100 ms load-base release-load-area " /pci@f2000000/pci-bridge@d/mac-io@7/ata-4@1f000/disk@0:2,\\ofwboot :,/bsd" $boot ;
After: (shows additional optional changes)
: bootybsd " Booting BSD..." .printf 100 ms load-base release-load-area " hd:2,ofwboot" $boot ;
The bottom line is that you should replace the text between that second set of quotes with whatever command you can successfully boot with at the OpenFirmware prompt. For me this was simply "hd:2,ofwboot".
Also, there is a second bug that is only binding if you have "defaultos=bsd" in yaboot.conf. Toward the bottom of ofboot.b, after the line "drop" is the command referring to whichever bootline is your default (either "bootyaboot" or "bootbsd"). It should read "bootybsd", not "bootbsd".
Note: Running ybin over-writes any changes, so you may want to make a copy of the fixed ofboot.b in your home directory for reference.