From 23b6c5ea4d48cdf731e5202991961a0e4b10ff29 Mon Sep 17 00:00:00 2001 From: Tom Zanussi Date: Fri, 7 Feb 2014 16:19:28 -0600 Subject: 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 Signed-off-by: Richard Purdie --- scripts/lib/mic/plugins/source/bootimg-efi.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'scripts/lib/mic/plugins/source/bootimg-efi.py') 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 -- cgit 1.2.3-korg