summaryrefslogtreecommitdiff
path: root/distrib/miniroot
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2002-05-18 17:56:04 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2002-05-18 17:56:04 +0000
commit8f7044cbf127a7ac249e1b339722f078b855d609 (patch)
tree12963ebb8b8f66d825f29e7606084cdde69e11fd /distrib/miniroot
parent21bbb8cdc8d79bafd5fd05ad8c9f0e91d021929b (diff)
Eliminate md_get_diskdevs() and md_get_cddevs() by
1) Saving one boot's worth of dmesg in /tmp/dmesg.boot 2) Using sed to scan for devices and pull out names in new get_diskdevs() and get_cddevs() in install.sub 3) Saving any md disk/cd sed patterns in MDDISKDEVS and MDCDDEVS variables.
Diffstat (limited to 'distrib/miniroot')
-rw-r--r--distrib/miniroot/install.sub29
1 files changed, 20 insertions, 9 deletions
diff --git a/distrib/miniroot/install.sub b/distrib/miniroot/install.sub
index 0362bf6a646..b3ee46176e1 100644
--- a/distrib/miniroot/install.sub
+++ b/distrib/miniroot/install.sub
@@ -1,4 +1,4 @@
-# $OpenBSD: install.sub,v 1.221 2002/05/14 01:49:25 krw Exp $
+# $OpenBSD: install.sub,v 1.222 2002/05/18 17:56:03 krw Exp $
# $NetBSD: install.sub,v 1.5.2.8 1996/09/02 23:25:02 pk Exp $
#
# Copyright (c) 1997-2002 Todd Miller, Theo de Raadt, Ken Westerback
@@ -71,16 +71,16 @@
#
# The following functions must be provided:
# md_congrats() - display friendly message
-# md_get_cddevs() - return available CD-ROM devices
-# md_get_diskdevs() - return available disk devices
# md_installboot() - install boot-blocks on disk
# md_prep_disklabel() - label the root disk
# md_set_term() - set up terminal
#
# The following variables can be provided if required:
-# MDTERM - 'vt220' assumed if not provided
-# MDFSTYPE - nothing assumed if not provided
-# MDFSOPTS - nothing assumed if not provided
+# MDTERM - 'vt220' assumed if not provided
+# MDFSTYPE - nothing assumed if not provided
+# MDFSOPTS - nothing assumed if not provided
+# MDDISKDEVS - '/^[sw]d[0-9][0-9]* /s/ .*//p' assumed if not provided
+# MDCDDEVS - '/^cd[0-9][0-9]* /s/ .*//p' assumed if not provided
. install.md
set_term() {
@@ -153,6 +153,14 @@ __EOT
md_congrats
}
+get_diskdevs() {
+ bsort `sed -ne ${MDDISKDEVS:-'/^[sw]d[0-9][0-9]* /s/ .*//p'} /tmp/dmesg.boot`
+}
+
+get_cddevs() {
+ bsort `sed -ne ${MDCDDEVS:-'/^cd[0-9][0-9]* /s/ .*//p'} /tmp/dmesg.boot`
+}
+
# Ask for a password, saving the input in $resp.
# Display $1 as the prompt.
# *Don't* allow the '!' options that ask does.
@@ -2158,9 +2166,12 @@ VERSION_MAJOR=$(( $VERSION / 10 ))
VERSION_MINOR=$(( $VERSION % 10 ))
export VERSION VERSION_MAJOR VERSION_MINOR
-# Use install.md routines to get lists of devices on system
-_DKDEVS=`md_get_diskdevs`
-_CDDEVS=`md_get_cddevs`
+# Extract and save one boot's worth of dmesg
+dmesg | sed -ne '/^OpenBSD /h;/^OpenBSD /!H;${g;p;}' > /tmp/dmesg.boot
+
+# Scan /tmp/dmesg.boot for disks and cds
+_DKDEVS=`get_diskdevs`
+_CDDEVS=`get_cddevs`
# extra "site" set can be provided by person doing install or
# upgrade.