summaryrefslogtreecommitdiff
path: root/distrib
diff options
context:
space:
mode:
Diffstat (limited to 'distrib')
-rw-r--r--distrib/miniroot/install.sh27
-rw-r--r--distrib/miniroot/install.sub38
-rw-r--r--distrib/miniroot/upgrade.sh77
3 files changed, 50 insertions, 92 deletions
diff --git a/distrib/miniroot/install.sh b/distrib/miniroot/install.sh
index 01b9082e041..27b276d2993 100644
--- a/distrib/miniroot/install.sh
+++ b/distrib/miniroot/install.sh
@@ -1,5 +1,5 @@
#!/bin/sh
-# $OpenBSD: install.sh,v 1.76 2001/04/16 19:43:27 krw Exp $
+# $OpenBSD: install.sh,v 1.77 2001/04/20 01:55:51 krw Exp $
# $NetBSD: install.sh,v 1.5.2.8 1996/08/27 18:15:05 gwr Exp $
#
# Copyright (c) 1997,1998 Todd Miller, Theo de Raadt
@@ -329,31 +329,6 @@ if [ "`df /`" = "`df /mnt`" ]; then
done
) < ${FILESYSTEMS} > /tmp/fstab
-# XXX We no longer do the following. It is not necessary. It can be done
-# XXX after the install is complete.
-#
-# echo "The fstab is configured as follows:"
-# echo
-# cat /tmp/fstab
-# cat << \__fstab_config_1
-#
-#You may wish to edit the fstab. You may also wish to take this opportunity to
-#place NFS mounts in the fstab (this would be especially useful if you plan to
-#keep '/usr' on an NFS server.
-#__fstab_config_1
-# echo -n "Edit the fstab with ${EDITOR}? [n] "
-# getresp "n"
-# case "$resp" in
-# y*|Y*)
-# ${EDITOR} /tmp/fstab
-# ;;
-#
-# *)
-# ;;
-# esac
-#
-# echo
-
munge_fstab /tmp/fstab /tmp/fstab.shadow
mount_fs /tmp/fstab.shadow "-o async"
fi
diff --git a/distrib/miniroot/install.sub b/distrib/miniroot/install.sub
index 1dbcf0a7d0f..e7947c3897d 100644
--- a/distrib/miniroot/install.sub
+++ b/distrib/miniroot/install.sub
@@ -1,5 +1,5 @@
#!/bin/sh
-# $OpenBSD: install.sub,v 1.165 2001/04/16 19:43:28 krw Exp $
+# $OpenBSD: install.sub,v 1.166 2001/04/20 01:55:51 krw Exp $
# $NetBSD: install.sub,v 1.5.2.8 1996/09/02 23:25:02 pk Exp $
#
# Copyright (c) 1997,1998 Todd Miller, Theo de Raadt
@@ -694,7 +694,6 @@ __EOT
# Much of this is gratuitously stolen from /etc/netstart.
enable_network() {
-
# Set up the hostname.
if [ ! -f /mnt/etc/myname ]; then
echo "ERROR: no /etc/myname!"
@@ -703,6 +702,8 @@ enable_network() {
hostname=`cat /mnt/etc/myname`
hostname $hostname
+ _didnet=1
+
# configure all the interfaces which we know about.
(
tmp="$IFS"
@@ -879,7 +880,7 @@ fi
echo
echo "This is an automated ${_url_type}-based installation process. You will be asked"
-echo "questions and then the files will be retrieved iteratively via ftp(1)."
+echo "questions and then the files will be retrieved iteratively via ${_url_type}."
echo
# Reuse old values w/o prompting for anything?
@@ -1973,34 +1974,33 @@ done
}
munge_fstab() {
-local _fstab _fstab_shadow _dev _mp _fstype _rest
+local _fstab _fstab_shadow _dev _mp _fstype _dev _options
-# Now that the 'real' fstab is configured, we munge it into a 'shadow'
-# fstab which we'll use for mounting and unmounting all of the target
-# filesystems relative to /mnt. Mount all filesystems.
+# Create a 'shadow' fstab to use for mounting and unmounting all
+# of the target filesystems relative to /mnt.
_fstab=$1
_fstab_shadow=$2
-( while read _dev _mp _fstype _rest; do
- # Skip comment lines
+( while read _dev _mp _fstype _options _rest; do
+ # Skip comment lines, non-ffs filesystems and
+ # 'noauto' filesystems.
case "$_dev" in
\#*) continue;;
*) ;;
esac
- # ...and filesystems with mounting options ``xx''
- case "$_rest" in
- xx*) continue;;
- *) ;;
- esac
- # and some filesystem types (like there are swap,kernfs,...)
case "$_fstype" in
- ffs|ufs|nfs) ;;
+ ffs) ;;
*) continue;;
esac
+ case "$_options" in
+ *noauto*) continue;;
+ *) ;;
+ esac
+ # Don't use soft updates
+ _options="$(echo ${_options} | sed 's/,softdep,/,/; s/,softdep//; s/softdep,//')"
if [ "$_mp" = "/" ]; then
- echo $_dev /mnt $_fstype $_rest
- else
- echo $_dev /mnt$_mp $_fstype $_rest
+ _mp=""
fi
+ echo $_dev /mnt$_mp $_fstype $_options $_rest
done ) < $_fstab > $_fstab_shadow
}
diff --git a/distrib/miniroot/upgrade.sh b/distrib/miniroot/upgrade.sh
index 861926c7bff..044921f5252 100644
--- a/distrib/miniroot/upgrade.sh
+++ b/distrib/miniroot/upgrade.sh
@@ -1,5 +1,5 @@
#!/bin/sh
-# $OpenBSD: upgrade.sh,v 1.15 2000/05/12 06:02:13 deraadt Exp $
+# $OpenBSD: upgrade.sh,v 1.16 2001/04/20 01:55:51 krw Exp $
# $NetBSD: upgrade.sh,v 1.2.4.5 1996/08/27 18:15:08 gwr Exp $
#
# Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -130,6 +130,7 @@ if [ ! -f /mnt/etc/fstab ]; then
echo "ERROR: no /etc/fstab!"
exit 1
fi
+cp /mnt/etc/fstab /tmp/fstab
# Grab the hosts table so we can use it.
if [ ! -f /mnt/etc/hosts ]; then
@@ -180,31 +181,19 @@ __network_config_2
;;
esac
-# Now that the network has been configured, it is safe to configure the
-# fstab. We remove all but ufs/ffs.
-(
- > /tmp/fstab
- while read _dev _mp _fstype _rest ; do
- if [ "X${_fstype}" = X"ufs" -o \
- "X${_fstype}" = X"ffs" ]; then
- if [ "X${_fstype}" = X"ufs" ]; then
- # Convert ufs to ffs.
- _fstype=ffs
- fi
- echo "$_dev $_mp $_fstype $_rest" >> /tmp/fstab
- fi
- done
-) < /mnt/etc/fstab
-
-echo "The fstab is configured as follows:"
-echo ""
+echo "The fstab is configured as follows:\n"
cat /tmp/fstab
+
cat << \__fstab_config_1
You may wish to edit the fstab. For example, you may need to resolve
-dependencies in the order which the filesystems are mounted. Note that
-this fstab is only for installation purposes, and will not be copied into
-the root filesystem.
+dependencies in the order which the filesystems are mounted.
+
+NOTE: 1) this fstab is used only during the upgrade. It will not be
+ copied into the root filesystem.
+
+ 2) all non-ffs filesystems, and filesystems with the 'noauto'
+ option, will be ignored during the upgrade.
__fstab_config_1
echo -n "Edit the fstab with ${EDITOR}? [n] "
@@ -219,6 +208,8 @@ case "$resp" in
esac
echo ""
+
+# Create a fstab containing only ffs filesystems w/o 'noauto'.
munge_fstab /tmp/fstab /tmp/fstab.shadow
if ! umount /mnt; then
@@ -226,12 +217,28 @@ if ! umount /mnt; then
exit 1
fi
-# Check all of the filesystems.
+# Check filesystems.
check_fs /tmp/fstab.shadow
# Mount filesystems.
mount_fs /tmp/fstab.shadow
+# If Xfree86 v3 directories that would prevent upgrading to XFree86 v4
+# are found, move them and replace them with links that the upgrade
+# can replace with new values.
+(
+if [ -d /mnt/usr/X11R6/lib/X11 ]; then
+ cd /mnt/usr/X11R6/lib/X11
+ for xf3dir in twm xkb xsm xinit rstart; do
+ if [ -e $xf3dir -a ! -L $xf3dir ]; then
+ mkdir -p XF3
+ mv $xf3dir XF3/.
+ ln -s XF3/$xf3dir $xf3dir
+ fi
+ done
+fi
+)
+
echo -n "Are the upgrade sets on one of your normally mounted (local) filesystems? [y] "
getresp "y"
case "$resp" in
@@ -248,30 +255,6 @@ install_sets $THESETS
# Get timezone info
get_timezone
-# Fix up the fstab.
-echo -n "Converting ufs to ffs in /etc/fstab..."
-(
- > /tmp/fstab
- while read _dev _mp _fstype _rest ; do
- if [ "X${_fstype}" = X"ufs" ]; then
- # Convert ufs to ffs.
- _fstype=ffs
- fi
- echo "$_dev $_mp $_fstype $_rest" >> /tmp/fstab
- done
-) < /mnt/etc/fstab
-echo "done."
-echo -n "Would you like to edit the resulting fstab with ${EDITOR}? [y] "
-getresp "y"
-case "$resp" in
- y*|Y*)
- ${EDITOR} /tmp/fstab
- ;;
-
- *)
- ;;
-esac
-
# Copy in configuration information and make devices in target root.
(
cd /tmp