summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgrr <grr@cvs.openbsd.org>1997-05-05 13:55:29 +0000
committergrr <grr@cvs.openbsd.org>1997-05-05 13:55:29 +0000
commit78509be7e335eafe829ee587d3a7d17b55533fae (patch)
tree78483d380f21d2ba1ba4cdd04d1b111337484ff3
parente8f6cfe03d315b5be2b3aa6f365836f552359a58 (diff)
inprove TERM/EDITOR stuff and mount /kern in miniroot/.profile and dump about 500K of termcap excess from the miniroot
-rw-r--r--distrib/sparc/miniroot/dot.profile82
-rw-r--r--distrib/sparc/miniroot/list7
2 files changed, 60 insertions, 29 deletions
diff --git a/distrib/sparc/miniroot/dot.profile b/distrib/sparc/miniroot/dot.profile
index 8bf10b79a62..f451bb92c57 100644
--- a/distrib/sparc/miniroot/dot.profile
+++ b/distrib/sparc/miniroot/dot.profile
@@ -1,4 +1,4 @@
-# $OpenBSD: dot.profile,v 1.4 1997/04/30 23:56:07 grr Exp $
+# $OpenBSD: dot.profile,v 1.5 1997/05/05 13:55:28 grr Exp $
# $NetBSD: dot.profile,v 1.1 1995/12/18 22:54:43 pk Exp $
#
# Copyright (c) 1995 Jason R. Thorpe
@@ -34,55 +34,85 @@
PATH=/sbin:/bin:/usr/bin:/usr/sbin:/
export PATH
+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 vt* pcvt* pc3 dumb"
TERM=sun
-export TERM
-umask 022
+# editors believed to be in $EDITBIN, smart and dumb defaults
+EDITORS="vi ed"
+EDITOR=vi
+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 ^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
+ while [ "X$_forceloop" = X"" ]; do
+ echo "Supported terminals are: $TERMS"
eval `tset -s -m ":?$TERM"`
- if [ "X${TERM}" != X"unknown" ]; then
+ if [ "X$TERM" != X"unknown" ]; then
_forceloop="done"
fi
done
export TERM
# get the editor preference
- EDITOR=vi
- _forceloop=""
- while [ "X${_forceloop}" = X"" ]; do
- echo -n "text editor - vi or ed? [$EDITOR] "
- read _forceloop
- case "$_forceloop" in
- vi|"")
- EDITOR=vi
- _forceloop=$EDITOR
- ;;
-
- ed)
- EDITOR=ed
- ;;
-
- *)
- echo "sorry, no $_forceloop available"
+ if [ "X$TERM" = "Xdumb" -o "X$TERM" = "Xunknown" ]; then
+ echo -n "$TERM can't handle $EDITOR"
+ EDITOR="$DUMB"
+ echo ", using $EDITOR as text 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=""
- ;;
- esac
- done
+ fi
+ if [ "X$_forceloop" = "X" ]; then
+ echo "Sorry, we don't do $_choice here."
+ _forceloop=""
+ fi
+ done
+ EDITOR="$_choice"
+ fi
export EDITOR
+printenv
+
# Installing or upgrading?
_forceloop=""
- while [ "X${_forceloop}" = X"" ]; do
+ while [ "X$_forceloop" = X"" ]; do
echo -n '(I)nstall or (U)pgrade? '
read _forceloop
case "$_forceloop" in
diff --git a/distrib/sparc/miniroot/list b/distrib/sparc/miniroot/list
index 0af76408ff3..4a161aa935e 100644
--- a/distrib/sparc/miniroot/list
+++ b/distrib/sparc/miniroot/list
@@ -1,4 +1,4 @@
-# $OpenBSD: list,v 1.7 1997/04/30 18:56:03 niklas Exp $
+# $OpenBSD: list,v 1.8 1997/05/05 13:55:27 grr Exp $
# $NetBSD: list,v 1.2.4.2 1996/06/26 19:25:00 pk Exp $
# Sparc extra's
@@ -39,8 +39,9 @@ COPYDIR ${DESTDIR}/usr/mdec usr/mdec
# the zoneinfo
COPYDIR ${DESTDIR}/usr/share/zoneinfo usr/share/zoneinfo
-# and the termcap file
-COPY ${CURDIR}/../../share/termcap/termcap.src usr/share/misc/termcap
+# and a few useful bits of the termcap file (512K and still growing 8-)
+# COPY ${CURDIR}/../../share/termcap/termcap.src usr/share/misc/termcap
+SPECIAL sed -n -e '/^dumb|/,/:[ ]*$/p' -e '/^unknown|/,/:[ ]*$/p' -e '/^sun.*|/,/:[ ]*$/p' -e '/^vt.*|/,/:[ ]*$/p' -e '/^pc3|/,/:[ ]*$/p' -e '/^pcvt.*|/,/:[ ]*$/p' ${CURDIR}/../../share/termcap/termcap.src > usr/share/misc/termcap
# copy the kernel
COPY bsd bsd