aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xrc.d/rc.sysinit14
-rw-r--r--sysconfig/init2
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