[openwrt/openwrt] uboot-mk: Enable specifying defconfig fragments

LEDE Commits lede-commits at lists.infradead.org
Sat Jun 7 12:10:56 PDT 2025


hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/49843b31bc601d52c993530ad5ec185d06e623bf

commit 49843b31bc601d52c993530ad5ec185d06e623bf
Author: Andreas Gnau <andreas.gnau at iopsys.eu>
AuthorDate: Fri May 30 17:47:57 2025 +0200

    uboot-mk: Enable specifying defconfig fragments
    
    U-Boot allows specifying additional KConfig fragments to be applied on
    top of a defconfig. These are usually located in the board
    sub-directory.
    
        make foo_defconfig bar.config baz.config
    
    Add support for specifying additional KConfig fragments using the
    UBOOT_CONFIG variable. Treat the first word in UBOOT_CONFIG as the name
    of the defconfig, any additional words as additional fragments.
    
    This can be useful to distinguish between different variants of U-Boot
    builds such as different RAM, storage (NAND/eMMC), security etc.
    
    While c05c0699d479 (u-boot.mk: add support for config customization,
    2023-06-02) already added means to modify specific KConfig options
    directly from the OpenWrt Makefile, leveraging existing fragments the
    U-Boot source-dir provides a more convenient way to extend the config
    when customising more than just one or two options. Furthermore it is
    desirable to leverage existing fragments from upstream U-Boot where they
    exist.
    
    Signed-off-by: Andreas Gnau <andreas.gnau at iopsys.eu>
    Link: https://github.com/openwrt/openwrt/pull/18963
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 include/u-boot.mk | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/include/u-boot.mk b/include/u-boot.mk
index 529d69f4ba..45f4d454f7 100644
--- a/include/u-boot.mk
+++ b/include/u-boot.mk
@@ -111,7 +111,11 @@ define Build/U-Boot/Target
 endef
 
 define Build/Configure/U-Boot
-	+$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) CROSS_COMPILE=$(TARGET_CROSS) $(UBOOT_CONFIGURE_VARS) $(UBOOT_CONFIG)_config
+	+$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
+		CROSS_COMPILE=$(TARGET_CROSS) \
+		$(UBOOT_CONFIGURE_VARS) \
+		$(firstword $(UBOOT_CONFIG))_config \
+		$(wordlist 2,$(words $(UBOOT_CONFIG)),$(UBOOT_CONFIG:%=%.config))
 	$(if $(strip $(UBOOT_CUSTOMIZE_CONFIG)),
 		$(PKG_BUILD_DIR)/scripts/config --file $(PKG_BUILD_DIR)/.config $(UBOOT_CUSTOMIZE_CONFIG)
 		+$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) CROSS_COMPILE=$(TARGET_CROSS) $(UBOOT_CONFIGURE_VARS) oldconfig)




More information about the lede-commits mailing list