Subject: Prep bootloader
To: None <port-prep@netbsd.org>
From: Tim Rightnour <root@garbled.net>
List: port-prep
Date: 03/07/2006 23:04:12
On my todo list is to fix up the bootloader for prep. The current bootloader is
a bit of a pain to use, because you have to go through all sorts of crazy
dances to retain your partitions whenever you replace the kernel.

I've done a bit of thinking about how we currently do things, and a bit of
investigation into how AIX does things.. and I think I've come up with a decent
way of doing things:

We make it possible for mkbootimage to be handed a device where the image
will be written to, such as /dev/rsd0c.  If handed a device.. we first read the
partition table from that device, and if it contains both a NetBSD partition,
and a prep boot partition, we save that partition map, rather than make a new
one up.

With those two things done, we can then go ahead and create a bootimage that
overwrites the partition table, just like the current one, but with the same
partition layout as the user allready has.  This should make upgrading the
kernel relatively painless for most users.  We can essentially ship a script
which will generate a bootimage from /netbsd, and write it out to the root
drive.

We would need to retain the old behavior of mkbootimage for use in creating
floppy and netboot images.  We could probably add a switch for this.

I would also like to get root on raid working.  My idea is that the user can
just write his boot partition to both disks.  However, even if we fix the
booted-device stuff so the machine knows where it was booted from, I'm not sure
how to convince it (other than directly editing the kernel config) that it
should mount root from raid0 rather than the device it was booted from.

Theoretically it should work now, if you enable raid and root at raid in your
kernel config.

---
Tim Rightnour <root@garbled.net>
NetBSD: Free multi-architecture OS http://www.netbsd.org/
Genecys: Open Source 3D MMORPG: http://www.genecys.org/