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:58:44 +0100 |
commit | a48630b12afa733040953768f086c949796e8f2c (patch) | |
tree | ed5aa02a3c6c6600447b3a124daabd8f48939dd7 /scripts/lib/wic | |
parent | 4ed22edac81797fb9e93c736318aba8f621f7c2b (diff) | |
download | poky-a48630b12afa733040953768f086c949796e8f2c.tar.gz |
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]
(From OE-Core rev: b9c56b1c95cd1d0fd809d257e0cd05a50c481bed)
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib/wic')
-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): | |||
92 | raise ArgumentTypeError("file not found: %s" % arg) | 92 | raise ArgumentTypeError("file not found: %s" % arg) |
93 | return result | 93 | return result |
94 | 94 | ||
95 | def systemidtype(arg): | ||
96 | """ | ||
97 | Custom type for ArgumentParser | ||
98 | Checks if the argument sutisfies system id requirements, | ||
99 | i.e. if it's one byte long integer > 0 | ||
100 | """ | ||
101 | error = "Invalid system type: %s. must be hex "\ | ||
102 | "between 0x1 and 0xFF" % arg | ||
103 | try: | ||
104 | result = int(arg, 16) | ||
105 | except ValueError: | ||
106 | raise ArgumentTypeError(error) | ||
107 | |||
108 | if result <= 0 or result > 0xff: | ||
109 | raise ArgumentTypeError(error) | ||
110 | |||
111 | return arg | ||
112 | |||
95 | class KickStart(object): | 113 | class KickStart(object): |
96 | """"Kickstart parser implementation.""" | 114 | """"Kickstart parser implementation.""" |
97 | 115 | ||
@@ -121,6 +139,7 @@ class KickStart(object): | |||
121 | part.add_argument('--size', type=sizetype, default=0) | 139 | part.add_argument('--size', type=sizetype, default=0) |
122 | part.add_argument('--source') | 140 | part.add_argument('--source') |
123 | part.add_argument('--sourceparams') | 141 | part.add_argument('--sourceparams') |
142 | part.add_argument('--system-id', type=systemidtype) | ||
124 | part.add_argument('--use-uuid', action='store_true') | 143 | part.add_argument('--use-uuid', action='store_true') |
125 | part.add_argument('--uuid') | 144 | part.add_argument('--uuid') |
126 | 145 | ||