File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -58,22 +58,21 @@ _img_build() {
5858 _msg2 " Laying out partitions..."
5959
6060 # compute EFS partition size in MiB
61- efs_size=$( du -bc " ${_DIR_DISK_EFI} " | grep total | cut -f1)
62- efs_part_size=$(( (efs_size* 105 )/ 100 / (1024 * 1024 ) + 1 ))
61+ efs_part_size=$( du -s --block-size=1M " ${_DIR_DISK_EFI} " | cut -f1)
6362
6463 if [[ $efs_part_size -lt 48 ]]; then
6564 efs_part_size=48
6665 fi
6766
6867 # compute root partition size in MiB
69- root_size=$( du -bc " ${_DIR_DISK_ROOT} " | grep total | cut -f1)
70- root_part_size=$(( ( root_size* 110 ) / 100 / ( 1024 * 1024 ) + 1 ))
68+ root_size=$( du -s --block-size=1M " ${_DIR_DISK_ROOT} " | cut -f1)
69+ root_part_size=$(( root_size + 128 ))
7170
7271 # compute disk size and create base image
7372 _msg2 " Allocating disk image..."
7473 _IMG_DISK=" ${_DIR_BUILD} /disk.img"
7574
76- disk_size=$(( efs_part_size + root_part_size + 5 ))
75+ disk_size=$(( efs_part_size + root_part_size + 8 ))
7776 dd if=/dev/zero of=" ${_IMG_DISK} " bs=" ${disk_size} " count=1048576 status=none
7877 sync
7978
You can’t perform that action at this time.
0 commit comments