OSDN Git Service

mkuserimg.sh: set default size according to the $SRC_DIR size honeycomb-x86
authorChih-Wei Huang <cwhuang@linux.org.tw>
Tue, 18 Jan 2011 09:55:00 +0000 (17:55 +0800)
committerChih-Wei Huang <cwhuang@linux.org.tw>
Mon, 16 May 2011 09:13:02 +0000 (17:13 +0800)
Calculate the default size by $SRC_DIR size plus 10%.

Change-Id: I94a7f378b12ccdbd39367c81b1153b8654303a93

ext4_utils/mkuserimg.sh

index 3f2d2d4..4973e3d 100755 (executable)
@@ -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"