diff options
author | Ed Bartosh <ed.bartosh@linux.intel.com> | 2016-04-22 12:31:59 +0300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-04-29 07:53:57 +0100 |
commit | b9c56b1c95cd1d0fd809d257e0cd05a50c481bed (patch) | |
tree | e8266710be1c52bf46a8953f733fc68e0cba76f8 /scripts | |
parent | dba099d77dcc66b239523a55f3ed26784f9a662a (diff) | |
download | openembedded-core-b9c56b1c95cd1d0fd809d257e0cd05a50c481bed.tar.gz openembedded-core-b9c56b1c95cd1d0fd809d257e0cd05a50c481bed.tar.bz2 openembedded-core-b9c56b1c95cd1d0fd809d257e0cd05a50c481bed.zip |
wic: add --system-id wks option
Added new option --system-id to wks parser. The option
will be used to set partition system id.
[YOCTO #9096]
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/lib/wic/ksparser.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/scripts/lib/wic/ksparser.py b/scripts/lib/wic/ksparser.py index 8c3f80882c..10d0d7c115 100644 --- a/scripts/lib/wic/ksparser.py +++ b/scripts/lib/wic/ksparser.py @@ -92,6 +92,24 @@ def cannedpathtype(arg): raise ArgumentTypeError("file not found: %s" % arg) return result +def systemidtype(arg): + """ + Custom type for ArgumentParser + Checks if the argument sutisfies system id requirements, + i.e. if it's one byte long integer > 0 + """ + error = "Invalid system type: %s. must be hex "\ + "between 0x1 and 0xFF" % arg + try: + result = int(arg, 16) + except ValueError: + raise ArgumentTypeError(error) + + if result <= 0 or result > 0xff: + raise ArgumentTypeError(error) + + return arg + class KickStart(object): """"Kickstart parser implementation.""" @@ -121,6 +139,7 @@ class KickStart(object): part.add_argument('--size', type=sizetype, default=0) part.add_argument('--source') part.add_argument('--sourceparams') + part.add_argument('--system-id', type=systemidtype) part.add_argument('--use-uuid', action='store_true') part.add_argument('--uuid') |