summaryrefslogtreecommitdiff
path: root/distrib/miniroot
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2002-03-30 00:50:58 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2002-03-30 00:50:58 +0000
commit59e067412fa8c8b8a6196c9d4b3c139b3e4362f4 (patch)
treee44ae7a10d067e6f5745945b701dadb8b93fb35a /distrib/miniroot
parent3dd8b456bab9f464ff2e6c1e04abe10b496ecdd9 (diff)
Squeeze a few bytes out of the installation scripts by using
standard __EOT as here document delimiter. Remove unnecessary escaping of __EOT. Could be/Should be extended to .md scripts and other non-miniroot architectures. Concept approved a *long* time ago by deraadt@ and millert@ but never got out of my tree.
Diffstat (limited to 'distrib/miniroot')
-rw-r--r--distrib/miniroot/install.sh10
-rw-r--r--distrib/miniroot/install.sub18
-rw-r--r--distrib/miniroot/upgrade.sh18
3 files changed, 23 insertions, 23 deletions
diff --git a/distrib/miniroot/install.sh b/distrib/miniroot/install.sh
index 42c95b317e2..363c74476ce 100644
--- a/distrib/miniroot/install.sh
+++ b/distrib/miniroot/install.sh
@@ -1,5 +1,5 @@
#!/bin/sh
-# $OpenBSD: install.sh,v 1.86 2002/03/19 12:16:13 krw Exp $
+# $OpenBSD: install.sh,v 1.87 2002/03/30 00:50:57 krw Exp $
# $NetBSD: install.sh,v 1.5.2.8 1996/08/27 18:15:05 gwr Exp $
#
# Copyright (c) 1997-2002 Todd Miller, Theo de Raadt, Ken Westerback
@@ -170,13 +170,13 @@ if [ ! -f /etc/fstab ]; then
# Assume partition 'a' of $ROOTDISK is for the root filesystem.
# Loop and get the rest.
# XXX ASSUMES THAT THE USER DOESN'T PROVIDE BOGUS INPUT.
- cat << __get_filesystems_1
+ cat << __EOT
You will now have the opportunity to enter filesystem information for ${DISK}.
You will be prompted for the mount point (full path, including the prepending
'/' character) for each BSD partition on ${DISK}. Enter "none" to skip a
partition or "done" when you are finished.
-__get_filesystems_1
+__EOT
if [ "${DISK}" = "${ROOTDISK}" ]; then
echo
@@ -291,14 +291,14 @@ fi
# Get network configuration information, and store it for placement in the
# root filesystem later.
-cat << \__network_config_1
+cat << __EOT
You will now be given the opportunity to configure the network. This will be
useful if you need to transfer the installation sets via FTP, HTTP, or NFS.
Even if you choose not to transfer installation sets that way, this information
will be preserved and copied into the new root filesystem.
-__network_config_1
+__EOT
echo -n "Configure the network? [y] "
getresp "y"
case "$resp" in
diff --git a/distrib/miniroot/install.sub b/distrib/miniroot/install.sub
index 9b8a5703156..caa5ee89a12 100644
--- a/distrib/miniroot/install.sub
+++ b/distrib/miniroot/install.sub
@@ -1,5 +1,5 @@
#!/bin/sh
-# $OpenBSD: install.sub,v 1.189 2002/03/26 01:50:08 krw Exp $
+# $OpenBSD: install.sub,v 1.190 2002/03/30 00:50:57 krw Exp $
# $NetBSD: install.sub,v 1.5.2.8 1996/09/02 23:25:02 pk Exp $
#
# Copyright (c) 1997-2002 Todd Miller, Theo de Raadt, Ken Westerback
@@ -329,12 +329,12 @@ ftp_list_files() {
# log in via ftp to host $1 as user $2 with password $3
# and return a list of all files in the directory $4 on stdout
- ftp ${_ftp_active} -V -n "$1" << __ptf
+ ftp ${_ftp_active} -V -n "$1" << __EOT
user "$2" "$3"
cd "$4"
ls
quit
-__ptf
+__EOT
}
get_localdir() {
@@ -890,7 +890,7 @@ glob_selection() {
fi
# This is safe in single user mode.
_tfile=/tmp/install_case.$$
- cat >$_tfile << OOF
+ cat >$_tfile << __EOT
case \$_f in
$_selection)
# Add/remove file to extraction list
@@ -906,7 +906,7 @@ glob_selection() {
_matched=\$(( \$_matched + 1 ))
;;
esac
-OOF
+__EOT
set +o noglob
# Eww.
@@ -2320,12 +2320,12 @@ donetconfig() {
echo "The host table is as follows:"
echo
cat /tmp/hosts
- cat << __hosts_table_1
+ cat << __EOT
You may want to edit the host table in the event that you are doing an
NFS installation or an FTP installation without a name server and want
to refer to the server by name rather than by its numeric ip address.
-__hosts_table_1
+__EOT
echo -n "Would you like to edit the host table with ${EDITOR}? [n] "
getresp "n"
case "$resp" in
@@ -2338,13 +2338,13 @@ __hosts_table_1
esac
fi
- cat << \__network_config_2
+ cat << __EOT
You will now be given the opportunity to escape to the command shell to do
any additional network configuration you may need. This may include adding
additional routes, if needed. In addition, you might take this opportunity
to redo the default route in the event that it failed above.
-__network_config_2
+__EOT
echo -n "Escape to shell? [n] "
getresp "n"
case "$resp" in
diff --git a/distrib/miniroot/upgrade.sh b/distrib/miniroot/upgrade.sh
index 6338729a39a..79d4a700905 100644
--- a/distrib/miniroot/upgrade.sh
+++ b/distrib/miniroot/upgrade.sh
@@ -1,5 +1,5 @@
#!/bin/sh
-# $OpenBSD: upgrade.sh,v 1.23 2002/03/26 01:50:08 krw Exp $
+# $OpenBSD: upgrade.sh,v 1.24 2002/03/30 00:50:57 krw Exp $
# $NetBSD: upgrade.sh,v 1.2.4.5 1996/08/27 18:15:08 gwr Exp $
#
# Copyright (c) 1997-2002 Todd Miller, Theo de Raadt, Ken Westerback
@@ -139,13 +139,13 @@ cp /mnt/etc/hosts /tmp/hosts
# Start up the network in same/similar configuration as the installed system
# uses.
-cat << \__network_config_1
+cat << __EOT
The upgrade program would now like to enable the network. It will use the
configuration already stored on the root filesystem. This is required
if you wish to use the network installation capabilities of this program.
-__network_config_1
+__EOT
echo -n "Enable network? [y] "
getresp "y"
case "$resp" in
@@ -155,14 +155,14 @@ case "$resp" in
exit 1
fi
- cat << \__network_config_2
+ cat << __EOT
You will now be given the opportunity to escape to the command shell to
do any additional network configuration you may need. This may include
adding additional routes, if needed. In addition, you might take this
opportunity to redo the default route in the event that it failed above.
-__network_config_2
+__EOT
echo -n "Escape to shell? [n] "
getresp "n"
case "$resp" in
@@ -182,7 +182,7 @@ esac
echo "The fstab is configured as follows:\n"
cat /tmp/fstab
-cat << \__fstab_config_1
+cat << __EOT
You may wish to edit the fstab. For example, you may need to resolve
dependencies in the order which the filesystems are mounted.
@@ -193,7 +193,7 @@ NOTE: 1) this fstab is used only during the upgrade. It will not be
2) all non-ffs filesystems, and filesystems with the 'noauto'
option, will be ignored during the upgrade.
-__fstab_config_1
+__EOT
echo -n "Edit the fstab with ${EDITOR}? [n] "
getresp "n"
case "$resp" in
@@ -273,11 +273,11 @@ get_timezone
echo "Moving /etc/sendmail.cf -> /etc/mail/sendmail.cf"
test -d /mnt/etc/mail || mkdir /mnt/etc/mail
mv /mnt/etc/sendmail.cf /mnt/etc/mail/sendmail.cf
- ed - /mnt/etc/rc << \__rc_edit
+ ed - /mnt/etc/rc << __EOT
1,$s/etc\/sendmail.cf/etc\/mail\/sendmail.cf/g
w
q
-__rc_edit
+__EOT
fi
echo -n "Making devices..."