last pass for now up correcting/upgrade sparc miniroot and install/upgrade stuff
authorgrr <grr@openbsd.org>
Mon, 5 May 1997 16:31:36 +0000 (16:31 +0000)
committergrr <grr@openbsd.org>
Mon, 5 May 1997 16:31:36 +0000 (16:31 +0000)
distrib/miniroot/list2sh.awk
distrib/sparc/floppies/inst-common/list
distrib/sparc/floppies/inst-common/mtree.conf
distrib/sparc/floppies/inst/dot.profile
distrib/sparc/floppies/inst/list
distrib/sparc/floppies/list2sh.awk
distrib/sparc/floppies/upgr/dot.profile
distrib/sparc/miniroot/dot.profile

index 9245163..a501924 100644 (file)
@@ -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);
index c70f3c4..0662729 100644 (file)
@@ -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
index 362b95d..cd198f1 100644 (file)
@@ -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
index ebec737..4b1ed8f 100644 (file)
@@ -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.
 
 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
+
index 79f323a..4b45271 100644 (file)
@@ -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
index fb519ec..42c3c54 100644 (file)
@@ -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);
index ab45a64..6cf74e0 100644 (file)
@@ -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.
 
 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
index f451bb9..f1c82e6 100644 (file)
@@ -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