Subject: Re: kern/25108: Default disklabel for cd(4)
To: None <gnats-bugs@gnats.netbsd.org, tech-kern@netbsd.org>
From: Manuel Bouyer <bouyer@antioche.lip6.fr>
List: tech-kern
Date: 05/07/2004 11:10:36
On Thu, May 06, 2004 at 09:50:31PM +0100, David Laight wrote:
> 
> That just adds code to all the drivers - which just isn't (and shouldn't be)
> necessary.
> 
> > Somehow I wonder what happens for devices that first calls their default
> > labelling function, and then call readdisklabel(), which inconditionally
> > overwrites type for 'a'.  I'd like some input on what to do here, too.
> 
> The obvious thing is for the default label (returned by readdisklabel)
> to contain the fs_type from the raw partition in entry 'a'.
> 
> This patch should suffice.
> 
> 	David
> 
> Index: subr_disk_mbr.c
> ===================================================================
> RCS file: /cvsroot/src/sys/kern/subr_disk_mbr.c,v
> retrieving revision 1.4
> diff -u -p -r1.4 subr_disk_mbr.c
> --- subr_disk_mbr.c	8 Oct 2003 04:25:46 -0000	1.4
> +++ subr_disk_mbr.c	6 May 2004 20:32:59 -0000
> @@ -225,13 +225,15 @@ readdisklabel(dev, strat, lp, osdep)
>  	if (lp->d_partitions[RAW_PART].p_size == 0)
>  		lp->d_partitions[RAW_PART].p_size = 0x1fffffff;
>  	lp->d_partitions[RAW_PART].p_offset = 0;
> +	if (lp->d_partitions[RAW_PART].p_fstype == FS_UNUSED)
> +		lp->d_partitions[RAW_PART].p_fstype = FS_BSDFFS;

Does this mean that the raw partition will always be of type 4.2BSD ?
I think it should remain as unused.

-- 
Manuel Bouyer <bouyer@antioche.eu.org>
     NetBSD: 26 ans d'experience feront toujours la difference
--