From patchwork Wed Nov 19 12:48:30 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Kanavin X-Patchwork-Id: 74960 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id F023FCF34AA for ; Wed, 19 Nov 2025 12:48:46 +0000 (UTC) Received: from mail-wr1-f54.google.com (mail-wr1-f54.google.com [209.85.221.54]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.6082.1763556519226737295 for ; Wed, 19 Nov 2025 04:48:39 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Ise6iKeq; spf=pass (domain: gmail.com, ip: 209.85.221.54, mailfrom: alex.kanavin@gmail.com) Received: by mail-wr1-f54.google.com with SMTP id ffacd0b85a97d-429ce7e79f8so4651943f8f.0 for ; Wed, 19 Nov 2025 04:48:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1763556517; x=1764161317; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=ZwT85iqWOOT/NJOLHany4M5pCkoglgquUmc2kVdDHNY=; b=Ise6iKeqU9iLs+DzFQgglUh0OM79UsewU7CSUyOzcKGvocH7EyTIa4bUcu0h7FZGYq p+ysfrJCSevi/Fw4vGSldgIXYqCgbEmG9hSuXCqOH8pYC6Z2qGZH86UQkxDIu8QAMP01 khYGaIGd7V3ba2jp+/n4U7up1mdZUEqTiCs9QLr9y08h82apKoxp+1Nku8+nOCH7IeyQ EFVRLbsElmVz4n4pUdULgv7zd+hvWpJC9qwGe5Z/auLSi0bYvTw/USuoKR1rMfkDSK3H 1Uyac8pb2gyQ7eFiyuneECaFfB+ontH6Di+1mTP5ch6xJRxG1PPMwts/7sZBljLKSNkp NmXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763556517; x=1764161317; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=ZwT85iqWOOT/NJOLHany4M5pCkoglgquUmc2kVdDHNY=; b=TfZQeUxhIv+tE+rL2k8aG7AVGPJBqxR0x5T0VLz9apGAO0v8XLTQA7J5WNYL8intVf weoBG/EANGGCm6Ff/QtMOs9n+bBraye0VJLEZMQeLEGPpg1TGqD1akj6/2ySDv3hs5h3 rOf3NLn+ERtxELhOUUSN2WJdL59V8KfjlglcDumQBAcHmlsyRUi7iE7glEObq59XZv4D XFlO4mJQOVGm9h/L8YusvrLKTL5EbSbLWX7CUWPLyC0uG4kjZgyT94/WOnBTvwaThqVE CST5+qKBYetyHAWvm59L/fs+fG/QpigfcuiHvW140VFLLAOt0ukMVmq4OOZL9vVtm2Vn Bl8g== X-Gm-Message-State: AOJu0YwQ3GXyZKSUJ5GucNbK9iTzof6bOhygvYjWBTQ6XIWue6Icz1EX 2Di09OExaBCm6/CRkQaj7wvyDYloGbjpSWkh4XPK566vRSeHjKuo4tlf64mAOw== X-Gm-Gg: ASbGncvF7PDGiGWufEu8f2LhoLcz8X2gP/7ONaHUj/M2z/J//h/jtm+7NLRWroZsMBx aR8ao15rgkb8zAlpgq8Frtjf3IsLAw2VxP7qBQBRYGESblCXUFO7OdAGQMNBWpwg5MJUUcN9GgS 061BvCSehUUfUuEp6X0q8ax2cUciymrw5f9U6oxNPwA0cN3G2y3Hii9FFRmsTUfQ8tNGsdnImrH ZYkD/I7iUYNcHoxHe8bZsQNQIH6yz+LXZ3qXJcMMwIV1jTnUTv173HLYP313zKFTtZSfUGE7zSI B4o1WhLT9p7gnhJdVQsScQiKnRYOmM8rqR15K0gk4nwRAgx9MI3dXq8b4HsMvkkU9lZ5mLM1zL/ n+xnyqRD3yUrL+4+Sk2fSWhIXkXdF35+uUch5fept/WlpCsS/9dtk36ultS6hWSh6nnyPixlbdR DdkeopQZ7/J8omUnivJMbQENnfc4/vlNOKl5nuvf5KfCIhv7I= X-Google-Smtp-Source: AGHT+IG2tx85v2BEYCV346rOrbXHiSABpRwt+HFu5eViZnKleS2XxhsfLW2N0TngK5WQxe7J7JaAhQ== X-Received: by 2002:a05:6000:2909:b0:429:d66b:507f with SMTP id ffacd0b85a97d-42b5939111dmr20430720f8f.48.1763556517318; Wed, 19 Nov 2025 04:48:37 -0800 (PST) Received: from Zen2.lab.linutronix.de. (drugstore.linutronix.de. [80.153.143.164]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-42b53e846afsm36953267f8f.13.2025.11.19.04.48.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Nov 2025 04:48:36 -0800 (PST) From: Alexander Kanavin To: bitbake-devel@lists.openembedded.org Cc: "Joshua Watt via lists.openembedded.org" , Joshua Watt , Alexander Kanavin Subject: [PATCH 1/3] bitbake-setup: Tell the user what to do if they don't like the top dir Date: Wed, 19 Nov 2025 13:48:30 +0100 Message-Id: <20251119124832.3906214-1-alex.kanavin@gmail.com> X-Mailer: git-send-email 2.39.5 MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 19 Nov 2025 12:48:46 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/18455 From: "Joshua Watt via lists.openembedded.org" If the top level directory look new (e.g. doesn't contain a site.conf file), then instruct the user on how to choose a different directory if they desire. This should help clarify what bitbake-setup is about to do and how to change it if desired. Signed-off-by: Joshua Watt Changed the wording and order of the two possibilities: changing the settings comes first. Signed-off-by: Alexander Kanavin --- bin/bitbake-setup | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/bin/bitbake-setup b/bin/bitbake-setup index ca0517924..cbcd637b2 100755 --- a/bin/bitbake-setup +++ b/bin/bitbake-setup @@ -697,7 +697,16 @@ def create_siteconf(top_dir, non_interactive, settings): if os.path.exists(siteconfpath): print('A site.conf file already exists. Please remove it if you would like to replace it with a default one') else: - print('A common site.conf file will be created, please edit or replace before running builds\n {}\n'.format(siteconfpath)) + print(f'{top_dir} looks like a new top directory. If you would like to use a different directory, answer "n" below and either:') + print('\t1) Change the default bitbake-setup settings:') + print('\t\tbitbake-setup settings set default top-level-prefix ') + print('\t\tbitbake-setup settings set default top-level-name ') + print('\t2) Pass one or more options on the command line to change the top level directory in that invocation only:') + print('\t\tbitbake-setup --setting default top-dir-prefix ...') + print('\t\tbitbake-setup --setting default top-dir-name ...') + print() + + print('A common site.conf file will be created, please check it is correct before running builds\n {}\n'.format(siteconfpath)) if not non_interactive: y_or_n = input('Proceed? (y/N): ') if y_or_n != 'y': @@ -947,7 +956,7 @@ def main(): settings_func(top_dir, all_settings, args) return - print('Bitbake-setup is using {} as top directory ("bitbake-setup settings --help" shows how to change it).\n'.format(top_dir, global_settings_path(args))) + print('Bitbake-setup is using {} as top directory.\n'.format(top_dir, global_settings_path(args))) if args.func == init_config: init_config(top_dir, all_settings, args) From patchwork Wed Nov 19 12:48:31 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Kanavin X-Patchwork-Id: 74961 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id F01EECF34A9 for ; Wed, 19 Nov 2025 12:48:46 +0000 (UTC) Received: from mail-wr1-f53.google.com (mail-wr1-f53.google.com [209.85.221.53]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.6073.1763556520175196145 for ; Wed, 19 Nov 2025 04:48:40 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=HmHnnDEh; spf=pass (domain: gmail.com, ip: 209.85.221.53, mailfrom: alex.kanavin@gmail.com) Received: by mail-wr1-f53.google.com with SMTP id ffacd0b85a97d-42b3720e58eso6118406f8f.3 for ; Wed, 19 Nov 2025 04:48:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1763556518; x=1764161318; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=KTvNz0gGmBNOD5YZkVjkViZdra37V5neDdFmAT15jVk=; b=HmHnnDEhWsfgogBcwnPI1thVRfYTymXoL1aZc8aU2V7WzkDFObUzJJIbz1B1MAMkqj ln56XGfZSqhoQx70bDvtQTuCiOmaja/rQftmD6M/LMBRc0ccEF6qehxlMnJgs+A0Ai4P Qe7P5FRPRWcQBmJhZ9dDFCpzj118VUwfK57URbChuhirImsrNxNJ9Z7jXkMHfKHSqPb4 ir9eSaoXnhTfImjgSlMSriu0mrwwSIBmH//H23AulAiRZacO7cIEmLRcpfxCLByMok+I aH3n5ZMhf7qpd3MLXVX1CLapUT1MWOCVCVtH2W3rp4cV9hmpCPQEdxnL7iinNfPRmuOQ AgYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763556518; x=1764161318; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=KTvNz0gGmBNOD5YZkVjkViZdra37V5neDdFmAT15jVk=; b=vQ7icWLy0pVkCiZ21ciyYsh6g9ayHLkXF4xXxBlpXGjbPYgHhpFlzKdeoSLs/uPcyn JaEtINEkAXkWcBYa4qTYczdjF6t71pGV3JQ/c0xKw7Y6DNjcs3y1IVO7Ymy/V55sqRoN fVytKiTXmlXN/4OEtSS5BRqLnSr+eIaxjyXj/3l1uwMwi+EWOsOL8KwlnXAeeVihu3W6 bY6VqChUVw3fcIJSwijTFyMK8mYBGX1CzXuBCbuY1M6mUmm7M1HqmGmasWQ8xpATF/ai /w6c3VICgpcaNLnFtnQekm3OczJzSrRkqz08lC5JQO+MFq3e1FHDkSdnAM2Nlte87w37 fSqA== X-Gm-Message-State: AOJu0YxpipTxj+jW97cx+F7MpWPHesn0hPTfW0FnKKh0nUaUmqaMoAZ1 srfu2G5fkOxEMxuqkdYawJ5cBvIm4ahpUmvJJU82yiKY7TMz8+nCq/Ht2pwFQw== X-Gm-Gg: ASbGncvIOj42951uYCkvrM2B9QoXCddVxvi3IfVeyTR/KPVoAGHRpcjwKGVYCsBM9JT OBANu5MSB8NbmiQrxRZHVG2F1KYvPu+hDWMQwt/rdpJhw8W0LffD4dMFBqBu6MOnNL1gOYr5XmO OEoAT0kCAwMxutYdJci3kdCW65YlRane1P53UioVwm1/w9IiUH2nXLbMWZ+hK+lZd2Du0sX4Jfc eZDzBBTlIPAmdyVVWigt2sIRc37aPmEKgI1b4rpryXbhV++9wzg69Tts75WIREWQ7mzz30yX86D kPeKQxyOxwtaZ5s9InWnCydH8wgqAHaei+sWZpB4sabcyAWM8PBMfyAk7oG9btaxd/5OybP2Or1 9NioZtUbWde18bo7dXX9uS2zw9HEO7UU8uXKxDyu8ZKmoB5hf/G3+SohoYmrWzsJ6DZeu82v7N/ W1iKo8fUkUvuTQ834A0/AArrheKxvD/5uRUwoRvk44H6xGUOJwxuJngIDL1A== X-Google-Smtp-Source: AGHT+IFFmbGDnri9jf8h6ao1axEI5SpC3UsPYFZw8w7bAiy61OxQUyIbk3Hy2e+GFABZQFFl1FdGmg== X-Received: by 2002:a05:6000:3110:b0:42b:394a:9e3 with SMTP id ffacd0b85a97d-42b593821d8mr17838607f8f.38.1763556518346; Wed, 19 Nov 2025 04:48:38 -0800 (PST) Received: from Zen2.lab.linutronix.de. (drugstore.linutronix.de. [80.153.143.164]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-42b53e846afsm36953267f8f.13.2025.11.19.04.48.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Nov 2025 04:48:37 -0800 (PST) From: Alexander Kanavin To: bitbake-devel@lists.openembedded.org Cc: "Joshua Watt via lists.openembedded.org" , Joshua Watt , Alexander Kanavin Subject: [PATCH 2/3] bitbake-setup: Allow setup-dir-name to be specified in JSON (and use that in the default registry) Date: Wed, 19 Nov 2025 13:48:31 +0100 Message-Id: <20251119124832.3906214-2-alex.kanavin@gmail.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20251119124832.3906214-1-alex.kanavin@gmail.com> References: <20251119124832.3906214-1-alex.kanavin@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 19 Nov 2025 12:48:46 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/18456 From: "Joshua Watt via lists.openembedded.org" Enables the JSON file to specify the preferred name of the setup directory with a 'setup-dir-name' key. This key can have variable expansions in the same format as python string.Template strings (which matches the shell variable expansion rules). Variables that can be expanded are any fragment configuration prompted by the user (e.g. the keys in "oe-fragments-one-of"), or "$name" to use the name of the configuration (e.g. the .conf.json file). Signed-off-by: Joshua Watt default-registry: Change default setup dir Uses the template mechanism to provide shorter setup-dir names by default. Specifically, the machine names are no longer part of the setup path since they are intended to be changed without needing a new setup directory. Signed-off-by: Joshua Watt Further tweaks by Alex: - $name support is not actually implemented (as far as I see) - add fallbacks to the full name if the short name already exists in the filesystem or there's a setting that forces full names - add documentation for the setup dir entry in configs and the setting to ignore it - adjust the schema - adjust the selftest to include the feature and test for it Signed-off-by: Alexander Kanavin --- bin/bitbake-setup | 16 ++++++++ .../configurations/oe-nodistro.conf.json | 1 + .../configurations/poky-master.conf.json | 1 + .../bitbake-user-manual-environment-setup.rst | 39 +++++++++++++++++++ lib/bb/tests/setup.py | 15 ++++--- setup-schema/bitbake-setup.schema.json | 4 ++ 6 files changed, 71 insertions(+), 5 deletions(-) diff --git a/bin/bitbake-setup b/bin/bitbake-setup index cbcd637b2..b331eac53 100755 --- a/bin/bitbake-setup +++ b/bin/bitbake-setup @@ -19,6 +19,7 @@ import copy import textwrap import signal import functools +import string default_registry = os.path.normpath(os.path.dirname(__file__) + "/../default-registry") @@ -492,6 +493,20 @@ def init_config(top_dir, settings, args): setup_dir_name = args.setup_dir_name else: setup_dir_name = "{}-{}".format(upstream_config['name']," ".join(upstream_config['non-interactive-cmdline-options'][1:]).replace(" ","-").replace("/","_")) + if 'setup-dir-name' in upstream_config['bitbake-config']: + mapping = { + k: v.replace(" ", "-").replace("/", "_") + for k, v in upstream_config['bitbake-config']['oe-fragment-choices'].items() + } + config_setup_dir_name = string.Template(upstream_config['bitbake-config']['setup-dir-name']).substitute(mapping) + config_setup_dir = os.path.join(top_dir, config_setup_dir_name) + if os.path.exists(config_setup_dir): + print("Setup directory {} (as suggested by configuration) already exists, using the full name instead.\n".format(config_setup_dir)) + elif settings['default']['use-full-setup-dir-name'] != 'no': + print("Using the full setup directory name instead of {} suggested by configuration, as set in the settings.\n".format(config_setup_dir)) + else: + setup_dir_name = config_setup_dir_name + if not args.non_interactive: n = input(f"Enter setup directory name: [{setup_dir_name}] ") if n: @@ -935,6 +950,7 @@ def main(): 'top-dir-prefix':os.getcwd(), 'top-dir-name':'bitbake-builds', 'registry':default_registry, + 'use-full-setup-dir-name':'no', } global_settings = load_settings(global_settings_path(args)) diff --git a/default-registry/configurations/oe-nodistro.conf.json b/default-registry/configurations/oe-nodistro.conf.json index 9cd11a218..70ae6d364 100644 --- a/default-registry/configurations/oe-nodistro.conf.json +++ b/default-registry/configurations/oe-nodistro.conf.json @@ -40,6 +40,7 @@ { "name": "nodistro", "description": "OpenEmbedded 'nodistro'", + "setup-dir-name": "oe-nodistro", "bb-layers": ["openembedded-core/meta"], "oe-fragments-one-of": { "machine": { diff --git a/default-registry/configurations/poky-master.conf.json b/default-registry/configurations/poky-master.conf.json index 9b63ea5f0..81e0e47f0 100644 --- a/default-registry/configurations/poky-master.conf.json +++ b/default-registry/configurations/poky-master.conf.json @@ -50,6 +50,7 @@ "configurations": [ { "bb-layers": ["openembedded-core/meta","meta-yocto/meta-yocto-bsp","meta-yocto/meta-poky"], + "setup-dir-name": "poky-master-$distro", "oe-fragments-one-of": { "machine": { "description": "Target machines", diff --git a/doc/bitbake-user-manual/bitbake-user-manual-environment-setup.rst b/doc/bitbake-user-manual/bitbake-user-manual-environment-setup.rst index dd8d08877..8a90e33e8 100644 --- a/doc/bitbake-user-manual/bitbake-user-manual-environment-setup.rst +++ b/doc/bitbake-user-manual/bitbake-user-manual-environment-setup.rst @@ -504,6 +504,7 @@ A valid settings file would for example be: top-dir-name = bitbake-builds registry = /path/to/bitbake/default-registry dl-dir = /path/to/bitbake-setup-downloads + use-full-setup-dir-name = yes Settings and their values can be listed and modified with the ``bitbake-setup settings`` command. See the :ref:`ref-bbsetup-command-settings` section for @@ -597,6 +598,17 @@ BitBake builds, so that there is a single directory containing a copy of everything needed to set up and run a BitBake build offline in a reproducible manner. +.. _ref-bbsetup-setting-use-full-setup-dir-name: + +``use-full-setup-dir-name`` +--------------------------- + +The :ref:`ref-bbsetup-setting-use-full-setup-dir-name` setting, if set to ``yes`` +will override the suggestions for the :term:`Setup` directory name made by +``setup-dir-name`` entries in :term:`Generic Configuration` files. This +will make the directory names longer, but fully specific: they will contain +all selections made during initialization. + .. _ref-bbsetup-section-config-reference: Generic Configuration Files Reference @@ -802,6 +814,33 @@ They contain the following sections: See https://docs.yoctoproject.org/dev/ref-manual/fragments.html for more information of OpenEmbedded configuration fragments. + - ``setup-dir-name`` (*optional*): a suggestion for the :term:`Setup` + directory name. Bitbake-setup will use it, unless it already exists, or + the :ref:`ref-bbsetup-setting-use-full-setup-dir-name` setting is set + to ``yes`` (in those cases, it will fall back to the built-in full name, + containing the full set of choices made during initialization). + + This key can have variable expansions in the same format as python + string.Template strings (which matches the shell variable expansion rules): + https://docs.python.org/3/library/string.html#template-strings-strings . + + Variables that can be expanded are any fragment configuration prompted + by the user (e.g. the keys in "oe-fragments-one-of"):: + + { + ... + "oe-fragments-one-of": { + "machine": { + "description": "Target machines", + "options" : ["machine/gadget", "machine/gizmo"] + } + }, + "setup-dir-name": "somebuild-$machine" + ... + } + + would expand to ``somebuild-machine_gadget``. + Generic Configuration Examples ------------------------------ diff --git a/lib/bb/tests/setup.py b/lib/bb/tests/setup.py index 27b9f288a..8b6d8bce6 100644 --- a/lib/bb/tests/setup.py +++ b/lib/bb/tests/setup.py @@ -118,7 +118,8 @@ print("BBPATH is {{}}".format(os.environ["BBPATH"])) "name": "gizmo", "description": "Gizmo configuration", "oe-template": "test-configuration-gizmo", - "oe-fragments": ["test-fragment-2"] + "oe-fragments": ["test-fragment-2"], + "setup-dir-name": "this-is-a-custom-gizmo-build" }, { "name": "gizmo-env-passthrough", @@ -227,6 +228,10 @@ print("BBPATH is {{}}".format(os.environ["BBPATH"])) self.assertTrue('BUILD_SERVER' in init_build_env) # a more throrough test could be to initialize a bitbake build-env, export FOO to the shell environment, set the env-passthrough on it and finally check against 'bitbake-getvar FOO' + def get_setup_path(self, cf, c): + if c == 'gizmo': + return os.path.join(self.tempdir, 'bitbake-builds', 'this-is-a-custom-gizmo-build') + return os.path.join(self.tempdir, 'bitbake-builds', '{}-{}'.format(cf, c)) def test_setup(self): # unset BBPATH to ensure tests run in isolation from the existing bitbake environment @@ -307,7 +312,7 @@ print("BBPATH is {{}}".format(os.environ["BBPATH"])) for cf, v in test_configurations.items(): for c in v['buildconfigs']: out = self.runbbsetup("init --non-interactive {} {}".format(v['cmdline'], c)) - setuppath = os.path.join(self.tempdir, 'bitbake-builds', '{}-{}'.format(cf, c)) + setuppath = self.get_setup_path(cf, c) self.check_setupdir_files(setuppath, test_file_content) os.environ['BBPATH'] = os.path.join(setuppath, 'build') out = self.runbbsetup("status") @@ -329,7 +334,7 @@ print("BBPATH is {{}}".format(os.environ["BBPATH"])) 'gizmo-env-passthrough', 'gizmo-no-fragment', 'gadget-notemplate', 'gizmo-notemplate'): - setuppath = os.path.join(self.tempdir, 'bitbake-builds', 'test-config-1-{}'.format(c)) + setuppath = self.get_setup_path('test-config-1', c) os.environ['BBPATH'] = os.path.join(setuppath, 'build') out = self.runbbsetup("status") self.assertIn("Layer repository file://{} checked out into {}/layers/test-repo updated revision master from".format(self.testrepopath, setuppath), out[0]) @@ -352,7 +357,7 @@ print("BBPATH is {{}}".format(os.environ["BBPATH"])) 'gizmo-env-passthrough', 'gizmo-no-fragment', 'gadget-notemplate', 'gizmo-notemplate'): - setuppath = os.path.join(self.tempdir, 'bitbake-builds', 'test-config-1-{}'.format(c)) + setuppath = self.get_setup_path('test-config-1', c) os.environ['BBPATH'] = os.path.join(setuppath, 'build') out = self.runbbsetup("status") self.assertIn("Configuration in {} has changed:".format(setuppath), out[0]) @@ -385,7 +390,7 @@ print("BBPATH is {{}}".format(os.environ["BBPATH"])) 'gizmo-env-passthrough', 'gizmo-no-fragment', 'gadget-notemplate', 'gizmo-notemplate'): - setuppath = os.path.join(self.tempdir, 'bitbake-builds', 'test-config-1-{}'.format(c)) + setuppath = self.get_setup_path('test-config-1', c) os.environ['BBPATH'] = os.path.join(setuppath, 'build') # write something in local.conf and bblayers.conf for f in ["local.conf", "bblayers.conf"]: diff --git a/setup-schema/bitbake-setup.schema.json b/setup-schema/bitbake-setup.schema.json index 7030f1d6d..027ba2568 100644 --- a/setup-schema/bitbake-setup.schema.json +++ b/setup-schema/bitbake-setup.schema.json @@ -96,6 +96,10 @@ "items": { "type": "string" } + }, + "setup-dir-name": { + "type": "string", + "description": "A suggestion for the setup directory name, $-prefixed keys from oe-fragments-one-of will be substituted with user selections." } }, "additionalProperties": false From patchwork Wed Nov 19 12:48:32 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Kanavin X-Patchwork-Id: 74962 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 08E0ACF34AC for ; Wed, 19 Nov 2025 12:48:47 +0000 (UTC) Received: from mail-wr1-f53.google.com (mail-wr1-f53.google.com [209.85.221.53]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.6074.1763556520962488486 for ; Wed, 19 Nov 2025 04:48:41 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=WiPfbfo7; spf=pass (domain: gmail.com, ip: 209.85.221.53, mailfrom: alex.kanavin@gmail.com) Received: by mail-wr1-f53.google.com with SMTP id ffacd0b85a97d-429c4c65485so5567087f8f.0 for ; Wed, 19 Nov 2025 04:48:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1763556519; x=1764161319; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=/m8YgXUJ9F/hFZnV2/x//+St4gPipSBHgmLd1/ctBVY=; b=WiPfbfo77T2Xn3w5kbWw4RBMq1+kKAvkLkrOBqAoyGqYKBKAEYvBvZmLcDzaIv5CSV cCHxq+ou1ytAhH9djkyLJJHr7SyfkFL/E5eAPHN93pwRv/5KOgYqssmTGMniFUCH7fqn TQ2YR+VP1IgGXhbcGkntlWBTyr/NblO+CqBjRm6hHZ8oe+TW0Fb7MrZlJl/HtezXeKSc vaUb8Nou6lZ6Vb1Znw/K74OFMLxCcO+NP4r8p0DzAMlqvAk7AQjJxp+BzMabrDy2zKi9 ssfIpvfZa+bq5qVeOKcxDvGIopbgwUSDQg598FC2C5w90axjT2QDcU8TNI3hfHMfoiQ1 2fxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763556519; x=1764161319; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=/m8YgXUJ9F/hFZnV2/x//+St4gPipSBHgmLd1/ctBVY=; b=oP7Ktiz+h+QtkOsIw7rYTdmwWxazV6TFEKWD3N+PKL3F6zdX/tr236hi95fyLWEeHl SMqc2O9ZgTsHXcqgFCdDd8ReOzlxPUHAL/d3c1iyypW3gRO37I6WRoaRiOXDgU2VpvEi zl8OG32gOdNzOLIYg+d0ywJ9MM/CZW1ZfZoHrEVnHKjBvwXmX0nDbTQTYVOq5xJ9cOYJ kbCcfhdDHcq7IB4B3DJ7TT0TPgsXUHyptAXkXXAhj2oFcYr+U4G6dTTJeE1ePOO3O0rW P+ONGprkCYaJ6hu4VBSSqCjIs+/eLMBMF3BcrrByQgE1hGn+lUbPh0nOQMv3dx8iVwEz /dTQ== X-Gm-Message-State: AOJu0Ywd7ccIYNC/9/4TG+l/XIoqX5EmGK11eTvf/tUBd6qyVkrYBd9p 6i90i+b8T/2ogje4JaidC8g/yz4OjY0oV8AcUdaucWtF1STVk2cP5aOy1HpBtA== X-Gm-Gg: ASbGnctEmAePvVyhM8aJZO2thk/aoa0/8fWLp5Wt16U1sp9tQXKlI15tAvoEmtgWHZc 1EmoZiHAFNDPEoS8V9p0/c6XDlmSsoaj7X5Usd1o63bxi5wegS2r7+AGK6Yxjffs4f59j5y+VEl snzdDoXSg9/5yppR5qPJPNlyJHKAMy3V+hLmeNjpAI0l2qWEapZu0dMDNarTMVr3CyElgl27B0v QutK11UG7WDWD2JH4bn0LFK3ah1zpomV+uAQC3sAH4by4BWAaCl74UTvAgpw7Hwi/7ARSSrCekP stV4+mQxpiGUaKvMqHzqXfwPjf8RrauvuISEyG3yW6sq1TvC9Ql1NPadpf4GvcUqW3yPLJ+D5P4 mPhN2HfhBbzg/AWfZUwc7pD3Kh160TfcSTuzvMWUg61LikvZuAYskkh30zc7KQSbjiik9gyvEDq swAXpgoeZNfoA32gUU6bzOkCPIQpKfgvsaGggjISQwcv/U12ZoG8pbn0IC0A== X-Google-Smtp-Source: AGHT+IGPsR126S7aDBf0jrn3oz68CqbvfUL3v57hCoXG8jtCB5OVh5jQYwtm4vqZgQYcyRxnTlq6Bg== X-Received: by 2002:a05:6000:2509:b0:42b:3e0a:649e with SMTP id ffacd0b85a97d-42b59328f9fmr20643126f8f.13.1763556519229; Wed, 19 Nov 2025 04:48:39 -0800 (PST) Received: from Zen2.lab.linutronix.de. (drugstore.linutronix.de. [80.153.143.164]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-42b53e846afsm36953267f8f.13.2025.11.19.04.48.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Nov 2025 04:48:38 -0800 (PST) From: Alexander Kanavin To: bitbake-devel@lists.openembedded.org Cc: Alexander Kanavin Subject: [PATCH 3/3] bitbake-setup: add information about enabling fragments to toolcfg.conf, tool output and written-out README Date: Wed, 19 Nov 2025 13:48:32 +0100 Message-Id: <20251119124832.3906214-3-alex.kanavin@gmail.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20251119124832.3906214-1-alex.kanavin@gmail.com> References: <20251119124832.3906214-1-alex.kanavin@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 19 Nov 2025 12:48:47 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/18457 From: Alexander Kanavin Also adjust the order of those pieces to be more logical, and tweak the newlines so that each item is separated by a single newline from the previous and next ones. Signed-off-by: Alexander Kanavin --- bin/bitbake-setup | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/bin/bitbake-setup b/bin/bitbake-setup index b331eac53..a8da10e4f 100755 --- a/bin/bitbake-setup +++ b/bin/bitbake-setup @@ -259,6 +259,12 @@ def setup_bitbake_build(bitbake_config, layerdir, setupdir, thisdir, update_bb_c shell = "bash" fragments = bitbake_config.get("oe-fragments", []) + sorted(bitbake_config.get("oe-fragment-choices",{}).values()) if fragments: + toolcfg_file = os.path.join(bitbake_builddir,'conf/toolcfg.conf') + toolcfg_comment = """# Run 'bitbake-config-build enable-fragment ' to enable additional fragments +# or replace built-in ones (e.g. machine/ or distro/ to change MACHINE or DISTRO). +""" + with open(toolcfg_file, 'w') as f: + f.write(toolcfg_comment) bb.process.run("{} -c '. {} && bitbake-config-build enable-fragment {}'".format(shell, init_script, " ".join(fragments))) if os.path.exists(backup_bitbake_confdir): @@ -287,23 +293,29 @@ def setup_bitbake_build(bitbake_config, layerdir, setupdir, thisdir, update_bb_c print('Applying upstream bitbake configuration changes') print(f'Leaving the previous configuration in {backup_bitbake_confdir}') - print("This bitbake configuration provides:\n {}\n".format(bitbake_config["description"])) + fragment_note = "Run 'bitbake-config-build enable-fragment ' to enable additional fragments or replace built-in ones (e.g. machine/ or distro/ to change MACHINE or DISTRO)." + readme = """{}\n\nAdditional information is in {} and {}\n -Source the environment using '. {}' to run builds from the command line. +Source the environment using '. {}' to run builds from the command line.\n +{}\n The bitbake configuration files (local.conf, bblayers.conf and more) can be found in {}/conf """.format( bitbake_config["description"], os.path.join(bitbake_builddir,'conf/conf-summary.txt'), os.path.join(bitbake_builddir,'conf/conf-notes.txt'), init_script, + fragment_note, bitbake_builddir ) readme_file = os.path.join(bitbake_builddir, "README") with open(readme_file, 'w') as f: f.write(readme) + + print("This bitbake configuration provides:\n {}\n".format(bitbake_config["description"])) print("Usage instructions and additional information are in\n {}\n".format(readme_file)) + print("To run builds, source the environment using\n . {}\n".format(init_script)) + print("{}\n".format(fragment_note)) print("The bitbake configuration files (local.conf, bblayers.conf and more) can be found in\n {}/conf\n".format(bitbake_builddir)) - print("To run builds, source the environment using\n . {}".format(init_script)) def get_registry_config(registry_path, id): for root, dirs, files in os.walk(registry_path):