summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2002-05-08 23:01:48 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2002-05-08 23:01:48 +0000
commit32a26d8360637b9a9ae41a4b77f7ba7f5f2eb352 (patch)
tree860c979d83a9aebcf9b121766a16e143062ea6a7
parent6cb2a4b6d953662fe7902f963ab0de3e0d351d2e (diff)
Abstract out common md_set_term() code into set_term() in install.sub,
calling md_set_term() from set_term() to do machine dependent stuff. Currently only i386 does anything - keyboard mappings. Add MDTERM variable to allow install.md to set proper default terminal type. Default to vt220. Eliminate md_get_partition_range() as useless since every architecture returned '[a-p]'. Make default term for all mvme* architectures vt100 as requested by miod@. ok deraadt@ millert@ miod@
-rw-r--r--distrib/alpha/common/install.md12
-rw-r--r--distrib/amiga/install.md13
-rw-r--r--distrib/hp300/ramdisk/install.md11
-rw-r--r--distrib/i386/common/install.md12
-rw-r--r--distrib/mac68k/ramdisk/install.md14
-rw-r--r--distrib/miniroot/install.sub44
-rw-r--r--distrib/mvme68k/ramdisk/install.md14
-rw-r--r--distrib/mvme88k/ramdisk/install.md14
-rw-r--r--distrib/mvmeppc/ramdisk/install.md12
-rw-r--r--distrib/sparc/install.md12
-rw-r--r--distrib/sparc64/common/install.md12
-rw-r--r--distrib/sun3/install.md12
-rw-r--r--distrib/vax/install.md12
13 files changed, 49 insertions, 145 deletions
diff --git a/distrib/alpha/common/install.md b/distrib/alpha/common/install.md
index 4b414c90851..e1f53a0d8ff 100644
--- a/distrib/alpha/common/install.md
+++ b/distrib/alpha/common/install.md
@@ -1,4 +1,4 @@
-# $OpenBSD: install.md,v 1.5 2002/04/28 14:44:01 krw Exp $
+# $OpenBSD: install.md,v 1.6 2002/05/08 23:01:46 krw Exp $
#
# Copyright (c) 1996 The NetBSD Foundation, Inc.
# All rights reserved.
@@ -40,13 +40,10 @@
# Machine-dependent install sets
MDSETS=kernel
+MDTERM=sun
ARCH=ARCH
md_set_term() {
- test -n "$TERM" && return
- ask "Specify terminal type:" sun
- TERM=$resp
- export TERM
}
md_get_msgbuf() {
@@ -70,11 +67,6 @@ md_get_cddevs() {
md_get_msgbuf | egrep -a "^cd[0-9]+ " | cutword 1
}
-md_get_partition_range() {
- # return range of valid partition letters
- echo [a-p]
-}
-
md_questions() {
:
}
diff --git a/distrib/amiga/install.md b/distrib/amiga/install.md
index 1c9d2516ce8..0419f3c9828 100644
--- a/distrib/amiga/install.md
+++ b/distrib/amiga/install.md
@@ -1,4 +1,4 @@
-# $OpenBSD: install.md,v 1.14 2002/05/07 02:03:57 krw Exp $
+# $OpenBSD: install.md,v 1.15 2002/05/08 23:01:46 krw Exp $
# $NetBSD: install.md,v 1.3.2.5 1996/08/26 15:45:28 gwr Exp $
#
#
@@ -45,12 +45,6 @@ MDSETS=kernel
ARCH=ARCH
md_set_term() {
- if [ ! -z "$TERM" ]; then
- return
- fi
- ask "Specify terminal type:" vt220
- TERM="$resp"
- export TERM
}
md_get_diskdevs() {
@@ -63,11 +57,6 @@ md_get_cddevs() {
dmesg | sed -n -e '/^a\{0,1\}cd[0-9] /{s/ .*//;p;}'
}
-md_get_partition_range() {
- # return range of valid partition letters
- echo "[a-p]"
-}
-
md_questions() {
:
}
diff --git a/distrib/hp300/ramdisk/install.md b/distrib/hp300/ramdisk/install.md
index 36a1a948df9..892a138bce4 100644
--- a/distrib/hp300/ramdisk/install.md
+++ b/distrib/hp300/ramdisk/install.md
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# $OpenBSD: install.md,v 1.27 2002/04/28 14:44:01 krw Exp $
+# $OpenBSD: install.md,v 1.28 2002/05/08 23:01:46 krw Exp $
# $NetBSD: install.md,v 1.1.2.4 1996/08/26 15:45:14 gwr Exp $
#
# Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -43,12 +43,10 @@
# Machine-dependent install sets
MDSETS=kernel
+MDTERM=hp300h
ARCH=ARCH
md_set_term() {
- ask "Specify terminal type:" hp300h
- TERM="$resp"
- export TERM
}
md_get_diskdevs() {
@@ -62,11 +60,6 @@ md_get_cddevs() {
dmesg | egrep -a "sd[0-9]*:.*CD-ROM" | cutword -t: 1 | sort -u
}
-md_get_partition_range() {
- # return range of valid partition letters
- echo [a-p]
-}
-
md_questions() {
:
}
diff --git a/distrib/i386/common/install.md b/distrib/i386/common/install.md
index aefb69642c7..c97d9b39732 100644
--- a/distrib/i386/common/install.md
+++ b/distrib/i386/common/install.md
@@ -1,4 +1,4 @@
-# $OpenBSD: install.md,v 1.2 2002/04/28 14:44:01 krw Exp $
+# $OpenBSD: install.md,v 1.3 2002/05/08 23:01:46 krw Exp $
#
#
# Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -46,11 +46,6 @@ ARCH=ARCH
md_set_term() {
local _tables
- test -n "$TERM" && return
- ask "Specify terminal type:" vt220
- TERM=$resp
- export TERM
-
ask "Do you wish to select a keyboard encoding table?" n
case $resp in
@@ -110,11 +105,6 @@ md_get_cddevs() {
bsort `dmesg | egrep -a "^cd[0-9]+ " | cutword 1`
}
-md_get_partition_range() {
- # return range of valid partition letters
- echo [a-p]
-}
-
md_questions() {
echo
ask "Do you expect to run the X Window System?" y
diff --git a/distrib/mac68k/ramdisk/install.md b/distrib/mac68k/ramdisk/install.md
index 4099882e70c..8b0f46b6b54 100644
--- a/distrib/mac68k/ramdisk/install.md
+++ b/distrib/mac68k/ramdisk/install.md
@@ -1,4 +1,4 @@
-# $OpenBSD: install.md,v 1.9 2002/04/28 14:44:01 krw Exp $
+# $OpenBSD: install.md,v 1.10 2002/05/08 23:01:46 krw Exp $
#
# Copyright (c) 2002, Miodrag Vallat.
# All rights reserved.
@@ -64,15 +64,10 @@
# Machine-dependent install sets
MDSETS="bsd-generic bsd-genericsbc"
+MDTERM=vt100
ARCH=ARCH
md_set_term() {
- if [ ! -z "$TERM" ]; then
- return
- fi
- ask "Specify terminal type:" vt100
- TERM="$resp"
- export TERM
}
md_get_diskdevs() {
@@ -85,11 +80,6 @@ md_get_cddevs() {
bsort `dmesg | egrep -a "^cd[0-9]+ " | cutword 1`
}
-md_get_partition_range() {
- # return range of valid partition letters
- echo [a-p]
-}
-
md_questions() {
:
}
diff --git a/distrib/miniroot/install.sub b/distrib/miniroot/install.sub
index c8850473e96..e1432b60504 100644
--- a/distrib/miniroot/install.sub
+++ b/distrib/miniroot/install.sub
@@ -1,4 +1,4 @@
-# $OpenBSD: install.sub,v 1.218 2002/05/04 22:21:21 krw Exp $
+# $OpenBSD: install.sub,v 1.219 2002/05/08 23:01:46 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
@@ -67,22 +67,33 @@
# OpenBSD install/upgrade script common subroutines and initialization code
-# include machine-dependent functions
+# Include machine-dependent functions and definitions.
+#
# The following functions must be provided:
-# md_get_diskdevs() - return available disk devices
-# md_get_cddevs() - return available CD-ROM devices
-# md_get_partition_range() - return range of valid partition letters
-# md_installboot() - install boot-blocks on disk
-# md_prep_disklabel() - label the root disk
-# md_welcome_banner() - display friendly message
+# 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_native_fsopts() - native filesystem options for disk installs
+# md_native_fstype() - native filesystem type for disk installs
# md_not_going_to_install() - display friendly message
-# md_congrats() - display friendly message
-# md_native_fstype() - native filesystem type for disk installs
-# md_native_fsopts() - native filesystem options for disk installs
-
-# include machine dependent subroutines
+# md_prep_disklabel() - label the root disk
+# md_set_term() - set up terminal
+# md_welcome_banner() - display friendly message
+#
+# The following variables can be provided if required:
+# MDTERM - 'vt220' assumed if not provided
. install.md
+set_term() {
+ [ "$TERM" ] && return
+ ask "Specify terminal type:" ${MDTERM:-vt220}
+ TERM=$resp
+ export TERM
+
+ md_set_term
+}
+
# Ask for a password, saving the input in $resp.
# Display $1 as the prompt.
# *Don't* allow the '!' options that ask does.
@@ -1211,7 +1222,7 @@ install_from_mounted_fs() {
}
install_cdrom() {
- local _drive _range _part _fstype _directory _n
+ local _drive _part _fstype _directory _n
# Get the cdrom device info
if [ -z "$_CDDEVS" ]; then
@@ -1268,12 +1279,11 @@ __EOT
_part=c
else
# Get partition from user
- _range=`md_get_partition_range`
resp=
while [ -z "$resp" ] ; do
ask "CD-ROM partition to mount? (normally 'c')" c
case $resp in
- $_range)
+ [a-p])
_part=$resp
;;
*) echo "Invalid response: $resp"
@@ -2152,7 +2162,7 @@ y*|Y*) echo "\nCool! Let's get to it...\n"
esac
# Deal with terminal issues
-md_set_term
+set_term
cat << __EOT
diff --git a/distrib/mvme68k/ramdisk/install.md b/distrib/mvme68k/ramdisk/install.md
index 04ee75708f0..7e1fab661b4 100644
--- a/distrib/mvme68k/ramdisk/install.md
+++ b/distrib/mvme68k/ramdisk/install.md
@@ -1,4 +1,4 @@
-# $OpenBSD: install.md,v 1.16 2002/04/28 14:44:01 krw Exp $
+# $OpenBSD: install.md,v 1.17 2002/05/08 23:01:47 krw Exp $
# Copyright (c) 1996 The NetBSD Foundation, Inc.
# All rights reserved.
#
@@ -40,15 +40,10 @@
# Machine-dependent install sets
MDSETS=kernel
+MDTERM=vt100
ARCH=ARCH
md_set_term() {
- if [ ! -z "$TERM" ]; then
- return
- fi
- ask "Specify terminal type:" vt100
- TERM="$resp"
- export TERM
}
md_get_diskdevs() {
@@ -61,11 +56,6 @@ md_get_cddevs() {
bsort `dmesg | egrep -a "^cd[0-9]+ " | cutword 1`
}
-md_get_partition_range() {
- # return range of valid partition letters
- echo [a-p]
-}
-
md_questions() {
:
}
diff --git a/distrib/mvme88k/ramdisk/install.md b/distrib/mvme88k/ramdisk/install.md
index e607b74931f..b35b013addc 100644
--- a/distrib/mvme88k/ramdisk/install.md
+++ b/distrib/mvme88k/ramdisk/install.md
@@ -1,4 +1,4 @@
-# $OpenBSD: install.md,v 1.11 2002/05/07 02:03:57 krw Exp $
+# $OpenBSD: install.md,v 1.12 2002/05/08 23:01:47 krw Exp $
# Copyright (c) 1996 The NetBSD Foundation, Inc.
# All rights reserved.
#
@@ -40,15 +40,10 @@
# Machine-dependent install sets
MDSETS=kernel
+MDTERM=vt100
ARCH=ARCH
md_set_term() {
- if [ ! -z "$TERM" ]; then
- return
- fi
- ask "Specify terminal type:" xterm
- TERM="$resp"
- export TERM
}
md_get_diskdevs() {
@@ -64,11 +59,6 @@ md_get_ifdevs() {
dmesg | egrep "(^ie[0-9] )|(^le[0-9] )" | cut -d" " -f1 | sort -u
}
-md_get_partition_range() {
- # return range of valid partition letters
- echo "[a-p]"
-}
-
md_questions() {
:
}
diff --git a/distrib/mvmeppc/ramdisk/install.md b/distrib/mvmeppc/ramdisk/install.md
index b3331b6e579..0883f5f2614 100644
--- a/distrib/mvmeppc/ramdisk/install.md
+++ b/distrib/mvmeppc/ramdisk/install.md
@@ -1,4 +1,4 @@
-# $OpenBSD: install.md,v 1.8 2002/04/28 14:44:01 krw Exp $
+# $OpenBSD: install.md,v 1.9 2002/05/08 23:01:47 krw Exp $
#
#
# Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -41,13 +41,10 @@
# Machine-dependent install sets
MDSETS=kernel
+MDTERM=vt100
ARCH=ARCH
md_set_term() {
- test -n "$TERM" && return
- ask "Specify terminal type:" vt220
- TERM=$resp
- export TERM
}
md_get_diskdevs() {
@@ -60,11 +57,6 @@ md_get_cddevs() {
bsort `dmesg | egrep -a "^cd[0-9]+ " | cutword 1`
}
-md_get_partition_range() {
- # return range of valid partition letters
- echo [a-p]
-}
-
md_questions() {
:
}
diff --git a/distrib/sparc/install.md b/distrib/sparc/install.md
index 7f6b5de0cd4..b1eda8ffdde 100644
--- a/distrib/sparc/install.md
+++ b/distrib/sparc/install.md
@@ -1,4 +1,4 @@
-# $OpenBSD: install.md,v 1.38 2002/05/07 02:03:57 krw Exp $
+# $OpenBSD: install.md,v 1.39 2002/05/08 23:01:47 krw Exp $
# $NetBSD: install.md,v 1.3.2.5 1996/08/26 15:45:28 gwr Exp $
#
#
@@ -42,13 +42,10 @@
# Machine-dependent install sets
MDSETS=kernel
+MDTERM=sun
ARCH=ARCH
md_set_term() {
- test -n "$TERM" && return
- ask "Specify terminal type:" sun
- TERM=$resp
- export TERM
}
md_get_msgbuf() {
@@ -75,11 +72,6 @@ md_get_cddevs() {
md_get_msgbuf | sed -n -e '/^cd[0-9] /{s/ .*//;p;}'
}
-md_get_partition_range() {
- # return range of valid partition letters
- echo [a-p]
-}
-
md_questions() {
:
}
diff --git a/distrib/sparc64/common/install.md b/distrib/sparc64/common/install.md
index 13f45933265..bd02a2d05a2 100644
--- a/distrib/sparc64/common/install.md
+++ b/distrib/sparc64/common/install.md
@@ -1,4 +1,4 @@
-# $OpenBSD: install.md,v 1.7 2002/04/28 14:44:01 krw Exp $
+# $OpenBSD: install.md,v 1.8 2002/05/08 23:01:47 krw Exp $
# $NetBSD: install.md,v 1.3.2.5 1996/08/26 15:45:28 gwr Exp $
#
#
@@ -42,13 +42,10 @@
# Machine-dependent install sets
MDSETS=kernel
+MDTERM=sun
ARCH=ARCH
md_set_term() {
- test -n "$TERM" && return
- ask "Specify terminal type:" sun
- TERM=$resp
- export TERM
}
md_get_msgbuf() {
@@ -74,11 +71,6 @@ md_get_cddevs() {
md_get_msgbuf | sed -n -e '/^cd[0-9] /{s/ .*//;p;}'
}
-md_get_partition_range() {
- # return range of valid partition letters
- echo [a-p]
-}
-
md_questions() {
echo
ask "Do you expect to run the X Window System?" y
diff --git a/distrib/sun3/install.md b/distrib/sun3/install.md
index c1b5c3afd92..82f07c76752 100644
--- a/distrib/sun3/install.md
+++ b/distrib/sun3/install.md
@@ -1,4 +1,4 @@
-# $OpenBSD: install.md,v 1.6 2002/05/07 02:03:57 krw Exp $
+# $OpenBSD: install.md,v 1.7 2002/05/08 23:01:47 krw Exp $
#
#
# Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -41,13 +41,10 @@
# Machine-dependent install sets
MDSETS=kernel
+MDTERM=sun
ARCH=ARCH
md_set_term() {
- test -n "$TERM" && return
- ask "Specify terminal type:" sun
- TERM=$resp
- export TERM
}
md_get_msgbuf() {
@@ -74,11 +71,6 @@ md_get_cddevs() {
md_get_msgbuf | sed -n -e '/^cd[0-9] /{s/ .*//;p;}'
}
-md_get_partition_range() {
- # return range of valid partition letters
- echo [a-p]
-}
-
md_questions() {
:
}
diff --git a/distrib/vax/install.md b/distrib/vax/install.md
index ceacbb900ca..d782ee97a82 100644
--- a/distrib/vax/install.md
+++ b/distrib/vax/install.md
@@ -1,4 +1,4 @@
-# $OpenBSD: install.md,v 1.11 2002/05/07 02:03:57 krw Exp $
+# $OpenBSD: install.md,v 1.12 2002/05/08 23:01:47 krw Exp $
# $NetBSD: install.md,v 1.3.2.5 1996/08/26 15:45:28 gwr Exp $
#
#
@@ -42,13 +42,10 @@
# Machine-dependent install sets
MDSETS=kernel
+MDTERM=vt100
ARCH=ARCH
md_set_term() {
- test -n "$TERM" && return
- ask "Specify terminal type:" vt100
- TERM=$resp
- export TERM
}
md_get_msgbuf() {
@@ -76,11 +73,6 @@ md_get_cddevs() {
-e '/^ra[0-9] .* RRD40$/{s/ .*//;p;}'
}
-md_get_partition_range() {
- # return range of valid partition letters
- echo [a-p]
-}
-
md_questions() {
:
}