summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--distrib/miniroot/install.sh5
-rw-r--r--distrib/miniroot/install.sub30
2 files changed, 19 insertions, 16 deletions
diff --git a/distrib/miniroot/install.sh b/distrib/miniroot/install.sh
index 6b6811cf17e..9d3f1ed452d 100644
--- a/distrib/miniroot/install.sh
+++ b/distrib/miniroot/install.sh
@@ -1,5 +1,5 @@
#!/bin/sh
-# $OpenBSD: install.sh,v 1.115 2002/09/22 22:42:25 krw Exp $
+# $OpenBSD: install.sh,v 1.116 2002/09/24 01:26:15 krw Exp $
# $NetBSD: install.sh,v 1.5.2.8 1996/08/27 18:15:05 gwr Exp $
#
# Copyright (c) 1997-2002 Todd Miller, Theo de Raadt, Ken Westerback
@@ -94,6 +94,7 @@ if [ ! -f /etc/fstab ]; then
while : ; do
_DKDEVS=`rmel "$DISK" $_DKDEVS`
+ _DKDEVS=${_DKDEVS% }
[ "$_DKDEVS" ] || break
# Always do ROOTDISK first, and repeat until
@@ -103,7 +104,7 @@ if [ ! -f /etc/fstab ]; then
rm -f /tmp/fstab
rm -f $FILESYSTEMS
else
- ask_fordev "Which disk do you wish to initialize?" "$_DKDEVS"
+ ask_which "disk" "do you wish to initialize?" "$_DKDEVS"
[ "$resp" = "done" ] && break
fi
diff --git a/distrib/miniroot/install.sub b/distrib/miniroot/install.sub
index a9384661b74..1c0c18a1c58 100644
--- a/distrib/miniroot/install.sub
+++ b/distrib/miniroot/install.sub
@@ -1,4 +1,4 @@
-# $OpenBSD: install.sub,v 1.258 2002/09/22 22:42:25 krw Exp $
+# $OpenBSD: install.sub,v 1.259 2002/09/24 01:26:15 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
@@ -233,20 +233,21 @@ ask_until () {
# Ask for the user to select a device from a list generated by scanning
# /var/run/dmesg.boot, and make the device if it doesn't exist.
#
-# $1 = question to ask
-# $2 = list of devices from /var/run/dmesg.boot scan
-# $3 = default device
+# $1 = device name (disk, cd, etc.)
+# $2 = question to ask
+# $3 = list of devices from /var/run/dmesg.boot scan
+# $4 = default device
#
# $resp holds device selected at exit, or 'done'
-ask_fordev () {
- local _query=$1 _devs=$2 _defdev=$3
+ask_which () {
+ local _name=$1 _query=$2 _devs=$3 _defdev=$4
[ "$_defdev" ] || _defdev=done
resp=
while [ -z "$resp" ]; do
- echo "\nAvailable devices are:\n\n${_devs}\n"
- ask "$_query (or done)" "$_defdev"
+ echo "Available ${_name}s are: ${_devs}."
+ ask "Which one $_query (or done)" "$_defdev"
if isin $resp $_devs ; then
makedev $resp || resp=
@@ -275,11 +276,11 @@ addel() {
shift
for _b; do
- echo "$_b"
+ echo -n "$_b "
[ "$_a" = "$_b" ] && _seen=true
done
- $_seen || echo "$_a"
+ $_seen || echo -n "$_a"
}
# remove all occurrences of first argument from list formed by
@@ -289,7 +290,7 @@ rmel() {
shift
for _b; do
- [ "$_a" != "$_b" ] && echo "$_b"
+ [ "$_a" != "$_b" ] && echo -n "$_b "
done
}
@@ -429,13 +430,14 @@ if [ "$MODE" = "install" -a ! -f /etc/fstab ]; then
You will now initialize the disk(s) that OpenBSD will use. To enable all
available security features you should configure the disk(s) to allow the
creation of separate filesystems for /, /tmp, /var, /usr, and /home.
+
__EOT
fi
ROOTDISK=
ROOTDEV=
- ask_fordev "Which disk is the root disk?" "$DKDEVS" "$_defdsk"
+ ask_which "disk" "is the root disk?" "$DKDEVS" "$_defdsk"
[ "$resp" = "done" ] && exit
ROOTDISK=$resp
@@ -1167,7 +1169,7 @@ install_cdrom() {
return
fi
- ask_fordev "Which CD-ROM contains the ${MODE} media?" "$CDDEVS" "`echo $CDDEVS | cutword 1`"
+ ask_which "CD-ROM" "contains the ${MODE} media?" "$CDDEVS" "`echo $CDDEVS | cutword 1`"
[ "$resp" = "done" ] && return
_drive=$resp
@@ -1253,7 +1255,7 @@ mount_a_disk() {
local _drive _def_partition _partition_range _partition
local _fstype _fsopts
- ask_fordev "Which disk contains the ${MODE} sets?" "$DKDEVS"
+ ask_which "disk" "contains the ${MODE} sets?" "$DKDEVS"
[ "$resp" = "done" ] && return 1
_drive=$resp