From ced864cba3139d333648abe7b8407c614c90ff6e Mon Sep 17 00:00:00 2001 From: grr Date: Mon, 5 May 1997 16:31:36 +0000 Subject: [PATCH] last pass for now up correcting/upgrade sparc miniroot and install/upgrade stuff --- distrib/miniroot/list2sh.awk | 4 +- distrib/sparc/floppies/inst-common/list | 10 ++- distrib/sparc/floppies/inst-common/mtree.conf | 7 +- distrib/sparc/floppies/inst/dot.profile | 81 ++++++++++++++++--- distrib/sparc/floppies/inst/list | 5 +- distrib/sparc/floppies/list2sh.awk | 21 +++-- distrib/sparc/floppies/upgr/dot.profile | 76 +++++++++++++++-- distrib/sparc/miniroot/dot.profile | 8 +- 8 files changed, 175 insertions(+), 37 deletions(-) diff --git a/distrib/miniroot/list2sh.awk b/distrib/miniroot/list2sh.awk index 9245163b10f..a501924c55b 100644 --- a/distrib/miniroot/list2sh.awk +++ b/distrib/miniroot/list2sh.awk @@ -1,4 +1,4 @@ -# $OpenBSD: list2sh.awk,v 1.4 1997/05/05 11:56:33 grr Exp $ +# $OpenBSD: list2sh.awk,v 1.5 1997/05/05 16:31:36 grr Exp $ # $NetBSD: list2sh.awk,v 1.2 1996/05/04 15:45:31 pk Exp $ BEGIN { @@ -56,7 +56,7 @@ $1 == "SPECIAL" { gsub("[\\\\]", "\\\\", work); gsub("[\"]", "\\\"", work); gsub("[$]", "\\$", work); - gsub("[`]", "\\&", work); + gsub("[`]", "\\`", work); printf("echo \"%s\"\n", work); work=$0; sub("^[ ]*" $1 "[ ]*", "", work); diff --git a/distrib/sparc/floppies/inst-common/list b/distrib/sparc/floppies/inst-common/list index c70f3c414f9..0662729177b 100644 --- a/distrib/sparc/floppies/inst-common/list +++ b/distrib/sparc/floppies/inst-common/list @@ -1,4 +1,4 @@ -# $OpenBSD: list,v 1.10 1997/05/01 11:30:53 niklas Exp $ +# $OpenBSD: list,v 1.11 1997/05/05 16:31:38 grr Exp $ # copy the crunched binary, link to it, and kill it COPY ${OBJDIR}/instbin instbin @@ -33,6 +33,7 @@ LINK instbin sbin/mount_cd9660 LINK instbin sbin/mount_ffs #LINK instbin sbin/mount_msdos LINK instbin sbin/mount_nfs +LINK instbin sbin/mount_kernfs LINK instbin sbin/newfs LINK instbin sbin/ping LINK instbin sbin/reboot @@ -50,7 +51,8 @@ SYMLINK /bin/cat usr/bin/sed #SYMLINK /bin/cat usr/sbin/bad144 SYMLINK /bin/cat usr/sbin/chown SYMLINK /bin/cat usr/sbin/chroot -SPECIAL /bin/rm instbin +# it's less confusing to leave instbin there and takes essentially no room. +# SPECIAL /bin/rm instbin SPECIAL sync # copy the MAKEDEV script and make some devices @@ -73,4 +75,6 @@ COPY ${DESTDIR}/etc/services etc/services # and the common installation tools COPY ${TOPDIR}/inst-common/dot.commonutils .commonutils -COPY ${TOPDIR}/inst-common/termcap.pc3 usr/share/misc/termcap +# and a few useful bits of the termcap file (sun*, basic vt100, dumb, unknown) +# COPY ${TOPDIR}/inst-common/termcap.pc3 usr/share/misc/termcap +SPECIAL sed -n -e '/^dumb|/,/:[ ]*$/p' -e '/^unknown|/,/:[ ]*$/p' -e '/^sun.*|/,/:[ ]*$/p' -e '/^vt100|/,/:[ ]*$/p' ${CURDIR}/../../share/termcap/termcap.src > usr/share/misc/termcap diff --git a/distrib/sparc/floppies/inst-common/mtree.conf b/distrib/sparc/floppies/inst-common/mtree.conf index 362b95d3993..cd198f1f7f0 100644 --- a/distrib/sparc/floppies/inst-common/mtree.conf +++ b/distrib/sparc/floppies/inst-common/mtree.conf @@ -1,4 +1,4 @@ -# $OpenBSD: mtree.conf,v 1.3 1997/05/01 11:30:53 niklas Exp $ +# $OpenBSD: mtree.conf,v 1.4 1997/05/05 16:31:39 grr Exp $ /set type=dir uname=root gname=wheel mode=0755 # . @@ -19,6 +19,11 @@ etc # ./etc .. +# ./kern +kern +# ./kern +.. + # ./mnt mnt # ./mnt diff --git a/distrib/sparc/floppies/inst/dot.profile b/distrib/sparc/floppies/inst/dot.profile index ebec7371d23..4b1ed8f1cfd 100644 --- a/distrib/sparc/floppies/inst/dot.profile +++ b/distrib/sparc/floppies/inst/dot.profile @@ -1,4 +1,4 @@ -# $OpenBSD: dot.profile,v 1.4 1997/05/01 18:46:54 grr Exp $ +# $OpenBSD: dot.profile,v 1.5 1997/05/05 16:31:37 grr Exp $ # # Copyright (c) 1994 Christopher G. Demetriou # All rights reserved. @@ -31,26 +31,89 @@ PATH=/sbin:/bin:/usr/bin:/usr/sbin:/ export PATH -TERM=sun -export TERM umask 022 +# XXX +# the TERM/EDITOR stuff is really well enough parameterized to be moved +# into install.sub where it could use the routines there and be invoked +# from the various (semi) MI install and upgrade scripts + +# terminals believed to be in termcap, default TERM +TERMS="sun vt100 dumb" +TERM=sun + +# editors believed to be in $EDITBIN, smart and dumb defaults +EDITORS="ed" +EDITOR=ed +DUMB=ed +EDITBIN=/bin + if [ "X${DONEPROFILE}" = "X" ]; then DONEPROFILE=YES + # mount kernfs and re-mount the boot media (perhaps r/w) + mount_kernfs /kern /kern + mount_ffs -o update /kern/rootdev / + # set up some sane defaults - echo 'erase ^?, werase ^W, kill ^U, intr ^C' - stty newcrt werase ^W intr ^C kill ^U erase ^? 9600 - echo '' + echo 'erase ^H, werase ^W, kill ^U, intr ^C' + stty newcrt werase ^W intr ^C kill ^U erase ^H 9600 + + # get the terminal type + _forceloop="" + while [ "X$_forceloop" = X"" ]; do + echo "Supported terminals are: $TERMS" + eval `tset -s -m ":?$TERM"` + if [ "X$TERM" != X"unknown" ]; then + _forceloop="done" + fi + done + export TERM + + # get the editor preference + if [ "X$TERM" = "Xdumb" -o "X$TERM" = "Xunknown" ]; then + echo -n "$TERM can't handle $EDITOR" + EDITOR="$DUMB" + echo ", using $EDITOR as text editor!" + elif [ "X$EDITOR" = "X$EDITORS" ]; then + echo "Only one editor available, you get to use $EDITOR!" + else + _forceloop="" + while [ "X$_forceloop" = X"" ]; do + echo "Supported editors are: $EDITORS" + echo -n "text editor? [$EDITOR] " + read _choice + if [ "X$_choice" = "X" ]; then + _choice="$EDITOR" + _forceloop="$_choice" + else + for _editor in $EDITORS; do + if [ "X$_choice" = "X$_editor" ]; then + _forceloop="$_choice" + break + fi + done + fi + if [ "X$_forceloop" != "X" -a ! -x $EDITBIN/$_choice ] + then + _forceloop="" + fi + if [ "X$_forceloop" = "X" ]; then + echo "Sorry, $_choice isn't available." + _forceloop="" + fi + done + EDITOR="$_choice" + fi + export EDITOR # pull in the functions that people will use from the shell prompt. . /.commonutils . /.instutils - # mount /kern so install can peek at msgbuf - mount -t kernfs /kern /kern - # run the installation script. install + fi + diff --git a/distrib/sparc/floppies/inst/list b/distrib/sparc/floppies/inst/list index 79f323a5606..4b45271ed7e 100644 --- a/distrib/sparc/floppies/inst/list +++ b/distrib/sparc/floppies/inst/list @@ -1,4 +1,4 @@ -# $OpenBSD: list,v 1.4 1997/05/01 18:46:57 grr Exp $ +# $OpenBSD: list,v 1.5 1997/05/05 16:31:38 grr Exp $ # the disktab explanation file COPY disktab.preinstall etc/disktab.preinstall @@ -12,8 +12,5 @@ COPY install.sh install # we need the contents of /usr/mdec COPYDIR ${DESTDIR}/usr/mdec usr/mdec -# and a mount point for the kernfs -SPECIAL mkdir kern - # make install executable SPECIAL chmod 755 install diff --git a/distrib/sparc/floppies/list2sh.awk b/distrib/sparc/floppies/list2sh.awk index fb519ec4d2f..42c3c54505e 100644 --- a/distrib/sparc/floppies/list2sh.awk +++ b/distrib/sparc/floppies/list2sh.awk @@ -1,4 +1,4 @@ -# $OpenBSD: list2sh.awk,v 1.2 1997/05/01 11:30:46 niklas Exp $ +# $OpenBSD: list2sh.awk,v 1.3 1997/05/05 16:31:37 grr Exp $ BEGIN { printf("cd ${CURDIR}\n"); @@ -35,13 +35,18 @@ $1 == "COPYDIR" { next; } $1 == "SPECIAL" { - printf("echo '%s'\n", $0); - printf("(cd ${TARGDIR};"); - for (i = 2; i <= NF; i++) - printf(" %s", $i); - printf(")\n"); - next; -} +# escaping shell quotation is ugly whether you use " or ', use cat <<'!' ... + work=$0; + gsub("[\\\\]", "\\\\", work); + gsub("[\"]", "\\\"", work); + gsub("[$]", "\\$", work); + gsub("[`]", "\\`", work); + printf("echo \"%s\"\n", work); + work=$0; + sub("^[ ]*" $1 "[ ]*", "", work); + printf("(cd ${TARGDIR}; %s)\n", work); + next; + } { printf("echo '%s'\n", $0); printf("echo 'Unknown keyword \"%s\" at line %d of input.'\n", $1, NR); diff --git a/distrib/sparc/floppies/upgr/dot.profile b/distrib/sparc/floppies/upgr/dot.profile index ab45a640172..6cf74e029dd 100644 --- a/distrib/sparc/floppies/upgr/dot.profile +++ b/distrib/sparc/floppies/upgr/dot.profile @@ -1,4 +1,4 @@ -# $OpenBSD: dot.profile,v 1.2 1997/05/01 11:30:58 niklas Exp $ +# $OpenBSD: dot.profile,v 1.3 1997/05/05 16:31:39 grr Exp $ # # Copyright (c) 1994 Christopher G. Demetriou # All rights reserved. @@ -31,18 +31,82 @@ PATH=/sbin:/bin:/usr/bin:/usr/sbin:/ export PATH -TERM=pc3 -export TERM umask 022 +# XXX +# the TERM/EDITOR stuff is really well enough parameterized to be moved +# into install.sub where it could use the routines there and be invoked +# from the various (semi) MI install and upgrade scripts + +# terminals believed to be in termcap, default TERM +TERMS="sun vt100 dumb" +TERM=sun + +# editors believed to be in $EDITBIN, smart and dumb defaults +EDITORS="ed" +EDITOR=ed +DUMB=ed +EDITBIN=/bin + if [ "X${DONEPROFILE}" = "X" ]; then DONEPROFILE=YES + # mount kernfs and re-mount the boot media (perhaps r/w) + mount_kernfs /kern /kern + mount_ffs -o update /kern/rootdev / + # set up some sane defaults - echo 'erase ^?, werase ^W, kill ^U, intr ^C' - stty newcrt werase ^W intr ^C kill ^U erase ^? 9600 - echo '' + echo 'erase ^H, werase ^W, kill ^U, intr ^C' + stty newcrt werase ^W intr ^C kill ^U erase ^H 9600 + + # get the terminal type + _forceloop="" + while [ "X$_forceloop" = X"" ]; do + echo "Supported terminals are: $TERMS" + eval `tset -s -m ":?$TERM"` + if [ "X$TERM" != X"unknown" ]; then + _forceloop="done" + fi + done + export TERM + + # get the editor preference + if [ "X$TERM" = "Xdumb" -o "X$TERM" = "Xunknown" ]; then + echo -n "$TERM can't handle $EDITOR" + EDITOR="$DUMB" + echo ", using $EDITOR as text editor!" + elif [ "X$EDITOR" = "X$EDITORS" ]; then + echo "Only one editor available, you get to use $EDITOR!" + else + _forceloop="" + while [ "X$_forceloop" = X"" ]; do + echo "Supported editors are: $EDITORS" + echo -n "text editor? [$EDITOR] " + read _choice + if [ "X$_choice" = "X" ]; then + _choice="$EDITOR" + _forceloop="$_choice" + else + for _editor in $EDITORS; do + if [ "X$_choice" = "X$_editor" ]; then + _forceloop="$_choice" + break + fi + done + fi + if [ "X$_forceloop" != "X" -a ! -x $EDITBIN/$_choice ] + then + _forceloop="" + fi + if [ "X$_forceloop" = "X" ]; then + echo "Sorry, $_choice isn't available." + _forceloop="" + fi + done + EDITOR="$_choice" + fi + export EDITOR # pull in the functions that people will use from the shell prompt. . /.commonutils diff --git a/distrib/sparc/miniroot/dot.profile b/distrib/sparc/miniroot/dot.profile index f451bb92c57..f1c82e638aa 100644 --- a/distrib/sparc/miniroot/dot.profile +++ b/distrib/sparc/miniroot/dot.profile @@ -1,4 +1,4 @@ -# $OpenBSD: dot.profile,v 1.5 1997/05/05 13:55:28 grr Exp $ +# $OpenBSD: dot.profile,v 1.6 1997/05/05 16:31:40 grr Exp $ # $NetBSD: dot.profile,v 1.1 1995/12/18 22:54:43 pk Exp $ # # Copyright (c) 1995 Jason R. Thorpe @@ -78,6 +78,8 @@ if [ "X${DONEPROFILE}" = "X" ]; then echo -n "$TERM can't handle $EDITOR" EDITOR="$DUMB" echo ", using $EDITOR as text editor!" + elif [ "X$EDITOR" = "X$EDITORS" ]; then + echo "Only one editor available, you get to use $EDITOR!" else _forceloop="" while [ "X$_forceloop" = X"" ]; do @@ -100,7 +102,7 @@ if [ "X${DONEPROFILE}" = "X" ]; then _forceloop="" fi if [ "X$_forceloop" = "X" ]; then - echo "Sorry, we don't do $_choice here." + echo "Sorry, $_choice isn't available." _forceloop="" fi done @@ -108,8 +110,6 @@ if [ "X${DONEPROFILE}" = "X" ]; then fi export EDITOR -printenv - # Installing or upgrading? _forceloop="" while [ "X$_forceloop" = X"" ]; do -- 2.20.1