When reading the disklabel if we fail to find one, return an error.
This should fix PR's 26564 and 26809. This allows CD installs on cats to work, as a cdxa partition is now faked, so sysinst can mount it. This does go against changes made for PR 21408, as it will cause the error cd0: no disk label to appear when running disklabel cd0. Really readdisklabel's API should be updated to allow better error returns, such that the driver can choose to fake the label, if readdisklabel didn't find one.
This commit is contained in:
parent
aae3f1ca07
commit
c0ffe8e4d5
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: disksubr.c,v 1.9 2003/08/07 16:26:51 agc Exp $ */
|
||||
/* $NetBSD: disksubr.c,v 1.10 2004/09/25 18:24:55 chris Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1998 Christopher G. Demetriou. All rights reserved.
|
||||
@ -97,7 +97,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: disksubr.c,v 1.9 2003/08/07 16:26:51 agc Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: disksubr.c,v 1.10 2004/09/25 18:24:55 chris Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
@ -217,8 +217,26 @@ readdisklabel(dev, strat, lp, osdep)
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (found == 0) {
|
||||
/*
|
||||
* we must return an error, when we don't find a disklabel,
|
||||
* so that the driver above can fake a sensible label.
|
||||
* Really readdisklabel should be able to return a value
|
||||
* indicating we faked the label, and the driver can then
|
||||
* decide to take the one we faked, or fake a new one.
|
||||
*
|
||||
* Faking a label at this level could generate the wrong
|
||||
* label, as we don't know correct FS we should use.
|
||||
*
|
||||
* By returning an error, we allow cd's to get the
|
||||
* correct faked label.
|
||||
*
|
||||
* Note this does go against PR kern/21408.
|
||||
*/
|
||||
msg = "no disk label";
|
||||
}
|
||||
|
||||
if (msg != NULL || found == 0)
|
||||
if (msg != NULL)
|
||||
goto done;
|
||||
|
||||
/* obtain bad sector table if requested and present */
|
||||
|
Loading…
Reference in New Issue
Block a user