summaryrefslogtreecommitdiff
path: root/recipes-core/fs-init/files/resizefs.sh
diff options
context:
space:
mode:
authorMax Krummenacher <max.krummenacher@toradex.com>2014-03-19 17:28:47 +0100
committerMax Krummenacher <max.krummenacher@toradex.com>2014-04-01 10:11:35 +0200
commit944ef367156ac02d610665b503c20a8e5082147d (patch)
treed424a3ec5035b4a4fd3ea562f37644a404321906 /recipes-core/fs-init/files/resizefs.sh
parent399ea797e1f12fe193d032d1700d28eebbc7c515 (diff)
resizefs.sh: add iMX6 specifics
Diffstat (limited to 'recipes-core/fs-init/files/resizefs.sh')
-rwxr-xr-xrecipes-core/fs-init/files/resizefs.sh9
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