diff mbox series

wic/bootimg-efi: if fixed-size is set then use that for mkdosfs

Message ID 20230421211055.3659678-1-rs@ti.com
State Accepted, archived
Commit 38e1a235f5eceade7c871f96dc97f6c384384c7b
Headers show
Series wic/bootimg-efi: if fixed-size is set then use that for mkdosfs | expand

Commit Message

Randolph Sapp April 21, 2023, 9:10 p.m. UTC
This is a bit of a compatibility issue more than anything. Some devices
get upset if the FAT file system contains less blocks than the
partition.

The fixed-size argument is currently respected by the partition creation
step but not by the file system creation step. Let's make it so the file
system respects this value as well.

Signed-off-by: Randolph Sapp <rs@ti.com>
---
 scripts/lib/wic/plugins/source/bootimg-efi.py | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/scripts/lib/wic/plugins/source/bootimg-efi.py b/scripts/lib/wic/plugins/source/bootimg-efi.py
index a65a5b9780..15557e5d36 100644
--- a/scripts/lib/wic/plugins/source/bootimg-efi.py
+++ b/scripts/lib/wic/plugins/source/bootimg-efi.py
@@ -387,6 +387,9 @@  class BootimgEFIPlugin(SourcePlugin):
 
         blocks += extra_blocks
 
+        if blocks < part.fixed_size:
+            blocks = part.fixed_size
+
         logger.debug("Added %d extra blocks to %s to get to %d total blocks",
                      extra_blocks, part.mountpoint, blocks)