-# $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 {
gsub("[\\\\]", "\\\\", work);
gsub("[\"]", "\\\"", work);
gsub("[$]", "\\$", work);
- gsub("[`]", "\\&", work);
+ gsub("[`]", "\\`", work);
printf("echo \"%s\"\n", work);
work=$0;
sub("^[ ]*" $1 "[ ]*", "", work);
-# $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
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
#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
# 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
-# $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
# .
# ./etc
..
+# ./kern
+kern
+# ./kern
+..
+
# ./mnt
mnt
# ./mnt
-# $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
+
-# $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
# 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
-# $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");
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);
-# $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
-# $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
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
_forceloop=""
fi
if [ "X$_forceloop" = "X" ]; then
- echo "Sorry, we don't do $_choice here."
+ echo "Sorry, $_choice isn't available."
_forceloop=""
fi
done
fi
export EDITOR
-printenv
-
# Installing or upgrading?
_forceloop=""
while [ "X$_forceloop" = X"" ]; do