summaryrefslogtreecommitdiffstats
path: root/scripts/lib/wic
diff options
context:
space:
mode:
authorAlexandre Belloni <alexandre.belloni@free-electrons.com>2015-02-09 00:16:22 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-02-14 08:40:58 +0000
commitd84742c39f39fefb7810c6f902cada222c7e4252 (patch)
tree529035f9ff4e114e23a9b9fbc941c046faaff62b /scripts/lib/wic
parent605627bc9d9fafc39caa6a802eee6203f520f6a8 (diff)
downloadast2050-yocto-poky-d84742c39f39fefb7810c6f902cada222c7e4252.zip
ast2050-yocto-poky-d84742c39f39fefb7810c6f902cada222c7e4252.tar.gz
wic: allow to configure extra space per partition
Introduce a new option --extra-space instead of using IMAGE_EXTRA_SPACE. This is useful for boot partitions where the extra space is often useless or for huge partition where 10MiB may not be enough. (From OE-Core rev: 9f7fe71a10bcdd1864d2f838f3510e96810ef42e) Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib/wic')
-rw-r--r--scripts/lib/wic/kickstart/custom_commands/partition.py20
-rw-r--r--scripts/lib/wic/utils/oe/misc.py1
2 files changed, 11 insertions, 10 deletions
diff --git a/scripts/lib/wic/kickstart/custom_commands/partition.py b/scripts/lib/wic/kickstart/custom_commands/partition.py
index 9be6b04..8bde1b8 100644
--- a/scripts/lib/wic/kickstart/custom_commands/partition.py
+++ b/scripts/lib/wic/kickstart/custom_commands/partition.py
@@ -50,6 +50,7 @@ class Wic_PartData(Mic_PartData):
self.sourceparams = kwargs.get("sourceparams", None)
self.rootfs = kwargs.get("rootfs-dir", None)
self.no_table = kwargs.get("no-table", False)
+ self.extra_space = kwargs.get("extra-space", "10M")
self.source_file = ""
self.size = 0
@@ -64,6 +65,7 @@ class Wic_PartData(Mic_PartData):
retval += " --rootfs-dir=%s" % self.rootfs
if self.no_table:
retval += " --no-table"
+ retval += " --extra-space=%d" % self.extra_space
return retval
@@ -227,9 +229,8 @@ class Wic_PartData(Mic_PartData):
actual_rootfs_size = int(out.split()[0])
extra_blocks = self.get_extra_block_count(actual_rootfs_size)
-
- if extra_blocks < IMAGE_EXTRA_SPACE:
- extra_blocks = IMAGE_EXTRA_SPACE
+ if extra_blocks < self.extra_space:
+ extra_blocks = self.extra_space
rootfs_size = actual_rootfs_size + extra_blocks
rootfs_size *= IMAGE_OVERHEAD_FACTOR
@@ -275,9 +276,8 @@ class Wic_PartData(Mic_PartData):
actual_rootfs_size = int(out.split()[0])
extra_blocks = self.get_extra_block_count(actual_rootfs_size)
-
- if extra_blocks < IMAGE_EXTRA_SPACE:
- extra_blocks = IMAGE_EXTRA_SPACE
+ if extra_blocks < self.extra_space:
+ extra_blocks = self.extra_space
rootfs_size = actual_rootfs_size + extra_blocks
rootfs_size *= IMAGE_OVERHEAD_FACTOR
@@ -316,9 +316,8 @@ class Wic_PartData(Mic_PartData):
blocks = int(out.split()[0])
extra_blocks = self.get_extra_block_count(blocks)
-
- if extra_blocks < IMAGE_EXTRA_SPACE:
- extra_blocks = IMAGE_EXTRA_SPACE
+ if extra_blocks < self.extra_space:
+ extra_blocks = self.extra_space
blocks += extra_blocks
@@ -527,4 +526,7 @@ class Wic_Partition(Mic_Partition):
# wether to add the partition in the partition table
op.add_option("--no-table", dest="no_table", action="store_true",
default=False)
+ # extra space beyond the partition size
+ op.add_option("--extra-space", dest="extra_space", action="store",
+ type="size", nargs=1, default="10M")
return op
diff --git a/scripts/lib/wic/utils/oe/misc.py b/scripts/lib/wic/utils/oe/misc.py
index b0b5baa..fa14fee 100644
--- a/scripts/lib/wic/utils/oe/misc.py
+++ b/scripts/lib/wic/utils/oe/misc.py
@@ -122,7 +122,6 @@ def add_wks_var(key, val):
wks_vars[key] = val
BOOTDD_EXTRA_SPACE = 16384
-IMAGE_EXTRA_SPACE = 10240
IMAGE_OVERHEAD_FACTOR = 1.3
__bitbake_env_lines = ""
OpenPOWER on IntegriCloud