diff options
author | Max Krummenacher <max.krummenacher@toradex.com> | 2014-03-19 17:28:47 +0100 |
---|---|---|
committer | Max Krummenacher <max.krummenacher@toradex.com> | 2014-04-01 10:11:35 +0200 |
commit | 7be9aa2c5df225fdd1e37e61635c9d8b6c4ce415 (patch) | |
tree | 165cc81ec1027e8e4c3f5a5eb843211b1ab474e3 /recipes-core/fs-init/files/resizefs.sh | |
parent | 4855af146958e42b029b0fda44e8938b73589397 (diff) |
resizefs.sh: add iMX6 specifics
Diffstat (limited to 'recipes-core/fs-init/files/resizefs.sh')
-rwxr-xr-x | recipes-core/fs-init/files/resizefs.sh | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/recipes-core/fs-init/files/resizefs.sh b/recipes-core/fs-init/files/resizefs.sh index 78addeb..4f38d0b 100755 --- a/recipes-core/fs-init/files/resizefs.sh +++ b/recipes-core/fs-init/files/resizefs.sh @@ -28,19 +28,20 @@ fi # resize now -#reduce I/O load by doing this in 32M increments +#reduce I/O load by doing this in STEPSIZE increments #idea stolen from here: #https://codereview.chromium.org/551127 -#get the current size in blocks of 512 byte +#start from the current size in blocks of 512 byte, add STEPSIZE on each iteration +STEPSIZE=`expr 64 \* 1024 \* 2` NEXTSIZE=`df /dev/$PART | grep /dev/root | awk '{print $2}'` NEXTSIZE=`expr $NEXTSIZE \* 2` -NEXTSIZE=`expr $NEXTSIZE + 32 \* 1024 \* 2` +NEXTSIZE=`expr $NEXTSIZE + $STEPSIZE` while [ $NEXTSIZE -lt $FSSIZE ]; do FSSIZEMEG=`expr $NEXTSIZE / 2 / 1024`"M" resize2fs /dev/$PART $FSSIZEMEG sleep 1 - NEXTSIZE=`expr $NEXTSIZE + 32 \* 1024 \* 2` + NEXTSIZE=`expr $NEXTSIZE + $STEPSIZE` done FSSIZEMEG=`expr $FSSIZE / 2 / 1024`"M" resize2fs /dev/$PART $FSSIZEMEG |