summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--distrib/miniroot/dot.profile5
-rw-r--r--distrib/miniroot/install.sub10
2 files changed, 8 insertions, 7 deletions
diff --git a/distrib/miniroot/dot.profile b/distrib/miniroot/dot.profile
index 3bac832dfb3..e6f70ee3842 100644
--- a/distrib/miniroot/dot.profile
+++ b/distrib/miniroot/dot.profile
@@ -1,4 +1,4 @@
-# $OpenBSD: dot.profile,v 1.14 2010/01/10 13:32:56 deraadt Exp $
+# $OpenBSD: dot.profile,v 1.15 2010/06/30 19:31:19 halex Exp $
# $NetBSD: dot.profile,v 1.1 1995/12/18 22:54:43 pk Exp $
#
# Copyright (c) 2009 Kenneth R. Westerback
@@ -61,8 +61,7 @@ if [ "X${DONEPROFILE}" = "X" ]; then
Welcome to the $OBSD installation program.
__EOT
- while :; do
- read REPLY?'(I)nstall, (U)pgrade or (S)hell? '
+ while read REPLY?'(I)nstall, (U)pgrade or (S)hell? '; do
case $REPLY in
i*|I*) /install && break
;;
diff --git a/distrib/miniroot/install.sub b/distrib/miniroot/install.sub
index 405237084cd..dbf00ee7d50 100644
--- a/distrib/miniroot/install.sub
+++ b/distrib/miniroot/install.sub
@@ -1,4 +1,4 @@
-# $OpenBSD: install.sub,v 1.607 2010/06/30 00:23:02 halex Exp $
+# $OpenBSD: install.sub,v 1.608 2010/06/30 19:31:19 halex Exp $
# $NetBSD: install.sub,v 1.5.2.8 1996/09/02 23:25:02 pk Exp $
#
# Copyright (c) 1997-2009 Todd Miller, Theo de Raadt, Ken Westerback
@@ -175,7 +175,7 @@ mount_mnt2() {
askpass() {
set -o noglob
stty -echo
- read -r resp?"$1 "
+ read -r resp?"$1 " || exit 1
stty echo
set +o noglob
echo
@@ -227,16 +227,18 @@ retrap
# and the function will return a non-zero value. Normally, the caller
# will then reprint any prompt and call the function again.
_ask() {
- local _int _redo=0 _pid
+ local _int _redo=0 _pid _fail
trap "_int=1" INT
trap "_redo=1" TERM
lock; dmesg >/tmp/update; unlock
- read resp
+ read resp || _fail=1
lock; rm /tmp/update; unlock
if (( _redo )); then
stty raw
stty -raw
+ elif [[ -n $_fail ]]; then
+ exit 1
else
case $resp in
!) echo "Type 'exit' to return to install."