public inbox for bitbake-devel@lists.openembedded.org
 help / color / mirror / Atom feed
* [PATCH 0/2] bitbake-setup: add descriptions for fragment choices
@ 2026-01-16 15:48 Antonin Godard
  2026-01-16 15:48 ` [PATCH 1/2] bin/bitbake-setup: " Antonin Godard
  2026-01-16 15:48 ` [PATCH 2/2] default-registry: update fragments choices with descriptions Antonin Godard
  0 siblings, 2 replies; 5+ messages in thread
From: Antonin Godard @ 2026-01-16 15:48 UTC (permalink / raw)
  To: bitbake-devel; +Cc: Thomas Petazzoni, docs, Antonin Godard

Signed-off-by: Antonin Godard <antonin.godard@bootlin.com>
---
Antonin Godard (2):
      bin/bitbake-setup: add descriptions for fragment choices
      default-registry: update fragments choices with descriptions

 bin/bitbake-setup                                  | 14 ++++++++-----
 .../configurations/oe-nodistro-master.conf.json    |  6 +++++-
 .../oe-nodistro-whinlatter.conf.json               |  6 +++++-
 .../configurations/poky-master.conf.json           | 14 +++++++++++--
 .../configurations/poky-whinlatter.conf.json       | 14 +++++++++++--
 .../bitbake-user-manual-environment-setup.rst      | 21 ++++++++++++++++++--
 setup-schema/bitbake-setup.schema.json             | 23 +++++++++++++++++-----
 7 files changed, 80 insertions(+), 18 deletions(-)
---
base-commit: c16e7ba2088dcd119e93bad6cf22d9026ec1736b
change-id: 20260116-bitbake-setup-choose-builtin-fb199054cc25



^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/2] bin/bitbake-setup: add descriptions for fragment choices
  2026-01-16 15:48 [PATCH 0/2] bitbake-setup: add descriptions for fragment choices Antonin Godard
