diff mbox series

uboot-envtools: support uci-default config also per subtargets

Message ID 20210402151021.47485-1-pepe2k@gmail.com
State Accepted, archived
Delegated to: Piotr Dymacz
Headers show
Series uboot-envtools: support uci-default config also per subtargets | expand

Commit Message

Piotr Dymacz April 2, 2021, 3:10 p.m. UTC
The current version of 'uboot-envtools' package generates dedicated
uci-default file only per target. This change makes it possible to
use subtarget-specific files, with name pattern: 'target_subtarget'
(example: 'ath79_nand'). The subtarget-specific files will take
precedence over target-specific one.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
---
 package/boot/uboot-envtools/Makefile | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/package/boot/uboot-envtools/Makefile b/package/boot/uboot-envtools/Makefile
index a9eccec0ce..597a029bee 100644
--- a/package/boot/uboot-envtools/Makefile
+++ b/package/boot/uboot-envtools/Makefile
@@ -70,9 +70,13 @@  define Package/uboot-envtools/install
 	$(INSTALL_DIR) $(1)/lib
 	$(INSTALL_DATA) ./files/uboot-envtools.sh $(1)/lib
 	$(INSTALL_DIR) $(1)/etc/uci-defaults
-	$(if $(wildcard ./files/$(BOARD)), \
-		$(INSTALL_DATA) ./files/$(BOARD) \
-		$(1)/etc/uci-defaults/30_uboot-envtools \
+	$(if $(wildcard ./files/$(BOARD)_$(SUBTARGET)), \
+		$(INSTALL_DATA) ./files/$(BOARD)_$(SUBTARGET) \
+		$(1)/etc/uci-defaults/30_uboot-envtools, \
+		$(if $(wildcard ./files/$(BOARD)), \
+			$(INSTALL_DATA) ./files/$(BOARD) \
+			$(1)/etc/uci-defaults/30_uboot-envtools \
+		) \
 	)
 endef