From: rpe Date: Wed, 3 Jan 2018 10:22:38 +0000 (+0000) Subject: Always present the same question at the end of installs or upgrades. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=8825d37fbc388d42b0f469496c2f740adb7a8fd5;p=openbsd Always present the same question at the end of installs or upgrades. Offer to exit to shell, halt or reboot the system, where 'reboot' is the default answer. Change default answer to 'halt' for installs if MDHALT is set to 'y'. suggested by landry@ OK halex@ --- diff --git a/distrib/miniroot/install.sub b/distrib/miniroot/install.sub index cd52d8d6850..06630c0ef6f 100644 --- a/distrib/miniroot/install.sub +++ b/distrib/miniroot/install.sub @@ -1,5 +1,5 @@ #!/bin/ksh -# $OpenBSD: install.sub,v 1.1052 2017/12/22 19:41:49 rpe Exp $ +# $OpenBSD: install.sub,v 1.1053 2018/01/03 10:22:38 rpe Exp $ # # Copyright (c) 1997-2015 Todd Miller, Theo de Raadt, Ken Westerback # Copyright (c) 2015, Robert Peichaer @@ -3175,7 +3175,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 +# MDHALT - default to 'halt' at the end of installs if set to 'y' . install.md # Start listener process looking for dmesg changes. @@ -3193,7 +3193,6 @@ INSTALL_METHOD= NIFS=0 export PS1="$MODE# " PUB_KEY=/etc/signify/openbsd-${VERSION}-base.pub -REBOOT=${MDREBOOT:-reboot} ROOTDEV= ROOTDISK= SETDIR="$VNAME/$ARCH" @@ -3281,15 +3280,15 @@ esac # automatic reboot in do_autoinstall(). $AUTO && exit -_r2=${REBOOT#?} -_r1=${REBOOT%$_r2} -typeset -u _R1=$_r1 +_d=reboot +[[ $MODE == install && $MDHALT == y ]] && _d=halt while :; do - ask "Exit to (S)hell or ($_R1)$_r2?" "$REBOOT" + ask "Exit to (S)hell, (H)alt or (R)eboot?" "$_d" case $resp in - [$_r1$_R1]*) exec "$REBOOT";; - [sS]*) break;; + [hH]*) exec halt;; + [rR]*) exec reboot;; + [sS]*) break;; esac done diff --git a/distrib/sparc64/common/install.md b/distrib/sparc64/common/install.md index d44c150de0c..26ec5132021 100644 --- a/distrib/sparc64/common/install.md +++ b/distrib/sparc64/common/install.md @@ -1,4 +1,4 @@ -# $OpenBSD: install.md,v 1.50 2017/12/17 18:29:56 rpe Exp $ +# $OpenBSD: install.md,v 1.51 2018/01/03 10:22:38 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,7 +32,7 @@ # machine dependent section of installation/upgrade script. # -MDREBOOT=halt +MDHALT=y MDTERM=sun MDXAPERTURE=1 MDXDM=y