mirror of
https://git.yoctoproject.org/poky
synced 2026-04-18 21:32:12 +02:00
bitbake-bblayers/create: Add optional layerid argument
This commit adds an optional layerid argument which can be passed to the bitbake-layers create-layer command. This allows for creation of a layer with a layer id different to that of the layer's name. The default behaviour of the command where the layer's id is set to the layer's name is still retained. (From OE-Core rev: 8f896bd9b34f19535838757c8f3049bae438e4fe) Signed-off-by: Charlie Davies <charles.davies@whitetree.xyz> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
b7d1f361ff
commit
27d0fcddd1
@@ -35,6 +35,7 @@ class CreatePlugin(LayerPlugin):
|
||||
bb.utils.mkdirhier(conf)
|
||||
|
||||
layername = os.path.basename(os.path.normpath(args.layerdir))
|
||||
layerid = args.layerid if args.layerid is not None else layername
|
||||
|
||||
# Create the README from templates/README
|
||||
readme_template = read_template('README').format(layername=layername)
|
||||
@@ -54,7 +55,7 @@ class CreatePlugin(LayerPlugin):
|
||||
|
||||
# Create the layer.conf from templates/layer.conf
|
||||
layerconf_template = read_template('layer.conf').format(
|
||||
layername=layername, priority=args.priority, compat=compat)
|
||||
layerid=layerid, priority=args.priority, compat=compat)
|
||||
layerconf = os.path.join(conf, 'layer.conf')
|
||||
with open(layerconf, 'w') as fd:
|
||||
fd.write(layerconf_template)
|
||||
@@ -71,6 +72,7 @@ class CreatePlugin(LayerPlugin):
|
||||
def register_commands(self, sp):
|
||||
parser_create_layer = self.add_command(sp, 'create-layer', self.do_create_layer, parserecipes=False)
|
||||
parser_create_layer.add_argument('layerdir', help='Layer directory to create')
|
||||
parser_create_layer.add_argument('--layerid', '-i', help='Layer id to use if different from layername')
|
||||
parser_create_layer.add_argument('--priority', '-p', default=6, help='Priority of recipes in layer')
|
||||
parser_create_layer.add_argument('--example-recipe-name', '-e', dest='examplerecipe', default='example', help='Filename of the example recipe')
|
||||
parser_create_layer.add_argument('--example-recipe-version', '-v', dest='version', default='0.1', help='Version number for the example recipe')
|
||||
|
||||
@@ -5,9 +5,9 @@ BBPATH .= ":${{LAYERDIR}}"
|
||||
BBFILES += "${{LAYERDIR}}/recipes-*/*/*.bb \
|
||||
${{LAYERDIR}}/recipes-*/*/*.bbappend"
|
||||
|
||||
BBFILE_COLLECTIONS += "{layername}"
|
||||
BBFILE_PATTERN_{layername} = "^${{LAYERDIR}}/"
|
||||
BBFILE_PRIORITY_{layername} = "{priority}"
|
||||
BBFILE_COLLECTIONS += "{layerid}"
|
||||
BBFILE_PATTERN_{layerid} = "^${{LAYERDIR}}/"
|
||||
BBFILE_PRIORITY_{layerid} = "{priority}"
|
||||
|
||||
LAYERDEPENDS_{layername} = "core"
|
||||
LAYERSERIES_COMPAT_{layername} = "{compat}"
|
||||
LAYERDEPENDS_{layerid} = "core"
|
||||
LAYERSERIES_COMPAT_{layerid} = "{compat}"
|
||||
|
||||
Reference in New Issue
Block a user