diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2008-12-10 23:41:20 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2008-12-10 23:41:20 +0000 |
commit | 8a6f5a71283d2b79884bcb184a302cba8f4f4556 (patch) | |
tree | aa1c2ef9beac481a1575c9b1abd5028db2e81693 /sys | |
parent | 3f312f920d16a47b2ffd5d0b0b9f5f581e7519aa (diff) |
When booting from a CD on i386/amd64, assume the root filesystem
is on the CD rather than always asking for its location. Behaviour
pointed out at OpenCON by Stephan Rickauer.
Tested by Stephan. nick@ has no objections.
ok deraadt@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/amd64/amd64/dkcsum.c | 6 | ||||
-rw-r--r-- | sys/arch/amd64/stand/libsa/diskprobe.c | 4 | ||||
-rw-r--r-- | sys/arch/i386/i386/dkcsum.c | 6 | ||||
-rw-r--r-- | sys/arch/i386/stand/libsa/diskprobe.c | 4 |
4 files changed, 14 insertions, 6 deletions
diff --git a/sys/arch/amd64/amd64/dkcsum.c b/sys/arch/amd64/amd64/dkcsum.c index 7eef0cc9d7a..41f7fdb9ded 100644 --- a/sys/arch/amd64/amd64/dkcsum.c +++ b/sys/arch/amd64/amd64/dkcsum.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dkcsum.c,v 1.14 2008/06/12 06:58:33 deraadt Exp $ */ +/* $OpenBSD: dkcsum.c,v 1.15 2008/12/10 23:41:19 krw Exp $ */ /*- * Copyright (c) 1997 Niklas Hallqvist. All rights reserved. @@ -65,6 +65,10 @@ dkcsumattach(void) if (bios_diskinfo == NULL || bios_cksumlen * DEV_BSIZE > MAXBSIZE) return; + /* Do nothing if bootdev is a CD drive. */ + if (B_TYPE(bootdev) == 6) + return; + #ifdef DEBUG printf("dkcsum: bootdev=%#x\n", bootdev); for (bdi = bios_diskinfo; bdi->bios_number != -1; bdi++) diff --git a/sys/arch/amd64/stand/libsa/diskprobe.c b/sys/arch/amd64/stand/libsa/diskprobe.c index 6de75d0bea5..f2174289a8a 100644 --- a/sys/arch/amd64/stand/libsa/diskprobe.c +++ b/sys/arch/amd64/stand/libsa/diskprobe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: diskprobe.c,v 1.5 2007/06/18 22:11:20 krw Exp $ */ +/* $OpenBSD: diskprobe.c,v 1.6 2008/12/10 23:41:19 krw Exp $ */ /* * Copyright (c) 1997 Tobias Weingartner @@ -232,7 +232,7 @@ cdprobe(void) dip->bios_info.flags |= BDI_GOODLABEL | BDI_EL_TORITO; dip->bios_info.checksum = 0; /* just in case */ dip->bios_info.bsd_dev = - MAKEBOOTDEV(0, 0, 0, 0xff, RAW_PART); + MAKEBOOTDEV(6, 0, 0, 0, RAW_PART); /* Create an imaginary disk label */ dip->disklabel.d_secsize = 2048; diff --git a/sys/arch/i386/i386/dkcsum.c b/sys/arch/i386/i386/dkcsum.c index 16c06fb8b76..61d39e8cf92 100644 --- a/sys/arch/i386/i386/dkcsum.c +++ b/sys/arch/i386/i386/dkcsum.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dkcsum.c,v 1.25 2008/06/12 06:58:34 deraadt Exp $ */ +/* $OpenBSD: dkcsum.c,v 1.26 2008/12/10 23:41:19 krw Exp $ */ /*- * Copyright (c) 1997 Niklas Hallqvist. All rights reserved. @@ -65,6 +65,10 @@ dkcsumattach(void) if (bios_diskinfo == NULL || bios_cksumlen * DEV_BSIZE > MAXBSIZE) return; + /* Do nothing if bootdev is a CD drive. */ + if (B_TYPE(bootdev) == 6) + return; + #ifdef DEBUG printf("dkcsum: bootdev=%#x\n", bootdev); for (bdi = bios_diskinfo; bdi->bios_number != -1; bdi++) diff --git a/sys/arch/i386/stand/libsa/diskprobe.c b/sys/arch/i386/stand/libsa/diskprobe.c index 0f0cff32192..b4d0a93eff5 100644 --- a/sys/arch/i386/stand/libsa/diskprobe.c +++ b/sys/arch/i386/stand/libsa/diskprobe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: diskprobe.c,v 1.29 2007/06/18 22:11:20 krw Exp $ */ +/* $OpenBSD: diskprobe.c,v 1.30 2008/12/10 23:41:19 krw Exp $ */ /* * Copyright (c) 1997 Tobias Weingartner @@ -236,7 +236,7 @@ cdprobe(void) dip->bios_info.flags |= BDI_GOODLABEL | BDI_EL_TORITO; dip->bios_info.checksum = 0; /* just in case */ dip->bios_info.bsd_dev = - MAKEBOOTDEV(0, 0, 0, 0xff, RAW_PART); + MAKEBOOTDEV(6, 0, 0, 0, RAW_PART); /* Create an imaginary disk label */ dip->disklabel.d_secsize = 2048; |