diff options
Diffstat (limited to 'scripts/yocto-kernel')
-rwxr-xr-x | scripts/yocto-kernel | 71 |
1 files changed, 70 insertions, 1 deletions
diff --git a/scripts/yocto-kernel b/scripts/yocto-kernel index 2e1789b13d..72b407109d 100755 --- a/scripts/yocto-kernel +++ b/scripts/yocto-kernel | |||
@@ -162,6 +162,65 @@ def yocto_kernel_patch_rm_subcommand(args, usage_str): | |||
162 | yocto_kernel_patch_rm(scripts_path, args[0]) | 162 | yocto_kernel_patch_rm(scripts_path, args[0]) |
163 | 163 | ||
164 | 164 | ||
165 | def yocto_kernel_feature_list_subcommand(args, usage_str): | ||
166 | """ | ||
167 | Command-line handling for listing the BSP features that are being | ||
168 | used by the BSP. The real work is done by | ||
169 | bsp.kernel.yocto_kernel_feature_list(). | ||
170 | """ | ||
171 | logging.debug("yocto_kernel_feature_list_subcommand") | ||
172 | |||
173 | parser = optparse.OptionParser(usage = usage_str) | ||
174 | |||
175 | (options, args) = parser.parse_args(args) | ||
176 | |||
177 | if len(args) != 1: | ||
178 | logging.error("Wrong number of arguments, exiting\n") | ||
179 | parser.print_help() | ||
180 | sys.exit(1) | ||
181 | |||
182 | yocto_kernel_feature_list(scripts_path, args[0]) | ||
183 | |||
184 | |||
185 | def yocto_kernel_feature_add_subcommand(args, usage_str): | ||
186 | """ | ||
187 | Command-line handling for adding the use of kernel features to a | ||
188 | BSP. The real work is done by bsp.kernel.yocto_kernel_feature_add(). | ||
189 | """ | ||
190 | logging.debug("yocto_kernel_feature_add_subcommand") | ||
191 | |||
192 | parser = optparse.OptionParser(usage = usage_str) | ||
193 | |||
194 | (options, args) = parser.parse_args(args) | ||
195 | |||
196 | if len(args) < 2: | ||
197 | logging.error("Wrong number of arguments, exiting\n") | ||
198 | parser.print_help() | ||
199 | sys.exit(1) | ||
200 | |||
201 | machine = args.pop(0) | ||
202 | yocto_kernel_feature_add(scripts_path, machine, args) | ||
203 | |||
204 | |||
205 | def yocto_kernel_feature_rm_subcommand(args, usage_str): | ||
206 | """ | ||
207 | Command-line handling for removing the use of kernel features from | ||
208 | a BSP. The real work is done by bsp.kernel.yocto_kernel_feature_rm(). | ||
209 | """ | ||
210 | logging.debug("yocto_kernel_feature_rm_subcommand") | ||
211 | |||
212 | parser = optparse.OptionParser(usage = usage_str) | ||
213 | |||
214 | (options, args) = parser.parse_args(args) | ||
215 | |||
216 | if len(args) != 1: | ||
217 | logging.error("Wrong number of arguments, exiting\n") | ||
218 | parser.print_help() | ||
219 | sys.exit(1) | ||
220 | |||
221 | yocto_kernel_feature_rm(scripts_path, args[0]) | ||
222 | |||
223 | |||
165 | subcommands = { | 224 | subcommands = { |
166 | "config-list": [yocto_kernel_config_list_subcommand, | 225 | "config-list": [yocto_kernel_config_list_subcommand, |
167 | yocto_kernel_config_list_usage, | 226 | yocto_kernel_config_list_usage, |
@@ -181,6 +240,15 @@ subcommands = { | |||
181 | "patch-rm": [yocto_kernel_patch_rm_subcommand, | 240 | "patch-rm": [yocto_kernel_patch_rm_subcommand, |
182 | yocto_kernel_patch_rm_usage, | 241 | yocto_kernel_patch_rm_usage, |
183 | yocto_kernel_patch_rm_help], | 242 | yocto_kernel_patch_rm_help], |
243 | "feature-list": [yocto_kernel_feature_list_subcommand, | ||
244 | yocto_kernel_feature_list_usage, | ||
245 | yocto_kernel_feature_list_help], | ||
246 | "feature-add": [yocto_kernel_feature_add_subcommand, | ||
247 | yocto_kernel_feature_add_usage, | ||
248 | yocto_kernel_feature_add_help], | ||
249 | "feature-rm": [yocto_kernel_feature_rm_subcommand, | ||
250 | yocto_kernel_feature_rm_usage, | ||
251 | yocto_kernel_feature_rm_help], | ||
184 | } | 252 | } |
185 | 253 | ||
186 | 254 | ||
@@ -212,7 +280,8 @@ def main(): | |||
212 | else: | 280 | else: |
213 | sc = 0 | 281 | sc = 0 |
214 | 282 | ||
215 | if args[sc] == "config" or args[sc] == "patch": | 283 | if args[sc] == "config" or args[sc] == "patch" or \ |
284 | args[sc] == "feature": | ||
216 | if len(args) < 2 + sc: | 285 | if len(args) < 2 + sc: |
217 | parser.print_help() | 286 | parser.print_help() |
218 | sys.exit(1) | 287 | sys.exit(1) |