Fake a label only if it appears to be blank, and if so use RAW_PART

instead of 0.
This commit is contained in:
pk 1999-02-14 12:42:33 +00:00
parent 4b9ee1f8ce
commit 9896803ae6
1 changed files with 7 additions and 5 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: disksubr.c,v 1.22 1998/06/20 03:45:27 mrg Exp $ */
/* $NetBSD: disksubr.c,v 1.23 1999/02/14 12:42:33 pk Exp $ */
/*
* Copyright (c) 1994, 1995 Gordon W. Ross
@ -156,10 +156,12 @@ readdisklabel(dev, strat, lp, clp)
/* 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;
if (lp->d_npartitions == 0) {
lp->d_npartitions = RAW_PART + 1;
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;
}
/* obtain buffer to probe drive with */
bp = geteblk((int)lp->d_secsize);