Skip to contentSkip to conversation

migrate most bitbake -e instructions to bitbake-getvar

PATCH Applied Quentin Schulz 3 participants 6 messages Oct 29, 2025 – Nov 26, 2025

lore
Share & tools
lore
#0 lore raw

cover migrate most bitbake -e instructions to bitbake-getvar

As reported by Robert, we still have a few examples with bitbake -e instructions instead of the more user-friendly bitbake-getvar.

This migrates what I believe to be the last instances of bitbake -e we can currently replace with bitbake-getvar.

---
Quentin Schulz (3):
kernel-dev: common: migrate bitbake -e to bitbake-getvar
ref-manual: variables: migrate the OVERRIDES note to bitbake-getvar
dev-manual: debugging: use bitbake-getvar in Viewing Variable Values section

 documentation/dev-manual/debugging.rst | 34 ++++++++++++++++++++--------------
 documentation/kernel-dev/common.rst    | 12 +++++-------
 documentation/ref-manual/variables.rst |  4 ++--
 3 files changed, 27 insertions(+), 23 deletions(-)

---
base-commit: 8b85245490ae0b19a9c3880ec31e55b42e19d094
change-id: 20251029-bitbake-e-2a7e8aa78702

Best regards,

Signature · 1 line
Quentin Schulz <[email protected]>
#1 lore raw

PATCH 1/3 kernel-dev: common: migrate bitbake -e to bitbake-getvar

From: Quentin Schulz <[email protected]>

It's recommended to use bitbake-getvar for a few releases now so let's use that instead of bitbake -e.

While at it, use a cross-reference for "OpenEmbedded Build System".

---
 documentation/kernel-dev/common.rst | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)
documentation/kernel-dev/common.rst +5 -7
index bd6c3fb2c..ef9a8d8fe 100644
@@ -1431,15 +1431,13 @@ Expanding Variables
 ===================
 
 Sometimes it is helpful to determine what a variable expands to during a
-build. You can examine the values of variables by examining the
-output of the ``bitbake -e`` command. The output is long and is more
-easily managed in a text file, which allows for easy searches::
+build. You can examine the value of a variable by running the ``bitbake-getvar``
+command::
 
-   $ bitbake -e virtual/kernel > some_text_file
+   $ bitbake-getvar -r virtual/kernel VARIABLE
 
-Within the text file, you can see
-exactly how each variable is expanded and used by the OpenEmbedded build
-system.
+The output of the command explains exactly how the variable is expanded and used
+by the :term:`OpenEmbedded Build System`.
 
 Working with a "Dirty" Kernel Version String
 ============================================
Signature · 1 line
2.51.0
#2 lore raw

PATCH 2/3 ref-manual: variables: migrate the OVERRIDES note to bitbake-getvar

In reply to Quentin Schulz

From: Quentin Schulz <[email protected]>

Wherever possible, we should use bitbake-getvar as it's the recommended tool so let's do that.

---
 documentation/ref-manual/variables.rst | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
documentation/ref-manual/variables.rst +2 -2
index 591c03028..1f55d1c00 100644
@@ -6472,8 +6472,8 @@ system and gives an overview of their function and contents.
 
       .. note::
 
-         An easy way to see what overrides apply is to search for :term:`OVERRIDES`
-         in the output of the ``bitbake -e`` command. See the
+         An easy way to see what overrides apply is to run the command
+         ``bitbake-getvar -r myrecipe OVERRIDES``. See the
          ":ref:`dev-manual/debugging:viewing variable values`" section in the Yocto
          Project Development Tasks Manual for more information.
 
Signature · 1 line
2.51.0
#3 lore raw

PATCH 3/3 dev-manual: debugging: use bitbake-getvar in Viewing Variable Values section

In reply to Quentin Schulz

From: Quentin Schulz <[email protected]>

We should recommend using bitbake-getvar command wherever possible as its output is much less confusing and overwhelming than bitbake -e.

Unfortunately, bitbake-getvar currently doesn't list Python tasks or functions, unlike bitbake -e, so keep the latter for some corner cases.

---
 documentation/dev-manual/debugging.rst | 34 ++++++++++++++++++++--------------
 1 file changed, 20 insertions(+), 14 deletions(-)
