diff options
Diffstat (limited to 'scripts/lib')
| -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 = "" |
