[pkg-fso-maint] [PATCH] install.sh runs mkswap if SD_SWAP_SIZE=0

Timo Juhani Lindfors timo.lindfors at iki.fi
Sat Mar 14 14:33:37 UTC 2009


Hi,

install.sh compares SD_SWAP_SIZE normally against 0 but it has two
tests that compare it against "". This causes install.sh to run mkswap
even if SD_SWAP_SIZE is 0 (the default). Here's a patch:

--- install.sh.orig     2009-03-14 16:32:02.000000000 +0200
+++ install.sh  2009-03-14 16:31:46.000000000 +0200
@@ -649,14 +649,14 @@
        echo " * Formatting the microSD card partitions"
        if [ "$SINGLE_PART" = "true" ]; then
                mkfs.ext2 ${SD_DEVICE}p1
-               if [ -n "$SD_SWAP_SIZE" ]; then
+               if [ 0 -lt "$SD_SWAP_SIZE" ]; then
                        echo " * Formatting swap on ${SD_DEVICE}p2"
                        mkswap ${SD_DEVICE}p2
                fi
        else
                mkfs.$SD_PART1_FS ${SD_DEVICE}p1
                mkfs.$SD_PART2_FS ${SD_DEVICE}p2
-               if [ -n "$SD_SWAP_SIZE" ]; then
+               if [ 0 -lt "$SD_SWAP_SIZE" ]; then
                        echo " * Formatting swap on ${SD_DEVICE}p3"
                        mkswap ${SD_DEVICE}p3
                fi



best regards,
Timo Lindfors



More information about the pkg-fso-maint mailing list