diff options
author | Robert Peichaer <rpe@cvs.openbsd.org> | 2015-12-23 18:06:33 +0000 |
---|---|---|
committer | Robert Peichaer <rpe@cvs.openbsd.org> | 2015-12-23 18:06:33 +0000 |
commit | 9220f26fbe137c7cfe7a4bad135c2230d25e10c0 (patch) | |
tree | 8605d1083102f0f8bd1a8bc26179efc09c47b1b5 /distrib/miniroot | |
parent | c76b1760ccc0249005e66fac7168f56956df07d0 (diff) |
Move the code, that lists uninitialized disk into a separate function.
This makes the disk initialization question code easier to understand.
OK krw@
Diffstat (limited to 'distrib/miniroot')
-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() { |