uboot-envtools: support uci-default config also per subtargets
authorPiotr Dymacz <pepe2k@gmail.com>
Thu, 1 Apr 2021 22:52:56 +0000 (00:52 +0200)
committerPiotr Dymacz <pepe2k@gmail.com>
Thu, 20 May 2021 11:57:43 +0000 (13:57 +0200)
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

index 02bca9cea3f6a7d9a177a99947ea7394e83bd5ad..1ace390c40a816e43797c8c4fc07f192b792b15a 100644 (file)
@@ -73,9 +73,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