Skip to contentSkip to conversation

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

PATCH New [email protected] 1 participant 1 message May 1, 2023

lore
Share & tools
lore
#0 lore raw

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

From: Randolph Sapp <[email protected]>

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.

---

This fix is already available in master but we'd like to backport it to kirkstone if possible! Considering it's a compatibility fix it should be applicable to other branches as well, but we only really care about Kirkstone at the moment.

 scripts/lib/wic/plugins/source/bootimg-efi.py | 7 +++++++
 1 file changed, 7 insertions(+)
scripts/lib/wic/plugins/source/bootimg-efi.py +7 -0
index d6aeab2aad..43c6fd94d9 100644
@@ -439,6 +439,13 @@ class BootimgEFIPlugin(SourcePlugin):
         logger.debug("Added %d extra blocks to %s to get to %d total blocks",
                      extra_blocks, part.mountpoint, blocks)
 
+        # required for compatibility with certain devices expecting file system
+        # block count to be equal to partition block count
+        if blocks < part.fixed_size:
+            blocks = part.fixed_size
+            logger.debug("Overriding %s to %d total blocks for compatibility",
+                     part.mountpoint, blocks)
+
         # dosfs image, created by mkdosfs
         bootimg = "%s/boot.img" % cr_workdir
 
Signature · 1 line
2.40.0