]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
wic/bootimg-efi: if fixed-size is set then use that for mkdosfs
authorRandolph Sapp <rs@ti.com>
Mon, 1 May 2023 16:04:21 +0000 (11:04 -0500)
committerSteve Sakoman <steve@sakoman.com>
Fri, 5 May 2023 18:55:27 +0000 (08:55 -1000)
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>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
scripts/lib/wic/plugins/source/bootimg-efi.py

index a65a5b978042db7335bbb5e4946b881502eb8850..c28d3917c2a073a3aac50ad5c9a2d18b06f7b5a9 100644 (file)
@@ -390,6 +390,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