diff mbox series

[2/2] bitbake-setup: write notes for generated build configs

Message ID 20260529-bb-setup-notes-v1-2-a251ef1c5af4@toradex.com
State New
Headers show
Series bitbake-setup: clarify configuration merging and add a notes property | expand

Commit Message

Ernest Van Hoecke May 29, 2026, 3 p.m. UTC
From: Ernest Van Hoecke <ernest.vanhoecke@toradex.com>

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".

Signed-off-by: Ernest Van Hoecke <ernest.vanhoecke@toradex.com>
---
 bin/bitbake-setup                                                 | 3 ++-
 doc/bitbake-user-manual/bitbake-user-manual-environment-setup.rst | 5 +++++
 lib/bb/tests/setup.py                                             | 4 ++++
 setup-schema/bitbake-setup.schema.json                            | 4 ++++
 4 files changed, 15 insertions(+), 1 deletion(-)

Comments

Alexander Kanavin May 29, 2026, 5:01 p.m. UTC | #1
Thanks, this lgtm too.

Alex

On Fri, 29 May 2026 at 17:00, Ernest Van Hoecke via
lists.openembedded.org
<ernestvanhoecke=gmail.com@lists.openembedded.org> wrote:
>
> From: Ernest Van Hoecke <ernest.vanhoecke@toradex.com>
>
> 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".
>
> Signed-off-by: Ernest Van Hoecke <ernest.vanhoecke@toradex.com>
> ---
>  bin/bitbake-setup                                                 | 3 ++-
>  doc/bitbake-user-manual/bitbake-user-manual-environment-setup.rst | 5 +++++
>  lib/bb/tests/setup.py                                             | 4 ++++
>  setup-schema/bitbake-setup.schema.json                            | 4 ++++
>  4 files changed, 15 insertions(+), 1 deletion(-)
>
> diff --git a/bin/bitbake-setup b/bin/bitbake-setup
> index 220540f7f9ca..e22e5b77bde1 100755
> --- a/bin/bitbake-setup
> +++ b/bin/bitbake-setup
> @@ -301,7 +301,8 @@ 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")
> +            f.write(notes + "\n" if notes else "")
>
>      def _make_init_build_env(builddir, oeinitbuildenvdir):
>          builddir = os.path.realpath(builddir)
> 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 1252f22c823a..e99cf7b3415d 100644
> --- a/doc/bitbake-user-manual/bitbake-user-manual-environment-setup.rst
> +++ b/doc/bitbake-user-manual/bitbake-user-manual-environment-setup.rst
> @@ -1057,6 +1057,11 @@ 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``. 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.
> diff --git a/lib/bb/tests/setup.py b/lib/bb/tests/setup.py
> index 638d56d3bb32..ffe390db1bda 100644
> --- a/lib/bb/tests/setup.py
> +++ b/lib/bb/tests/setup.py
> @@ -136,6 +136,7 @@ print("BBPATH is {{}}".format(os.environ["BBPATH"]))
>              {
>                  "name": "gadget-notemplate",
>                  "description": "Gadget notemplate configuration",
> +                "notes": "Gadget notemplate notes",
>                  "bb-layers": ["layerA","layerB/meta-layer"],
>                  "oe-fragments": ["test-fragment-1"]
>              },
> @@ -249,6 +250,9 @@ 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")
> +                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"]:
> diff --git a/setup-schema/bitbake-setup.schema.json b/setup-schema/bitbake-setup.schema.json
> index be8772db1b2d..6a39e66a0ae4 100644
> --- a/setup-schema/bitbake-setup.schema.json
> +++ b/setup-schema/bitbake-setup.schema.json
> @@ -41,6 +41,10 @@
>                                  "type": "string",
>                                  "description": "Human-readable description of the configuration"
>                              },
> +                            "notes": {
> +                                "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",
>
> --
> 2.43.0
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#19565): https://lists.openembedded.org/g/bitbake-devel/message/19565
> Mute This Topic: https://lists.openembedded.org/mt/119548246/1686489
> Group Owner: bitbake-devel+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/bitbake-devel/unsub [alex.kanavin@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
diff mbox series

Patch

diff --git a/bin/bitbake-setup b/bin/bitbake-setup
index 220540f7f9ca..e22e5b77bde1 100755
--- a/bin/bitbake-setup
+++ b/bin/bitbake-setup
@@ -301,7 +301,8 @@  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")
+            f.write(notes + "\n" if notes else "")
 
     def _make_init_build_env(builddir, oeinitbuildenvdir):
         builddir = os.path.realpath(builddir)
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 1252f22c823a..e99cf7b3415d 100644
--- a/doc/bitbake-user-manual/bitbake-user-manual-environment-setup.rst
+++ b/doc/bitbake-user-manual/bitbake-user-manual-environment-setup.rst
@@ -1057,6 +1057,11 @@  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``. 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.
diff --git a/lib/bb/tests/setup.py b/lib/bb/tests/setup.py
index 638d56d3bb32..ffe390db1bda 100644
--- a/lib/bb/tests/setup.py
+++ b/lib/bb/tests/setup.py
@@ -136,6 +136,7 @@  print("BBPATH is {{}}".format(os.environ["BBPATH"]))
             {
                 "name": "gadget-notemplate",
                 "description": "Gadget notemplate configuration",
+                "notes": "Gadget notemplate notes",
                 "bb-layers": ["layerA","layerB/meta-layer"],
                 "oe-fragments": ["test-fragment-1"]
             },
@@ -249,6 +250,9 @@  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")
+                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"]:
diff --git a/setup-schema/bitbake-setup.schema.json b/setup-schema/bitbake-setup.schema.json
index be8772db1b2d..6a39e66a0ae4 100644
--- a/setup-schema/bitbake-setup.schema.json
+++ b/setup-schema/bitbake-setup.schema.json
@@ -41,6 +41,10 @@ 
                                 "type": "string",
                                 "description": "Human-readable description of the configuration"
                             },
+                            "notes": {
+                                "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",