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

Bug#372780: OpenBSD can't boot via yaboot on powerpc (no dualboot possible)



Package: yaboot
Version: 1.3.13-5
Severity: normal

OpenBSD can't boot via yaboot on powerpc. Dualboot doesn't work.

This bug is common to all versions of debian (stable,
testing, unstable).



boot-procedure in general
-------------------------

After poweron the bios of a new world powerpc looks
for a nvram-variable, in order to examine, which
programm is to boot at first place.

The powerpc-bios is called "open firmware". "New world"
is called the architecture of the newer powerpc's.

If debian is installed, the open firmware finds the
complete path to the debian-bootlooder and boots.

The debian-bootloader is called "ofboot.b". Notice
the last two chars ".b".

This programm is written in forth, because open
firmware is able to interpret it.

The debian-bootloader ofboot.b has to be found in
a special partition, which is called "new world
boot partition".

ofboot.b displays a small menu. The user has to
strike a single key, in order to boot an os.

The key "b" forces ofboot to load & start the openbsd
bootloader, which is called "ofwboot". Notice the
char "w".

ofwboot is the original openbsd-bootloader.


the bug
-------

ofboot.b tranfers to ofwboot the complete path to the 
openbsd-kernel. The user configured this path in /etc/yaboot.conf,
something like bsd=/dev/...

yaboot.conf is the "alias" of lilo.conf on powerpc.

For example:

If your openbsd-installation resides on partition 7,
ofboot.b transfers "hd0:7,/bsd" or something more
cryptical to ofwboot. (ofboot.b uses a notation,
which open firmware understands. Sometimes this
notation looks very cryptical.)

Transferring this parameter to ofwboot is a bug,
because ofwboot doesn't want to know a complete path.

ofwboot has a built-in automatic, to look for the
openbsd-partition.

ofwboot searches for the last openbsd-partition on
the disk and tries to boot it. It does not matter,
how much openbsd-installations exist. It does not
matter, on which partition openbsd was installed.
ofwboot allways looks for the openbsd-partition,
which is the last on the disk.

ofwboot searches only in that partition. ofwboot
needs only a path relativ to that partition.

In the example, ofwboot finds the openbsd-partition
7 and tries to boot the kernel with the name
"hd0:7,/bsd", which is not used, because the kernel
is named "bsd" on "/". In this example the correct
path has to be "/bsd". That path will be useable 
by ofwboot.

But you can't specify that path. You got an error,
when you run ybin.

ybin is the 'alias' of lilo for powerpc.


workaround for the non-root-user
------------------------------

While poweron hold the four keys "win/apple", "alt",
"o" and "f" at the same time. Release the keys after
the appearing of the open firmware message.

On the open firmware prompt type in
"boot hd0:5,/ofwboot /bsd", if your partition "5" on
disk 0 is your new world boot partition and the
openbsd-partition has a kernel named "bsd" under "/".

You don't need to specify the path to the openbsd
partition (in my example 7), because ofwboot finds
it without further help. (And ofwboot finds only one,
if there are more of them. ofwboot finds the last one).


quick & dirty fix
-----------------

ofboot.b is not visible as part of the debian-package
yaboot.

ofboot.b is generated on the fly by running ybin.

ybin calls "/usr/lib/yaboot/ofboot" as subprogramm.
Notice the missing ".b" at the end.

ofboot generates the file ofboot.b and stores it
in the new world boot partition.

In order to change ofboot.b you have to change
ofboot.

Fixing the bug is easy.

Cut the complete-path-specification in line 114 of
"/usr/lib/yaboot/ofboot".


old & buggy line 114:

#	[ "$1" = "ybsd" ] && BOOT="load-base release-load-area \" ${4}${5%/*}/${5##*/},/bsd\" \$boot"


new & working line 114:

	[ "$1" = "ybsd" ] && BOOT="load-base release-load-area \" ${4},\\\\\\\\ofwboot /bsd\" \$boot"


Ofcourse you have to run ybin another time after changing /usr/lib/yaboot/ofboot.


a better solution
-----------------

Change the use of the path-parameter "bsd=...." in yaboot.conf.

Let this parameter point to the openbsd-kernel relativ
to the openbsd-partition.

In my example let the user use "bsd-kernel=/bsd"
and not "bsd=/dev/hda..."

And please change the hardcoded name of the openbsd-kernel.

ofboot allways set the name to "bsd". But that is not good.

If you compile a new openbsd-kernel, you usually
rename the old working kernel to "bsd.generic" or
"bsd.old".

If the new kernel doesn't work, you need a fallback, but
cannot use yaboot. Yaboot is only able to boot "bsd" and
not any otherwise named openbsd-kernel.


further information
-------------------

Testet on Mac mini with debian-testing (01.Jun-2006).


Thank you for your passion to read this long text.

Yours
Peter Voigt
peter.voigt1 aht gmx.net





Reply to: