Package: dphys-swapfile
Version: 20061020-3
Severity: normal

When installing dphys-swapfile on a small ARM embedded with 64Mb of RAM
should configure 128Mb of swap file - instead, it reports I want a 128Gb
swap, then trims it back to the configured maximum of 2G - and fills my
uSD card trying to create it.

Memory detection is at /sbin/dphys-swapfile:51, namely

   MEMSIZE="`head -1 /proc/meminfo | awk '{ print $2 }'`"

Both my FoxG20 ARM embedded board and my desktop machine report memory
in kB, but along in the script all computations are done as if meminfo
gives MB instead.
The line

   MEMSIZE="`head -1 /proc/meminfo | awk '{ print int($2/1024) }'`"

might offer a naive fix for this issue, but a better approach
is to actually read from meminfo the correct multiplier.

As a side note, it would be way better if the script could refuse to
create a swap file larger than the available disk space.

Regards,

Antonio

-- System Information:
Debian Release: 6.0
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: armel (armv5tejl)

Kernel: Linux 2.6.35.9 (PREEMPT)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) (ignored: LC_ALL 
set to en_US.UTF-8)
Shell: /bin/sh linked to /bin/dash

-- no debconf information



-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to