OSDN Git Service

mkuserimg.sh: set default size according to the $SRC_DIR size
[android-x86/system-extras.git] / ext4_utils / mkuserimg.sh
index c44129e..0435215 100755 (executable)
@@ -47,6 +47,8 @@ fi
 if [ -z $SIZE ]; then
   echo "Need size of filesystem"
   exit 2
+elif [ 0 -eq 0$SIZE ]; then
+  SIZE=$((`du -sm $SRC_DIR | cut -f1`*11/10))M
 fi
 
 if [ -n "$FC" ]; then