summaryrefslogtreecommitdiff
path: root/recipes-core
diff options
context:
space:
mode:
authorMax Krummenacher <max.krummenacher@toradex.com>2013-10-07 16:51:38 +0200
committerMax Krummenacher <max.krummenacher@toradex.com>2013-10-07 16:51:38 +0200
commitcb26eb87691fe93d8169ec42f0e874122c0f7e08 (patch)
treec41745793f94680c71426cee0840e3c0766d3833 /recipes-core
parent7ca224d4ac8ccd7140cf9206b8dd51b1febae4cc (diff)
resizefs.sh: start from current fs size, not from a const
Diffstat (limited to 'recipes-core')
-rwxr-xr-xrecipes-core/fs-init/files/resizefs.sh5
1 files changed, 4 insertions, 1 deletions
diff --git a/recipes-core/fs-init/files/resizefs.sh b/recipes-core/fs-init/files/resizefs.sh
index 24ea1fd..78addeb 100755
--- a/recipes-core/fs-init/files/resizefs.sh
+++ b/recipes-core/fs-init/files/resizefs.sh
@@ -32,7 +32,10 @@ fi
#idea stolen from here:
#https://codereview.chromium.org/551127
-NEXTSIZE=`expr 320 \* 1024 \* 2`
+#get the current size in blocks of 512 byte
+NEXTSIZE=`df /dev/$PART | grep /dev/root | awk '{print $2}'`
+NEXTSIZE=`expr $NEXTSIZE \* 2`
+NEXTSIZE=`expr $NEXTSIZE + 32 \* 1024 \* 2`
while [ $NEXTSIZE -lt $FSSIZE ]; do
FSSIZEMEG=`expr $NEXTSIZE / 2 / 1024`"M"
resize2fs /dev/$PART $FSSIZEMEG