From patchwork Thu Jan 8 20:22:37 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ryan Eatmon X-Patchwork-Id: 78299 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6B23FD1D493 for ; Thu, 8 Jan 2026 20:22:54 +0000 (UTC) Received: from CH1PR05CU001.outbound.protection.outlook.com (CH1PR05CU001.outbound.protection.outlook.com [52.101.193.40]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.16044.1767903770563937476 for ; Thu, 08 Jan 2026 12:22:50 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@ti.com header.s=selector1 header.b=vdFgWGMj; spf=permerror, err=parse error for token &{10 18 spf.protection.outlook.com}: limit exceeded (domain: ti.com, ip: 52.101.193.40, mailfrom: reatmon@ti.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=h2xKOOj34F99ZkdT1Bkg7WiUYvh2rMCd6tNjBJgFe8aZkC7VefpuM3cGM2dejIs7xWBSb9423CxUvwSggWbyEyPICJCIcVb3eVqqtgb2doag1wJeskhzGgdXEJgydeezz79wPRK+UESiRDTdgs+iyEZwtS16eReC73yEZOsV9fbkridzC0Z7+TRPpjLeFckx2VRZJ9Q13bHumFM/SLri36AvJLlOiLdg2JVpCbpqBU8yYmfFi1l+wHzm0njOyvuBUYloYgJiMgNt6aDW5GPv3dZmgxUvLmLmAw7RTTaXaaDGae2UaPPYYoRRBjtogKpTQ7txgkSc1Ki+LBHHH4cISQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=qkN03Ah8tNIXoeGPhVf0wJOx2PFT/kqbglMzxIAgiN0=; b=GR4DplKC60o69oXUzwYnY7F7VUrJpHskcitbYpY4BMctjs34x72txErx7ee6r7xlmNzybPu7a55ggUBaPUb8L/EEiiRfgObJ81v1IFrexDYNMG/l1XhDmLrsrmTXZijyr0Z58KKR1WxHDMlcNFbf9eUWlJbAqtMn7H1eQlIqx0VjVN4MefPrCrKWRLhsUJsT9HXzyYsVz2mfwQQigknkYI9FzTLzNE5bf5uYIWu3sTgLRKiu+AW7ojwXsZwYBmxjXATZlDA1iqrIoOq0bFccWtQRevfVdx0AxIgaqqwqt7oOOEbEEbRjvwzMZkT9QEdtjKab7RYLkX0gWKvb5IB8MQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 198.47.23.195) smtp.rcpttodomain=lists.openembedded.org smtp.mailfrom=ti.com; dmarc=pass (p=quarantine sp=none pct=100) action=none header.from=ti.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=qkN03Ah8tNIXoeGPhVf0wJOx2PFT/kqbglMzxIAgiN0=; b=vdFgWGMj+uEWLpZm+OfB5GxMuYMowSUemRVVxEjwa2Vj4LvAWFtrnBY0xD7/RkxL4UFxIUhO6bosEfld4LWa2G0KWMPNZQsY6xnDF1tvObWNBUSrJtOQkXX9kLJyvULbCATSSUREjWscI2doXV7rxBFDErsEswmgnGqHHYvF3Y4= Received: from SJ0PR03CA0251.namprd03.prod.outlook.com (2603:10b6:a03:3a0::16) by DS4PPF72472EF09.namprd10.prod.outlook.com (2603:10b6:f:fc00::d2a) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9499.2; Thu, 8 Jan 2026 20:22:47 +0000 Received: from MWH0EPF000989E5.namprd02.prod.outlook.com (2603:10b6:a03:3a0:cafe::1e) by SJ0PR03CA0251.outlook.office365.com (2603:10b6:a03:3a0::16) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9478.4 via Frontend Transport; Thu, 8 Jan 2026 20:21:54 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 198.47.23.195) smtp.mailfrom=ti.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=ti.com; Received-SPF: Pass (protection.outlook.com: domain of ti.com designates 198.47.23.195 as permitted sender) receiver=protection.outlook.com; client-ip=198.47.23.195; helo=lewvzet201.ext.ti.com; pr=C Received: from lewvzet201.ext.ti.com (198.47.23.195) by MWH0EPF000989E5.mail.protection.outlook.com (10.167.241.132) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9520.1 via Frontend Transport; Thu, 8 Jan 2026 20:22:43 +0000 Received: from DLEE213.ent.ti.com (157.170.170.116) by lewvzet201.ext.ti.com (10.4.14.104) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.20; Thu, 8 Jan 2026 14:22:39 -0600 Received: from DLEE208.ent.ti.com (157.170.170.97) by DLEE213.ent.ti.com (157.170.170.116) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.20; Thu, 8 Jan 2026 14:22:39 -0600 Received: from lelvem-mr06.itg.ti.com (10.180.75.8) by DLEE208.ent.ti.com (157.170.170.97) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.20 via Frontend Transport; Thu, 8 Jan 2026 14:22:39 -0600 Received: from grumpy (grumpy.dhcp.ti.com [128.247.81.229]) by lelvem-mr06.itg.ti.com (8.18.1/8.18.1) with ESMTP id 608KMdEG2934711 for ; Thu, 8 Jan 2026 14:22:39 -0600 Received: from reatmon by grumpy with local (Exim 4.97) (envelope-from ) id 1vdwWl-0000000AAS9-0Y4V for openembedded-core@lists.openembedded.org; Thu, 08 Jan 2026 14:22:39 -0600 From: Ryan Eatmon To: Subject: [OE-core][PATCH 1/3] u-boot: Overhaul UBOOT_CONFIG flow Date: Thu, 8 Jan 2026 14:22:37 -0600 Message-ID: <20260108202239.2423335-1-reatmon@ti.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-C2ProcessedOrg: 333ef613-75bf-4e12-a4b1-8e3623f5dcea X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWH0EPF000989E5:EE_|DS4PPF72472EF09:EE_ X-MS-Office365-Filtering-Correlation-Id: 98fcfef8-3937-4b49-e8e8-08de4ef3ae10 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|82310400026|1800799024|36860700013|34070700014|34020700016; X-Microsoft-Antispam-Message-Info: 0tjV8N1YAZQUtMp0VLOP2mvXH8WZWITvyzOylCzwqazdB96T/LcJ0cZLe6nfj0V0icxFIwQ7iq7TkctdS7bHBJtp2kSRpLMVKjy6aNaicEmBO2jHUSKY5U7IURq0LLFiluvhH5sY2cQd+JrVQzVFTXH2e/WOGWqRJfBQqrbfmGpJYfUsL0h1TYAkFvcZPeV1dNzTc9pxwTB0jzZ0oG+cKA/9p3KVdnVBtGLYB+SXtHm7EGCMiasqDR1CzqREd68FZuKkGlRl+qWr+uaqh3G/y0a8f9X6kfl51QzjVps3Bk87lG7EUXDff4caHegt/TtAS1J7ztLDHB/SUMlUkYvXtVRVY+JJ5hDJuaTxil4FZiK/XHEl3ylfCzvaP106716/6Iau49ITxQYQM/9mPeOKZmQjCoZ6ejIRkkdA4D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IOYybHtBNnMxpzXewY3+pjSvvma8fGoqLpnh19Wb8kd/PgxmpbmipbB5XOWa9GFOld2OI8jCLMtn61jdwyjWaEYnu1N056MUc= X-Forefront-Antispam-Report: CIP:198.47.23.195;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:lewvzet201.ext.ti.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(82310400026)(1800799024)(36860700013)(34070700014)(34020700016);DIR:OUT;SFP:1101; X-OriginatorOrg: ti.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jan 2026 20:22:43.6277 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 98fcfef8-3937-4b49-e8e8-08de4ef3ae10 X-MS-Exchange-CrossTenant-Id: e5b49634-450b-4709-8abb-1e2b19b982b7 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=e5b49634-450b-4709-8abb-1e2b19b982b7;Ip=[198.47.23.195];Helo=[lewvzet201.ext.ti.com] X-MS-Exchange-CrossTenant-AuthSource: MWH0EPF000989E5.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS4PPF72472EF09 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 08 Jan 2026 20:22:54 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/229088 The existing flow for setting UBOOT_CONFIG options is a little confusing. The comma separated list is difficult to remember which slot is used for which option, and the order of the options cannot be changed just added on to. This commit overhauls the UBOOT_CONFIG flow while maintaining the backwards compatibility with the existing settings. Rather than use a comma separated list, a new set of placeholder variables have been defined where the same config flags can be used to specify all of the needed changes: UBOOT_CONFIG = "foo bar" UBOOT_CONFIG[foo] = "config1,fstype1,binary1" UBOOT_CONFIG[bar] = "config2,fstype2,binary2" becomes: UBOOT_CONFIG = "foo bar" UBOOT_CONFIG[foo] = "config1" UBOOT_CONFIG[bar] = "config2" UBOOT_CONFIG_IMAGE_FSTYPES[foo] = "fstype1" UBOOT_CONFIG_IMAGE_FSTYPES[bar] = "fstype2" UBOOT_CONFIG_BINARY[foo] = "binary1" UBOOT_CONFIG_BINARY[bar] = "binary2" The previous addition of makeopts has been removed and replaced with: UBOOT_CONFIG_MAKE_OPTS[config] = "opts" Signed-off-by: Ryan Eatmon --- meta/classes-recipe/uboot-config.bbclass | 119 +++++++++++++++---- meta/classes-recipe/uboot-sign.bbclass | 9 +- meta/recipes-bsp/u-boot/u-boot-configure.inc | 12 +- meta/recipes-bsp/u-boot/u-boot.inc | 22 +--- 4 files changed, 101 insertions(+), 61 deletions(-) diff --git a/meta/classes-recipe/uboot-config.bbclass b/meta/classes-recipe/uboot-config.bbclass index 81057b5cad..715fb5c1d2 100644 --- a/meta/classes-recipe/uboot-config.bbclass +++ b/meta/classes-recipe/uboot-config.bbclass @@ -2,12 +2,33 @@ # # The format to specify it, in the machine, is: # +# UBOOT_MACHINE = "config" +# +# or to build u-boot multiple times with different configs/options: +# +# UBOOT_MACHINE = "" # UBOOT_CONFIG ??= -# UBOOT_CONFIG[foo] = "config,images,binary" +# UBOOT_CONFIG[foo] = "foo_config" +# UBOOT_CONFIG[bar] = "bar_config" # -# or +# UBOOT_CONFIG_IMAGE_FSTYPES[bar] = "fstype" # -# UBOOT_MACHINE = "config" +# UBOOT_CONFIG_BINARY[foo] = "binary" +# +# UBOOT_CONFIG_MAKE_OPTS[foo] = "FOO=1" +# UBOOT_CONFIG_MAKE_OPTS[bar] = "BAR=1" +# +# For more information about this, please see the official documentation. +# +# There is a legacy method that is still supported where some of the above +# controls can be specified in a comma-separated list. This method was +# deemed to be limiting in terms of expanding support to more and more knobs +# that might need to be turned to customize a config build. +# +# UBOOT_MACHINE = "" +# UBOOT_CONFIG ??= +# UBOOT_CONFIG[foo] = "foo_config,images,binary" +# UBOOT_CONFIG[bar] = "bar_config,images,binary" # # Copyright 2013, 2014 (C) O.S. Systems Software LTDA. # @@ -113,9 +134,13 @@ python () { ubootmachine = d.getVar("UBOOT_MACHINE") ubootconfigflags = d.getVarFlags('UBOOT_CONFIG') + ubootconfigimagefstypes = d.getVar('UBOOT_CONFIG_IMAGE_FSTYPES') + ubootconfigimagefstypesflags = d.getVarFlags('UBOOT_CONFIG_IMAGE_FSTYPES') ubootbinary = d.getVar('UBOOT_BINARY') - ubootbinaries = d.getVar('UBOOT_BINARIES') + ubootconfigbinary = d.getVar('UBOOT_CONFIG_BINARY') + ubootconfigbinaryflags = d.getVarFlags('UBOOT_CONFIG_BINARY') ubootconfigmakeopts = d.getVar('UBOOT_CONFIG_MAKE_OPTS') + ubootconfigmakeoptsflags = d.getVarFlags('UBOOT_CONFIG_MAKE_OPTS') # The "doc" varflag is special, we don't want to see it here ubootconfigflags.pop('doc', None) ubootconfig = (d.getVar('UBOOT_CONFIG') or "").split() @@ -130,42 +155,70 @@ python () { if ubootmachine and ubootconfig: raise bb.parse.SkipRecipe("You cannot use UBOOT_MACHINE and UBOOT_CONFIG at the same time.") - if ubootconfigflags and ubootbinaries: - raise bb.parse.SkipRecipe("You cannot use UBOOT_BINARIES as it is internal to uboot_config.bbclass.") + if ubootconfigimagefstypes: + raise bb.parse.SkipRecipe("You cannot use UBOOT_CONFIG_IMAGE_FSTYPES as a variable, you can only set flags.") + + if ubootconfigbinary: + raise bb.parse.SkipRecipe("You cannot use UBOOT_CONFIG_BINARY as a variable, you can only set flags.") - if ubootconfigflags and ubootconfigmakeopts: - raise bb.parse.SkipRecipe("You cannot use UBOOT_CONFIG_MAKE_OPTS as it is internal to uboot_config.bbclass.") + if ubootconfigmakeopts: + raise bb.parse.SkipRecipe("You cannot use UBOOT_CONFIG_MAKE_OPTS as a variable, you can only set flags.") if len(ubootconfig) > 0: for config in ubootconfig: found = False + binary = ubootbinary + imagefstype = "" for f, v in ubootconfigflags.items(): if config == f: found = True items = v.split(',') - if items[0] and len(items) > 4: - raise bb.parse.SkipRecipe('Only config,images,binary,make_opts can be specified!') + if items[0] and len(items) > 3: + raise bb.parse.SkipRecipe('Only config,images,binary can be specified!') d.appendVar('UBOOT_MACHINE', ' ' + items[0]) # IMAGE_FSTYPES appending if len(items) > 1 and items[1]: - bb.debug(1, "Appending '%s' to IMAGE_FSTYPES." % items[1]) - d.appendVar('IMAGE_FSTYPES', ' ' + items[1]) + bb.debug(1, "Staging '%s' for IMAGE_FSTYPES." % items[1]) + imagefstype = items[1] if len(items) > 2 and items[2]: - bb.debug(1, "Appending '%s' to UBOOT_BINARIES." % items[2]) - d.appendVar('UBOOT_BINARIES', ' ' + items[2]) - else: - bb.debug(1, "Appending '%s' to UBOOT_BINARIES." % ubootbinary) - d.appendVar('UBOOT_BINARIES', ' ' + ubootbinary) - if len(items) > 3 and items[3]: - bb.debug(1, "Appending '%s' to UBOOT_CONFIG_MAKE_OPTS." % items[3]) - d.appendVar('UBOOT_CONFIG_MAKE_OPTS', items[3] + " ? ") - else: - bb.debug(1, "Appending '%s' to UBOOT_CONFIG_MAKE_OPTS." % "") - d.appendVar('UBOOT_CONFIG_MAKE_OPTS', " ? ") + bb.debug(1, "Staging '%s' for UBOOT_CONFIG_BINARY." % items[2]) + binary = items[2] break if not found: - raise bb.parse.SkipRecipe("The selected UBOOT_CONFIG key %s has no match in %s." % (ubootconfig, ubootconfigflags.keys())) + raise bb.parse.SkipRecipe("The selected UBOOT_CONFIG key %s has no match in %s." % (config, ubootconfigflags.keys())) + + # Extract out any settings from UBOOT_IMAGE_FSTYPES[config] + if ubootconfigimagefstypesflags: + for f, v in ubootconfigimagefstypesflags.items(): + if config == f: + bb.debug(1, "Staging '%s' for IMAGE_FSTYPES." % v) + imagefstype = v + + if imagefstype: + bb.debug(1, "Appending '%s' to IMAGE_FSTYPES." % imagefstype) + d.appendVar('IMAGE_FSTYPES', ' ' + imagefstype) + + # Extract out any settings from UBOOT_CONFIG_BINARY[config] + if ubootconfigbinaryflags: + for f, v in ubootconfigbinaryflags.items(): + if config == f: + bb.debug(1, "Staging '%s' for UBOOT_CONFIG_BINARY." % v) + binary = v + + bb.debug(1, "Appending '%s' to UBOOT_CONFIG_BINARY." % binary) + d.appendVar('UBOOT_CONFIG_BINARY', binary + " ? ") + + # Extract out any settings from UBOOT_CONFIG_MAKE_OPTS[config] + make_opts = "" + if ubootconfigmakeoptsflags: + for f, v in ubootconfigmakeoptsflags.items(): + if config == f: + bb.debug(1, "Staging '%s' for UBOOT_CONFIG_MAKE_OPTS." % v) + make_opts = v + + bb.debug(1, "Appending '%s' to UBOOT_CONFIG_MAKE_OPTS." % make_opts) + d.appendVar('UBOOT_CONFIG_MAKE_OPTS', make_opts + " ? ") # 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 @@ -176,3 +229,21 @@ python () { # Disable menuconfig for multiple configs d.setVar('KCONFIG_CONFIG_ENABLE_MENUCONFIG', "false") } + +uboot_config_get_indexed_value () { + local list=$1 + local index=$2 + + local k="" + + IFS="?" + for value in $list; do + k=$(expr $k + 1); + if [ $k -eq $index ]; then + break + fi + done + unset IFS + + echo "$value" +} diff --git a/meta/classes-recipe/uboot-sign.bbclass b/meta/classes-recipe/uboot-sign.bbclass index 66b9698c1d..9cb5c6ccf3 100644 --- a/meta/classes-recipe/uboot-sign.bbclass +++ b/meta/classes-recipe/uboot-sign.bbclass @@ -530,15 +530,10 @@ do_uboot_assemble_fitimage() { builddir="${config}-${type}" - for binary in ${UBOOT_BINARIES}; do - k=$(expr $k + 1); - if [ $k -eq $i ]; then - break; - fi - done + config_binary=$(uboot_config_get_indexed_value "${UBOOT_CONFIG_BINARY}" $i) cd ${B}/${builddir} - uboot_assemble_fitimage_helper ${type} ${binary} + uboot_assemble_fitimage_helper ${type} ${config_binary} done else cd ${B} diff --git a/meta/recipes-bsp/u-boot/u-boot-configure.inc b/meta/recipes-bsp/u-boot/u-boot-configure.inc index f3d9e55105..337b8ed6c3 100644 --- a/meta/recipes-bsp/u-boot/u-boot-configure.inc +++ b/meta/recipes-bsp/u-boot/u-boot-configure.inc @@ -35,17 +35,7 @@ uboot_configure_config () { builddir="${config}-${type}" - unset k - IFS="?" - uboot_config_make_opts="${UBOOT_CONFIG_MAKE_OPTS}" - for config_make_opts in $uboot_config_make_opts; do - k=$(expr $k + 1); - if [ $k -eq $i ]; then - break - fi - done - unset IFS - unset k + config_make_opts=$(uboot_config_get_indexed_value "${UBOOT_CONFIG_MAKE_OPTS}" $i) oe_runmake -C ${S} O=${B}/${builddir} ${config_make_opts} ${UBOOT_MAKE_OPTS} ${config} if [ -n "${@' '.join(find_cfgs(d))}" ]; then diff --git a/meta/recipes-bsp/u-boot/u-boot.inc b/meta/recipes-bsp/u-boot/u-boot.inc index ffa9ef2d59..a58bba2160 100644 --- a/meta/recipes-bsp/u-boot/u-boot.inc +++ b/meta/recipes-bsp/u-boot/u-boot.inc @@ -78,28 +78,12 @@ uboot_compile_config () { builddir="${config}-${type}" - unset k - IFS="?" - uboot_config_make_opts="${UBOOT_CONFIG_MAKE_OPTS}" - for config_make_opts in $uboot_config_make_opts; do - k=$(expr $k + 1); - if [ $k -eq $i ]; then - break - fi - done - unset IFS - unset k + config_make_opts=$(uboot_config_get_indexed_value "${UBOOT_CONFIG_MAKE_OPTS}" $i) + config_binary=$(uboot_config_get_indexed_value "${UBOOT_CONFIG_BINARY}" $i) oe_runmake -C ${S} O=${B}/${builddir} ${config_make_opts} ${UBOOT_MAKE_OPTS} ${UBOOT_MAKE_TARGET} - unset k - for binary in ${UBOOT_BINARIES}; do - k=$(expr $k + 1); - if [ $k -eq $i ]; then - uboot_compile_config_copy_binary $config $type $binary - fi - done - unset k + uboot_compile_config_copy_binary $config $type $config_binary # Generate the uboot-initial-env if [ -n "${UBOOT_INITIAL_ENV}" ]; then From patchwork Thu Jan 8 20:22:38 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ryan Eatmon X-Patchwork-Id: 78298 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 649BBD1D490 for ; Thu, 8 Jan 2026 20:22:54 +0000 (UTC) Received: from BN1PR04CU002.outbound.protection.outlook.com (BN1PR04CU002.outbound.protection.outlook.com [52.101.56.61]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.16271.1767903767939462598 for ; Thu, 08 Jan 2026 12:22:48 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@ti.com header.s=selector1 header.b=BvkwYeLD; spf=permerror, err=parse error for token &{10 18 spf.protection.outlook.com}: limit exceeded (domain: ti.com, ip: 52.101.56.61, mailfrom: reatmon@ti.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=VGSkuE7XyLN9nHdum+qXLXA+PSYvhFH7s9w7zdiilQIqDnBe46/pRdtMNR7h8bd+uvS8WlnHzCLFPsYDEwu/BwrNaigPNipsG4YnzQXFxKyBQqeuG/oVvtwT3jTiTJY9uuv4Na8frsAxpCfTnKeFFqRUFtChbocwmuKaKNC+fkP1yvKrjV/mKTx6t6r/9iWh8IndF/K9k+RZVPQCGg7C2yE1AAtlZaZghphyHDozM+a5gX6gupOfJAgttaRSdfTdR8LgbfaidynBiLcR8pW3aIn0ub6crVpDkYtOtCgkdFfQg0FfPCbB0nY4w2LnOxxXbJL/Z4XoTwUBR+R88HEmeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=RDCFzZ+doH0D8Uni3WVTvowcwVXwDnAreW5js+egpQA=; b=cseX0xlCETORd8+H77Gc7W1Ev8ghJgj2eop3yD4YWMfSkSjgG8QCBs3xczXQAKucu0UGYkr4us4Db2sqzeJEd/eTr4VHh6kzs3rMp3B/G/EK2U9irsUQW2TNfJV7/X/KiqanO3JxQ40m0m4rhymVXGb6IDRB2Fha40S6ZqDeNnLqsUye0e6OJspt26eIxftr/yImnpLCOkYOaYWHitanyUGrFVzEvtcaQu+R0uUa6KzcQZCEcpeAKVSEPIo9E5Eqdoou4YUTsWPHqsye1cenThkzwGU4sp0cERRxB3saQHCyLOqGcclk+QUG3KWSLpvX5sdED4/H/9mV+Bj50ld6Tg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 198.47.21.194) smtp.rcpttodomain=lists.openembedded.org smtp.mailfrom=ti.com; dmarc=pass (p=quarantine sp=none pct=100) action=none header.from=ti.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=RDCFzZ+doH0D8Uni3WVTvowcwVXwDnAreW5js+egpQA=; b=BvkwYeLDS1smtGkA1OWeO72zt2/RqYDA2hCv9ynKpO5mVbUtJS+ahNwwCVHxvZgpzaU9F9zYgYlhvNitNNNRTbhk2qUEey4KItYQQ/2b3jH83F15OcbgjCuX8f1zWuqVwhFBeO75ijJmeNlE9pxDcw9J3OO2CCR/9EJ1SkwEQ90= Received: from DS7PR06CA0020.namprd06.prod.outlook.com (2603:10b6:8:2a::21) by SJ1PR10MB5956.namprd10.prod.outlook.com (2603:10b6:a03:489::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9499.2; Thu, 8 Jan 2026 20:22:41 +0000 Received: from DS2PEPF00003447.namprd04.prod.outlook.com (2603:10b6:8:2a:cafe::81) by DS7PR06CA0020.outlook.office365.com (2603:10b6:8:2a::21) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9499.3 via Frontend Transport; Thu, 8 Jan 2026 20:22:36 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 198.47.21.194) smtp.mailfrom=ti.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=ti.com; Received-SPF: Pass (protection.outlook.com: domain of ti.com designates 198.47.21.194 as permitted sender) receiver=protection.outlook.com; client-ip=198.47.21.194; helo=flwvzet200.ext.ti.com; pr=C Received: from flwvzet200.ext.ti.com (198.47.21.194) by DS2PEPF00003447.mail.protection.outlook.com (10.167.17.74) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9520.1 via Frontend Transport; Thu, 8 Jan 2026 20:22:39 +0000 Received: from DFLE212.ent.ti.com (10.64.6.70) by flwvzet200.ext.ti.com (10.248.192.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.20; Thu, 8 Jan 2026 14:22:39 -0600 Received: from DFLE206.ent.ti.com (10.64.6.64) by DFLE212.ent.ti.com (10.64.6.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.20; Thu, 8 Jan 2026 14:22:39 -0600 Received: from lelvem-mr05.itg.ti.com (10.180.75.9) by DFLE206.ent.ti.com (10.64.6.64) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.20 via Frontend Transport; Thu, 8 Jan 2026 14:22:39 -0600 Received: from grumpy (grumpy.dhcp.ti.com [128.247.81.229]) by lelvem-mr05.itg.ti.com (8.18.1/8.18.1) with ESMTP id 608KMdTE3045867 for ; Thu, 8 Jan 2026 14:22:39 -0600 Received: from reatmon by grumpy with local (Exim 4.97) (envelope-from ) id 1vdwWl-0000000AASQ-0bCO for openembedded-core@lists.openembedded.org; Thu, 08 Jan 2026 14:22:39 -0600 From: Ryan Eatmon To: Subject: [OE-core][PATCH 2/3] u-boot: Add support for UBOOT_CONFIG_FRAGMENTS and UBOOT_FRAGMENTS Date: Thu, 8 Jan 2026 14:22:38 -0600 Message-ID: <20260108202239.2423335-2-reatmon@ti.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260108202239.2423335-1-reatmon@ti.com> References: <20260108202239.2423335-1-reatmon@ti.com> MIME-Version: 1.0 X-C2ProcessedOrg: 333ef613-75bf-4e12-a4b1-8e3623f5dcea X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS2PEPF00003447:EE_|SJ1PR10MB5956:EE_ X-MS-Office365-Filtering-Correlation-Id: 0f04e165-dae8-4b77-5e47-08de4ef3abd2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|1800799024|82310400026|34020700016|34070700014|376014; X-Microsoft-Antispam-Message-Info: DU5I5xi6Oj6a7GHPhl3zGObHTmY3SbLwyQmKeAaiOPifRAFKq7/KtMeoDz9AEPylx6TgCMeVbH/PwIFd5sglEU+dqib/WsnX60Wej6UfhIgKx3deeuaLDbz10fGXZ4O5BDVIJZ0zw1fV5xPAer+mADtYisc5Ns/7f5GABZbLzojjgduSbeUNQiYLsuWyyd8PyvFTl6zZyKfwL37yNwt9ng6YqcziCLJPCOJ8yOXGt+pm8BmSnzzJtpKbEdw6yLsFjlh6mwGiRdy1nI82/vpMnS4/Eo2VkV91ScPo7Z8J8oobOZorYp95CSsLbmi4DAMc7ljd7h2LIhaNgGYG3z92BuZA7Pi6rtKttSC+XCA5LZMRjrsvornr5V7yhFnE9uTF6O8BXaisbvBCU4wPyw9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CikOujxboys076gUXcLI5AhlIqnJUypgpnz/j/4Up+QQXQDZdjgYqcMjGehiz2eDn6OT5ZBpotbrPCThQ2JO0bJWwE= X-Forefront-Antispam-Report: CIP:198.47.21.194;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:flwvzet200.ext.ti.com;PTR:ErrorRetry;CAT:NONE;SFS:(13230040)(36860700013)(1800799024)(82310400026)(34020700016)(34070700014)(376014);DIR:OUT;SFP:1101; X-OriginatorOrg: ti.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jan 2026 20:22:39.9135 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0f04e165-dae8-4b77-5e47-08de4ef3abd2 X-MS-Exchange-CrossTenant-Id: e5b49634-450b-4709-8abb-1e2b19b982b7 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=e5b49634-450b-4709-8abb-1e2b19b982b7;Ip=[198.47.21.194];Helo=[flwvzet200.ext.ti.com] X-MS-Exchange-CrossTenant-AuthSource: DS2PEPF00003447.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ1PR10MB5956 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 08 Jan 2026 20:22:54 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/229087 There are config fragments that live in the u-boot source tree. UBOOT_FRAGMENTS will globally add a set of fragments to the configure. UBOOT_CONFIG_FRAGMENTS makes use of the overhauled config flow to add support for specifying alternative fragments for each variation build. Signed-off-by: Ryan Eatmon --- meta/classes-recipe/uboot-config.bbclass | 19 +++++++++++++++++++ meta/recipes-bsp/u-boot/u-boot-configure.inc | 5 +++-- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/meta/classes-recipe/uboot-config.bbclass b/meta/classes-recipe/uboot-config.bbclass index 715fb5c1d2..823a66157a 100644 --- a/meta/classes-recipe/uboot-config.bbclass +++ b/meta/classes-recipe/uboot-config.bbclass @@ -18,6 +18,8 @@ # UBOOT_CONFIG_MAKE_OPTS[foo] = "FOO=1" # UBOOT_CONFIG_MAKE_OPTS[bar] = "BAR=1" # +# UBOOT_CONFIG_FRAGMENTS[foo] = "foo.fragment" +# # For more information about this, please see the official documentation. # # There is a legacy method that is still supported where some of the above @@ -57,6 +59,7 @@ UBOOT_IMAGE ?= "${UBOOT_BINARYNAME}-${MACHINE}-${UBOOT_VERSION}.${UBOOT_SUFFIX}" UBOOT_SYMLINK ?= "${UBOOT_BINARYNAME}-${MACHINE}.${UBOOT_SUFFIX}" UBOOT_MAKE_TARGET ?= "all" UBOOT_MAKE_OPTS ?= "" +UBOOT_FRAGMENTS ?= "" # Output the ELF generated. Some platforms can use the ELF file and directly # load it (JTAG booting, QEMU) additionally the ELF can be used for debugging @@ -141,6 +144,8 @@ python () { ubootconfigbinaryflags = d.getVarFlags('UBOOT_CONFIG_BINARY') ubootconfigmakeopts = d.getVar('UBOOT_CONFIG_MAKE_OPTS') ubootconfigmakeoptsflags = d.getVarFlags('UBOOT_CONFIG_MAKE_OPTS') + ubootconfigfragments = d.getVar('UBOOT_CONFIG_FRAGMENTS') + ubootconfigfragmentsflags = d.getVarFlags('UBOOT_CONFIG_FRAGMENTS') # The "doc" varflag is special, we don't want to see it here ubootconfigflags.pop('doc', None) ubootconfig = (d.getVar('UBOOT_CONFIG') or "").split() @@ -164,6 +169,9 @@ python () { if ubootconfigmakeopts: raise bb.parse.SkipRecipe("You cannot use UBOOT_CONFIG_MAKE_OPTS as a variable, you can only set flags.") + if ubootconfigfragments: + raise bb.parse.SkipRecipe("You cannot use UBOOT_CONFIG_FRAGMENTS as a variable, you can only set flags.") + if len(ubootconfig) > 0: for config in ubootconfig: found = False @@ -220,6 +228,17 @@ python () { bb.debug(1, "Appending '%s' to UBOOT_CONFIG_MAKE_OPTS." % make_opts) d.appendVar('UBOOT_CONFIG_MAKE_OPTS', make_opts + " ? ") + # Extract out any settings from UBOOT_CONFIG_FRAGMENTS[config] + fragments = "" + if ubootconfigfragmentsflags: + for f, v in ubootconfigfragmentsflags.items(): + if config == f: + bb.debug(1, "Staging '%s' for UBOOT_CONFIG_FRAGMENTS." % v) + fragments = v + + 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: diff --git a/meta/recipes-bsp/u-boot/u-boot-configure.inc b/meta/recipes-bsp/u-boot/u-boot-configure.inc index 337b8ed6c3..379637e73e 100644 --- a/meta/recipes-bsp/u-boot/u-boot-configure.inc +++ b/meta/recipes-bsp/u-boot/u-boot-configure.inc @@ -36,8 +36,9 @@ uboot_configure_config () { builddir="${config}-${type}" config_make_opts=$(uboot_config_get_indexed_value "${UBOOT_CONFIG_MAKE_OPTS}" $i) + config_fragments=$(uboot_config_get_indexed_value "${UBOOT_CONFIG_FRAGMENTS}" $i) - oe_runmake -C ${S} O=${B}/${builddir} ${config_make_opts} ${UBOOT_MAKE_OPTS} ${config} + oe_runmake -C ${S} O=${B}/${builddir} ${config_make_opts} ${UBOOT_MAKE_OPTS} ${config} ${config_fragments} ${UBOOT_FRAGMENTS} if [ -n "${@' '.join(find_cfgs(d))}" ]; then merge_config.sh -m -O ${B}/${builddir} ${B}/${builddir}/.config ${@" ".join(find_cfgs(d))} oe_runmake -C ${S} O=${B}/${builddir} oldconfig @@ -46,7 +47,7 @@ uboot_configure_config () { uboot_configure () { if [ -n "${UBOOT_MACHINE}" ]; then - oe_runmake -C ${S} O=${B} ${UBOOT_MAKE_OPTS} ${UBOOT_MACHINE} + oe_runmake -C ${S} O=${B} ${UBOOT_MAKE_OPTS} ${UBOOT_MACHINE} ${UBOOT_FRAGMENTS} else oe_runmake -C ${S} O=${B} ${UBOOT_MAKE_OPTS} oldconfig fi From patchwork Thu Jan 8 20:22:39 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ryan Eatmon X-Patchwork-Id: 78300 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4B61CD1D494 for ; Thu, 8 Jan 2026 20:23:04 +0000 (UTC) Received: from DM5PR21CU001.outbound.protection.outlook.com (DM5PR21CU001.outbound.protection.outlook.com [52.101.62.17]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.16045.1767903777534581850 for ; Thu, 08 Jan 2026 12:22:57 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@ti.com header.s=selector1 header.b=G/MB64nr; spf=permerror, err=parse error for token &{10 18 spf.protection.outlook.com}: limit exceeded (domain: ti.com, ip: 52.101.62.17, mailfrom: reatmon@ti.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=czUQMMaPqsNZnMfuF0I+/iiYRp2gwZ9bOgT/0i4+JYX3+oc6CRb1ndX6IfrMUt9ZIJxA57pPg71fXhfdh07L5MNuBTsNwpvdu3wv5v+XoX1njJkEjSAC0llgjdYMgyEVQCKj3jWBKRbWhXo96RURC8gr6utHG6hCvljxowaQZziNWbgxOqK0OSGF6VZd7j3OffSulWLFgAqdhdPvKlb98pS4KUpVIevgDQF7YpAIXgEYzea16FYCCrmX5T5mXlJdfz3QVjqwByYTpTNI3FWPcEjcbqycobgoh5zSVM0RxrIAqUnwbeZBCpr9JD0WL0pXCkrHiwRk0dlQgEG5ywmYSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ml5qbCwgwD/TyjDbhitPOZsvrVwMFIwoFfNbO9XNpq0=; b=SW83IpC+UgWLgVz451cIdCq/0nUAUyHYCza8bxvhuy9rRhHtB5M1lwWiLgA3niFxABlDqnN51a1iBDwBfAYll2pfBavTwCAot/V/Tt6NBBRStrEF8kfU4J6Y4LgzL4RLWoO63IYsY8Ylxr6H13M01q5Bc5ftPtUGPP0QilmO9qFuTrbxG/50eOMd+YJ0tE0pawfP4O+MiGiw0suc0ymS1H42m6vhbxSfRg45uMurQCLUX9INaVDKfmC2o5FcGoWolT7bfwH4EjcUdvun1pL9E/Ln70Y4OYxTgkma6DxK4L1S8tQ0JBm46RTNSmZR3VGXMsX2gI/bwh6HGYGaEaQj+g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 198.47.21.194) smtp.rcpttodomain=lists.openembedded.org smtp.mailfrom=ti.com; dmarc=pass (p=quarantine sp=none pct=100) action=none header.from=ti.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ml5qbCwgwD/TyjDbhitPOZsvrVwMFIwoFfNbO9XNpq0=; b=G/MB64nrjtZ6Nej4w+F1zfacQRmLB3XMDvgewwK3vtWHLmp9pa043X0vSf84fXzcNGQV5dfDvhc1Nddt6VnVuX9ED7jGYjygNvwZtsIJPKkpYNLJDyl3qprBb4OEmkR9dQ43tXI9npijkF82CPa3Ro8pf2yrJPLjZDE7gf4KlSo= Received: from DS7PR06CA0007.namprd06.prod.outlook.com (2603:10b6:8:2a::25) by SA1PR10MB5734.namprd10.prod.outlook.com (2603:10b6:806:23f::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9499.2; Thu, 8 Jan 2026 20:22:53 +0000 Received: from DS2PEPF00003447.namprd04.prod.outlook.com (2603:10b6:8:2a:cafe::20) by DS7PR06CA0007.outlook.office365.com (2603:10b6:8:2a::25) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9499.3 via Frontend Transport; Thu, 8 Jan 2026 20:22:50 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 198.47.21.194) smtp.mailfrom=ti.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=ti.com; Received-SPF: Pass (protection.outlook.com: domain of ti.com designates 198.47.21.194 as permitted sender) receiver=protection.outlook.com; client-ip=198.47.21.194; helo=flwvzet200.ext.ti.com; pr=C Received: from flwvzet200.ext.ti.com (198.47.21.194) by DS2PEPF00003447.mail.protection.outlook.com (10.167.17.74) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9520.1 via Frontend Transport; Thu, 8 Jan 2026 20:22:52 +0000 Received: from DFLE20.ent.ti.com (10.64.6.57) by flwvzet200.ext.ti.com (10.248.192.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.20; Thu, 8 Jan 2026 14:22:51 -0600 Received: from DFLE210.ent.ti.com (10.64.6.68) by DFLE20.ent.ti.com (10.64.6.57) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.20; Thu, 8 Jan 2026 14:22:51 -0600 Received: from lelvem-mr06.itg.ti.com (10.180.75.8) by DFLE210.ent.ti.com (10.64.6.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.20 via Frontend Transport; Thu, 8 Jan 2026 14:22:39 -0600 Received: from grumpy (grumpy.dhcp.ti.com [128.247.81.229]) by lelvem-mr06.itg.ti.com (8.18.1/8.18.1) with ESMTP id 608KMd9v2934714 for ; Thu, 8 Jan 2026 14:22:39 -0600 Received: from reatmon by grumpy with local (Exim 4.97) (envelope-from ) id 1vdwWl-0000000AASg-0eLB for openembedded-core@lists.openembedded.org; Thu, 08 Jan 2026 14:22:39 -0600 From: Ryan Eatmon To: Subject: [OE-core][PATCH 3/3] selftest: uboot: Add selftests for new UBOOT_CONFIG flow Date: Thu, 8 Jan 2026 14:22:39 -0600 Message-ID: <20260108202239.2423335-3-reatmon@ti.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260108202239.2423335-1-reatmon@ti.com> References: <20260108202239.2423335-1-reatmon@ti.com> MIME-Version: 1.0 X-C2ProcessedOrg: 333ef613-75bf-4e12-a4b1-8e3623f5dcea X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS2PEPF00003447:EE_|SA1PR10MB5734:EE_ X-MS-Office365-Filtering-Correlation-Id: 803d2fd7-adfd-41b5-f666-08de4ef3b32c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|1800799024|34070700014|34020700016|36860700013|376014; X-Microsoft-Antispam-Message-Info: dmRe5fabG2k/6eSHYFHQdXIqSY2tMDHijRYvcnVV9eNF4Ee9ATUUbiH0K3G8E3T6VgzsZjEbFuQHk38BvEa5vhyTiugPhJba6fnoHTw8UoMggCGyjhgDzoyokurxwSn2B3QjWiN8OEjfXQtIlu3dRJrBXUI2AWr3C15b/xt3wWz7OClj/0Uii6J641xrqnqL6OYR1RPAyHP4AAlrh6EsCEnCPY7gQz05FlPDk7i4jI8e/LhhZHA3BYAUJbgWuJf5JYiNrTY8lni9TMlqXYDGmuW76wmItgQUCx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IC6YmiMu49lVhSaBhvt+5SmuvDABLJAJxRo7lz+k4MvkOoqnQ259x3ucSBjexaHpib9Nxv8s6hI7ceOjt7H3N6J/vsTu7X5IxaF0an5eqi0HUBwIwYAp6yEzpxoUIaVzqNJAuzxK0aWfve9jSirJgmAAEYZ5iFHogbMGBxks0XiM7PhiFXEew9auKvxVn5uFQzNEzWB8RrLeAjf1J0VbuA2w= X-Forefront-Antispam-Report: CIP:198.47.21.194;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:flwvzet200.ext.ti.com;PTR:ErrorRetry;CAT:NONE;SFS:(13230040)(82310400026)(1800799024)(34070700014)(34020700016)(36860700013)(376014);DIR:OUT;SFP:1101; X-OriginatorOrg: ti.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jan 2026 20:22:52.2275 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 803d2fd7-adfd-41b5-f666-08de4ef3b32c X-MS-Exchange-CrossTenant-Id: e5b49634-450b-4709-8abb-1e2b19b982b7 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=e5b49634-450b-4709-8abb-1e2b19b982b7;Ip=[198.47.21.194];Helo=[flwvzet200.ext.ti.com] X-MS-Exchange-CrossTenant-AuthSource: DS2PEPF00003447.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR10MB5734 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 08 Jan 2026 20:23:04 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/229089 This adds seven new selftests to verify the functionality of the overhauled UBOOT_CONFIG flow. Signed-off-by: Ryan Eatmon --- meta/lib/oeqa/selftest/cases/uboot.py | 217 ++++++++++++++++++++++++++ 1 file changed, 217 insertions(+) diff --git a/meta/lib/oeqa/selftest/cases/uboot.py b/meta/lib/oeqa/selftest/cases/uboot.py index 28169514f5..8e53ae5031 100644 --- a/meta/lib/oeqa/selftest/cases/uboot.py +++ b/meta/lib/oeqa/selftest/cases/uboot.py @@ -150,3 +150,220 @@ QB_DRIVE_TYPE = "/dev/vd" )) self.assertExists(uboot_initial_env_binary_path) + + +class UBootConfigTest(OESelftestTestCase): + + def test_uboot_config_extract(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 test2 test3" + 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"], "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 ? ? ") + + def test_uboot_config_extract_legacy(self): + """ + Tests the legacy comma-separated portion of 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 test2 test3" + UBOOT_CONFIG[test1] = "machine1" + UBOOT_CONFIG[test2] = "machine2,image_fstype2" + UBOOT_CONFIG[test3] = "machine3,image_fstype3,binary3" + """)) + + 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") + + 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"], " ? ? ? ") + + def test_uboot_config_extract_error_missing_config(self): + """ + Tests the uboot-config.bbclass python function that extracts all of + the config variations to make sure it errors on having a missing + flag in UBOOT_CONFIG. + """ + + self.write_config(textwrap.dedent(f""" + UBOOT_BINARY = "defBinary" + UBOOT_MACHINE = "" + UBOOT_CONFIG = "test1 test2 test3" + UBOOT_CONFIG[test1] = "machine1" + UBOOT_CONFIG[test2] = "machine2" + """)) + + with self.assertRaises(AssertionError) as cm: + bitbake("-e u-boot") + + e = cm.exception + s = str(e) + + self.assertIn("ERROR: Nothing PROVIDES 'u-boot'", s) + self.assertIn("u-boot was skipped: The selected UBOOT_CONFIG key test3 has no match in dict_keys(['test1', 'test2']).", s) + + def test_uboot_config_extract_error_nothing_set(self): + """ + Tests the uboot-config.bbclass python function that extracts all of + the config variations to make sure it errors on not having + UBOOT_MACHINE or UBOOT_CONFIG set. + """ + + machine = get_bb_var("MACHINE", "u-boot") + + self.write_config(textwrap.dedent(f""" + UBOOT_MACHINE = "" + UBOOT_CONFIG = "" + """)) + + with self.assertRaises(AssertionError) as cm: + bitbake("-e u-boot") + + e = cm.exception + s = str(e) + + self.assertIn("ERROR: Nothing PROVIDES 'u-boot'", s) + self.assertIn("u-boot was skipped: Either UBOOT_MACHINE or UBOOT_CONFIG must be set in the %s machine configuration." % machine, s) + + def test_uboot_config_extract_error_set_both_config_and_machine(self): + """ + Tests the uboot-config.bbclass python function that extracts all of + the config variations to make sure it errors on setting both + UBOOT_MACHINE or UBOOT_CONFIG. + """ + + self.write_config(textwrap.dedent(f""" + UBOOT_MACHINE = "machine" + UBOOT_CONFIG = "test1 test2" + """)) + + with self.assertRaises(AssertionError) as cm: + bitbake("-e u-boot") + + e = cm.exception + s = str(e) + + self.assertIn("ERROR: Nothing PROVIDES 'u-boot'", s) + self.assertIn("u-boot was skipped: You cannot use UBOOT_MACHINE and UBOOT_CONFIG at the same time.", s) + + def test_uboot_config_extract_error_set_uboot_config_image_fstypes(self): + """ + Tests the uboot-config.bbclass python function that extracts all of + the config variations to make sure it errors on setting internal + variable UBOOT_CONFIG_IMAGE_FSTYPES. + """ + + self.write_config(textwrap.dedent(f""" + UBOOT_MACHINE = "" + UBOOT_CONFIG = "test1 test2" + UBOOT_CONFIG_IMAGE_FSTYPES = "fstype" + """)) + + with self.assertRaises(AssertionError) as cm: + bitbake("-e u-boot") + + e = cm.exception + s = str(e) + + self.assertIn("ERROR: Nothing PROVIDES 'u-boot'", s) + self.assertIn("u-boot was skipped: You cannot use UBOOT_CONFIG_IMAGE_FSTYPES as a variable, you can only set flags.", s) + + def test_uboot_config_extract_error_set_uboot_config_binary(self): + """ + Tests the uboot-config.bbclass python function that extracts all of + the config variations to make sure it errors on setting internal + variable UBOOT_CONFIG_BINARY. + """ + + self.write_config(textwrap.dedent(f""" + UBOOT_MACHINE = "" + UBOOT_CONFIG = "test1 test2" + UBOOT_CONFIG_BINARY = "binary" + """)) + + with self.assertRaises(AssertionError) as cm: + bitbake("-e u-boot") + + e = cm.exception + s = str(e) + + self.assertIn("ERROR: Nothing PROVIDES 'u-boot'", s) + self.assertIn("u-boot was skipped: You cannot use UBOOT_CONFIG_BINARY as a variable, you can only set flags.", s) + + def test_uboot_config_extract_error_set_uboot_config_make_opts(self): + """ + Tests the uboot-config.bbclass python function that extracts all of + the config variations to make sure it errors on setting internal + variable UBOOT_CONFIG_MAKE_OPTS. + """ + + self.write_config(textwrap.dedent(f""" + UBOOT_MACHINE = "" + UBOOT_CONFIG = "test1 test2" + UBOOT_CONFIG_MAKE_OPTS = "OPT=1" + """)) + + with self.assertRaises(AssertionError) as cm: + bitbake("-e u-boot") + + e = cm.exception + s = str(e) + + self.assertIn("ERROR: Nothing PROVIDES 'u-boot'", s) + self.assertIn("u-boot was skipped: You cannot use UBOOT_CONFIG_MAKE_OPTS as a variable, you can only set flags.", s) + + def test_uboot_config_extract_error_set_uboot_config_fragments(self): + """ + Tests the uboot-config.bbclass python function that extracts all of + the config variations to make sure it errors on setting internal + variable UBOOT_CONFIG_FRAGMENTS. + """ + + self.write_config(textwrap.dedent(f""" + UBOOT_MACHINE = "" + UBOOT_CONFIG = "test1 test2" + UBOOT_CONFIG_FRAGMENTS = "fragment" + """)) + + with self.assertRaises(AssertionError) as cm: + bitbake("-e u-boot") + + e = cm.exception + s = str(e) + + self.assertIn("ERROR: Nothing PROVIDES 'u-boot'", s) + self.assertIn("u-boot was skipped: You cannot use UBOOT_CONFIG_FRAGMENTS as a variable, you can only set flags.", s)