summaryrefslogtreecommitdiffstats
path: root/scripts/lib/wic/ksparser.py
diff options
context:
space:
mode:
authorPierre-Loup GOSSE <pierre-loup.gosse@smile.fr>2025-09-03 16:45:27 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2025-09-08 18:02:39 +0100
commit21d98bd960132033b2bbd460a40274d40ea28b60 (patch)
tree6ced7d142b61b8adfc270b85c9c332190c025d4a /scripts/lib/wic/ksparser.py
parent857bb50a3533f897290add64706b98b72a0bded2 (diff)
downloadpoky-21d98bd960132033b2bbd460a40274d40ea28b60.tar.gz
wic: add --extra-partition-space option to set unused space
By default, the content of the partition is filled by the filesystem without leaving any unused free space. The --extra-space flag adds extra space to the filesystem size, not to the partition. Unused free space after the filesystem can be useful for some cases, such as encrypting a partition at runtime. With --extra-partition-space 32M, we ensure that the last 32M of the partition is unused: this space does not contain filesystem data and can store the LUKS2 header. The implementation sets a difference between the partition and filesystem size: - With --fixed-size, the extra part space is removed from the filesystem size. - Otherwise (with or without --size flag), the extra part space is added to the partition size. (From OE-Core rev: 22fd1702aedf40257aa53963b62b5ef1bbd2818a) 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>
Diffstat (limited to 'scripts/lib/wic/ksparser.py')
-rw-r--r--scripts/lib/wic/ksparser.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/scripts/lib/wic/ksparser.py b/scripts/lib/wic/ksparser.py
index 596b6e8e7e..a1aaf1b4b3 100644
--- a/scripts/lib/wic/ksparser.py
+++ b/scripts/lib/wic/ksparser.py
@@ -154,6 +154,7 @@ class KickStart():
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-space", type=sizetype("M"))
157 part.add_argument('--extra-partition-space', type=sizetype("M"))
157 part.add_argument('--fsoptions', dest='fsopts') 158 part.add_argument('--fsoptions', dest='fsopts')
158 part.add_argument('--fspassno', dest='fspassno') 159 part.add_argument('--fspassno', dest='fspassno')
159 part.add_argument('--fstype', default='vfat', 160 part.add_argument('--fstype', default='vfat',
@@ -259,6 +260,8 @@ class KickStart():
259 err = "%s:%d: Must set the label with --label" \ 260 err = "%s:%d: Must set the label with --label" \
260 % (confpath, lineno) 261 % (confpath, lineno)
261 raise KickStartError(err) 262 raise KickStartError(err)
263 if not parsed.extra_partition_space:
264 parsed.extra_partition_space = 0
262 # using ArgumentParser one cannot easily tell if option 265 # using ArgumentParser one cannot easily tell if option
263 # was passed as argument, if said option has a default 266 # was passed as argument, if said option has a default
264 # value; --overhead-factor/--extra-space cannot be used 267 # value; --overhead-factor/--extra-space cannot be used