diff options
Diffstat (limited to 'scripts/lib/wic/ksparser.py')
| -rw-r--r-- | scripts/lib/wic/ksparser.py | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/scripts/lib/wic/ksparser.py b/scripts/lib/wic/ksparser.py index 7ef3dc83dd..a762d3b6cf 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,8 @@ 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', '--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', |
| @@ -174,9 +175,9 @@ class KickStart(): | |||
| 174 | part.add_argument('--hidden', action='store_true') | 175 | part.add_argument('--hidden', action='store_true') |
| 175 | 176 | ||
| 176 | # --size and --fixed-size cannot be specified together; options | 177 | # --size and --fixed-size cannot be specified together; options |
| 177 | # ----extra-space and --overhead-factor should also raise a parser | 178 | # ----extra-filesystem-space and --overhead-factor should also raise a |
| 178 | # --error, but since nesting mutually exclusive groups does not work, | 179 | # parser error, but since nesting mutually exclusive groups does not work, |
| 179 | # ----extra-space/--overhead-factor are handled later | 180 | # ----extra-filesystem-space/--overhead-factor are handled later |
| 180 | sizeexcl = part.add_mutually_exclusive_group() | 181 | sizeexcl = part.add_mutually_exclusive_group() |
| 181 | sizeexcl.add_argument('--size', type=sizetype("M"), default=0) | 182 | sizeexcl.add_argument('--size', type=sizetype("M"), default=0) |
| 182 | sizeexcl.add_argument('--fixed-size', type=sizetype("M"), default=0) | 183 | sizeexcl.add_argument('--fixed-size', type=sizetype("M"), default=0) |
| @@ -259,14 +260,17 @@ 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-filesystem-space |
| 265 | # with --fixed-size, so at least detect when these were | 268 | # cannot be used with --fixed-size, so at least detect |
| 266 | # passed with non-0 values ... | 269 | # when these were passed with non-0 values ... |
| 267 | if parsed.fixed_size: | 270 | if parsed.fixed_size: |
| 268 | if parsed.overhead_factor or parsed.extra_space: | 271 | if parsed.overhead_factor or parsed.extra_filesystem_space: |
| 269 | err = "%s:%d: arguments --overhead-factor and --extra-space not "\ | 272 | err = "%s:%d: arguments --overhead-factor and "\ |
| 273 | "--extra-filesystem-space not "\ | ||
| 270 | "allowed with argument --fixed-size" \ | 274 | "allowed with argument --fixed-size" \ |
| 271 | % (confpath, lineno) | 275 | % (confpath, lineno) |
| 272 | raise KickStartError(err) | 276 | raise KickStartError(err) |
| @@ -275,10 +279,10 @@ class KickStart(): | |||
| 275 | # --fixed-size iff given option was not used | 279 | # --fixed-size iff given option was not used |
| 276 | # (again, one cannot tell if option was passed but | 280 | # (again, one cannot tell if option was passed but |
| 277 | # with value equal to 0) | 281 | # with value equal to 0) |
| 278 | if '--overhead-factor' not in line_args: | 282 | if not parsed.overhead_factor: |
| 279 | parsed.overhead_factor = self.DEFAULT_OVERHEAD_FACTOR | 283 | parsed.overhead_factor = self.DEFAULT_OVERHEAD_FACTOR |
| 280 | if '--extra-space' not in line_args: | 284 | if not parsed.extra_filesystem_space: |
| 281 | parsed.extra_space = self.DEFAULT_EXTRA_SPACE | 285 | parsed.extra_filesystem_space = self.DEFAULT_EXTRA_FILESYSTEM_SPACE |
| 282 | 286 | ||
| 283 | self.partnum += 1 | 287 | self.partnum += 1 |
| 284 | self.partitions.append(Partition(parsed, self.partnum)) | 288 | self.partitions.append(Partition(parsed, self.partnum)) |
