diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 1998-10-03 21:19:02 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 1998-10-03 21:19:02 +0000 |
commit | 2847382ad0f79d42676104f5b99c1b14a78a5b90 (patch) | |
tree | 3e173e06925848427cc197fb15b7a2d7b3e5c12c /sys/arch/arm32 | |
parent | 17219f15915dee86717b444ef5a7e0c11c2e9bb4 (diff) |
Add a "spoofonly" argument to readdisklabel() which will be used to
implement an ioctl to get a spoofed label even for disks that have
a label on them.
Diffstat (limited to 'sys/arch/arm32')
-rw-r--r-- | sys/arch/arm32/arm32/disksubr.c | 6 | ||||
-rw-r--r-- | sys/arch/arm32/mainbus/fd.c | 2 | ||||
-rw-r--r-- | sys/arch/arm32/mainbus/wd.c | 4 |
3 files changed, 8 insertions, 4 deletions
diff --git a/sys/arch/arm32/arm32/disksubr.c b/sys/arch/arm32/arm32/disksubr.c index ff8c676993e..aea222b325a 100644 --- a/sys/arch/arm32/arm32/disksubr.c +++ b/sys/arch/arm32/arm32/disksubr.c @@ -107,11 +107,12 @@ filecore_checksum(bootblock) */ char * -readdisklabel(dev, strat, lp, osdep) +readdisklabel(dev, strat, lp, osdep, spoofonly) dev_t dev; void (*strat)(); struct disklabel *lp; struct cpu_disklabel *osdep; + int spoofony; { struct riscbsd_partition *rp = osdep->partitions; struct dkbad *bdp = &osdep->bad; @@ -144,6 +145,9 @@ readdisklabel(dev, strat, lp, osdep) lp->d_partitions[RAW_PART].p_size = 0x1fffffff; } + if (spoofonly) + return (NULL); + /* obtain buffer to probe drive with */ bp = geteblk((int)lp->d_secsize); diff --git a/sys/arch/arm32/mainbus/fd.c b/sys/arch/arm32/mainbus/fd.c index a5960924123..db8316cf288 100644 --- a/sys/arch/arm32/mainbus/fd.c +++ b/sys/arch/arm32/mainbus/fd.c @@ -1222,7 +1222,7 @@ fdioctl(dev, cmd, addr, flag) buffer.d_type = DTYPE_FLOPPY; buffer.d_secsize = FDC_BSIZE; - if (readdisklabel(dev, fdstrategy, &buffer, NULL) != NULL) + if (readdisklabel(dev, fdstrategy, &buffer, NULL, 0) != NULL) return EINVAL; *(struct disklabel *)addr = buffer; diff --git a/sys/arch/arm32/mainbus/wd.c b/sys/arch/arm32/mainbus/wd.c index 00613810f1f..04b78437d28 100644 --- a/sys/arch/arm32/mainbus/wd.c +++ b/sys/arch/arm32/mainbus/wd.c @@ -1049,7 +1049,7 @@ wdgetdisklabel(wd) if (wd->sc_state > RECAL) wd->sc_state = RECAL; errstring = readdisklabel(MAKEWDDEV(0, wd->sc_dev.dv_unit, RAW_PART), - wdstrategy, lp, wd->sc_dk.dk_cpulabel); + wdstrategy, lp, wd->sc_dk.dk_cpulabel, 0); if (errstring) { /* * This probably happened because the drive's default @@ -1060,7 +1060,7 @@ wdgetdisklabel(wd) if (wd->sc_state > GEOMETRY) wd->sc_state = GEOMETRY; errstring = readdisklabel(MAKEWDDEV(0, wd->sc_dev.dv_unit, RAW_PART), - wdstrategy, lp, wd->sc_dk.dk_cpulabel); + wdstrategy, lp, wd->sc_dk.dk_cpulabel, 0); } if (errstring) { printf("%s: %s\n", wd->sc_dev.dv_xname, errstring); |