From patchwork Mon Nov 30 15:26:59 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Purdie X-Patchwork-Id: 106507 Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.34558.1796052443694827284 for ; Mon, 30 Nov 2026 07:27:24 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=fecmQ7+P; spf=pass (domain: linuxfoundation.org, ip: 209.85.128.44, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-4bb70074ab2so112506525e9.0 for ; Mon, 30 Nov 2026 07:27:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1796052442; x=1796657242; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to:content-type; bh=xCq6H1+czFB0c4sNFDf5JnIKa1uuCN8U7g+xQmgY0Bw=; b=fecmQ7+PpaSBZz79p+9d4fNYvZwkzb4W0jmiFnI0dnGq0OtFpbDXR5P3o0rYPnrEEB ZeiVX+idreZcQWk0R3S9p3Ac2z5+aMqunUPBiYVU528fIU76JVleAU395Lgv2ReeowAZ Nh4ZvYiqho0iQLrYm5BaAUp1CRKpgbpClUJa8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796052442; x=1796657242; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to:content-type; bh=xCq6H1+czFB0c4sNFDf5JnIKa1uuCN8U7g+xQmgY0Bw=; b=JkYFMWISIQ6420HG2koOX8WIKlWwqo4A6uMEcayfE+waqKf0Ud5ycHvPfATOzko97y 7ptV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meYZqf1wPg== X-Received: by 2002:a05:600c:8b11:b0:4bb:6871:8f21 with SMTP id 5b1f17b1804b1-4bb88822346mr697687375e9.23.1796052441832; Mon, 30 Nov 2026 07:27:21 -0800 (PST) Return-Path: Received: from max.int.rpsys.net ([2001:8b0:aba:5f3c:2444:81bb:2aff:8d84]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4bb8538b09bsm1704014155e9.4.2026.11.30.07.27.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Nov 2026 07:27:20 -0800 (PST) From: Richard Purdie To: openembedded-core@lists.openembedded.org Subject: [PATCH 11/16] bitbake-layers: Update to match new layer format Date: Mon, 30 Nov 2026 15:26:59 +0000 Message-ID: <20261130152704.3471590-11-richard.purdie@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20261130152704.3471590-1-richard.purdie@linuxfoundation.org> References: <20261130152704.3471590-1-richard.purdie@linuxfoundation.org> MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by lin-tor-korg-lkml-alma10-1 with HTTPS for ; Mon, 30 Nov 2026 15:27:31 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/251620 Update to match the new layer format, updating the template, using layername as the command parameter instead of layerid (which remains an alias) and droping the priority options. The selftest is updated to match. AI-Generated: Uses Claude Opus 5.5 Signed-off-by: Richard Purdie --- meta/lib/bblayers/create.py | 11 +++++------ meta/lib/bblayers/templates/layer.conf | 17 ++++++----------- meta/lib/oeqa/selftest/cases/bblayers.py | 17 +++-------------- 3 files changed, 14 insertions(+), 31 deletions(-) diff --git a/meta/lib/bblayers/create.py b/meta/lib/bblayers/create.py index b38c4b5e38a..5128611b707 100644 --- a/meta/lib/bblayers/create.py +++ b/meta/lib/bblayers/create.py @@ -37,11 +37,11 @@ class CreatePlugin(LayerPlugin): conf = os.path.join(layerdir, 'conf') bb.utils.mkdirhier(conf) - layername = os.path.basename(os.path.normpath(args.layerdir)) - layerid = args.layerid if args.layerid is not None else layername + layerdirname = os.path.basename(os.path.normpath(args.layerdir)) + layername = args.layername if args.layername is not None else layerdirname # Create the README from templates/README - readme_template = read_template('README').format(layername=layername) + readme_template = read_template('README').format(layername=layerdirname) readme = os.path.join(layerdir, 'README') with open(readme, 'w') as fd: fd.write(readme_template) @@ -58,7 +58,7 @@ class CreatePlugin(LayerPlugin): # Create the layer.conf from templates/layer.conf layerconf_template = read_template('layer.conf').format( - layerid=layerid, priority=args.priority, compat=compat) + layername=layername, compat=compat) layerconf = os.path.join(conf, 'layer.conf') with open(layerconf, 'w') as fd: fd.write(layerconf_template) @@ -83,8 +83,7 @@ class CreatePlugin(LayerPlugin): 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('--add-layer', '-a', action='store_true', help='Add the layer to bblayers.conf after creation') - parser_create_layer.add_argument('--layerid', '-i', help='Layer ID to use in BBFILE_COLLECTIONS, if different from the layerdir basename') - parser_create_layer.add_argument('--priority', '-p', default=6, help='Priority of recipes in layer') + parser_create_layer.add_argument('--layername', '--layerid', '-i', dest='layername', help='Layer name to use for LAYERNAME, if different from the layerdir basename') 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') diff --git a/meta/lib/bblayers/templates/layer.conf b/meta/lib/bblayers/templates/layer.conf index dddfbf716e0..557d498c85d 100644 --- a/meta/lib/bblayers/templates/layer.conf +++ b/meta/lib/bblayers/templates/layer.conf @@ -1,13 +1,8 @@ -# We have a conf and classes directory, add to BBPATH -BBPATH .= ":${{LAYERDIR}}" +# BBPATH and BBFILES are constructed automatically by bitbake. Recipes and +# bbappends in any recipes* directory within this layer are found automatically. -# We have recipes-* directories, add to BBFILES -BBFILES += "${{LAYERDIR}}/recipes-*/*/*.bb \ - ${{LAYERDIR}}/recipes-*/*/*.bbappend" +LAYERNAME = "{layername}" +LAYERVERSION = "1" -BBFILE_COLLECTIONS += "{layerid}" -BBFILE_PATTERN_{layerid} = "^${{LAYERDIR}}/" -BBFILE_PRIORITY_{layerid} = "{priority}" - -LAYERDEPENDS_{layerid} = "core" -LAYERSERIES_COMPAT_{layerid} = "{compat}" +LAYERDEPENDS = "oe-core" +LAYERSERIES_COMPAT = "{compat}" diff --git a/meta/lib/oeqa/selftest/cases/bblayers.py b/meta/lib/oeqa/selftest/cases/bblayers.py index 7ca82e0d5c0..b83ae6283df 100644 --- a/meta/lib/oeqa/selftest/cases/bblayers.py +++ b/meta/lib/oeqa/selftest/cases/bblayers.py @@ -102,29 +102,18 @@ class BitbakeLayers(OESelftestTestCase): self.assertIn('ERROR:', result.output) def test_bitbakelayers_createlayer(self): - priority = 10 layername = 'test-bitbakelayer-layercreate' layerpath = os.path.join(self.builddir, layername) self.assertFalse(os.path.exists(layerpath), '%s should not exist at this point in time' % layerpath) - result = runCmd('bitbake-layers create-layer --priority=%d %s' % (priority, layerpath)) + result = runCmd('bitbake-layers create-layer %s' % layerpath) self.track_for_cleanup(layerpath) result = runCmd('bitbake-layers add-layer %s' % layerpath) self.add_command_to_tearDown('bitbake-layers remove-layer %s' % layerpath) result = runCmd('bitbake-layers show-layers') - find_in_contents = re.search(re.escape(layername) + r'\s+' + re.escape(layerpath) + r'\s+' + re.escape(str(priority)), result.output) + find_in_contents = re.search(re.escape(layername) + r'\s+' + re.escape(layerpath) + r'\s+1\s+oe-core', result.output) self.assertTrue(find_in_contents, "%s not found in layers\n%s" % (layername, result.output)) - layervars = ['BBFILE_PRIORITY', 'BBFILE_PATTERN', 'LAYERDEPENDS', 'LAYERSERIES_COMPAT'] - bb_vars = get_bb_vars(['BBFILE_COLLECTIONS'] + ['%s_%s' % (v, layername) for v in layervars]) - - for v in layervars: - varname = '%s_%s' % (v, layername) - self.assertIsNotNone(bb_vars[varname], "%s not found" % varname) - - find_in_contents = re.search(r'(^|\s)' + re.escape(layername) + r'($|\s)', bb_vars['BBFILE_COLLECTIONS']) - self.assertTrue(find_in_contents, "%s not in BBFILE_COLLECTIONS" % layername) - - self.assertEqual(bb_vars['BBFILE_PRIORITY_%s' % layername], str(priority), 'BBFILE_PRIORITY_%s != %d' % (layername, priority)) + self.assertEqual(get_bb_var('LAYERDIR_%s' % layername), layerpath, 'LAYERDIR_%s not set to %s' % (layername, layerpath)) result = runCmd('bitbake-layers save-build-conf {} {}'.format(layerpath, "buildconf-1")) for f in ('local.conf.sample', 'bblayers.conf.sample', 'conf-summary.txt', 'conf-notes.txt'):