aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/lib/mic/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/lib/mic/plugins')
-rw-r--r--scripts/lib/mic/plugins/source/bootimg-efi.py10
-rw-r--r--scripts/lib/mic/plugins/source/bootimg-pcbios.py10
2 files changed, 18 insertions, 2 deletions
diff --git a/scripts/lib/mic/plugins/source/bootimg-efi.py b/scripts/lib/mic/plugins/source/bootimg-efi.py
index 3e0997bacf..1974b062b2 100644
--- a/scripts/lib/mic/plugins/source/bootimg-efi.py
+++ b/scripts/lib/mic/plugins/source/bootimg-efi.py
@@ -131,7 +131,15 @@ class BootimgEFIPlugin(SourcePlugin):
rc, out = exec_cmd(du_cmd)
blocks = int(out.split()[0])
- blocks += BOOTDD_EXTRA_SPACE
+ extra_blocks = part.get_extra_block_count(blocks)
+
+ if extra_blocks < BOOTDD_EXTRA_SPACE:
+ extra_blocks = BOOTDD_EXTRA_SPACE
+
+ blocks += extra_blocks
+
+ msger.debug("Added %d extra blocks to %s to get to %d total blocks" % \
+ (extra_blocks, part.mountpoint, blocks))
# Ensure total sectors is an integral number of sectors per
# track or mcopy will complain. Sectors are 512 bytes, and we
diff --git a/scripts/lib/mic/plugins/source/bootimg-pcbios.py b/scripts/lib/mic/plugins/source/bootimg-pcbios.py
index 3cd446f052..fad150f940 100644
--- a/scripts/lib/mic/plugins/source/bootimg-pcbios.py
+++ b/scripts/lib/mic/plugins/source/bootimg-pcbios.py
@@ -154,7 +154,15 @@ class BootimgPcbiosPlugin(SourcePlugin):
rc, out = exec_cmd(du_cmd)
blocks = int(out.split()[0])
- blocks += BOOTDD_EXTRA_SPACE
+ extra_blocks = part.get_extra_block_count(blocks)
+
+ if extra_blocks < BOOTDD_EXTRA_SPACE:
+ extra_blocks = BOOTDD_EXTRA_SPACE
+
+ blocks += extra_blocks
+
+ msger.debug("Added %d extra blocks to %s to get to %d total blocks" % \
+ (extra_blocks, part.mountpoint, blocks))
# Ensure total sectors is an integral number of sectors per
# track or mcopy will complain. Sectors are 512 bytes, and we