fix: 解决不同环境下计算的rootfs的size偏小,导致mcopy造成的disk full错误
构建环境的分区文件系统格式不同,会引起du命令计算文件夹size不同,当制作fat格式 的rootfs时,计算的rootfs文件夹的size比fat格式下的小, 则会导致mcopy过程出现 disk full错误。当前通过修正du计算的rootfs文件夹size的方式处理该问题。 close: #I3IA06 Signed-off-by: YOUR_NAME <zhangfanfan2@huawei.com> Change-Id: I19c66e35c4382d768e020531a869e1e9186032a7
This commit is contained in:
parent
e93c52c091
commit
c54879b548
|
@ -84,7 +84,9 @@ elif [ "${FSTYPE}" = "vfat" ]; then
|
|||
FAT32_ITEM_SIZE=4
|
||||
RESV_CNT=38
|
||||
IMG_MIN_SIZE=1048576
|
||||
DIR_SIZE=$(( $(echo $(du -s ${ROOTFS_DIR} | awk '{print $1}')) * 1024 ))
|
||||
DU_DIR_SIZE=$(( $(echo $(du -s ${ROOTFS_DIR} | awk '{print $1}')) * 1024 ))
|
||||
DIR_NUM=$(( $(echo $(ls -lR ${ROOTFS_DIR} | grep "^d" | wc -l | awk '{print $1}')) + 1 ))
|
||||
DIR_SIZE=$(( ${DU_DIR_SIZE} + ${DIR_NUM} * 4096 ))
|
||||
IMG_SIZE=$(( ${DIR_SIZE} / (1 - ${FAT_TAB_NUM} * ${FAT32_ITEM_SIZE} / ${CLT_SIZE}) + ${RESV_CNT} * ${BLK_SIZE}))
|
||||
if [ ${IMG_SIZE} -le ${IMG_MIN_SIZE} ]; then
|
||||
IMG_SIZE=${IMG_MIN_SIZE}
|
||||
|
|
Loading…
Reference in New Issue