documentation/dev-manual/debugging.rst +20 -14
index 6c45ccf65..9ee153d95 100644
@@ -111,17 +111,17 @@ occurred in your project. Perhaps an attempt to :ref:`modify a variable
 <bitbake-user-manual/bitbake-user-manual-metadata:modifying existing
 variables>` did not work out as expected.
 
-BitBake's ``-e`` option is used to display variable values after
-parsing. The following command displays the variable values after the
-configuration files (i.e. ``local.conf``, ``bblayers.conf``,
+BitBake's ``bitbake-getvar`` command is used to display variable values after
+parsing. The following command displays the variable value for :term:`OVERRIDES`
+after the configuration files (i.e. ``local.conf``, ``bblayers.conf``,
 ``bitbake.conf`` and so forth) have been parsed::
 
-   $ bitbake -e
+   $ bitbake-getvar OVERRIDES
 
-The following command displays variable values after a specific recipe has
-been parsed. The variables include those from the configuration as well::
+The following command displays the value of :term:`PV` after a specific recipe
+has been parsed::
 
-   $ bitbake -e recipename
+   $ bitbake-getvar -r recipename PV
 
 .. note::
 
@@ -135,19 +135,25 @@ been parsed. The variables include those from the configuration as well::
    the recipe datastore, which means that variables set within one task
    will not be visible to other tasks.
 
-In the output of ``bitbake -e``, each variable is preceded by a
-description of how the variable got its value, including temporary
-values that were later overridden. This description also includes
-variable flags (varflags) set on the variable. The output can be very
+In the output of ``bitbake-getvar``, the line containing the value of the
+variable is preceded by a description of how the variable got its value,
+including temporary values that were later overridden. This description also
+includes variable flags (varflags) set on the variable. The output can be very
 helpful during debugging.
 
 Variables that are exported to the environment are preceded by
-``export`` in the output of ``bitbake -e``. See the following example::
+``export`` in the output of ``bitbake-getvar``. See the following example::
 
    export CC="i586-poky-linux-gcc -m32 -march=i586 --sysroot=/home/ulf/poky/build/tmp/sysroots/qemux86"
 
-In addition to variable values, the output of the ``bitbake -e`` and
-``bitbake -e`` recipe commands includes the following information:
+Shell functions and tasks can also be inspected with the same mechanism::
+
+   $ bitbake-getvar -r recipename do_install
+
+For Python functions and tasks, ``bitbake -e recipename`` can be used instead.
+
+Moroever, the output of the ``bitbake -e`` and ``bitbake -e`` recipe commands
+includes the following information:
 
 -  The output starts with a tree listing all configuration files and
    classes included globally, recursively listing the files they include
Signature · 1 line
2.51.0
#4 lore raw

Re: [PATCH 3/3] dev-manual: debugging: use bitbake-getvar in Viewing Variable Values section

Quoted 9 lines · Quentin Schulz

From: Quentin Schulz <[email protected]>

We should recommend using bitbake-getvar command wherever possible as its output is much less confusing and overwhelming than bitbake -e.

Unfortunately, bitbake-getvar currently doesn't list Python tasks or functions, unlike bitbake -e, so keep the latter for some corner cases.

... snip ...

thanks for handling all that.

rday

#5 lore raw
In reply to Quentin Schulz
Quoted 8 lines · Quentin Schulz

As reported by Robert, we still have a few examples with bitbake -e instructions instead of the more user-friendly bitbake-getvar.

This migrates what I believe to be the last instances of bitbake -e we can currently replace with bitbake-getvar.

[...]

Applied, thanks!

[1/3] kernel-dev: common: migrate bitbake -e to bitbake-getvar

      commit: 54585646d8220f8de1ba2c7246cb3f2fcbc59583
[2/3] ref-manual: variables: migrate the OVERRIDES note to bitbake-getvar
      commit: 2293a3f2767895e9fb5c3e8f3ec11bb4951a7127
[3/3] dev-manual: debugging: use bitbake-getvar in Viewing Variable Values section
      commit: 41e4e05369c4e028c679749b7b62434327927a09

Best regards,