diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2001-04-20 01:55:52 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2001-04-20 01:55:52 +0000 |
commit | f423bc21404201591966408685991c64690b7dae (patch) | |
tree | 3c3310d95be01a7e9b57c7fd2ff451a3eb5b676e /distrib | |
parent | 8f64aa406d22388ceb59f21770e455c311be0934 (diff) |
Cleanup, new features, shrinkage.
Remove chunk of commented out, unused code.
Add _didnet=1 to enable_network() so that ftp upgrade
does not ask for network information it already has.
Tell a user that selects the http installation method
that the files will be downloaded via http.
Suppress all 'softdep' options in fstab_shadow so
there are no warnings when the filesystems are
mounted.
Suppress all non-ffs (including nfs, ufs) filesystems
from fstab_shadow. Ufs was never used to install
OpenBSD.
Suppress all 'noauto' filesystems from fstab_shadow.
Reword some comments and messages, esp. the one
just before the offer to edit fstab. Punch up the
fact that the fstab will not be saved, mention
that non-ffs and noauto filesystems will be
ignored.
Move
/usr/X11R6/lib/X11/{rstart,twm,xkb,xsm,xinit}
directories to
/usr/X11R6/lib/X11/XF3{rstart,twm,xkb,xsm,xinit}
and replace with links. Links can be overwritten
during upgrade. Directories can't. This enables the
upgrade from XFree86 3.x to XFree86 4.x.
ok deraadt@ millert@
Diffstat (limited to 'distrib')
-rw-r--r-- | distrib/miniroot/install.sh | 27 | ||||
-rw-r--r-- | distrib/miniroot/install.sub | 38 | ||||
-rw-r--r-- | distrib/miniroot/upgrade.sh | 77 |
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 |