Subject: Re: disklabel(8) and machdep on-disk structures issues
To: matthew green <mrg@eterna.com.au>
From: Manuel Bouyer <bouyer@antioche.lip6.fr>
List: tech-kern
Date: 10/31/2003 15:59:59
On Sat, Nov 01, 2003 at 01:07:36AM +1100, matthew green wrote:
>    
>    - the #ifdef __sparc__ in disklabel(8) can probably go away, as sun3 works
>      without it.
> 
> "works".
> 
> if you let disklabel write a NetBSD disklabel to the disk the
> sparc will not be able to boot from it.  this is precisely why
> the kernel always converts and userland is disabled from writing
> a (normal) label.

Hum, I found that sun3 uses edlabel for its install script, and edlabel
always use DIOCWDINFO, it doesn't write to disk directly. This is why
there's no problems at install time.

Here's an idea to get rid of #ifdef __sparc__ in disklabel(8), which would
also make it work properly for sun3, and next68k with a change to the
next68k's disksubr:
with -r/-I, write the disklabel directly to disk (it will always be a
NetBSD disklabel then), and then issue a DIOCWDINFO. DIOCWDINFO will
make the kernel convert the disklabel if needed.

--
Manuel Bouyer, LIP6, Universite Paris VI.           Manuel.Bouyer@lip6.fr
     NetBSD: 24 ans d'experience feront toujours la difference
--