mke2img.sh: fix folder size calculation error when it have multilevel subdirectory

Change-Id: If7c9ad04fce7dc4d711864dcc2b29875c74fdaef
Signed-off-by: Hans Yang <yhx@rock-chips.com>
This commit is contained in:
Hans Yang
2018-07-21 10:51:52 +08:00
parent 88cf757802
commit cfb48d2500

View File

@ -2,7 +2,7 @@
SRC=$1
DST=$2
SIZE=$(du -h -BM --max-depth=1 $SRC | awk '{print int($1)}')
SIZE=$(du -h -BM --max-depth=0 $SRC | awk '{print int($1)}')
# echo "create image size=${SIZE}M"
dd if=/dev/zero of=$DST bs=1M count=$SIZE >/dev/null 2>&1
mke2fs -F -t ext2 $DST >/dev/null 2>&1