@ 2026-01-16 15:48 ` Antonin Godard
  2026-01-16 18:23   ` [docs] " Alexander Kanavin
  2026-01-16 15:48 ` [PATCH 2/2] default-registry: update fragments choices with descriptions Antonin Godard
  1 sibling, 1 reply; 5+ messages in thread
From: Antonin Godard @ 2026-01-16 15:48 UTC (permalink / raw)
  To: bitbake-devel; +Cc: Thomas Petazzoni, docs, Antonin Godard

Make it possible to give fragments descriptions as it can help users
determine which fragments to pick during bitbake-setup init.

It is still possible to provide a list (with no descriptions) for
backwards-compatibility.

Update the documentation accordingly.

Signed-off-by: Antonin Godard <antonin.godard@bootlin.com>
---
 bin/bitbake-setup                                  | 14 ++++++++-----
 .../bitbake-user-manual-environment-setup.rst      | 21 ++++++++++++++++++--
 setup-schema/bitbake-setup.schema.json             | 23 +++++++++++++++++-----
 3 files changed, 46 insertions(+), 12 deletions(-)

diff --git a/bin/bitbake-setup b/bin/bitbake-setup
index abe7614c832..bb0a579bbed 100755
--- a/bin/bitbake-setup
+++ b/bin/bitbake-setup
@@ -494,20 +494,24 @@ def choose_fragments(possibilities, parameters, non_interactive, skip_selection)
         if skip_selection and k in skip_selection:
             logger.info("Skipping a selection of {}, as requested on command line. The resulting bitbake configuration may require further manual adjustments.".format(k))
             continue
-        choice = [o for o in v["options"] if o in parameters]
+        options = v["options"]
+        choice = [o for o in options if o in parameters]
         if len(choice) > 1:
-            raise Exception("Options specified on command line do not allow a single selection from possibilities {}, please remove one or more from {}".format(v["options"], parameters))
+            raise Exception("Options specified on command line do not allow a single selection from possibilities {}, please remove one or more from {}".format(options, parameters))
         if len(choice) == 1:
             choices[k] = choice[0]
             continue
 
         if non_interactive:
-            raise Exception("Unable to choose from options in non-interactive mode: {}".format(v["options"]))
+            raise Exception("Unable to choose from options in non-interactive mode: {}".format(options))
 
         logger.plain("\n" + v["description"] + ":")
-        options_enumerated = list(enumerate(v["options"], 1))
+        options_enumerated = list(enumerate(options, 1))
         for n,o in options_enumerated:
-            logger.plain("{}. {}".format(n, o))
+            opt_str = f"{n}. {o}"
+            if isinstance(options, dict):
+                opt_str += f"\t{options[o]}"
+            logger.plain(opt_str)
         option_n = int_input([i[0] for i in options_enumerated],
                              "\nPlease select one of the above options by its number: ") - 1
         choices[k] = options_enumerated[option_n][1]
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 fcffab8123b..14d0f87aeb4 100644
--- a/doc/bitbake-user-manual/bitbake-user-manual-environment-setup.rst
+++ b/doc/bitbake-user-manual/bitbake-user-manual-environment-setup.rst
@@ -747,11 +747,21 @@ They contain the following sections:
                 "oe-fragments-one-of": {
                     "machine": {
                         "description": "Target machines",
-                        "options" : ["machine/qemux86-64", "machine/qemuarm64", "machine/qemuriscv64", "machine/genericarm64", "machine/genericx86-64"]
+                        "options" : {
+                            "machine/qemux86-64": "Machine configuration for running an x86-64 system on QEMU",
+                            "machine/qemuarm64": "Machine configuration for running an ARMv8 system on QEMU",
+                            "machine/qemuriscv64": "Machine configuration for running an RISC-V system on QEMU",
+                            "machine/genericarm64": "Machine configuration for Arm64 SystemReady IR/ES platforms",
+                            "machine/genericx86-64": "Machine configuration for generic x86_64 (64-bit) PCs and servers"
+                        }
                     },
                     "distro": {
                         "description": "Distribution configuration variants",
-                        "options" : ["distro/poky", "distro/poky-altcfg", "distro/poky-tiny"]
+                        "options" : {
+                            "distro/poky": "Distro configuration for Poky (Yocto Project Reference Distro)",
+                            "distro/poky-altcfg": "Distro configuration for Poky (systemd init manager)",
+                            "distro/poky-tiny": "Distro configuration for Poky (optimized for size)"
+                        }
                     }
                 },
                 "configurations": [
@@ -840,6 +850,13 @@ They contain the following sections:
    -  ``oe-fragments-one-of`` (*optional*, OpenEmbedded specific): the OpenEmbedded
       fragments to select as part of the build.
 
+      This can one of two formats:
+
+      -  A dictionary where keys are fragments names and values are descriptions
+         for these fragments (like in the example above).
+
+      -  A list of fragment names.
+
       This will trigger choices to make during the
       :ref:`ref-bbsetup-command-init` command execution.
 
diff --git a/setup-schema/bitbake-setup.schema.json b/setup-schema/bitbake-setup.schema.json
index e51fef3b97c..51035fbaa53 100644
--- a/setup-schema/bitbake-setup.schema.json
+++ b/setup-schema/bitbake-setup.schema.json
@@ -61,11 +61,24 @@
                             },
                             "oe-fragments": {
                                 "$anchor": "oe-fragments",
-                                "type": "array",
-                                "description": "List of BitBake configuration fragments to enable",
-                                "items": {
-                                    "type": "string"
-                                }
+                                "oneOf": [
+                                    {
+                                        "type": "array",
+                                        "description": "List of BitBake configuration fragments to enable",
+                                        "items": {
+                                            "type": "string"
+                                        }
+                                    },
+                                    {
+                                        "type": "object",
+                                        "description": "Dictionary of BitBake configuration fragments to enable (with description)",
+                                        "patternProperties": {
+                                            ".*": {
+                                                "type": "string"
+                                            }
+                                        }
+                                    }
+                                ]
                             },
                             "oe-fragments-one-of": {
                                 "type": "object",

-- 
2.52.0



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/2] default-registry: update fragments choices with descriptions
  2026-01-16 15:48 [PATCH 0/2] bitbake-setup: add descriptions for fragment choices Antonin Godard
  2026-01-16 15:48 ` [PATCH 1/2] bin/bitbake-setup: " Antonin Godard
