From 14291f3e60dc095c720f48bbfba7b45f33b540ad Mon Sep 17 00:00:00 2001 From: kn Date: Tue, 6 Jun 2023 09:35:44 +0000 Subject: [PATCH] Fold disk crypto question '?' text into prompt Since this question moved after the root disk one and '?' stopped listing disks, hoist the implementation details in order to drop the custom answer and reuse existing ask_yn(), thus Encrypt the root disk? (yes, no or '?' for details) [no] ? Create a passphrase protected CRYPTO softraid volume to be used as root disk. Encrypt the root disk? (yes, no or '?' for details) [no] becomes Encrypt the root disk? (passphrase CRYPTO softraid) [no] Prodded by afresh1 --- distrib/miniroot/install.sub | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/distrib/miniroot/install.sub b/distrib/miniroot/install.sub index 1f4b87c469e..fe1e978f065 100644 --- a/distrib/miniroot/install.sub +++ b/distrib/miniroot/install.sub @@ -1,5 +1,5 @@ #!/bin/ksh -# $OpenBSD: install.sub,v 1.1248 2023/05/24 20:04:05 naddy Exp $ +# $OpenBSD: install.sub,v 1.1249 2023/06/06 09:35:44 kn Exp $ # # Copyright (c) 1997-2015 Todd Miller, Theo de Raadt, Ken Westerback # Copyright (c) 2015, Robert Peichaer @@ -3075,7 +3075,6 @@ do_autoinstall() { encrypt_root() { local _chunk _tries=0 - local _q="Encrypt the root disk? (yes, no or '?' for details)" [[ $MDBOOTSR == y ]] || return @@ -3086,21 +3085,8 @@ encrypt_root() { # e.g. auto-assembled at boot or done in (S)hell. [[ -z $(get_softraid_volumes) ]] || return - while :; do - _ask "$_q" no || continue - case $resp in - '?') cat <<'__EOT' -Create a passphrase protected CRYPTO softraid volume to be used as root disk. -__EOT - ;; - '') ;; - n|no) return;; - y|yes) break;; - *) echo "'$resp' is not a valid choice." - continue;; - esac - done - log_answers "$_q" "$resp" + ask_yn 'Encrypt the root disk? (passphrase CRYPTO softraid)' || return + _chunk=$ROOTDISK echo "\nConfiguring the crypto chunk $_chunk...\n" -- 2.20.1