From e187b6e0d3a4251799d3eac3b9ec946213f00bca Mon Sep 17 00:00:00 2001 From: rpe Date: Sun, 17 Dec 2017 18:29:56 +0000 Subject: [PATCH] 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@ --- distrib/miniroot/install.sub | 16 ++++++++++++++-- distrib/sparc64/common/install.md | 3 ++- 2 files changed, 16 insertions(+), 3 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 @@ -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 diff --git a/distrib/sparc64/common/install.md b/distrib/sparc64/common/install.md index 9bc62ea8bb7..d44c150de0c 100644 --- a/distrib/sparc64/common/install.md +++ b/distrib/sparc64/common/install.md @@ -1,4 +1,4 @@ -# $OpenBSD: install.md,v 1.49 2017/07/28 18:15:44 rpe Exp $ +# $OpenBSD: install.md,v 1.50 2017/12/17 18:29:56 rpe Exp $ # $NetBSD: install.md,v 1.3.2.5 1996/08/26 15:45:28 gwr Exp $ # # Copyright (c) 1996 The NetBSD Foundation, Inc. @@ -32,6 +32,7 @@ # machine dependent section of installation/upgrade script. # +MDREBOOT=halt MDTERM=sun MDXAPERTURE=1 MDXDM=y -- 2.20.1