diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2003-06-27 22:40:41 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2003-06-27 22:40:41 +0000 |
commit | 7ecefe1843fb840c68bf5eae26e082e88b737895 (patch) | |
tree | 1bd9e094863aa7c050e8e02fba7292c9f42eb882 /distrib/miniroot/install.sub | |
parent | 869db4a9428308456276dd1dba0cce60e664a2aa (diff) |
Improve swap partition handling during install/upgrade.
a) Add all defined swap partitions except the default partition on the
root disk to the installed /etc/fstab.
b) Mount all possible swap partitions just before creating all
devices, giving small memory machines a better chance to successfully
install/upgrade.
Should obviate the need for FAQ 4.3.6.
ok deraadt@ millert@ (slightly earlier version)
Diffstat (limited to 'distrib/miniroot/install.sub')
-rw-r--r-- | distrib/miniroot/install.sub | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/distrib/miniroot/install.sub b/distrib/miniroot/install.sub index 03edb12f610..b0651168838 100644 --- a/distrib/miniroot/install.sub +++ b/distrib/miniroot/install.sub @@ -1,4 +1,4 @@ -# $OpenBSD: install.sub,v 1.306 2003/06/23 00:38:57 krw Exp $ +# $OpenBSD: install.sub,v 1.307 2003/06/27 22:40:40 krw Exp $ # $NetBSD: install.sub,v 1.5.2.8 1996/09/02 23:25:02 pk Exp $ # # Copyright (c) 1997-2003 Todd Miller, Theo de Raadt, Ken Westerback @@ -457,12 +457,14 @@ fi ROOTDISK= ROOTDEV= + SWAPDEV= ask_which "disk" "is the root disk?" "$DKDEVS" "$_defdsk" [ "$resp" = "done" ] && exit ROOTDISK=$resp ROOTDEV=${ROOTDISK}a + SWAPDEV=${ROOTDISK}b } # Create an entry in the hosts file. If an entry with the @@ -1688,10 +1690,24 @@ set_machdep_apertureallowed() { } finish_up() { - local _dev + local _dev _mp _fstype _rest set_timezone + # Mount all known swap partitions. This gives systems with little + # memory a better chance at running 'MAKEDEV all'. + if [[ -x /mnt/sbin/swapctl ]]; then + /mnt/sbin/swapctl -a /dev/$SWAPDEV >/dev/null 2>&1 + # Can't do chmod && swapctl -A because devices are not yet + # created on install'ed systems. On upgrade'ed system there + # is a small chance the device does not exist on the ramdisk + # and will thus not get mounted. + while read _dev _mp _fstype _rest; do + [[ $_fstype == swap ]] && \ + /mnt/sbin/swapctl -a $_dev >/dev/null 2>&1 + done </mnt/etc/fstab + fi + echo -n "Making all device nodes..." cd /mnt/dev sh MAKEDEV all |