diff options
author | Robert Peichaer <rpe@cvs.openbsd.org> | 2017-12-17 18:29:57 +0000 |
---|---|---|
committer | Robert Peichaer <rpe@cvs.openbsd.org> | 2017-12-17 18:29:57 +0000 |
commit | cb2adb66955ecb1740ff0b6d41c1ab85109fccdc (patch) | |
tree | 75a680fd590cc308d2005be9ed560be8d8dd2ff0 /distrib/miniroot/install.sub | |
parent | 14f9137439d632ac84f4177a865b8e561a269670 (diff) |
Add a new question "Escape to shell before reboot? [no]" at the end of
the install and upgrade process.
"no" or [enter] reboots the system
"yes" leaves the install or upgrade at the shell prompt
On selected architectures, sparc64 being the only so far, the system
is halted instead of rebooted.
autoinstall(8) is NOT affected by this new question as it reboots the
system automatically already.
Suggested by and OK deraadt@, tb@ phessler@
Feedback on sparc64 by stsp@
Positive feedback pea@ landry@
Diffstat (limited to 'distrib/miniroot/install.sub')
-rw-r--r-- | distrib/miniroot/install.sub | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/distrib/miniroot/install.sub b/distrib/miniroot/install.sub index 4b7c76c8295..0548b0bfab1 100644 --- a/distrib/miniroot/install.sub +++ b/distrib/miniroot/install.sub @@ -1,5 +1,5 @@ #!/bin/ksh -# $OpenBSD: install.sub,v 1.1046 2017/12/17 17:03:52 rpe Exp $ +# $OpenBSD: install.sub,v 1.1047 2017/12/17 18:29:56 rpe Exp $ # # Copyright (c) 1997-2015 Todd Miller, Theo de Raadt, Ken Westerback # Copyright (c) 2015, Robert Peichaer <rpe@openbsd.org> @@ -2762,7 +2762,6 @@ __EOT cat <<__EOT CONGRATULATIONS! Your OpenBSD $MODE has been successfully completed! -To boot the new system, enter 'reboot' at the command prompt. __EOT [[ $MODE == install ]] && cat <<__EOT When you login to your new system the first time, please read your mail @@ -3182,6 +3181,7 @@ done # MDXDM - ask if xdm should be started if set to 'y' # NCPU - the number of cpus for mp capable arches # MDKERNEL - the name of the boot kernel +# MDREBOOT - the command to either reboot or halt the system . install.md # Start listener process looking for dmesg changes. @@ -3279,3 +3279,15 @@ case $MODE in install) do_install;; upgrade) do_upgrade;; esac + +# In case of autoinstall, this is a second process of install.sub. +# Exiting here returns to the original process, which handles the +# 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 |