Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/distrib On install CDs: make ^C and ^Z work (mostly) as they...



details:   https://anonhg.NetBSD.org/src/rev/ed99082ec086
branches:  trunk
changeset: 764347:ed99082ec086
user:      martin <martin%NetBSD.org@localhost>
date:      Sun Apr 17 12:18:19 2011 +0000

description:
On install CDs: make ^C and ^Z work (mostly) as they used to do on
crunched/ramdisk install media again.
Fixes the remaining parts of PR 44738.

diffstat:

 distrib/amd64/cdroms/Makefile.cdrom         |   3 +-
 distrib/amd64/cdroms/install.sh             |  48 +++++++++++++++++++++++-----
 distrib/i386/cdroms/Makefile.cdrom          |   3 +-
 distrib/i386/cdroms/install.sh              |  48 +++++++++++++++++++++++-----
 distrib/sparc64/cdroms/installcd/Makefile   |   3 +-
 distrib/sparc64/cdroms/installcd/install.sh |  48 +++++++++++++++++++++++-----
 distrib/sparc64/instfs/dot.profile          |  14 ++++++-
 7 files changed, 134 insertions(+), 33 deletions(-)

diffs (truncated from 330 to 300 lines):

diff -r f86b56d09907 -r ed99082ec086 distrib/amd64/cdroms/Makefile.cdrom
--- a/distrib/amd64/cdroms/Makefile.cdrom       Sun Apr 17 11:45:40 2011 +0000
+++ b/distrib/amd64/cdroms/Makefile.cdrom       Sun Apr 17 12:18:19 2011 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.cdrom,v 1.3 2011/01/29 01:54:33 jym Exp $
+# $NetBSD: Makefile.cdrom,v 1.4 2011/04/17 12:18:19 martin Exp $
 
 .include <bsd.own.mk>
 
@@ -34,6 +34,7 @@
 CDRUNTIME+=    ./usr/bin/sed
 CDRUNTIME+=    ./usr/bin/sort
 CDRUNTIME+=    ./usr/bin/tip
+CDRUNTIME+=    ./usr/bin/tput
 CDRUNTIME+=    ./usr/bin/vmstat
 CDRUNTIME+=    ./usr/lib/libbz2.so*
 CDRUNTIME+=    ./usr/lib/libc.so*
diff -r f86b56d09907 -r ed99082ec086 distrib/amd64/cdroms/install.sh
--- a/distrib/amd64/cdroms/install.sh   Sun Apr 17 11:45:40 2011 +0000
+++ b/distrib/amd64/cdroms/install.sh   Sun Apr 17 12:18:19 2011 +0000
@@ -1,5 +1,5 @@
-#! /bin/sh
-# $NetBSD: install.sh,v 1.1 2011/01/18 00:16:13 jym Exp $
+#! /bin/sh -m
+# $NetBSD: install.sh,v 1.2 2011/04/17 12:18:20 martin Exp $
 #
 # -
 #  Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -34,17 +34,23 @@
 PATH=/sbin:/bin:/usr/bin:/usr/sbin:/
 export PATH
 
+termfile=/tmp/sysinst.term
+
 # Check if we are on a framebuffer or on serial console and default
 # the terminal type accordingly.
 # There is no /var/db/dev.db, so sysctl might not map the devicename properly;
 # ttyE0 is 90,0 -> 0x5a00
 case $(sysctl -nx kern.consdev) in
  002f000000000000)
-   TERM=wsvt25
-   ;;
+    TERM=wsvt25
+    ;;
  *)
-   TERM=vt220
-   ;;
+    if [ -r ${termfile} ]; then
+       . ${termfile}
+    else
+       TERM=vt220
+    fi
+    ;;
 esac
 
 export TERM
@@ -54,6 +60,8 @@
 export BLOCKSIZE
 EDITOR=ed
 export EDITOR
+SHELL=/bin/sh
+export SHELL
 
 umask 022
 
@@ -78,8 +86,30 @@
 fi
 
 # run the installation or upgrade script.
-/sysinst || {
-           echo "Oops, something went wrong - we will try again"; exit; }
+cd /
+cmd=./sysinst
 
