diff options
author | 2015-12-23 18:06:32 +0000 | |
---|---|---|
committer | 2015-12-23 18:06:32 +0000 | |
commit | bcc54e984e2555b53868cef2779ad906551ddb29 (patch) | |
tree | 03f3e05a0a7888511e8470bf12bcc592bdf0da64 | |
parent | - quote user supplied hostname (diff) | |
download | wireguard-openbsd-bcc54e984e2555b53868cef2779ad906551ddb29.tar.xz wireguard-openbsd-bcc54e984e2555b53868cef2779ad906551ddb29.zip |
Move the code, that lists uninitialized disk into a separate function.
This makes the disk initialization question code easier to understand.
OK krw@
-rw-r--r-- | distrib/miniroot/install.sh | 6 | ||||
-rw-r--r-- | distrib/miniroot/install.sub | 11 |
2 files changed, 12 insertions, 5 deletions
diff --git a/distrib/miniroot/install.sh b/distrib/miniroot/install.sh index 6f9c995a75a..7befac08fe0 100644 --- a/distrib/miniroot/install.sh +++ b/distrib/miniroot/install.sh @@ -1,5 +1,5 @@ #!/bin/ksh -# $OpenBSD: install.sh,v 1.271 2015/12/23 17:54:52 rpe Exp $ +# $OpenBSD: install.sh,v 1.272 2015/12/23 18:06:32 rpe Exp $ # $NetBSD: install.sh,v 1.5.2.8 1996/08/27 18:15:05 gwr Exp $ # # Copyright (c) 1997-2015 Todd Miller, Theo de Raadt, Ken Westerback @@ -129,9 +129,7 @@ while :; do # Force the user to think and type in a disk name by # making 'done' the default choice. ask_which "disk" "do you wish to initialize" \ - '$(l=$(get_dkdevs); for a in $DISKS_DONE; do - l=$(rmel $a $l); done; bsort $l)' \ - done + '$(get_dkdevs_uninitialized)' done [[ $resp == done ]] && break fi diff --git a/distrib/miniroot/install.sub b/distrib/miniroot/install.sub index a7c1499c929..7cf3bcc3f8c 100644 --- a/distrib/miniroot/install.sub +++ b/distrib/miniroot/install.sub @@ -1,4 +1,4 @@ -# $OpenBSD: install.sub,v 1.865 2015/12/23 17:45:13 rpe Exp $ +# $OpenBSD: install.sub,v 1.866 2015/12/23 18:06:32 rpe Exp $ # # Copyright (c) 1997-2015 Todd Miller, Theo de Raadt, Ken Westerback # Copyright (c) 2015, Robert Peichaer <rpe@openbsd.org> @@ -243,6 +243,15 @@ get_cddevs () { echo $(scan_disknames "${MDCDDEVS:-/^cd[0-9][0-9]* /s/ .*//p}") } +# Return list of disks not yet initialized. +get_dkdevs_uninitialized() { + local _disks=$(get_dkdevs) _d + for _d in $DISKS_DONE; do + _disks=$(rmel "$_d" $_disks) + done + bsort $_disks +} + # Return list of network devices. Filter out dynamically created network # pseudo-devices except vlan. get_ifdevs() { |