diff options
author | Alexandre Belloni <alexandre.belloni@free-electrons.com> | 2015-02-09 00:16:22 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-02-14 08:40:58 +0000 |
commit | d84742c39f39fefb7810c6f902cada222c7e4252 (patch) | |
tree | 529035f9ff4e114e23a9b9fbc941c046faaff62b /scripts | |
parent | 605627bc9d9fafc39caa6a802eee6203f520f6a8 (diff) | |
download | 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')
-rw-r--r-- | scripts/lib/image/help.py | 6 | ||||
-rw-r--r-- | scripts/lib/wic/kickstart/custom_commands/partition.py | 20 | ||||
-rw-r--r-- | scripts/lib/wic/utils/oe/misc.py | 1 |
3 files changed, 17 insertions, 10 deletions
diff --git a/scripts/lib/image/help.py b/scripts/lib/image/help.py index aab0b609af..8e026986aa 100644 --- a/scripts/lib/image/help.py +++ b/scripts/lib/image/help.py | |||
@@ -743,6 +743,12 @@ DESCRIPTION | |||
743 | partition table. It may be useful for | 743 | partition table. It may be useful for |
744 | bootloaders. | 744 | bootloaders. |
745 | 745 | ||
746 | --extra-space: This option is specific to wic. It adds extra | ||
747 | space after the space filled by the content | ||
748 | of the partition. The final size can go | ||
749 | beyond the size specified by --size. | ||
750 | By default, 10MB. | ||
751 | |||
746 | * bootloader | 752 | * bootloader |
747 | 753 | ||
748 | This command allows the user to specify various bootloader | 754 | This command allows the user to specify various bootloader |
diff --git a/scripts/lib/wic/kickstart/custom_commands/partition.py b/scripts/lib/wic/kickstart/custom_commands/partition.py index 9be6b0457b..8bde1b80e1 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): | |||
50 | self.sourceparams = kwargs.get("sourceparams", None) | 50 | self.sourceparams = kwargs.get("sourceparams", None) |
51 | self.rootfs = kwargs.get("rootfs-dir", None) | 51 | self.rootfs = kwargs.get("rootfs-dir", None) |
52 | self.no_table = kwargs.get("no-table", False) | 52 | self.no_table = kwargs.get("no-table", False) |
53 | self.extra_space = kwargs.get("extra-space", "10M") | ||
53 | self.source_file = "" | 54 | self.source_file = "" |
54 | self.size = 0 | 55 | self.size = 0 |
55 | 56 | ||
@@ -64,6 +65,7 @@ class Wic_PartData(Mic_PartData): | |||
64 | retval += " --rootfs-dir=%s" % self.rootfs | 65 | retval += " --rootfs-dir=%s" % self.rootfs |
65 | if self.no_table: | 66 | if self.no_table: |
66 | retval += " --no-table" | 67 | retval += " --no-table" |
68 | retval += " --extra-space=%d" % self.extra_space | ||
67 | 69 | ||
68 | return retval | 70 | return retval |
69 | 71 | ||
@@ -227,9 +229,8 @@ class Wic_PartData(Mic_PartData): | |||
227 | actual_rootfs_size = int(out.split()[0]) | 229 | actual_rootfs_size = int(out.split()[0]) |
228 | 230 | ||
229 | extra_blocks = self.get_extra_block_count(actual_rootfs_size) | 231 | extra_blocks = self.get_extra_block_count(actual_rootfs_size) |
230 | 232 | if extra_blocks < self.extra_space: | |
231 | if extra_blocks < IMAGE_EXTRA_SPACE: | 233 | extra_blocks = self.extra_space |
232 | extra_blocks = IMAGE_EXTRA_SPACE | ||
233 | 234 | ||
234 | rootfs_size = actual_rootfs_size + extra_blocks | 235 | rootfs_size = actual_rootfs_size + extra_blocks |
235 | rootfs_size *= IMAGE_OVERHEAD_FACTOR | 236 | rootfs_size *= IMAGE_OVERHEAD_FACTOR |
@@ -275,9 +276,8 @@ class Wic_PartData(Mic_PartData): | |||
275 | actual_rootfs_size = int(out.split()[0]) | 276 | actual_rootfs_size = int(out.split()[0]) |
276 | 277 | ||
277 | extra_blocks = self.get_extra_block_count(actual_rootfs_size) | 278 | extra_blocks = self.get_extra_block_count(actual_rootfs_size) |
278 | 279 | if extra_blocks < self.extra_space: | |
279 | if extra_blocks < IMAGE_EXTRA_SPACE: | 280 | extra_blocks = self.extra_space |
280 | extra_blocks = IMAGE_EXTRA_SPACE | ||
281 | 281 | ||
282 | rootfs_size = actual_rootfs_size + extra_blocks | 282 | rootfs_size = actual_rootfs_size + extra_blocks |
283 | rootfs_size *= IMAGE_OVERHEAD_FACTOR | 283 | rootfs_size *= IMAGE_OVERHEAD_FACTOR |
@@ -316,9 +316,8 @@ class Wic_PartData(Mic_PartData): | |||
316 | blocks = int(out.split()[0]) | 316 | blocks = int(out.split()[0]) |
317 | 317 | ||
318 | extra_blocks = self.get_extra_block_count(blocks) | 318 | extra_blocks = self.get_extra_block_count(blocks) |
319 | 319 | if extra_blocks < self.extra_space: | |
320 | if extra_blocks < IMAGE_EXTRA_SPACE: | 320 | extra_blocks = self.extra_space |
321 | extra_blocks = IMAGE_EXTRA_SPACE | ||
322 | 321 | ||
323 | blocks += extra_blocks | 322 | blocks += extra_blocks |
324 | 323 | ||
@@ -527,4 +526,7 @@ class Wic_Partition(Mic_Partition): | |||
527 | # wether to add the partition in the partition table | 526 | # wether to add the partition in the partition table |
528 | op.add_option("--no-table", dest="no_table", action="store_true", | 527 | op.add_option("--no-table", dest="no_table", action="store_true", |
529 | default=False) | 528 | default=False) |
529 | # extra space beyond the partition size | ||
530 | op.add_option("--extra-space", dest="extra_space", action="store", | ||
531 | type="size", nargs=1, default="10M") | ||
530 | return op | 532 | return op |
diff --git a/scripts/lib/wic/utils/oe/misc.py b/scripts/lib/wic/utils/oe/misc.py index b0b5baab73..fa14fee1ab 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): | |||
122 | wks_vars[key] = val | 122 | wks_vars[key] = val |
123 | 123 | ||
124 | BOOTDD_EXTRA_SPACE = 16384 | 124 | BOOTDD_EXTRA_SPACE = 16384 |
125 | IMAGE_EXTRA_SPACE = 10240 | ||
126 | IMAGE_OVERHEAD_FACTOR = 1.3 | 125 | IMAGE_OVERHEAD_FACTOR = 1.3 |
127 | 126 | ||
128 | __bitbake_env_lines = "" | 127 | __bitbake_env_lines = "" |