+while [ -n "${cmd}" ]
+do
+       ${cmd}
+       if [ $? = 4 ]; then
+               echo "Oops, something went wrong - we will try again"
+               exit
+       else
+               if [ -n "$(jobs)" ]; then
+                       tput clear
+                       echo "You have stopped sysinst, return to it by" \
+                               "typing 'exit' or ^D."
+                       ${SHELL} -i
+                       cmd="fg"
+               else
+                       cmd=""
+               fi
+       fi
+done
+
+# remember terminal type, now that we know it for sure
+echo "TERM=${TERM}" > ${termfile}
+echo
 echo "To return to the installer, quit this shell by typing 'exit' or ^D."
-exec /bin/sh
+exec ${SHELL}
diff -r f86b56d09907 -r ed99082ec086 distrib/i386/cdroms/Makefile.cdrom
--- a/distrib/i386/cdroms/Makefile.cdrom        Sun Apr 17 11:45:40 2011 +0000
+++ b/distrib/i386/cdroms/Makefile.cdrom        Sun Apr 17 12:18:19 2011 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.cdrom,v 1.23 2011/01/27 15:34:38 gdt Exp $
+# $NetBSD: Makefile.cdrom,v 1.24 2011/04/17 12:18:20 martin Exp $
 
 .include <bsd.own.mk>
 
@@ -34,6 +34,7 @@
 CDRUNTIME+=    ./usr/bin/sed
 CDRUNTIME+=    ./usr/bin/sort
 CDRUNTIME+=    ./usr/bin/tip
+CDRUNTIME+=    ./usr/bin/tput
 CDRUNTIME+=    ./usr/bin/vmstat
 CDRUNTIME+=    ./usr/lib/libbz2.so*
 CDRUNTIME+=    ./usr/lib/libc.so*
diff -r f86b56d09907 -r ed99082ec086 distrib/i386/cdroms/install.sh
--- a/distrib/i386/cdroms/install.sh    Sun Apr 17 11:45:40 2011 +0000
+++ b/distrib/i386/cdroms/install.sh    Sun Apr 17 12:18:19 2011 +0000
@@ -1,5 +1,5 @@
-#! /bin/sh
-# $NetBSD: install.sh,v 1.1 2010/04/19 04:41:36 martin Exp $
+#! /bin/sh -m
+# $NetBSD: install.sh,v 1.2 2011/04/17 12:18:20 martin Exp $
 #
 # -
 #  Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -34,17 +34,23 @@
 PATH=/sbin:/bin:/usr/bin:/usr/sbin:/
 export PATH
 
+termfile=/tmp/sysinst.term
+
 # Check if we are on a framebuffer or on serial console and default
 # the terminal type accordingly.
 # There is no /var/db/dev.db, so sysctl might not map the devicename properly;
 # ttyE0 is 90,0 -> 0x5a00
 case $(sysctl -nx kern.consdev) in
  002f000000000000)
-   TERM=wsvt25
-   ;;
+    TERM=wsvt25
+    ;;
  *)
-   TERM=vt220
-   ;;
+    if [ -r ${termfile} ]; then
+       . ${termfile}
+    else
+       TERM=vt220
+    fi
+    ;;
 esac
 
 export TERM
@@ -54,6 +60,8 @@
 export BLOCKSIZE
 EDITOR=ed
 export EDITOR
+SHELL=/bin/sh
+export SHELL
 
 umask 022
 
@@ -78,8 +86,30 @@
 fi
 
 # run the installation or upgrade script.
-/sysinst || {
-           echo "Oops, something went wrong - we will try again"; exit; }
+cd /
+cmd=./sysinst
 
+while [ -n "${cmd}" ]
+do
+       ${cmd}
+       if [ $? = 4 ]; then
+               echo "Oops, something went wrong - we will try again"
+               exit
+       else
+               if [ -n "$(jobs)" ]; then
+                       tput clear
+                       echo "You have stopped sysinst, return to it by" \
+                               "typing 'exit' or ^D."
+                       ${SHELL} -i
+                       cmd="fg"
+               else
+                       cmd=""
+               fi
+       fi
+done
+
+# remember terminal type, now that we know it for sure
+echo "TERM=${TERM}" > ${termfile}
+echo
 echo "To return to the installer, quit this shell by typing 'exit' or ^D."
