diff options
author | Kevin Hao <kexin.hao@windriver.com> | 2018-09-12 08:44:46 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-09-12 08:18:09 +0100 |
commit | 51638edaa00befaed58e2def255d46ae44d9234f (patch) | |
tree | 7a9bbf34353a7ffcccad98e3b01e17dd6454626f /scripts/lib/wic/ksparser.py | |
parent | 3e222bf3e0631b385dc46b02b6ba890451c291b2 (diff) | |
download | openembedded-core-51638edaa00befaed58e2def255d46ae44d9234f.tar.gz openembedded-core-51638edaa00befaed58e2def255d46ae44d9234f.tar.bz2 openembedded-core-51638edaa00befaed58e2def255d46ae44d9234f.zip |
wic: Introduce the --use-label partition parameter
We can use this parameter to make the wic use the label to name a
partition in /etc/fstab.
Signed-off-by: Kevin Hao <kexin.hao@windriver.com>
Reviewed-by: Tom Rini <trini@konsulko.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.py | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/scripts/lib/wic/ksparser.py b/scripts/lib/wic/ksparser.py index a5d29189b9..7e5a9c5092 100644 --- a/scripts/lib/wic/ksparser.py +++ b/scripts/lib/wic/ksparser.py @@ -141,6 +141,7 @@ class KickStart(): 'squashfs', 'vfat', 'msdos', 'swap')) part.add_argument('--mkfs-extraopts', default='') part.add_argument('--label') + part.add_argument('--use-label', action='store_true') part.add_argument('--no-table', action='store_true') part.add_argument('--ondisk', '--ondrive', dest='disk', default='sda') part.add_argument("--overhead-factor", type=overheadtype) @@ -197,8 +198,17 @@ class KickStart(): (confpath, lineno, err)) if line.startswith('part'): # SquashFS does not support filesystem UUID - if parsed.fstype == 'squashfs' and parsed.fsuuid: - err = "%s:%d: SquashFS does not support UUID" \ + if parsed.fstype == 'squashfs': + if parsed.fsuuid: + err = "%s:%d: SquashFS does not support UUID" \ + % (confpath, lineno) + raise KickStartError(err) + if parsed.label: + err = "%s:%d: SquashFS does not support LABEL" \ + % (confpath, lineno) + raise KickStartError(err) + if parsed.use_label and not parsed.label: + err = "%s:%d: Must set the label with --label" \ % (confpath, lineno) raise KickStartError(err) # using ArgumentParser one cannot easily tell if option |