From cb26eb87691fe93d8169ec42f0e874122c0f7e08 Mon Sep 17 00:00:00 2001 From: Max Krummenacher Date: Mon, 7 Oct 2013 16:51:38 +0200 Subject: resizefs.sh: start from current fs size, not from a const --- recipes-core/fs-init/files/resizefs.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'recipes-core') 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 -- cgit v1.2.3