image: add support for overriding kernel/rootfs images in sysupgrade-tar template
authorFelix Fietkau <nbd@nbd.name>
Sat, 30 Jul 2016 11:47:36 +0000 (13:47 +0200)
committerFelix Fietkau <nbd@nbd.name>
Sat, 30 Jul 2016 12:10:33 +0000 (14:10 +0200)
Signed-off-by: Felix Fietkau <nbd@nbd.name>
include/image-commands.mk
include/image.mk

index 8cf54bbaa16795e389863c7001d207a5ae53968f..f95a68dab14ac529b967a6f1d7d48d5d21916c56 100644 (file)
@@ -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
index b5e45ec155ae7d766d7a3984e461a9f5066b554b..8c3c983c068ea5ce19cc3258b93736d4f0ecded9 100644 (file)
@@ -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))