From a3c8ee7762343fdb7aba42f328e4aaaace8f95a0 Mon Sep 17 00:00:00 2001 From: rpe Date: Mon, 18 Dec 2017 22:48:28 +0000 Subject: [PATCH] Change the question at the end of installs and upgrades to present a choice between exiting to the shell or to reboot the latter being the default. (On sparc64 the second choice is to halt the system which leaves it at the OpenBoot PROM prompt) While there add a newline after the CONGRATULATIONS message. OK tb@ positive feedback naddy@ deraadt@ giovanni@ --- distrib/miniroot/install.sub | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/distrib/miniroot/install.sub b/distrib/miniroot/install.sub index 9e7b887721e..1090097e231 100644 --- a/distrib/miniroot/install.sub +++ b/distrib/miniroot/install.sub @@ -1,5 +1,5 @@ #!/bin/ksh -# $OpenBSD: install.sub,v 1.1048 2017/12/18 21:33:26 tb Exp $ +# $OpenBSD: install.sub,v 1.1049 2017/12/18 22:48:28 rpe Exp $ # # Copyright (c) 1997-2015 Todd Miller, Theo de Raadt, Ken Westerback # Copyright (c) 2015, Robert Peichaer @@ -2762,10 +2762,12 @@ __EOT cat <<__EOT CONGRATULATIONS! Your OpenBSD $MODE has been successfully completed! + __EOT [[ $MODE == install ]] && cat <<__EOT When you login to your new system the first time, please read your mail using the 'mail' command. + __EOT md_congrats @@ -3201,6 +3203,7 @@ INSTALL_METHOD= NIFS=0 export PS1="$MODE# " PUB_KEY=/etc/signify/openbsd-${VERSION}-base.pub +REBOOT=${MDREBOOT:-reboot} ROOTDEV= ROOTDISK= SETDIR="$VNAME/$ARCH" @@ -3288,9 +3291,17 @@ esac # automatic reboot in do_autoinstall(). $AUTO && exit -if ask_yn "Escape to shell before reboot?"; then - echo "To boot the new system, enter 'reboot' at the command prompt." - # Fall through to .profile which leaves us at the command prompt. -else - exec "${MDREBOOT:-reboot}" -fi +_r2=${REBOOT#?} +_r1=${REBOOT%$_r2} +typeset -u _R1=$_r1 + +while :; do + ask "Exit to (S)hell or ($_R1)$_r2?" "$REBOOT" + case $resp in + [$_r1$_R1]*) exec "$REBOOT";; + [sS]*) break;; + esac +done + +# Fall through to .profile which leaves us at the command prompt. +echo "To boot the new system, enter 'reboot' at the command prompt." -- 2.20.1