aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPoul-Henning Kamp <phk@FreeBSD.org>1994-11-08 10:35:52 +0000
committerPoul-Henning Kamp <phk@FreeBSD.org>1994-11-08 10:35:52 +0000
commit9daafd51256c982ec98b8942ceb9107b9147a6e3 (patch)
tree983cec8a182b6ccc24192d36505231833a692e57
parent46c134684cd4c2b2732f175466e11d80dada2bb3 (diff)
downloadsrc-9daafd51256c982ec98b8942ceb9107b9147a6e3.tar.gz
src-9daafd51256c982ec98b8942ceb9107b9147a6e3.zip
If we have no MBR, we need to allow the poor guy to write one...
Notes
Notes: svn path=/head/; revision=4268
-rw-r--r--sys/i386/isa/readMBR.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/i386/isa/readMBR.c b/sys/i386/isa/readMBR.c
index 27e517f92330..ab944e87d9c9 100644
--- a/sys/i386/isa/readMBR.c
+++ b/sys/i386/isa/readMBR.c
@@ -15,7 +15,7 @@
* written by julian elischer (julian@tfs.com)
*
* @(#)readMBR.c 8.5 (tfs) 1/21/94
- * $Id: readMBR.c,v 1.1 1994/10/27 20:44:50 jkh Exp $
+ * $Id: readMBR.c,v 1.2 1994/10/28 12:41:55 jkh Exp $
*/
#include <sys/param.h>
@@ -101,8 +101,11 @@ readMBRtolabel(dev, strat, lp, dp, cyl)
*/
if ((*(bp->b_un.b_addr + 510) != (char) 0x55)
||(*(bp->b_un.b_addr + 511) != (char) 0xaa)) {
- msg = "Disk has no Fdisk partitions";
- goto bad;
+ printf("disk doesn't have an MBR\n");
+ if(dp)
+ bzero(bp->b_un.b_addr + DOSPARTOFF,
+ NDOSPART * sizeof(*dp));
+ goto hrumpf;
}
if(dp) { /* if they asked for a copy, give it to them */
@@ -220,6 +223,7 @@ readMBRtolabel(dev, strat, lp, dp, cyl)
}
lp->d_npartitions = 8;
}
+hrumpf:
bp->b_flags = B_INVAL | B_AGE;
brelse(bp);
return 0;