public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
* [OE-core][PATCH 1/2] uboot-config: Change indentation for KCONFIG_CONFIG_ROOTDIR check
@ 2026-03-13 15:14 Ryan Eatmon
  2026-03-13 15:14 ` [OE-core][PATCH 2/2] selftest: uboot: Add sefltest for recent KCONFIG_CONFIG_ROOTDIR fix Ryan Eatmon
  0 siblings, 1 reply; 2+ messages in thread
From: Ryan Eatmon @ 2026-03-13 15:14 UTC (permalink / raw)
  To: openembedded-core

The current check is in the inner loop of UBOOT_CONFIG, but the check is
attempting to only apply to the case when there is a single entry in
UBOOT_CONFIG.  Shift the indention to be outside of the for loop and
only execute once.

Signed-off-by: Ryan Eatmon <reatmon@ti.com>
---
 meta/classes-recipe/uboot-config.bbclass | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/meta/classes-recipe/uboot-config.bbclass b/meta/classes-recipe/uboot-config.bbclass
index f7848396c1..9e24db1f48 100644
--- a/meta/classes-recipe/uboot-config.bbclass
+++ b/meta/classes-recipe/uboot-config.bbclass
@@ -247,15 +247,15 @@ python () {
             bb.debug(1, "Appending '%s' to UBOOT_CONFIG_FRAGMENTS." % fragments)
             d.appendVar('UBOOT_CONFIG_FRAGMENTS', fragments + " ? ")
 
-            # This recipe might be inherited e.g. by the kernel recipe via kernel-fitimage.bbclass
-            # Ensure the uboot specific menuconfig settings do not leak into other recipes
-            if 'u-boot' in recipename:
-                if len(ubootconfig) == 1:
-                    builddir = "%s-%s" % (d.getVar("UBOOT_MACHINE").strip(), config)
-                    d.setVar('KCONFIG_CONFIG_ROOTDIR', os.path.join("${B}", builddir))
-                else:
-                    # Disable menuconfig for multiple configs
-                    d.setVar('KCONFIG_CONFIG_ENABLE_MENUCONFIG', "false")
+        # This recipe might be inherited e.g. by the kernel recipe via kernel-fitimage.bbclass
+        # Ensure the uboot specific menuconfig settings do not leak into other recipes
+        if 'u-boot' in recipename:
+            if len(ubootconfig) == 1:
+                builddir = "%s-%s" % (d.getVar("UBOOT_MACHINE").strip(), config)
+                d.setVar('KCONFIG_CONFIG_ROOTDIR', os.path.join("${B}", builddir))
+            else:
+                # Disable menuconfig for multiple configs
+                d.setVar('KCONFIG_CONFIG_ENABLE_MENUCONFIG', "false")
 }
 
 uboot_config_get_indexed_value () {
-- 
2.43.0



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

* [OE-core][PATCH 2/2] selftest: uboot: Add sefltest for recent KCONFIG_CONFIG_ROOTDIR fix
  2026-03-13 15:14 [OE-core][PATCH 1/2] uboot-config: Change indentation for KCONFIG_CONFIG_ROOTDIR check Ryan Eatmon
@ 2026-03-13 15:14 ` Ryan Eatmon
  0 siblings, 0 replies; 2+ messages in thread
From: Ryan Eatmon @ 2026-03-13 15:14 UTC (permalink / raw)
  To: openembedded-core

Add a check to make sure that KCONFIG_CONFIG_ROOTDIR and
KCONFIG_CONFIG_ENABLE_MENUCONFIG are being set correctly in the
different cases.

A recent commit [1] showed that we were missing a check for the
correctness of these variables.

[1] https://git.openembedded.org/openembedded-core/commit/?id=2548c040ea155c981e41cb0282bcb28c47b3b688

Signed-off-by: Ryan Eatmon <reatmon@ti.com>
---
 meta/lib/oeqa/selftest/cases/uboot.py | 38 +++++++++++++++++++++++++--
 1 file changed, 36 insertions(+), 2 deletions(-)

diff --git a/meta/lib/oeqa/selftest/cases/uboot.py b/meta/lib/oeqa/selftest/cases/uboot.py
index 8e53ae5031..2e4530fddd 100644
--- a/meta/lib/oeqa/selftest/cases/uboot.py
+++ b/meta/lib/oeqa/selftest/cases/uboot.py
@@ -178,13 +178,46 @@ class UBootConfigTest(OESelftestTestCase):
 
         bitbake("-e u-boot")
 
