OSDN Git Service

mkuserimg.sh: set default size according to the $SRC_DIR size marshmallow-x86 android-x86-6.0-r1 android-x86-6.0-r2 android-x86-6.0-r3
authorChih-Wei Huang <cwhuang@linux.org.tw>
Tue, 8 Mar 2016 09:14:34 +0000 (17:14 +0800)
committerChih-Wei Huang <cwhuang@linux.org.tw>
Thu, 5 May 2016 10:14:51 +0000 (18:14 +0800)
Add extra size by the $SRC_DIR size plus 10%.

ext4_utils/mkuserimg.sh

index 8667013..a737d3c 100755 (executable)
@@ -88,6 +88,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=""