bitbake-setup: write notes for generated build configs
PATCH v2 1/1 bitbake-setup: write notes for generated build configs
From: Ernest Van Hoecke <[email protected]>
For bb-layers configurations, bitbake-setup currently writes an empty "conf-notes.txt". Configurations using "oe-template" get this file from the template.
Add an optional field called "notes" to configurations that populates this field when "bb-layers" is used instead of "oe-template".
---
Add a "notes" string property that can be used to populate
"conf-notes.txt" when bb-layers is used instead of oe-template.
---
Changes in v2:
- The "notes" field can now either be an array of strings (lines) or
just a string.
- Link to v1: https://lore.kernel.org/r/[email protected]
--- bin/bitbake-setup | 5 ++++- .../bitbake-user-manual-environment-setup.rst | 6 ++++++ lib/bb/tests/setup.py | 9 +++++++++ setup-schema/bitbake-setup.schema.json | 14 ++++++++++++++ 4 files changed, 33 insertions(+), 1 deletion(-)
bin/bitbake-setup +4 -1
@@ -301,7 +301,10 @@ def setup_bitbake_build(bitbake_config, layerdir, setupdir, thisdir, update_bb_c f.write(bitbake_config["description"] + "\n") with open(os.path.join(build_conf_dir, "conf-notes.txt"), 'w') as f: - f.write("") + notes = bitbake_config.get("notes") + if isinstance(notes, list): + notes = "\n".join(notes) + f.write(notes + "\n" if notes else "") def _make_init_build_env(builddir, oeinitbuildenvdir): builddir = os.path.realpath(builddir)
doc/bitbake-user-manual/bitbake-user-manual-environment-setup.rst +6 -0
@@ -1057,6 +1057,12 @@ They contain the following sections: snippet. This is what is prompted during the :ref:`ref-bbsetup-command-init` command execution. + - ``notes`` (*optional*): additional information written to + ``build/conf/conf-notes.txt`` when ``bitbake-setup`` generates the build + configuration from ``bb-layers``. This can be a string, or a list of + strings which will be written one per line. For ``oe-template`` + configurations, this file is provided by the template. + - ``configurations``: Configurations can recursively contain as many nested configurations as needed. This will create more choices when running the :ref:`ref-bbsetup-command-init` command.
lib/bb/tests/setup.py +9 -0
@@ -136,6 +136,10 @@ print("BBPATH is {{}}".format(os.environ["BBPATH"])) { "name": "gadget-notemplate", "description": "Gadget notemplate configuration", + "notes": [ + "Gadget notemplate notes", + "Second line" + ], "bb-layers": ["layerA","layerB/meta-layer"], "oe-fragments": ["test-fragment-1"] },
@@ -249,6 +253,11 @@ print("BBPATH is {{}}".format(os.environ["BBPATH"])) else: with open(os.path.join(bb_conf_path, 'conf-summary.txt')) as f: self.assertIn(bitbake_config["description"], f.read()) + with open(os.path.join(bb_conf_path, 'conf-notes.txt')) as f: + expected_notes = bitbake_config.get("notes") + if isinstance(expected_notes, list): + expected_notes = "\n".join(expected_notes) + self.assertEqual(f.read(), expected_notes + "\n" if expected_notes else "") with open(os.path.join(bb_conf_path, 'bblayers.conf')) as f: bblayers = f.read() for l in bitbake_config["bb-layers"]:
setup-schema/bitbake-setup.schema.json +14 -0
@@ -41,6 +41,20 @@ "type": "string", "description": "Human-readable description of the configuration" }, + "notes": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ], + "description": "Extra notes that populate conf-notes.txt when bb-layers is used" + }, "bb-layers": { "type": "array", "description": "List of BitBake layer paths to include, relative to the layers download directory",
---
base-commit: 26978d55eab18278cc6a527072e8015cfbced9de
change-id: 20260529-bb-setup-notes-0663341b0478
Best regards,
Signature · 1 line
Ernest Van Hoecke <[email protected]>