aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorPiotr Dymacz <pepe2k@gmail.com>2017-06-23 23:07:10 +0200
committerPiotr Dymacz <pepe2k@gmail.com>2017-06-29 10:37:36 +0200
commit5b7f59225118a3553af5e9d485e2445f28444fb9 (patch)
tree9b7dddb8a8120b07e8e8db9152d923279beb0a97 /include
parent7d6c63d875421fc1f66833ba0e690914ea28f1a3 (diff)
downloadupstream-5b7f59225118a3553af5e9d485e2445f28444fb9.tar.gz
upstream-5b7f59225118a3553af5e9d485e2445f28444fb9.tar.bz2
upstream-5b7f59225118a3553af5e9d485e2445f28444fb9.zip
build: move mktplinkfw2 related commands to image-commands.mk
There are already two targets (lantiq, ramips) which use mktplinkfw2 tool for creating images. This de-duplicates code, introduces two new build commands: tplink-v2-header, tplink-v2-image and makes use of them in place of old, (sub)target specific ones. Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
Diffstat (limited to 'include')
-rw-r--r--include/image-commands.mk14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/image-commands.mk b/include/image-commands.mk
index 718ffe82c3..ce84e3f11c 100644
--- a/include/image-commands.mk
+++ b/include/image-commands.mk
@@ -233,6 +233,20 @@ define Build/sysupgrade-tar
$@
endef
+define Build/tplink-v2-header
+ $(STAGING_DIR_HOST)/bin/mktplinkfw2 \
+ -c -V "ver. 2.0" -B $(TPLINK_BOARD_ID) $(1) -k $@ -o $@.new
+ @mv $@.new $@
+endef
+
+define Build/tplink-v2-image
+ $(STAGING_DIR_HOST)/bin/mktplinkfw2 \
+ -a 0x4 -j -V "ver. 2.0" -B $(TPLINK_BOARD_ID) $(1) \
+ -k $(IMAGE_KERNEL) -r $(IMAGE_ROOTFS) -o $@.new
+ cat $@.new >> $@
+ rm -rf $@.new
+endef
+
json_quote=$(subst ','\'',$(subst ",\",$(1)))
#")')
metadata_devices=$(if $(1),$(subst "$(space)","$(comma)",$(strip $(foreach v,$(1),"$(call json_quote,$(v))"))))