Subject: Re: Prep bootloader
To: Tim Rightnour <root@garbled.net>
From: Simon Burge <simonb@wasabisystems.com>
List: port-prep
Date: 03/12/2006 10:38:36
Tim Rightnour wrote:

> 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.

Root-on-raid should Just Work, and at least would be a simple solution
to not being able to find your booted device.  If you have the right
RAIDframe autoconfigure bits turned on ("raidctl -A root raid0" for
example), RF will scan all disks and find raid0 and automatically use
that as the root filesystem.  You can even use RAIDframe with a single
disk (just have a "broken" mirror with a non-existant disk) if you
want...

For a long time here, one of my x86 boxes loaded the kernel from one
disk and had root on a RAID set that was an entirely different set of
disks, and there was nothing I needed to do different to use this.
(Yay for PC BIOSes that couldn't boot of the disk I wanted it to).

Simon.
--
Simon Burge                            <simonb@wasabisystems.com>
NetBSD Support and Service:         http://www.wasabisystems.com/