--- /tmp/dphys-swapfile 2011-01-24 02:44:17.000000000 +0000 +++ /sbin/dphys-swapfile 2011-01-24 02:56:48.000000000 +0000 @@ -46,10 +46,7 @@ if [ "${CONF_SWAPSIZE}" = "" ] ; then # compute automatic optimal size echo -n "computing size, " - # this seems to be the nearest to physical RAM size, lacks about 60k - KCORESIZE="`ls -l /proc/kcore | awk '{ print $5 }'`" - # make MBytes which rounded down will be exactly 1 too few, so add 1 - MEMSIZE="`expr "${KCORESIZE}" / 1048576 + 1`" + MEMSIZE=$(($(cat /proc/meminfo | awk '/^MemTotal/ { print $2 }') / 1024)) # default, without config file overwriding, swap=2*RAM CONF_SWAPSIZE="`expr "${MEMSIZE}" '*' "${SWAPFACTOR}"`" fi