build: move mktplinkfw2 related commands to image-commands.mk
[openwrt/openwrt.git] / include / image-commands.mk
index 718ffe82c33d9ecf475e8b1e9de0c27272a49b7a..ce84e3f11cf48d4384eb063f0597404d8f1eba12 100644 (file)
@@ -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))"))))