summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2007-07-11 04:53:43 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2007-07-11 04:53:43 +0000
commit22c6bf5fd31dbb26cf37e66225e7b4d47c44175d (patch)
tree4cd37dafff1d34f78c6a068ef29e67225842cb4f
parent234042e5565a2d9003d708d707413af9a875c19d (diff)
Try reading a native label in the first sector, before trying to find
MBR-like partitions.
-rw-r--r--sys/arch/mac68k/mac68k/disksubr.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/sys/arch/mac68k/mac68k/disksubr.c b/sys/arch/mac68k/mac68k/disksubr.c
index bff47bf9d38..48ffd0b8b7d 100644
--- a/sys/arch/mac68k/mac68k/disksubr.c
+++ b/sys/arch/mac68k/mac68k/disksubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: disksubr.c,v 1.50 2007/06/20 18:15:45 deraadt Exp $ */
+/* $OpenBSD: disksubr.c,v 1.51 2007/07/11 04:53:42 miod Exp $ */
/* $NetBSD: disksubr.c,v 1.22 1997/11/26 04:18:20 briggs Exp $ */
/*
@@ -344,6 +344,9 @@ readdisklabel(dev_t dev, void (*strat)(struct buf *),
bp = geteblk(size);
bp->b_dev = dev;
+ if (spoofonly)
+ goto doslabel;
+
bp->b_blkno = LABELSECTOR;
bp->b_bcount = size;
bp->b_flags = B_BUSY | B_READ;
@@ -360,10 +363,6 @@ readdisklabel(dev_t dev, void (*strat)(struct buf *),
goto done;
}
- msg = readdoslabel(bp, strat, lp, NULL, spoofonly);
- if (msg == NULL)
- goto done;
-
/* Get a MI label */
bp->b_blkno = LABELSECTOR;
bp->b_bcount = lp->d_secsize;
@@ -378,6 +377,11 @@ readdisklabel(dev_t dev, void (*strat)(struct buf *),
if (msg == NULL)
goto done;
+doslabel:
+ msg = readdoslabel(bp, strat, lp, NULL, spoofonly);
+ if (msg == NULL)
+ goto done;
+
#if defined(CD9660)
if (iso_disklabelspoof(dev, strat, lp) == 0) {
msg = NULL;