--- usr/lib/setup/SeTswap.orig 2006-01-01 19:08:04.000000000 +0000 +++ usr/lib/setup/SeTswap 2006-01-01 19:38:48.000000000 +0000 @@ -45,11 +45,24 @@ fi rm -f $TMP/swapmsg if [ $REPLY = 0 ]; then # yes - if cat /proc/meminfo | grep "Swap: 0 0 0" 1> $NDIR 2> $NDIR ; then - USE_SWAP=0 # swap is not currently mounted - else # warn of possible problems: + # The format of /proc/meminfo differs between Linux 2.4 and 2.6: + KERNELVER="$( uname -r | cut -d. -f1-2 )" + + if [ "$KERNELVER" = "2.4" ]; then + if cat /proc/meminfo | grep "Swap: 0 0 0" 1> $NDIR 2> $NDIR ; then + USE_SWAP=0 + fi + elif [ "$KERNELVER" = "2.6" ]; then + if [ $( grep "SwapTotal:" /proc/meminfo | cut -c17-22 ) -eq 0 ]; then + USE_SWAP=0 # swap is not currently mounted + fi + fi + + # If swap is already in use, warn of possible problems: + # $USE_SWAP will be null if swap is not mounted. + if [ -z "$USE_SWAP" ]; then # This 10231808 below is the size of a swapfile pre-supplied by install.zip that we'd like to ignore. - if /proc/meminfo | grep 10231808 1> $NDIR 2> $NDIR ; then + if grep 10231808 /proc/meminfo 1> $NDIR 2> $NDIR ; then USE_SWAP=0 else cat << EOF > $TMP/swapmsg