diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 1998-10-04 20:02:59 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 1998-10-04 20:02:59 +0000 |
commit | 2c94dfa6516ecec3c5ff1df7d7523e432454f91b (patch) | |
tree | c1ff57bd136c57ddbb1fc942b78ed3419a7c92ce /sys/arch/pmax | |
parent | 97833dbcfa0db5ff5f614fd8d88a6cf72b5df361 (diff) |
make sure there is a reasonable 'c' partition
Diffstat (limited to 'sys/arch/pmax')
-rw-r--r-- | sys/arch/pmax/pmax/disksubr.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/sys/arch/pmax/pmax/disksubr.c b/sys/arch/pmax/pmax/disksubr.c index b340fa04a52..be0c0a0edff 100644 --- a/sys/arch/pmax/pmax/disksubr.c +++ b/sys/arch/pmax/pmax/disksubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disksubr.c,v 1.14 1998/10/03 21:18:56 millert Exp $ */ +/* $OpenBSD: disksubr.c,v 1.15 1998/10/04 20:02:58 millert Exp $ */ /* $NetBSD: disksubr.c,v 1.14 1997/01/15 00:55:43 jonathan Exp $ */ /* @@ -75,12 +75,17 @@ readdisklabel(dev, strat, lp, osdep, spoofonly) struct disklabel *dlp; char *msg = NULL; + /* minimal requirements for archetypal disk label */ + if (lp->d_secsize == 0) + lp->d_secsize = DEV_BSIZE; 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_secpercyl == 0) + lp->d_secpercyl = 1; + lp->d_npartitions = RAW_PART + 1; + if (lp->d_partitions[RAW_PART].p_size == 0) + lp->d_partitions[RAW_PART].p_size = lp->d_secperunit; + lp->d_partitions[RAW_PART].p_offset = 0; /* don't read the on-disk label if we are in spoofed-only mode */ if (spoofonly) |