Subject: Re: NetBSD's swap partition ID
To: Thor Lancelot Simon <email@example.com>
From: David Laight <firstname.lastname@example.org>
Date: 02/27/2006 21:52:17
On Mon, Feb 27, 2006 at 03:42:09PM -0500, Thor Lancelot Simon wrote:
> On Mon, Feb 27, 2006 at 08:51:29PM +0100, Pavel Cahyna wrote:
> > Well, somebody else claimed that "<disklabel> simplifies coding of the way
> > partitions are handled" :-)
> It does; the code to read and write the disklabel is exactly the same for
> every platform. It's _finding_ the disklabel that's unclean; unfortunately,
> the two issues are more than slightly confused because, long ago, each
> platform got the same code, which does both, copied into its own disksubr.
Unfortunately a lot of the MD kernel code is like that.
Quite a few ports use mbr disks, I think they could all use the code
in subr_disk_mbr.c - but someone with the hardware needs to check that
such a kernel boots.
That code may also work for systems that don't expect mbr disks, but have
16 partitions in the netbsd label.
Unfortunately it isn't possible to handle the ports that have 8 partition
labels. That property needs to be a disk property, not a kernel one.
Additionally the 'c' v 'd' being the entire disk is also fubar.
Since there is only one place in the i386 kernel that uses the 'c' ptn,
I have thought of adding code to transparantly switch 'c' and 'd' as needed
when reading a netbsd label.
We also need to code to byteswap labels.
David Laight: email@example.com