diff options
| author | Pierre-Loup GOSSE <pierre-loup.gosse@smile.fr> | 2025-09-03 16:45:28 +0200 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-09-08 18:02:39 +0100 |
| commit | 468bcd19506ea20082cafaaa5f53909c802dc19a (patch) | |
| tree | f018280c77201a7cc44896e1a7a9217ad0d64a6e | |
| parent | 21d98bd960132033b2bbd460a40274d40ea28b60 (diff) | |
| download | poky-468bcd19506ea20082cafaaa5f53909c802dc19a.tar.gz | |
wic: rename wks flag --extra-space to --extra-filesystem-space
Makes a clear distinction with --extra-partition-space flag.
(From OE-Core rev: 39d10137b86ebb6d1f20c36ae50a7771e6c76251)
Signed-off-by: Pierre-Loup GOSSE <pierre-loup.gosse@smile.fr>
CC: Alexander Kanavin <alex.kanavin@gmail.com>
CC: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
| -rw-r--r-- | meta/lib/oeqa/selftest/cases/wic.py | 4 | ||||
| -rw-r--r-- | scripts/lib/wic/help.py | 12 | ||||
| -rw-r--r-- | scripts/lib/wic/ksparser.py | 25 | ||||
| -rw-r--r-- | scripts/lib/wic/partition.py | 6 |
4 files changed, 24 insertions, 23 deletions
diff --git a/meta/lib/oeqa/selftest/cases/wic.py b/meta/lib/oeqa/selftest/cases/wic.py index c244c9f188..b1c318bd4e 100644 --- a/meta/lib/oeqa/selftest/cases/wic.py +++ b/meta/lib/oeqa/selftest/cases/wic.py | |||
| @@ -1311,12 +1311,12 @@ run_wic_cmd() { | |||
| 1311 | p, _ = self._get_wic_partitions(tempf.name, ignore_status=True) | 1311 | p, _ = self._get_wic_partitions(tempf.name, ignore_status=True) |
| 1312 | self.assertNotEqual(p.status, 0, "wic exited successfully when an error was expected:\n%s" % p.output) | 1312 | self.assertNotEqual(p.status, 0, "wic exited successfully when an error was expected:\n%s" % p.output) |
| 1313 | 1313 | ||
| 1314 | def test_extra_space(self): | 1314 | def test_extra_filesystem_space(self): |
| 1315 | native_sysroot = get_bb_var("RECIPE_SYSROOT_NATIVE", "wic-tools") | 1315 | native_sysroot = get_bb_var("RECIPE_SYSROOT_NATIVE", "wic-tools") |
| 1316 | 1316 | ||
| 1317 | with NamedTemporaryFile("w", suffix=".wks") as tempf: | 1317 | with NamedTemporaryFile("w", suffix=".wks") as tempf: |
| 1318 | tempf.write("bootloader --ptable gpt\n" \ | 1318 | tempf.write("bootloader --ptable gpt\n" \ |
| 1319 | "part / --source rootfs --ondisk hda --extra-space 200M --fstype=ext4\n") | 1319 | "part / --source rootfs --ondisk hda --extra-filesystem-space 200M --fstype=ext4\n") |
| 1320 | tempf.flush() | 1320 | tempf.flush() |
| 1321 | 1321 | ||
| 1322 | _, partlns = self._get_wic_partitions(tempf.name, native_sysroot) | 1322 | _, partlns = self._get_wic_partitions(tempf.name, native_sysroot) |
diff --git a/scripts/lib/wic/help.py b/scripts/lib/wic/help.py index 800c0abf0f..6b49a67de9 100644 --- a/scripts/lib/wic/help.py +++ b/scripts/lib/wic/help.py | |||
| @@ -1013,12 +1013,12 @@ DESCRIPTION | |||
| 1013 | --no-fstab-update: This option is specific to wic. It does not update the | 1013 | --no-fstab-update: This option is specific to wic. It does not update the |
| 1014 | '/etc/fstab' stock file for the given partition. | 1014 | '/etc/fstab' stock file for the given partition. |
| 1015 | 1015 | ||
| 1016 | --extra-space: This option is specific to wic. It adds extra | 1016 | --extra-filesystem-space: This option is specific to wic. It adds extra |
| 1017 | space after the space filled by the content | 1017 | space after the space filled by the content |
| 1018 | of the partition. The final size can go | 1018 | of the partition. The final size can go |
| 1019 | beyond the size specified by --size. | 1019 | beyond the size specified by --size. |
| 1020 | By default, 10MB. This option cannot be used | 1020 | By default, 10MB. This option cannot be used |
| 1021 | with --fixed-size option. | 1021 | with --fixed-size option. |
| 1022 | 1022 | ||
| 1023 | --extra-partition-space: This option is specific to wic. It adds extra | 1023 | --extra-partition-space: This option is specific to wic. It adds extra |
| 1024 | empty space after the space filled by the | 1024 | empty space after the space filled by the |
diff --git a/scripts/lib/wic/ksparser.py b/scripts/lib/wic/ksparser.py index a1aaf1b4b3..705f989750 100644 --- a/scripts/lib/wic/ksparser.py +++ b/scripts/lib/wic/ksparser.py | |||
| @@ -132,7 +132,7 @@ def systemidtype(arg): | |||
| 132 | class KickStart(): | 132 | class KickStart(): |
| 133 | """Kickstart parser implementation.""" | 133 | """Kickstart parser implementation.""" |
| 134 | 134 | ||
| 135 | DEFAULT_EXTRA_SPACE = 10*1024 | 135 | DEFAULT_EXTRA_FILESYSTEM_SPACE = 10*1024 |
| 136 | DEFAULT_OVERHEAD_FACTOR = 1.3 | 136 | DEFAULT_OVERHEAD_FACTOR = 1.3 |
| 137 | 137 | ||
| 138 | def __init__(self, confpath): | 138 | def __init__(self, confpath): |
| @@ -153,7 +153,7 @@ class KickStart(): | |||
| 153 | part.add_argument('--exclude-path', nargs='+') | 153 | part.add_argument('--exclude-path', nargs='+') |
| 154 | part.add_argument('--include-path', nargs='+', action='append') | 154 | part.add_argument('--include-path', nargs='+', action='append') |
| 155 | part.add_argument('--change-directory') | 155 | part.add_argument('--change-directory') |
| 156 | part.add_argument("--extra-space", type=sizetype("M")) | 156 | part.add_argument('--extra-filesystem-space', type=sizetype("M")) |
| 157 | part.add_argument('--extra-partition-space', type=sizetype("M")) | 157 | part.add_argument('--extra-partition-space', type=sizetype("M")) |
| 158 | part.add_argument('--fsoptions', dest='fsopts') | 158 | part.add_argument('--fsoptions', dest='fsopts') |
| 159 | part.add_argument('--fspassno', dest='fspassno') | 159 | part.add_argument('--fspassno', dest='fspassno') |
| @@ -175,9 +175,9 @@ class KickStart(): | |||
| 175 | part.add_argument('--hidden', action='store_true') | 175 | part.add_argument('--hidden', action='store_true') |
| 176 | 176 | ||
| 177 | # --size and --fixed-size cannot be specified together; options | 177 | # --size and --fixed-size cannot be specified together; options |
| 178 | # ----extra-space and --overhead-factor should also raise a parser | 178 | # ----extra-filesystem-space and --overhead-factor should also raise a |
| 179 | # --error, but since nesting mutually exclusive groups does not work, | 179 | # parser error, but since nesting mutually exclusive groups does not work, |
| 180 | # ----extra-space/--overhead-factor are handled later | 180 | # ----extra-filesystem-space/--overhead-factor are handled later |
| 181 | sizeexcl = part.add_mutually_exclusive_group() | 181 | sizeexcl = part.add_mutually_exclusive_group() |
| 182 | sizeexcl.add_argument('--size', type=sizetype("M"), default=0) | 182 | sizeexcl.add_argument('--size', type=sizetype("M"), default=0) |
| 183 | sizeexcl.add_argument('--fixed-size', type=sizetype("M"), default=0) | 183 | sizeexcl.add_argument('--fixed-size', type=sizetype("M"), default=0) |
| @@ -264,12 +264,13 @@ class KickStart(): | |||
| 264 | parsed.extra_partition_space = 0 | 264 | parsed.extra_partition_space = 0 |
| 265 | # using ArgumentParser one cannot easily tell if option | 265 | # using ArgumentParser one cannot easily tell if option |
| 266 | # was passed as argument, if said option has a default | 266 | # was passed as argument, if said option has a default |
| 267 | # value; --overhead-factor/--extra-space cannot be used | 267 | # value; --overhead-factor/--extra-filesystem-space |
| 268 | # with --fixed-size, so at least detect when these were | 268 | # cannot be used with --fixed-size, so at least detect |
| 269 | # passed with non-0 values ... | 269 | # when these were passed with non-0 values ... |
| 270 | if parsed.fixed_size: | 270 | if parsed.fixed_size: |
| 271 | if parsed.overhead_factor or parsed.extra_space: | 271 | if parsed.overhead_factor or parsed.extra_filesystem_space: |
| 272 | err = "%s:%d: arguments --overhead-factor and --extra-space not "\ | 272 | err = "%s:%d: arguments --overhead-factor and "\ |
| 273 | "--extra-filesystem-space not "\ | ||
| 273 | "allowed with argument --fixed-size" \ | 274 | "allowed with argument --fixed-size" \ |
| 274 | % (confpath, lineno) | 275 | % (confpath, lineno) |
| 275 | raise KickStartError(err) | 276 | raise KickStartError(err) |
| @@ -280,8 +281,8 @@ class KickStart(): | |||
| 280 | # with value equal to 0) | 281 | # with value equal to 0) |
| 281 | if not parsed.overhead_factor: | 282 | if not parsed.overhead_factor: |
| 282 | parsed.overhead_factor = self.DEFAULT_OVERHEAD_FACTOR | 283 | parsed.overhead_factor = self.DEFAULT_OVERHEAD_FACTOR |
| 283 | if not parsed.extra_space: | 284 | if not parsed.extra_filesystem_space: |
| 284 | parsed.extra_space = self.DEFAULT_EXTRA_SPACE | 285 | parsed.extra_filesystem_space = self.DEFAULT_EXTRA_FILESYSTEM_SPACE |
| 285 | 286 | ||
| 286 | self.partnum += 1 | 287 | self.partnum += 1 |
| 287 | self.partitions.append(Partition(parsed, self.partnum)) | 288 | self.partitions.append(Partition(parsed, self.partnum)) |
diff --git a/scripts/lib/wic/partition.py b/scripts/lib/wic/partition.py index d358aabbd6..0c9b1a5b96 100644 --- a/scripts/lib/wic/partition.py +++ b/scripts/lib/wic/partition.py | |||
| @@ -28,7 +28,7 @@ class Partition(): | |||
| 28 | self.align = args.align | 28 | self.align = args.align |
| 29 | self.disk = args.disk | 29 | self.disk = args.disk |
| 30 | self.device = None | 30 | self.device = None |
| 31 | self.extra_space = args.extra_space | 31 | self.extra_filesystem_space = args.extra_filesystem_space |
| 32 | self.extra_partition_space = args.extra_partition_space | 32 | self.extra_partition_space = args.extra_partition_space |
| 33 | self.exclude_path = args.exclude_path | 33 | self.exclude_path = args.exclude_path |
| 34 | self.include_path = args.include_path | 34 | self.include_path = args.include_path |
| @@ -104,8 +104,8 @@ class Partition(): | |||
| 104 | (actual_rootfs_size, rootfs_size)) | 104 | (actual_rootfs_size, rootfs_size)) |
| 105 | else: | 105 | else: |
| 106 | extra_blocks = self.get_extra_block_count(actual_rootfs_size) | 106 | extra_blocks = self.get_extra_block_count(actual_rootfs_size) |
| 107 | if extra_blocks < self.extra_space: | 107 | if extra_blocks < self.extra_filesystem_space: |
| 108 | extra_blocks = self.extra_space | 108 | extra_blocks = self.extra_filesystem_space |
| 109 | 109 | ||
| 110 | rootfs_size = actual_rootfs_size + extra_blocks | 110 | rootfs_size = actual_rootfs_size + extra_blocks |
| 111 | rootfs_size = int(rootfs_size * self.overhead_factor) | 111 | rootfs_size = int(rootfs_size * self.overhead_factor) |