-        bb_vars = get_bb_vars(["UBOOT_MACHINE", "IMAGE_FSTYPES", "UBOOT_CONFIG_BINARY", "UBOOT_CONFIG_MAKE_OPTS", "UBOOT_CONFIG_FRAGMENTS"], "u-boot")
+        bb_vars = get_bb_vars(["UBOOT_MACHINE", "IMAGE_FSTYPES", "UBOOT_CONFIG_BINARY", "UBOOT_CONFIG_MAKE_OPTS", "UBOOT_CONFIG_FRAGMENTS", "KCONFIG_CONFIG_ENABLE_MENUCONFIG"], "u-boot")
 
         self.assertEqual(bb_vars["UBOOT_MACHINE"], " machine1 machine2 machine3")
         self.assertTrue(bb_vars["IMAGE_FSTYPES"].endswith(" image_fstype2 image_fstype3"))
         self.assertEqual(bb_vars["UBOOT_CONFIG_BINARY"], "defBinary ? defBinary ? binary3 ? ")
         self.assertEqual(bb_vars["UBOOT_CONFIG_MAKE_OPTS"], "OPT=1 ?  ? OPT=3 FOO=2 ? ")
         self.assertEqual(bb_vars["UBOOT_CONFIG_FRAGMENTS"], "fragment1a fragment1b ? fragment2 ?  ? ")
+        self.assertEqual(bb_vars["KCONFIG_CONFIG_ENABLE_MENUCONFIG"], "false")
+
+    def test_uboot_config_extract_single_config(self):
+        """
+        Tests the uboot-config.bbclass python function that extracts all of
+        the config variations into the support variables.
+        """
+
+        self.write_config(textwrap.dedent(f"""
+            UBOOT_BINARY = "defBinary"
+            UBOOT_MACHINE = ""
+            UBOOT_CONFIG = "test1"
+            UBOOT_CONFIG[test1] = "machine1"
+            UBOOT_CONFIG[test2] = "machine2"
+            UBOOT_CONFIG[test3] = "machine3"
+            UBOOT_CONFIG_IMAGE_FSTYPES[test2] = "image_fstype2"
+            UBOOT_CONFIG_IMAGE_FSTYPES[test3] = "image_fstype3"
+            UBOOT_CONFIG_BINARY[test3] = "binary3"
+            UBOOT_CONFIG_MAKE_OPTS[test1] = "OPT=1"
+            UBOOT_CONFIG_MAKE_OPTS[test3] = "OPT=3 FOO=2"
+            UBOOT_CONFIG_FRAGMENTS[test1] = "fragment1a fragment1b"
+            UBOOT_CONFIG_FRAGMENTS[test2] = "fragment2"
+        """))
+
+        bitbake("-e u-boot")
+
+        bb_vars = get_bb_vars(["UBOOT_MACHINE", "IMAGE_FSTYPES", "UBOOT_CONFIG_BINARY", "UBOOT_CONFIG_MAKE_OPTS", "UBOOT_CONFIG_FRAGMENTS", "KCONFIG_CONFIG_ROOTDIR"], "u-boot")
+
+        self.assertEqual(bb_vars["UBOOT_MACHINE"], " machine1")
+        self.assertEqual(bb_vars["UBOOT_CONFIG_BINARY"], "defBinary ? ")
+        self.assertEqual(bb_vars["UBOOT_CONFIG_MAKE_OPTS"], "OPT=1 ? ")
+        self.assertEqual(bb_vars["UBOOT_CONFIG_FRAGMENTS"], "fragment1a fragment1b ? ")
+        self.assertTrue(bb_vars["KCONFIG_CONFIG_ROOTDIR"].endswith("/build/machine1-test1"))
 
     def test_uboot_config_extract_legacy(self):
         """
@@ -204,13 +237,14 @@ class UBootConfigTest(OESelftestTestCase):
 
         bitbake("-e u-boot")
 
-        bb_vars = get_bb_vars(["UBOOT_MACHINE", "IMAGE_FSTYPES", "UBOOT_CONFIG_BINARY", "UBOOT_CONFIG_MAKE_OPTS", "UBOOT_CONFIG_FRAGMENTS"], "u-boot")
+        bb_vars = get_bb_vars(["UBOOT_MACHINE", "IMAGE_FSTYPES", "UBOOT_CONFIG_BINARY", "UBOOT_CONFIG_MAKE_OPTS", "UBOOT_CONFIG_FRAGMENTS", "KCONFIG_CONFIG_ENABLE_MENUCONFIG"], "u-boot")
 
         self.assertEqual(bb_vars["UBOOT_MACHINE"], " machine1 machine2 machine3")
         self.assertTrue(bb_vars["IMAGE_FSTYPES"].endswith(" image_fstype2 image_fstype3"))
         self.assertEqual(bb_vars["UBOOT_CONFIG_BINARY"], "defBinary ? defBinary ? binary3 ? ")
         self.assertEqual(bb_vars["UBOOT_CONFIG_MAKE_OPTS"], " ?  ?  ? ")
         self.assertEqual(bb_vars["UBOOT_CONFIG_FRAGMENTS"], " ?  ?  ? ")
+        self.assertEqual(bb_vars["KCONFIG_CONFIG_ENABLE_MENUCONFIG"], "false")
 
     def test_uboot_config_extract_error_missing_config(self):
         """
-- 
2.43.0



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

end of thread, other threads:[~2026-03-13 15:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-13 15:14 [OE-core][PATCH 1/2] uboot-config: Change indentation for KCONFIG_CONFIG_ROOTDIR check Ryan Eatmon
2026-03-13 15:14 ` [OE-core][PATCH 2/2] selftest: uboot: Add sefltest for recent KCONFIG_CONFIG_ROOTDIR fix Ryan Eatmon

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