From: Chih-Wei Huang Date: Tue, 8 Mar 2016 09:14:34 +0000 (+0800) Subject: mkuserimg.sh: set default size according to the $SRC_DIR size X-Git-Tag: android-x86-8.1-r1~1 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=998e96d45532fc2672148295e5207987816d6cfb;hp=8f5b663c9dc6278dc22eb3c868e648a2b9fe3b56;p=android-x86%2Fsystem-extras.git mkuserimg.sh: set default size according to the $SRC_DIR size Add extra size by the $SRC_DIR size plus 10%. --- diff --git a/ext4_utils/mkuserimg.sh b/ext4_utils/mkuserimg.sh index 06c68d4a..d33348cd 100755 --- a/ext4_utils/mkuserimg.sh +++ b/ext4_utils/mkuserimg.sh @@ -119,6 +119,9 @@ fi if [ -z $SIZE ]; then echo "Need size of filesystem" exit 2 +elif [ 0 -eq 0$SIZE ]; then + s=$(du -sm $SRC_DIR | cut -f1) + SIZE=$(($s / 10 + $s))M fi OPT=""