kernel: update 4.9 to 4.9.51
[openwrt/openwrt.git] / include / image-commands.mk
index 8607c85e9e156ae41ac2d11809c3f55632148c80..acf25d64da83d4f1d3577474b717978a7c95cc09 100644 (file)
@@ -91,7 +91,7 @@ endef
 
 define Build/tplink-safeloader
        -$(STAGING_DIR_HOST)/bin/tplink-safeloader \
-               -B $(TPLINK_BOARD_NAME) \
+               -B $(TPLINK_BOARD_ID) \
                -V $(REVISION) \
                -k $(IMAGE_KERNEL) \
                -r $@ \
@@ -114,6 +114,11 @@ define Build/install-dtb
        )
 endef
 
+define Build/install-zImage
+    $(CP) $(KDIR)/zImage \
+      $(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE_SANITIZED)-zImage
+endef
+
 define Build/fit
        $(TOPDIR)/scripts/mkits.sh \
                -D $(DEVICE_NAME) -o $@.its -k $@ \
@@ -233,6 +238,29 @@ define Build/sysupgrade-tar
                $@
 endef
 
+define Build/tplink-v1-header
+       $(STAGING_DIR_HOST)/bin/mktplinkfw \
+               -c -H $(TPLINK_HWID) -W $(TPLINK_HWREV) -L $(KERNEL_LOADADDR) \
+               -E $(if $(KERNEL_ENTRY),$(KERNEL_ENTRY),$(KERNEL_LOADADDR)) \
+               -m $(TPLINK_HEADER_VERSION) -N "$(VERSION_DIST)" -V $(REVISION) \
+               -k $@ -o $@.new $(1)
+       @mv $@.new $@
+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))"))))