summaryrefslogtreecommitdiff
path: root/recipes-core/fs-init/files/resizefs.sh
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-core/fs-init/files/resizefs.sh')
-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