summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2005-04-03 19:34:01 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2005-04-03 19:34:01 +0000
commit677c18cc7dd621a4c552d67a1ba2d8751a515bde (patch)
tree18d99fc3181bf2b713f8ddc515a48f7f5d8d4f66
parent5ce55a1aa8032e2c661665ee5b384c195b0ea87b (diff)
More shrinkage with a bit of code factoring.
-rw-r--r--distrib/miniroot/install.sub36
-rw-r--r--distrib/sparc/install.md4
-rw-r--r--distrib/vax/install.md5
3 files changed, 18 insertions, 27 deletions
diff --git a/distrib/miniroot/install.sub b/distrib/miniroot/install.sub
index 80ac60f2362..d5a6b92914e 100644
--- a/distrib/miniroot/install.sub
+++ b/distrib/miniroot/install.sub
@@ -1,4 +1,4 @@
-# $OpenBSD: install.sub,v 1.370 2005/04/02 14:27:08 krw Exp $
+# $OpenBSD: install.sub,v 1.371 2005/04/03 19:33:59 krw Exp $
# $NetBSD: install.sub,v 1.5.2.8 1996/09/02 23:25:02 pk Exp $
#
# Copyright (c) 1997-2005 Todd Miller, Theo de Raadt, Ken Westerback
@@ -73,9 +73,10 @@
# 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
+# MDDKDEVS - '/^[sw]d[0-9][0-9]* /s/ .*//p' assumed if not provided
# MDCDDEVS - '/^cd[0-9][0-9]* /s/ .*//p' assumed if not provided
-# MDXAPERTURE - if not empty, set machdep.allowaperture=value in sysctl.conf
+# MDMTDEVS - '/^[cmsw]t[0-9][0-9]* /s/ .*//p'
+# MDXAPERTURE - set machdep.allowaperture=value in sysctl.conf
. install.md
set_term() {
@@ -161,17 +162,8 @@ __EOT
echo "Cool! Let's get to it..."
}
-get_dkdevs() {
- bsort `sed -ne "${MDDISKDEVS:-/^[sw]d[0-9][0-9]* /s/ .*//p}" /var/run/dmesg.boot`
-}
-
-get_cddevs() {
- bsort `sed -ne "${MDCDDEVS:-/^cd[0-9][0-9]* /s/ .*//p}" /var/run/dmesg.boot`
-}
-
-get_tapedevs () {
- bsort $(egrep "^(ct|mt|st|ts|wt)[[:digit:]]+ " /var/run/dmesg.boot \
- | sed -e "s/ .*//p" )
+scan_dmesg() {
+ bsort $(sed -ne "$1" /var/run/dmesg.boot)
}
get_ifdevs() {
@@ -183,17 +175,15 @@ get_ifdevs() {
# Get the first (lowest unit #) serial device if any, if MDSERIAL is set.
# NOTE: Only single digit serial devices (<dev>0 -> <dev>9) are looked for.
get_serialdev() {
- local _devs _d _bd _td
+ local _d _bd _td
[[ -n $MDSERIAL ]] || exit
set -- $MDSERIAL
_d=$1
_bd=$2
_td=$3
- _devs=$(sed -ne "/^${_d}\([0-9]\) .*/s//\1/p" /var/run/dmesg.boot)
- _devs=$(bsort $_devs)
- set -- $_devs
- echo "${_bd}${1} ${_td}${1}"
+ set -- $(scan_dmesg "/^${_d}\([0-9]\) .*/s//\1/p")
+ echo "$_bd$1 $_td$1"
}
get_drive() {
@@ -1238,7 +1228,7 @@ install_tape() {
fi
# Get the name of the tape device.
- get_drive "tape drive" "$TAPEDEVS" || return
+ get_drive "tape drive" "$MTDEVS" || return
export TAPE=/dev/nr$resp
if [[ ! -c $TAPE ]]; then
echo "$TAPE is not a character special file."
@@ -1672,10 +1662,10 @@ done
dmesg | sed -ne '/^OpenBSD /h;/^OpenBSD /!H;${g;p;}' >/var/run/dmesg.boot
# Scan /var/run/dmesg.boot for interesting devices.
-DKDEVS=$(get_dkdevs)
-CDDEVS=$(get_cddevs)
+DKDEVS=$(scan_dmesg "${MDDKDEVS:-/^[sw]d[0-9][0-9]* /s/ .*//p}")
+CDDEVS=$(scan_dmesg "${MDCDDEVS:-/^cd[0-9][0-9]* /s/ .*//p}")
+MTDEVS=$(scan_dmesg "${MDMTDEVS:-/^[cmsw]t[0-9][0-9]* /s/ .*//p}")
IFDEVS=$(get_ifdevs)
-TAPEDEVS=$(get_tapedevs)
SERIALDEV=$(get_serialdev)
# Devices created with makedev().
diff --git a/distrib/sparc/install.md b/distrib/sparc/install.md
index 8b44f5f72cb..3da8e0058b8 100644
--- a/distrib/sparc/install.md
+++ b/distrib/sparc/install.md
@@ -1,4 +1,4 @@
-# $OpenBSD: install.md,v 1.51 2005/03/27 15:13:50 krw Exp $
+# $OpenBSD: install.md,v 1.52 2005/04/03 19:33:59 krw Exp $
# $NetBSD: install.md,v 1.3.2.5 1996/08/26 15:45:28 gwr Exp $
#
#
@@ -41,7 +41,7 @@
#
MDTERM=sun
-MDDISKDEVS='/^sd[0-9] /s/ .*//p;/^x[dy][0-9] /s/ .*//p'
+MDDKDEVS='/^sd[0-9] /s/ .*//p;/^x[dy][0-9] /s/ .*//p'
ARCH=ARCH
md_installboot() {
diff --git a/distrib/vax/install.md b/distrib/vax/install.md
index f57a177ad19..d5a5b98d99c 100644
--- a/distrib/vax/install.md
+++ b/distrib/vax/install.md
@@ -1,4 +1,4 @@
-# $OpenBSD: install.md,v 1.23 2005/03/27 15:13:50 krw Exp $
+# $OpenBSD: install.md,v 1.24 2005/04/03 19:34:00 krw Exp $
# $NetBSD: install.md,v 1.3.2.5 1996/08/26 15:45:28 gwr Exp $
#
#
@@ -41,8 +41,9 @@
#
MDTERM=vt100
-MDDISKDEVS='/^[hs]d[0-9] /s/ .*//p;/^r[al][0-9] /s/ .*//p'
+MDDKDEVS='/^[hs]d[0-9] /s/ .*//p;/^r[al][0-9] /s/ .*//p'
MDCDDEVS='/^cd[0-9] /s/ .*//p;/^ra[0-9] .* RRD40$/s/ .*//p'
+MDMTDEVS='/^[cmsw]t[0-9][0-9]* /s/ .*//p;/^ts[0-9]0-9]* /s/ .*//p'
ARCH=ARCH
md_installboot() {