aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/lib/mic/plugins/source/bootimg-pcbios.py
diff options
context:
space:
mode:
authorTom Zanussi <tom.zanussi@linux.intel.com>2014-02-07 16:19:28 -0600
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-02-08 21:00:46 +0000
commit23b6c5ea4d48cdf731e5202991961a0e4b10ff29 (patch)
tree0b624f0f17d1752043b608475de06f8ae1f86025 /scripts/lib/mic/plugins/source/bootimg-pcbios.py
parentc1375208b363d0ac281189889efd450685bc46bc (diff)
downloadopenembedded-core-23b6c5ea4d48cdf731e5202991961a0e4b10ff29.tar.gz
openembedded-core-23b6c5ea4d48cdf731e5202991961a0e4b10ff29.tar.bz2
openembedded-core-23b6c5ea4d48cdf731e5202991961a0e4b10ff29.zip
wic: Honor --size for --source partititions
Instead of simply creating partitions large enough to contain the contents of a --source partition (and adding a pre-specified amount of padding), use the --size used in the partition .wks statement. If --size isn't used, or is smaller than the actual --source size, retain the current behavior. Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib/mic/plugins/source/bootimg-pcbios.py')
-rw-r--r--scripts/lib/mic/plugins/source/bootimg-pcbios.py10
1 files changed, 9 insertions, 1 deletions
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