diff options
author | Max Krummenacher <max.krummenacher@toradex.com> | 2013-10-07 16:51:38 +0200 |
---|---|---|
committer | Max Krummenacher <max.krummenacher@toradex.com> | 2013-10-07 16:51:38 +0200 |
commit | 6443e382daa1bdf1f58a940f78615825980be2a7 (patch) | |
tree | f5fdc0a0eb86d31d34dd044a76f8cb680040cc03 /recipes-core | |
parent | 4a8b5ef0d02d9687eda68068e354ac4934dab1ce (diff) |
resizefs.sh: start from current fs size, not from a const
Diffstat (limited to 'recipes-core')
-rwxr-xr-x | recipes-core/fs-init/files/resizefs.sh | 5 |
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 |