Skip to content

Commit

Permalink
flashfiles.mk: Use du -b to get apparent size
Browse files Browse the repository at this point in the history
On disks using ZFS, `du` can't get correct size of efi_images_tmp,
which caused "Disk full" error. Using apparent size can fix it.

Tracked-On: OAM-106622
Signed-off-by: Hao Yao <[email protected]>
  • Loading branch information
hao-yao committed Apr 17, 2023
1 parent 096507f commit 1103544
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions tasks/flashfiles.mk
Original file line number Diff line number Diff line change
Expand Up @@ -417,11 +417,9 @@ endif
done;

$(hide)rm -rf $(ISO_EFI); \
flashfile_size=`du -s ${PRODUCT_OUT}/efi_images_tmp/ | awk '{print $$1}'`; \
flashfile_size=`expr $${flashfile_size} + 102400`; \
flashfile_size=`expr $${flashfile_size} / 63 + 1 `; \
flashfile_size=`expr $${flashfile_size} \* 63 `; \
dd if=/dev/zero of=$(ISO_EFI) bs=1024 count=$${flashfile_size};
flashfile_size=`du -b -s ${PRODUCT_OUT}/efi_images_tmp/ | awk '{print $$1}'`; \
flashfile_size=`expr $${flashfile_size} / 1048576 + 11`; \
dd if=/dev/zero of=$(ISO_EFI) bs=1M count=$${flashfile_size};

$(hide)mkdosfs -F32 -n EFI $(ISO_EFI);
$(hide)mmd -i $(ISO_EFI) ::EFI;
Expand Down

0 comments on commit 1103544

Please sign in to comment.