summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkrw <krw@openbsd.org>2010-01-03 04:25:42 +0000
committerkrw <krw@openbsd.org>2010-01-03 04:25:42 +0000
commitbbfb4d1dad9ea6d85e59fc61d9c6c2db55214657 (patch)
tree31711566fed632b6c0d9afa39a0d24c95378c2af
parentNuke some unused variables, ok marco (diff)
downloadwireguard-openbsd-bbfb4d1dad9ea6d85e59fc61d9c6c2db55214657.tar.xz
wireguard-openbsd-bbfb4d1dad9ea6d85e59fc61d9c6c2db55214657.zip
Since we can now recognize new disks as they appear, loop waiting
for a root disk to appear if no disks are initially found. Diff & ok from halex@, idea from deraadt@
-rw-r--r--distrib/miniroot/install.sub11
1 files changed, 6 insertions, 5 deletions
diff --git a/distrib/miniroot/install.sub b/distrib/miniroot/install.sub
index ce041f7fb83..a079c629f24 100644
--- a/distrib/miniroot/install.sub
+++ b/distrib/miniroot/install.sub
@@ -1,4 +1,4 @@
-# $OpenBSD: install.sub,v 1.594 2009/07/23 00:30:03 krw Exp $
+# $OpenBSD: install.sub,v 1.595 2010/01/03 04:25:42 krw Exp $
# $NetBSD: install.sub,v 1.5.2.8 1996/09/02 23:25:02 pk Exp $
#
# Copyright (c) 1997-2009 Todd Miller, Theo de Raadt, Ken Westerback
@@ -1953,10 +1953,11 @@ if [[ $MODE == install ]]; then
fi
# Get ROOTDISK, ROOTDEV and SWAPDEV.
-[[ -n $(get_dkdevs) ]] || { echo "No disks found." ; exit ; }
-
-ask_which "disk" "is the root disk" '$(get_dkdevs)'
-[[ $resp == done ]] && exit
+while :; do
+ ask_which "disk" "is the root disk" '$(get_dkdevs | sed s,^$,none, )'
+ [[ $resp == done ]] && exit
+ [[ $resp != none ]] && break
+done
makedev $resp || exit
ROOTDISK=$resp