summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorcgd <cgd@NetBSD.org>1994-03-04 23:22:33 +0000
committercgd <cgd@NetBSD.org>1994-03-04 23:22:33 +0000
commitb8d4a797fa5532c8f35476efc179890dfe3c03ec (patch)
tree966d499b91c83673b0ee948554c46c349e241021 /sys
parent6cea70fe75861b18a4fe0c1c0707d20e57d56cc5 (diff)
initialize the raw partition when creating a new disk label.
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/i386/i386/disksubr.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/sys/arch/i386/i386/disksubr.c b/sys/arch/i386/i386/disksubr.c
index f144dc31d11..e7933326486 100644
--- a/sys/arch/i386/i386/disksubr.c
+++ b/sys/arch/i386/i386/disksubr.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)ufs_disksubr.c 7.16 (Berkeley) 5/4/91
- * $Id: disksubr.c,v 1.4 1994/01/11 16:38:48 mycroft Exp $
+ * $Id: disksubr.c,v 1.5 1994/03/04 23:22:33 cgd Exp $
*/
#include "param.h"
@@ -48,6 +48,8 @@
#define b_cylin b_resid
+#define RAW_PART 3
+
/*
* Attempt to read a disk label from a device
* using the indicated stategy routine.
@@ -80,10 +82,14 @@ readdisklabel(dev, strat, lp, osdep)
/* minimal requirements for archtypal disk label */
if (lp->d_secperunit == 0)
lp->d_secperunit = 0x1fffffff;
- lp->d_npartitions = 1;
- if (lp->d_partitions[0].p_size == 0)
- lp->d_partitions[0].p_size = 0x1fffffff;
- lp->d_partitions[0].p_offset = 0;
+ lp->d_npartitions = RAW_PART + 1;
+ for (i = 0; i < RAW_PART; i++) {
+ lp->d_partitions[0].p_size = 0;
+ lp->d_partitions[0].p_offset = 0;
+ }
+ if (lp->d_partitions[i].p_size == 0)
+ lp->d_partitions[i].p_size = 0x1fffffff;
+ lp->d_partitions[i].p_offset = 0;
/* obtain buffer to probe drive with */
bp = geteblk((int)lp->d_secsize);