[source] image: add support for overriding kernel/rootfs images in sysupgrade-tar template

LEDE Commits lede-commits at lists.infradead.org
Sat Jul 30 05:10:40 PDT 2016


nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/?p=source.git;a=commitdiff;h=84718d8736b3e8282e7a4db6cb3aee73663a3b40

commit 84718d8736b3e8282e7a4db6cb3aee73663a3b40
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Sat Jul 30 13:47:36 2016 +0200

    image: add support for overriding kernel/rootfs images in sysupgrade-tar template
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 include/image-commands.mk | 4 ++--
 include/image.mk          | 1 +
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/include/image-commands.mk b/include/image-commands.mk
index 8cf54bb..f95a68d 100644
--- a/include/image-commands.mk
+++ b/include/image-commands.mk
@@ -151,7 +151,7 @@ endef
 define Build/sysupgrade-tar
 	sh $(TOPDIR)/scripts/sysupgrade-tar.sh \
 		--board $(if $(BOARD_NAME),$(BOARD_NAME),$(DEVICE_NAME)) \
-		--kernel $(word 1,$^) \
-		--rootfs $(word 2,$^) \
+		--kernel $(call param_get_default,kernel,$(1),$(word 1,$^)) \
+		--rootfs $(call param_get_default,rootfs,$(1),$(word 2,$^)) \
 		$@
 endef
diff --git a/include/image.mk b/include/image.mk
index b5e45ec..8c3c983 100644
--- a/include/image.mk
+++ b/include/image.mk
@@ -29,6 +29,7 @@ override NO_TRACE_MAKE:=$(_SINGLE)$(NO_TRACE_MAKE)
 
 target_params = $(subst +,$(space),$*)
 param_get = $(patsubst $(1)=%,%,$(filter $(1)=%,$(2)))
+param_get_default = $(firstword $(call param_get,$(1),$(2)) $(3))
 param_mangle = $(subst $(space),_,$(strip $(1)))
 param_unmangle = $(subst _,$(space),$(1))
 



More information about the lede-commits mailing list