Subject: Re: disklabel(8) and machdep on-disk structures issues
To: Manuel Bouyer <bouyer@antioche.eu.org>
From: David Laight <david@l8s.co.uk>
List: tech-kern
Date: 10/31/2003 00:25:07
On Thu, Oct 30, 2003 at 09:38:48PM +0100, Manuel Bouyer wrote:
> Hi,
> reinstalling a next68k current from scratch on a blank disk, I ran into the
> issue that the disklabel written to disk was a native NetBSD disklabel,
> not a NeXT disklabel.
> I tracked it down to disklabel(8) itself, which writes the disklabel
> itself to disk instead of asking the kernel to do it, when -r or -I
> is passed on command line (this is in disklabel.c:writelabel()).
>
> Note that there is a #ifdef __sparc__ to disable this code on sparc and
> always let the kernel write the disklabel to disk (and do the conversion
> if needed). My first though was "we need this for next68k too".
> However, I think other platforms needs this as well (sun3 comes to mind).
> How is the conversion between NetBSD and hardware-depedant disklabel format
> done in this case ?
I think that disklabel(8) ought to be able to write the label in all
formats on any format without requiring any kernel code. It should
probably overwrite any old label by default as well.
Then the kernel can be changed to play 'hunt the disklabel' for reading
and have the code that writes labels removed entirely.
(The 'write label' code would need to be in (say) libutil, so other
programs can use it.)
David
--
David Laight: david@l8s.co.uk