diff options
-rw-r--r-- | sys/arch/macppc/macppc/disksubr.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/sys/arch/macppc/macppc/disksubr.c b/sys/arch/macppc/macppc/disksubr.c index 83df3e09682..f5f0cd6f88e 100644 --- a/sys/arch/macppc/macppc/disksubr.c +++ b/sys/arch/macppc/macppc/disksubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disksubr.c,v 1.11 2005/03/30 07:52:32 deraadt Exp $ */ +/* $OpenBSD: disksubr.c,v 1.12 2005/09/29 23:02:17 krw Exp $ */ /* $NetBSD: disksubr.c,v 1.21 1996/05/03 19:42:03 christos Exp $ */ /* @@ -104,6 +104,10 @@ readdisklabel(dev_t dev, void (*strat)(struct buf *), bp = geteblk((int)lp->d_secsize); bp->b_dev = dev; + /* don't read the on-disk label if we are in spoofed-only mode */ + if (spoofonly) + goto done; + /* DPME (HFS) disklabel */ bp->b_blkno = 1; @@ -160,10 +164,6 @@ readdisklabel(dev_t dev, void (*strat)(struct buf *), } lp->d_npartitions = MAXPARTITIONS; - /* don't read the on-disk label if we are in spoofed-only mode */ - if (spoofonly) - goto done; - /* next, dig out disk label */ bp->b_blkno = hfspartoff; bp->b_cylin = hfspartoff/lp->d_secpercyl; /* XXX */ @@ -201,6 +201,11 @@ hfs_done: if (part_blkno < extoff) part_blkno = extoff; + if (spoofonly) { + bzero(dp, NDOSPART * sizeof(*dp)); + goto donot; + } + /* read boot record */ bp->b_blkno = part_blkno; bp->b_bcount = lp->d_secsize; |