export-image: use apparent size when calculating disk usage

This commit is contained in:
Serge Schneider 2017-06-20 16:13:59 +01:00
parent e583c18eba
commit 02728fe65e

View File

@ -8,8 +8,8 @@ rm -f ${IMG_FILE}
rm -rf ${ROOTFS_DIR} rm -rf ${ROOTFS_DIR}
mkdir -p ${ROOTFS_DIR} mkdir -p ${ROOTFS_DIR}
BOOT_SIZE=$(du -s ${EXPORT_ROOTFS_DIR}/boot --block-size=1 | cut -f 1) BOOT_SIZE=$(du --apparent-size -s ${EXPORT_ROOTFS_DIR}/boot --block-size=1 | cut -f 1)
TOTAL_SIZE=$(du -s ${EXPORT_ROOTFS_DIR} --exclude var/cache/apt/archives --block-size=1 | cut -f 1) TOTAL_SIZE=$(du --apparent-size -s ${EXPORT_ROOTFS_DIR} --exclude var/cache/apt/archives --block-size=1 | cut -f 1)
IMG_SIZE=$((BOOT_SIZE + TOTAL_SIZE + (400 * 1024 * 1024))) IMG_SIZE=$((BOOT_SIZE + TOTAL_SIZE + (400 * 1024 * 1024)))