tags 612877 + fixed-upstream confirmed
kthxbye

Hi Antonio,

thanks for your bug report.

Antonio Galea wrote:
> 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.

This is a bug in the workaround for #564466, a missing /1024 as you
noticed. Upstream has rewritten that section completely already, but
not yet released a new version.

JFTR: This bug has also been reported against Ubuntu at
https://bugs.launchpad.net/ubuntu/+source/dphys-swapfile/+bug/706764

> 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.

You can set CONF_MAXSWAP in /etc/dphys-swapfile to set a manual limit.
IIRC the default manual limit is 2 GB which is obviously not enough
for your case.

This problem will probably be fixed with the fix for
http://bugs.debian.org/596187.

                Regards, Axel
-- 
 ,''`.  |  Axel Beckert <a...@debian.org>, http://people.debian.org/~abe/
: :' :  |  Debian Developer, ftp.ch.debian.org Admin
`. `'   |  1024D: F067 EA27 26B9 C3FC 1486  202E C09E 1D89 9593 0EDE
  `-    |  4096R: 2517 B724 C5F6 CA99 5329  6E61 2FF9 CD59 6126 16B5



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to