diff options
Diffstat (limited to 'scripts/lib')
-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 |
3 files changed, 22 insertions, 21 deletions
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) |