diff options
author | Bill Nottingham <notting@redhat.com> | 2006-07-21 15:33:36 +0000 |
---|---|---|
committer | Bill Nottingham <notting@redhat.com> | 2006-07-21 15:33:36 +0000 |
commit | 278ed116c80ca26e5e75d47672b165aa22deac56 (patch) | |
tree | 086065f1e3e031725fb12740acb1d04a2f3901da | |
parent | 7e86677bbb98ebc5cd4b17b5e620b7bd16da4657 (diff) | |
download | initscripts-278ed116c80ca26e5e75d47672b165aa22deac56.tar initscripts-278ed116c80ca26e5e75d47672b165aa22deac56.tar.gz initscripts-278ed116c80ca26e5e75d47672b165aa22deac56.tar.bz2 initscripts-278ed116c80ca26e5e75d47672b165aa22deac56.tar.xz initscripts-278ed116c80ca26e5e75d47672b165aa22deac56.zip |
Fix swapping stuff; make swapon of arbitrary swap devices optional
(and off by default) (#198695, #196179, #196208)
-rwxr-xr-x | rc.d/rc.sysinit | 14 | ||||
-rw-r--r-- | sysconfig/init | 2 |
2 files changed, 12 insertions, 4 deletions
diff --git a/rc.d/rc.sysinit b/rc.d/rc.sysinit index adeb7b70..1f363383 100755 --- a/rc.d/rc.sysinit +++ b/rc.d/rc.sysinit @@ -832,11 +832,17 @@ chown root:root /tmp/.ICE-unix # Start up swapping. update_boot_stage RCswap -swappartitions=`blkid -t TYPE=swap -o device` -if [ x"$swappartitions" != x ]; then - action $"Enabling local swap partitions: " swapon $swappartitions -fi action $"Enabling /etc/fstab swaps: " swapon -a -e +if [ "$AUTOSWAP" = "yes" ]; then + curswap=$(awk '/^\/dev/ { print $1 }' /proc/swaps | while read x; do get_numeric_dev dec $x ; echo -n " "; done) + swappartitions=`blkid -t TYPE=swap -o device` + if [ x"$swappartitions" != x ]; then + for partition in $swappartitions ; do + majmin=$(get_numeric_dev dec $partition) + echo $curswap | grep -qw "$majmin" || action $"Enabling local swap partitions: " swapon $partition + done + fi +fi # Set up binfmt_misc /bin/mount -t binfmt_misc none /proc/sys/fs/binfmt_misc > /dev/null 2>&1 diff --git a/sysconfig/init b/sysconfig/init index 1ffeaea6..117b6bc6 100644 --- a/sysconfig/init +++ b/sysconfig/init @@ -21,3 +21,5 @@ SETCOLOR_NORMAL="echo -en \\033[0;39m" LOGLEVEL=3 # Set to anything other than 'no' to allow hotkey interactive startup... PROMPT=yes +# Set to 'yes' to allow probing for devices with swap signatures +AUTOSWAP=no |