From 7df29e33ce80edf132a3b509bab9886c20c7e4f9 Mon Sep 17 00:00:00 2001 From: Hao Yao Date: Sat, 25 Feb 2023 21:38:02 +0800 Subject: [PATCH] flashfiles.mk: Use `du -b` to get apparent size 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 --- tasks/flashfiles.mk | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/tasks/flashfiles.mk b/tasks/flashfiles.mk index 785d429..cb32ab8 100755 --- a/tasks/flashfiles.mk +++ b/tasks/flashfiles.mk @@ -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;