Skip to contentSkip to conversation

wic/bootimg-efi: Respect fixed partition size

PATCH In review Andrei Gherzan 2 participants 3 messages Mar 16, 2020 – Aug 14, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 wic/bootimg-efi: Respect fixed partition size

---
 scripts/lib/wic/plugins/source/bootimg-efi.py | 21 +++++++++++--------
 1 file changed, 12 insertions(+), 9 deletions(-)
scripts/lib/wic/plugins/source/bootimg-efi.py +12 -9
index 2cfdc10ecd..6c3d7b8491 100644
@@ -263,19 +263,22 @@ class BootimgEFIPlugin(SourcePlugin):
             cp_cmd = "cp %s %s/" % (startup, hdddir)
             exec_cmd(cp_cmd, True)
 
-        du_cmd = "du -bks %s" % hdddir
-        out = exec_cmd(du_cmd)
-        blocks = int(out.split()[0])
+        if part.fixed-size:
+            blocks = part.fixed_size
+        else:
+            du_cmd = "du -bks %s" % hdddir
+            out = exec_cmd(du_cmd)
+            blocks = int(out.split()[0])
 
-        extra_blocks = part.get_extra_block_count(blocks)
+            extra_blocks = part.get_extra_block_count(blocks)
 
-        if extra_blocks < BOOTDD_EXTRA_SPACE:
-            extra_blocks = BOOTDD_EXTRA_SPACE
+            if extra_blocks < BOOTDD_EXTRA_SPACE:
+                extra_blocks = BOOTDD_EXTRA_SPACE
 
-        blocks += extra_blocks
+            blocks += extra_blocks
 
-        logger.debug("Added %d extra blocks to %s to get to %d total blocks",
-                     extra_blocks, part.mountpoint, blocks)
+            logger.debug("Added %d extra blocks to %s to get to %d total blocks",
+                         extra_blocks, part.mountpoint, blocks)
 
         # dosfs image, created by mkdosfs
         bootimg = "%s/boot.img" % cr_workdir
Signature · 1 line
2.17.1
#1 lore raw

Hi,

Quoted 42 lines · Andrei Gherzan
---
 scripts/lib/wic/plugins/source/bootimg-efi.py | 21 +++++++++++--------
 1 file changed, 12 insertions(+), 9 deletions(-)
scripts/lib/wic/plugins/source/bootimg-efi.py +12 -9
index 2cfdc10ecd..6c3d7b8491 100644
@@ -263,19 +263,22 @@ class BootimgEFIPlugin(SourcePlugin):
             cp_cmd = "cp %s %s/" % (startup, hdddir)
             exec_cmd(cp_cmd, True)
 
-        du_cmd = "du -bks %s" % hdddir
-        out = exec_cmd(du_cmd)
-        blocks = int(out.split()[0])
+        if part.fixed-size:
+            blocks = part.fixed_size
+        else:
+            du_cmd = "du -bks %s" % hdddir
+            out = exec_cmd(du_cmd)
+            blocks = int(out.split()[0])
 
-        extra_blocks = part.get_extra_block_count(blocks)
+            extra_blocks = part.get_extra_block_count(blocks)
 
-        if extra_blocks < BOOTDD_EXTRA_SPACE:
-            extra_blocks = BOOTDD_EXTRA_SPACE
+            if extra_blocks < BOOTDD_EXTRA_SPACE:
+                extra_blocks = BOOTDD_EXTRA_SPACE
 
-        blocks += extra_blocks
+            blocks += extra_blocks
 
-        logger.debug("Added %d extra blocks to %s to get to %d total
 blocks",
-                     extra_blocks, part.mountpoint, blocks)
+            logger.debug("Added %d extra blocks to %s to get to %d total
 blocks",
+                         extra_blocks, part.mountpoint, blocks)
 
Quoted 4 lines
         # dosfs image, created by mkdosfs
         bootimg = "%s/boot.img" % cr_workdir

Small ping for this.

Thanks,
Andrei

#2 lore raw
In reply to Andrei Gherzan
Quoted 5 lines · Andrei Gherzan
---
 scripts/lib/wic/plugins/source/bootimg-efi.py | 21 +++++++++++----
----
 1 file changed, 12 insertions(+), 9 deletions(-)

Causes build failures:

https://autobuilder.yoctoproject.org/typhoon/#/builders/48/builds/2302

https://autobuilder.yoctoproject.org/typhoon/#/builders/113/builds/146

and others in:

https://autobuilder.yoctoproject.org/typhoon/#/builders/83/builds/1260

Cheers,

Richard