summaryrefslogtreecommitdiff
path: root/sys/arch/i386/stand/installboot
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1997-09-30 21:59:44 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1997-09-30 21:59:44 +0000
commite9e698545240ef4fcd5c34db4b7110d42c3e0ff3 (patch)
tree8012a17140132f19252a2997ee7c76cce81556b8 /sys/arch/i386/stand/installboot
parentd7ef8c12f83ba03c9cbf557d7b7cc90642ff786e (diff)
Don't blithely use geometry from the disk. Get it from sysctl or
the user.
Diffstat (limited to 'sys/arch/i386/stand/installboot')
-rw-r--r--sys/arch/i386/stand/installboot/installboot.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/sys/arch/i386/stand/installboot/installboot.c b/sys/arch/i386/stand/installboot/installboot.c
index a9d140d4b9e..e45551725a5 100644
--- a/sys/arch/i386/stand/installboot/installboot.c
+++ b/sys/arch/i386/stand/installboot/installboot.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: installboot.c,v 1.13 1997/09/24 23:10:03 mickey Exp $ */
+/* $OpenBSD: installboot.c,v 1.14 1997/09/30 21:59:43 millert Exp $ */
/* $NetBSD: installboot.c,v 1.5 1995/11/17 23:23:50 gwr Exp $ */
/*
@@ -158,7 +158,8 @@ main(argc, argv)
if (nsectors == -1)
nsectors = BIOSNSECTS(geo);
}
- }
+ } else if (nheads == -1 || nsectors == -1)
+ errx(1, "Unable to get BIOS geometry, must specify -h and -s");
/* Open and check raw disk device */
if ((devfd = opendev(dev, (nowrite? O_RDONLY:O_RDWR),
@@ -430,10 +431,8 @@ loadblocknums(boot, devfd, dl)
if (dl->d_type != 0 && dl->d_type < DTYPE_FLOPPY) {
/* adjust disklabel w/ synthetic geometry */
- if (nsectors > 0)
- dl->d_nsectors = nsectors;
- if (nheads > 0)
- dl->d_secpercyl = dl->d_nsectors * nheads;
+ dl->d_nsectors = nsectors;
+ dl->d_secpercyl = dl->d_nsectors * nheads;
}
if (verbose)