From: kn Date: Fri, 7 Apr 2023 13:48:42 +0000 (+0000) Subject: Default 'Is the disk partition alrady mounted?' to 'no' on install X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=6b374d60b43907069aad4acc57a7586df8754a0d;p=openbsd Default 'Is the disk partition alrady mounted?' to 'no' on install For installation, no partitions whatsoever are mounted, so 'yes' is always wrong unless the user manually mounted stuff before that question. No change for upgrade, where partitions on the root disk are mounted. Idea from naddy, diff from Mikhail (mp39590 AT gmail) Tweaks from me OK op afresh1 --- diff --git a/distrib/miniroot/install.sub b/distrib/miniroot/install.sub index a365bd5259e..af1457a9d9f 100644 --- a/distrib/miniroot/install.sub +++ b/distrib/miniroot/install.sub @@ -1,5 +1,5 @@ #!/bin/ksh -# $OpenBSD: install.sub,v 1.1240 2023/04/07 09:40:18 kn Exp $ +# $OpenBSD: install.sub,v 1.1241 2023/04/07 13:48:42 kn Exp $ # # Copyright (c) 1997-2015 Todd Miller, Theo de Raadt, Ken Westerback # Copyright (c) 2015, Robert Peichaer @@ -2048,7 +2048,12 @@ install_cdrom() { # Install sets from disk. # Ask for the disk device containing the set files. install_disk() { - if ! ask_yn "Is the disk partition already mounted?" yes; then + local _ismounted=yes + + # No partitions are mounted prior to regular installation. + [[ $MODE == install ]] && _ismounted=no + + if ! ask_yn "Is the disk partition already mounted?" $_ismounted; then ask_which "disk" "contains the $MODE media" \ '$(bsort $(get_dkdevs))' \ '$(get_dkdevs_uninitialized)'