@ 2026-01-16 15:48 ` Antonin Godard
  1 sibling, 0 replies; 5+ messages in thread
From: Antonin Godard @ 2026-01-16 15:48 UTC (permalink / raw)
  To: bitbake-devel; +Cc: Thomas Petazzoni, docs, Antonin Godard

Give descriptions to the fragment choices to help the user know what to
pick during 'bitbake-setup init'. These descriptions were based on the
descriptions found in the corresponding configuration files in
OE-Core/meta-yocto.

Signed-off-by: Antonin Godard <antonin.godard@bootlin.com>
---
 .../configurations/oe-nodistro-master.conf.json            |  6 +++++-
 .../configurations/oe-nodistro-whinlatter.conf.json        |  6 +++++-
 default-registry/configurations/poky-master.conf.json      | 14 ++++++++++++--
 default-registry/configurations/poky-whinlatter.conf.json  | 14 ++++++++++++--
 4 files changed, 34 insertions(+), 6 deletions(-)

diff --git a/default-registry/configurations/oe-nodistro-master.conf.json b/default-registry/configurations/oe-nodistro-master.conf.json
index 180d2008a72..b8d4324dc3b 100644
--- a/default-registry/configurations/oe-nodistro-master.conf.json
+++ b/default-registry/configurations/oe-nodistro-master.conf.json
@@ -45,7 +45,11 @@
             "oe-fragments-one-of": {
                 "machine": {
                     "description": "Target machines",
-                    "options" : ["machine/qemux86-64", "machine/qemuarm64", "machine/qemuriscv64"]
+                    "options" : {
+                        "machine/qemux86-64": "Machine configuration for running an x86-64 system on QEMU",
+                        "machine/qemuarm64": "Machine configuration for running an ARMv8 system on QEMU",
+                        "machine/qemuriscv64": "Machine configuration for running an RISC-V system on QEMU"
+                    }
                 }
             }
         }
diff --git a/default-registry/configurations/oe-nodistro-whinlatter.conf.json b/default-registry/configurations/oe-nodistro-whinlatter.conf.json
index 7b183ae1c43..7774bf7eefd 100644
--- a/default-registry/configurations/oe-nodistro-whinlatter.conf.json
+++ b/default-registry/configurations/oe-nodistro-whinlatter.conf.json
@@ -46,7 +46,11 @@
             "oe-fragments-one-of": {
                 "machine": {
                     "description": "Target machines",
-                    "options" : ["machine/qemux86-64", "machine/qemuarm64", "machine/qemuriscv64"]
+                    "options" : {
+                        "machine/qemux86-64": "Machine configuration for running an x86-64 system on QEMU",
+                        "machine/qemuarm64": "Machine configuration for running an ARMv8 system on QEMU",
+                        "machine/qemuriscv64": "Machine configuration for running an RISC-V system on QEMU"
+                    }
                 }
             }
         }
diff --git a/default-registry/configurations/poky-master.conf.json b/default-registry/configurations/poky-master.conf.json
index 1de038babe7..e3998ab8c7d 100644
--- a/default-registry/configurations/poky-master.conf.json
+++ b/default-registry/configurations/poky-master.conf.json
@@ -54,11 +54,21 @@
             "oe-fragments-one-of": {
                 "machine": {
                     "description": "Target machines",
-                    "options" : ["machine/qemux86-64", "machine/qemuarm64", "machine/qemuriscv64", "machine/genericarm64", "machine/genericx86-64"]
+                    "options" : {
+                        "machine/qemux86-64": "Machine configuration for running an x86-64 system on QEMU",
+                        "machine/qemuarm64": "Machine configuration for running an ARMv8 system on QEMU",
+                        "machine/qemuriscv64": "Machine configuration for running an RISC-V system on QEMU",
+                        "machine/genericarm64": "Machine configuration for Arm64 SystemReady IR/ES platforms",
+                        "machine/genericx86-64": "Machine configuration for generic x86_64 (64-bit) PCs and servers"
+                    }
                 },
                 "distro": {
                     "description": "Distribution configuration variants",
-                    "options" : ["distro/poky", "distro/poky-altcfg", "distro/poky-tiny"]
+                    "options" : {
+                        "distro/poky": "Distro configuration for Poky (Yocto Project Reference Distro)",
+                        "distro/poky-altcfg": "Distro configuration for Poky (systemd init manager)",
+                        "distro/poky-tiny": "Distro configuration for Poky (optimized for size)"
+                    }
                 }
             },
             "configurations": [
diff --git a/default-registry/configurations/poky-whinlatter.conf.json b/default-registry/configurations/poky-whinlatter.conf.json
index bfa67426dbf..b6834274f8a 100644
--- a/default-registry/configurations/poky-whinlatter.conf.json
+++ b/default-registry/configurations/poky-whinlatter.conf.json
@@ -55,11 +55,21 @@
             "oe-fragments-one-of": {
                 "machine": {
                     "description": "Target machines",
-                    "options" : ["machine/qemux86-64", "machine/qemuarm64", "machine/qemuriscv64", "machine/genericarm64", "machine/genericx86-64"]
+                    "options" : {
+                        "machine/qemux86-64": "Machine configuration for running an x86-64 system on QEMU",
+                        "machine/qemuarm64": "Machine configuration for running an ARMv8 system on QEMU",
+                        "machine/qemuriscv64": "Machine configuration for running an RISC-V system on QEMU",
+                        "machine/genericarm64": "Machine configuration for Arm64 SystemReady IR/ES platforms",
+                        "machine/genericx86-64": "Machine configuration for generic x86_64 (64-bit) PCs and servers"
+                    }
                 },
                 "distro": {
                     "description": "Distribution configuration variants",
-                    "options" : ["distro/poky", "distro/poky-altcfg", "distro/poky-tiny"]
+                    "options" : {
+                        "distro/poky": "Distro configuration for Poky (Yocto Project Reference Distro)",
+                        "distro/poky-altcfg": "Distro configuration for Poky (systemd init manager)",
+                        "distro/poky-tiny": "Distro configuration for Poky (optimized for size)"
+                    }
                 }
             },
             "configurations": [

-- 
2.52.0



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [docs] [PATCH 1/2] bin/bitbake-setup: add descriptions for fragment choices
  2026-01-16 15:48 ` [PATCH 1/2] bin/bitbake-setup: " Antonin Godard
