From: rpe Date: Wed, 20 May 2015 19:14:35 +0000 (+0000) Subject: Merge the get_drive() function with install_disk(), which is the X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=d7c22ab5848e5f9574d7327dbf94a09b232191b5;p=openbsd Merge the get_drive() function with install_disk(), which is the only remaining consumer. OK krw@ --- diff --git a/distrib/miniroot/install.sub b/distrib/miniroot/install.sub index b21e0a746e5..e4c7c26b885 100644 --- a/distrib/miniroot/install.sub +++ b/distrib/miniroot/install.sub @@ -1,4 +1,4 @@ -# $OpenBSD: install.sub,v 1.840 2015/05/19 20:12:29 rpe Exp $ +# $OpenBSD: install.sub,v 1.841 2015/05/20 19:14:35 rpe Exp $ # # Copyright (c) 1997-2015 Todd Miller, Theo de Raadt, Ken Westerback # Copyright (c) 2015, Robert Peichaer @@ -254,14 +254,6 @@ get_ifdevs() { done } -# Ask for the device that contains the install/upgrade media. -get_drive() { - ask_which "$1" "contains the $MODE media" "$2" "$3" - [[ $resp == done ]] && return 1 - makedev $resp || return 1 - return 0 -} - # Return the device name of the device $1, which may be a disklabel UID. getdevname() { local _dev=$1 @@ -1354,9 +1346,11 @@ install_cdrom() { # installation. install_disk() { if ! ask_yn "Is the disk partition already mounted?"; then - get_drive "disk" '$(bsort $(get_dkdevs))' \ - '$(bsort $(rmel $ROOTDISK $(get_dkdevs)))' || return - mount_mnt2 $resp || return + ask_which "disk" "contains the $MODE media" \ + '$(bsort $(get_dkdevs))' \ + '$(bsort $(rmel $ROOTDISK $(get_dkdevs)))' + [[ $resp == done ]] && return 1 + makedev $resp && mount_mnt2 $resp || return fi install_mounted_fs