-exec /bin/sh
+exec ${SHELL}
diff -r f86b56d09907 -r ed99082ec086 distrib/sparc64/cdroms/installcd/Makefile
--- a/distrib/sparc64/cdroms/installcd/Makefile Sun Apr 17 11:45:40 2011 +0000
+++ b/distrib/sparc64/cdroms/installcd/Makefile Sun Apr 17 12:18:19 2011 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.10 2011/03/20 09:04:53 martin Exp $
+#      $NetBSD: Makefile,v 1.11 2011/04/17 12:18:20 martin Exp $
 CDBASE=                sparc64cd               # gives ${CDBASE}.iso
 CDRELEASE=     true                    # include $RELEASEDIR/$MACHINE
 
@@ -35,6 +35,7 @@
 CDRUNTIME+=    ./usr/bin/sed
 CDRUNTIME+=    ./usr/bin/sort
 CDRUNTIME+=    ./usr/bin/tip
+CDRUNTIME+=    ./usr/bin/tput
 CDRUNTIME+=    ./usr/bin/vmstat
 CDRUNTIME+=    ./usr/lib/libbz2.so*
 CDRUNTIME+=    ./usr/lib/libc.so*
diff -r f86b56d09907 -r ed99082ec086 distrib/sparc64/cdroms/installcd/install.sh
--- a/distrib/sparc64/cdroms/installcd/install.sh       Sun Apr 17 11:45:40 2011 +0000
+++ b/distrib/sparc64/cdroms/installcd/install.sh       Sun Apr 17 12:18:19 2011 +0000
@@ -1,5 +1,5 @@
-#! /bin/sh
-# $NetBSD: install.sh,v 1.1 2010/04/18 12:58:57 martin Exp $
+#! /bin/sh -m
+# $NetBSD: install.sh,v 1.2 2011/04/17 12:18:20 martin Exp $
 #
 # -
 #  Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -34,17 +34,23 @@
 PATH=/sbin:/bin:/usr/bin:/usr/sbin:/
 export PATH
 
+termfile=/tmp/sysinst.term
+
 # Check if we are on a framebuffer or on serial console and default
 # the terminal type accordingly.
 # There is no /var/db/dev.db, so sysctl might not map the devicename properly;
 # ttyE0 is 90,0 -> 0x5a00
 case $(sysctl -nx kern.consdev) in
  0000000000005a0*)
-   TERM=wsvt25
-   ;;
+    TERM=wsvt25
+    ;;
  *)
-   TERM=vt220
-   ;;
+    if [ -r ${termfile} ]; then
+       . ${termfile}
+    else
+       TERM=vt220
+    fi
+    ;;
 esac
 
 export TERM
@@ -54,6 +60,8 @@
 export BLOCKSIZE
 EDITOR=ed
 export EDITOR
+SHELL=/bin/sh
+export SHELL
 
 umask 022
 
@@ -78,8 +86,30 @@
 fi
 
 # run the installation or upgrade script.
-/sysinst || {
-           echo "Oops, something went wrong - we will try again"; exit; }
+cd /
+cmd=./sysinst
 
+while [ -n "${cmd}" ]
+do
+       ${cmd}
+       if [ $? = 4 ]; then
+               echo "Oops, something went wrong - we will try again"
+               exit
+       else
+               if [ -n "$(jobs)" ]; then
+                       tput clear
+                       echo "You have stopped sysinst, return to it by" \
+                               "typing 'exit' or ^D."
+                       ${SHELL} -i
+                       cmd="fg"
+               else
+                       cmd=""
+               fi
+       fi
+done
+
+# remember terminal type, now that we know it for sure
+echo "TERM=${TERM}" > ${termfile}
+echo
 echo "To return to the installer, quit this shell by typing 'exit' or ^D."
-exec /bin/sh
+exec ${SHELL}
diff -r f86b56d09907 -r ed99082ec086 distrib/sparc64/instfs/dot.profile
--- a/distrib/sparc64/instfs/dot.profile        Sun Apr 17 11:45:40 2011 +0000
+++ b/distrib/sparc64/instfs/dot.profile        Sun Apr 17 12:18:19 2011 +0000



Home | Main Index | Thread Index | Old Index