Module Name:    src
Committed By:   martin
Date:           Sun Apr 17 12:18:20 UTC 2011

Modified Files:
        src/distrib/amd64/cdroms: Makefile.cdrom install.sh
        src/distrib/i386/cdroms: Makefile.cdrom install.sh
        src/distrib/sparc64/cdroms/installcd: Makefile install.sh
        src/distrib/sparc64/instfs: dot.profile

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/distrib/amd64/cdroms/Makefile.cdrom
cvs rdiff -u -r1.1 -r1.2 src/distrib/amd64/cdroms/install.sh
cvs rdiff -u -r1.23 -r1.24 src/distrib/i386/cdroms/Makefile.cdrom
cvs rdiff -u -r1.1 -r1.2 src/distrib/i386/cdroms/install.sh
cvs rdiff -u -r1.10 -r1.11 src/distrib/sparc64/cdroms/installcd/Makefile
cvs rdiff -u -r1.1 -r1.2 src/distrib/sparc64/cdroms/installcd/install.sh
cvs rdiff -u -r1.5 -r1.6 src/distrib/sparc64/instfs/dot.profile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/distrib/amd64/cdroms/Makefile.cdrom
diff -u src/distrib/amd64/cdroms/Makefile.cdrom:1.3 src/distrib/amd64/cdroms/Makefile.cdrom:1.4
--- src/distrib/amd64/cdroms/Makefile.cdrom:1.3	Sat Jan 29 01:54:33 2011
+++ src/distrib/amd64/cdroms/Makefile.cdrom	Sun Apr 17 12:18:19 2011
@@ -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*

Index: src/distrib/amd64/cdroms/install.sh
diff -u src/distrib/amd64/cdroms/install.sh:1.1 src/distrib/amd64/cdroms/install.sh:1.2
--- src/distrib/amd64/cdroms/install.sh:1.1	Tue Jan 18 00:16:13 2011
+++ src/distrib/amd64/cdroms/install.sh	Sun Apr 17 12:18:20 2011
@@ -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}

Index: src/distrib/i386/cdroms/Makefile.cdrom
diff -u src/distrib/i386/cdroms/Makefile.cdrom:1.23 src/distrib/i386/cdroms/Makefile.cdrom:1.24
--- src/distrib/i386/cdroms/Makefile.cdrom:1.23	Thu Jan 27 15:34:38 2011
+++ src/distrib/i386/cdroms/Makefile.cdrom	Sun Apr 17 12:18:20 2011
@@ -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*

Index: src/distrib/i386/cdroms/install.sh
diff -u src/distrib/i386/cdroms/install.sh:1.1 src/distrib/i386/cdroms/install.sh:1.2
--- src/distrib/i386/cdroms/install.sh:1.1	Mon Apr 19 04:41:36 2010
+++ src/distrib/i386/cdroms/install.sh	Sun Apr 17 12:18:20 2011
@@ -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}

Index: src/distrib/sparc64/cdroms/installcd/Makefile
diff -u src/distrib/sparc64/cdroms/installcd/Makefile:1.10 src/distrib/sparc64/cdroms/installcd/Makefile:1.11
--- src/distrib/sparc64/cdroms/installcd/Makefile:1.10	Sun Mar 20 09:04:53 2011
+++ src/distrib/sparc64/cdroms/installcd/Makefile	Sun Apr 17 12:18:20 2011
@@ -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*

Index: src/distrib/sparc64/cdroms/installcd/install.sh
diff -u src/distrib/sparc64/cdroms/installcd/install.sh:1.1 src/distrib/sparc64/cdroms/installcd/install.sh:1.2
--- src/distrib/sparc64/cdroms/installcd/install.sh:1.1	Sun Apr 18 12:58:57 2010
+++ src/distrib/sparc64/cdroms/installcd/install.sh	Sun Apr 17 12:18:20 2011
@@ -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}

Index: src/distrib/sparc64/instfs/dot.profile
diff -u src/distrib/sparc64/instfs/dot.profile:1.5 src/distrib/sparc64/instfs/dot.profile:1.6
--- src/distrib/sparc64/instfs/dot.profile:1.5	Sat Mar 13 14:05:39 2010
+++ src/distrib/sparc64/instfs/dot.profile	Sun Apr 17 12:18:20 2011
@@ -1,4 +1,4 @@
-# $NetBSD: dot.profile,v 1.5 2010/03/13 14:05:39 martin Exp $
+# $NetBSD: dot.profile,v 1.6 2011/04/17 12:18:20 martin Exp $
 #
 # Copyright (c) 1997 Perry E. Metzger
 # Copyright (c) 1994 Christopher G. Demetriou
@@ -56,6 +56,8 @@
 export BLOCKSIZE
 EDITOR=ed
 export EDITOR
+SHELL=/bin/sh
+export SHELL
 
 umask 022
 
@@ -96,6 +98,12 @@
 	mount -t ffs -u /kern/rootdev /
 
 	# run the installation or upgrade script.
-	sysinst || {
-	    echo "Oops, something went wrong - we will try again"; exit; }
+	sysinst
+	if [ $? = 4 ]; then
+		echo "Oops, something went wrong - we will try again"
+		exit
+	fi
+	echo
+	echo "To return to the installer, quit this shell by typing 'exit'" \
+		"or ^D."
 fi

Reply via email to