summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Zanussi <tom.zanussi@intel.com>2013-01-18 12:27:12 -0600
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-01-20 13:05:39 +0000
commit1ca4b36445a5471e9d12ee50708946df9f6baf52 (patch)
tree6f6194bf56f71476fb608ce2332332b63a4bf61e
parent7b0026ea1250b170ac70e1212d12bb86698e79e9 (diff)
downloadpoky-1ca4b36445a5471e9d12ee50708946df9f6baf52.tar.gz
yocto-layer: add optional layer priority param
If the user specifies a layer priority following the layer name, layer creation will proceed without further queries using the specified layer priority and the remaining values defaulted. (From meta-yocto rev: 84a0bd8940f82fb938972d7b026367d40c9472e7) Signed-off-by: Tom Zanussi <tom.zanussi@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--scripts/lib/bsp/help.py14
-rwxr-xr-xscripts/yocto-layer9
2 files changed, 19 insertions, 4 deletions
diff --git a/scripts/lib/bsp/help.py b/scripts/lib/bsp/help.py
index eac172af19..346bf0f2bd 100644
--- a/scripts/lib/bsp/help.py
+++ b/scripts/lib/bsp/help.py
@@ -622,7 +622,8 @@ yocto_layer_create_usage = """
622 622
623 Create a new generic Yocto layer 623 Create a new generic Yocto layer
624 624
625 usage: yocto-layer create <layer-name> [-o <DIRNAME> | --outdir <DIRNAME>] 625 usage: yocto-layer create <layer-name> [layer_priority]
626 [-o <DIRNAME> | --outdir <DIRNAME>]
626 [-i <JSON PROPERTY FILE> | --infile <JSON PROPERTY_FILE>] 627 [-i <JSON PROPERTY FILE> | --infile <JSON PROPERTY_FILE>]
627 628
628 This command creates a generic Yocto layer based on the specified 629 This command creates a generic Yocto layer based on the specified
@@ -631,6 +632,10 @@ yocto_layer_create_usage = """
631 'meta-layer-name'. The -o option can be used to place the layer in a 632 'meta-layer-name'. The -o option can be used to place the layer in a
632 directory with a different name and location. 633 directory with a different name and location.
633 634
635 If layer_priority is specified, a simple layer will be created using
636 the given layer priority, and the user will not be prompted for
637 further input.
638
634 NOTE: Once created, you should add your new layer to your 639 NOTE: Once created, you should add your new layer to your
635 bblayers.conf file in order for it to be subsequently seen and 640 bblayers.conf file in order for it to be subsequently seen and
636 modified by the yocto-kernel tool. Instructions for doing this can 641 modified by the yocto-kernel tool. Instructions for doing this can
@@ -646,7 +651,8 @@ NAME
646 yocto-layer create - Create a new generic Yocto layer 651 yocto-layer create - Create a new generic Yocto layer
647 652
648SYNOPSIS 653SYNOPSIS
649 yocto-layer create <layer-name> [-o <DIRNAME> | --outdir <DIRNAME>] 654 yocto-layer create <layer-name> [layer_priority]
655 [-o <DIRNAME> | --outdir <DIRNAME>]
650 [-i <JSON PROPERTY FILE> | --infile <JSON PROPERTY_FILE>] 656 [-i <JSON PROPERTY FILE> | --infile <JSON PROPERTY_FILE>]
651 657
652DESCRIPTION 658DESCRIPTION
@@ -656,6 +662,10 @@ DESCRIPTION
656 'meta-layer-name'. The -o option can be used to place the layer 662 'meta-layer-name'. The -o option can be used to place the layer
657 in a directory with a different name and location. 663 in a directory with a different name and location.
658 664
665 If layer_priority is specified, a simple layer will be created
666 using the given layer priority, and the user will not be prompted
667 for further input.
668
659 The layer-specific properties that define the values that will be 669 The layer-specific properties that define the values that will be
660 used to generate the layer can be specified on the command-line 670 used to generate the layer can be specified on the command-line
661 using the -i option and supplying a JSON object consisting of the 671 using the -i option and supplying a JSON object consisting of the
diff --git a/scripts/yocto-layer b/scripts/yocto-layer
index f75927552e..53d2aabd3f 100755
--- a/scripts/yocto-layer
+++ b/scripts/yocto-layer
@@ -60,19 +60,24 @@ def yocto_layer_create_subcommand(args, usage_str):
60 default = False, help = "dump the generated code to layergen.out") 60 default = False, help = "dump the generated code to layergen.out")
61 (options, args) = parser.parse_args(args) 61 (options, args) = parser.parse_args(args)
62 62
63 if len(args) != 1: 63 if len(args) < 1 or len(args) > 2:
64 logging.error("Wrong number of arguments, exiting\n") 64 logging.error("Wrong number of arguments, exiting\n")
65 parser.print_help() 65 parser.print_help()
66 sys.exit(1) 66 sys.exit(1)
67 67
68 layer_name = args[0] 68 layer_name = args[0]
69 properties = ""
70
71 if len(args) == 2:
72 layer_priority = args[1]
73 properties = '{"layer_priority":"' + layer_priority + '"}'
69 74
70 if options.outdir: 75 if options.outdir:
71 layer_output_dir = options.outdir 76 layer_output_dir = options.outdir
72 else: 77 else:
73 layer_output_dir = "meta-" + layer_name 78 layer_output_dir = "meta-" + layer_name
74 79
75 yocto_layer_create(layer_name, scripts_path, layer_output_dir, options.codedump, options.properties_file) 80 yocto_layer_create(layer_name, scripts_path, layer_output_dir, options.codedump, options.properties_file, properties)
76 81
77 82
78def yocto_layer_list_subcommand(args, usage_str): 83def yocto_layer_list_subcommand(args, usage_str):