@ 2026-01-16 18:23   ` Alexander Kanavin
  2026-01-20  8:57     ` Antonin Godard
  0 siblings, 1 reply; 5+ messages in thread
From: Alexander Kanavin @ 2026-01-16 18:23 UTC (permalink / raw)
  To: antonin.godard; +Cc: bitbake-devel, Thomas Petazzoni, docs

On Fri, 16 Jan 2026 at 16:49, Antonin Godard via
lists.yoctoproject.org
<antonin.godard=bootlin.com@lists.yoctoproject.org> wrote:
> -                        "options" : ["machine/qemux86-64", "machine/qemuarm64", "machine/qemuriscv64", "machine/genericarm64", "machine/genericx86-64"]
> +                        "options" : {
> +                            "machine/qemux86-64": "Machine configuration for running an x86-64 system on QEMU",
> +                            "machine/qemuarm64": "Machine configuration for running an ARMv8 system on QEMU",
> +                            "machine/qemuriscv64": "Machine configuration for running an RISC-V system on QEMU",
> +                            "machine/genericarm64": "Machine configuration for Arm64 SystemReady IR/ES platforms",
> +                            "machine/genericx86-64": "Machine configuration for generic x86_64 (64-bit) PCs and servers"

Let's make this properly extensible:

options: [ {"name":"machine/qemux86-64","description":"Machine
configuration for ..."}, {"name":...},...]

Basically "options" remains a list, but each item in that list can be
either a string, or a dictionary. That way more keys can be added to
the dictionary in the future if needed.

Alex


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [docs] [PATCH 1/2] bin/bitbake-setup: add descriptions for fragment choices
  2026-01-16 18:23   ` [docs] " Alexander Kanavin
@ 2026-01-20  8:57     ` Antonin Godard
  0 siblings, 0 replies; 5+ messages in thread
From: Antonin Godard @ 2026-01-20  8:57 UTC (permalink / raw)
  To: Alexander Kanavin; +Cc: bitbake-devel, Thomas Petazzoni, docs

Hi,

On Fri Jan 16, 2026 at 7:23 PM CET, Alexander Kanavin wrote:
> On Fri, 16 Jan 2026 at 16:49, Antonin Godard via
> lists.yoctoproject.org
> <antonin.godard=bootlin.com@lists.yoctoproject.org> wrote:
>> -                        "options" : ["machine/qemux86-64", "machine/qemuarm64", "machine/qemuriscv64", "machine/genericarm64", "machine/genericx86-64"]
>> +                        "options" : {
>> +                            "machine/qemux86-64": "Machine configuration for running an x86-64 system on QEMU",
>> +                            "machine/qemuarm64": "Machine configuration for running an ARMv8 system on QEMU",
>> +                            "machine/qemuriscv64": "Machine configuration for running an RISC-V system on QEMU",
>> +                            "machine/genericarm64": "Machine configuration for Arm64 SystemReady IR/ES platforms",
>> +                            "machine/genericx86-64": "Machine configuration for generic x86_64 (64-bit) PCs and servers"
>
> Let's make this properly extensible:
>
> options: [ {"name":"machine/qemux86-64","description":"Machine
> configuration for ..."}, {"name":...},...]
>
> Basically "options" remains a list, but each item in that list can be
> either a string, or a dictionary. That way more keys can be added to
> the dictionary in the future if needed.

Makes total sense, I'm about to send a v2. Thanks :)

Antonin

-- 
Antonin Godard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-01-20  8:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-16 15:48 [PATCH 0/2] bitbake-setup: add descriptions for fragment choices Antonin Godard
2026-01-16 15:48 ` [PATCH 1/2] bin/bitbake-setup: " Antonin Godard
2026-01-16 18:23   ` [docs] " Alexander Kanavin
2026-01-20  8:57     ` Antonin Godard
2026-01-16 15:48 ` [PATCH 2/2] default-registry: update fragments choices with descriptions Antonin Godard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox