From: Chih-Wei Huang Date: Tue, 18 Jan 2011 09:55:00 +0000 (+0800) Subject: mkuserimg.sh: set default size according to the $SRC_DIR size X-Git-Url: http://git.osdn.net/view?p=android-x86%2Fsystem-extras.git;a=commitdiff_plain;h=83106b5710151ad174bba64022691f10f91a5d11 mkuserimg.sh: set default size according to the $SRC_DIR size Calculate the default size by $SRC_DIR size plus 10%. Change-Id: I94a7f378b12ccdbd39367c81b1153b8654303a93 --- diff --git a/ext4_utils/mkuserimg.sh b/ext4_utils/mkuserimg.sh index 3f2d2d44..4973e3d1 100755 --- a/ext4_utils/mkuserimg.sh +++ b/ext4_utils/mkuserimg.sh @@ -44,7 +44,7 @@ if [ -z $MOUNT_POINT ]; then fi if [ -z $SIZE ]; then - SIZE=128M + SIZE=$((`du -sm $SRC_DIR | cut -f1`*11/10))M fi MAKE_EXT4FS_CMD="make_ext4fs $ENABLE_SPARSE_IMAGE -l $SIZE -a $MOUNT_POINT $OUTPUT_FILE $SRC_DIR"