$@
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))"))))
-define Build/tplink-fw
- mktplinkfw2 -c -B $(BOARD_ID) -s \
- -k $@ -o $@.new
- mv $@.new $@
-endef
-
-define Build/mktplinkfw2
- mktplinkfw2 -B $(BOARD_ID) -s -a 0x4 -j \
- -k $(IMAGE_KERNEL) -r $(IMAGE_ROOTFS) \
- -o $@
-endef
-DEVICE_VARS += BOARD_ID
+DEVICE_VARS += TPLINK_BOARD_ID
define Device/lantiqTpLink
KERNEL := kernel-bin | append-dtb | lzma
- KERNEL_INITRAMFS := kernel-bin | append-dtb | lzma | tplink-fw
+ KERNEL_INITRAMFS := kernel-bin | append-dtb | lzma | \
+ tplink-v2-header -s -V "ver. 1.0"
IMAGES := sysupgrade.bin
- IMAGE/sysupgrade.bin := mktplinkfw2 | append-metadata | check-size $$$$(IMAGE_SIZE)
+ IMAGE/sysupgrade.bin := tplink-v2-image -s -V "ver. 1.0" | \
+ append-metadata | check-size $$$$(IMAGE_SIZE)
endef
define Device/TDW8970
$(Device/lantiqTpLink)
DEVICE_PROFILE := TDW8970
- BOARD_ID := TD-W8970v1
+ TPLINK_BOARD_ID := TD-W8970v1
IMAGE_SIZE := 7680k
DEVICE_TITLE := TP-LINK TD-W8970
DEVICE_PACKAGES:= kmod-ath9k wpad-mini kmod-usb-dwc2 kmod-usb-ledtrig-usbport
define Device/TDW8980
$(Device/lantiqTpLink)
DEVICE_PROFILE := TDW8980
- BOARD_ID := TD-W8980v1
+ TPLINK_BOARD_ID := TD-W8980v1
IMAGE_SIZE := 7680k
DEVICE_TITLE := TP-LINK TD-W8980
DEVICE_PACKAGES:= kmod-ath9k kmod-owl-loader wpad-mini kmod-usb-dwc2 kmod-usb-ledtrig-usbport
define Device/VR200v
$(Device/lantiqTpLink)
DEVICE_PROFILE := VR200v
- BOARD_ID := ArcherVR200V
+ TPLINK_BOARD_ID := ArcherVR200V
IMAGE_SIZE := 15808k
DEVICE_TITLE := TP-LINK Archer VR200v
DEVICE_PACKAGES:= kmod-usb-dwc2 kmod-usb-ledtrig-usbport
# MT7620A Profiles
#
-define Build/tplink-header
- $(STAGING_DIR_HOST)/bin/mktplinkfw2 -a 0x4 -V "ver. 2.0" -B $(1) \
- -o $@.new -k $@ -r $(IMAGE_ROOTFS) && mv $@.new $@
-endef
+DEVICE_VARS += TPLINK_BOARD_ID
define Build/elecom-header
cp $@ $(KDIR)/v_0.0.0.bin
define Device/ArcherC20i
DTS := ArcherC20i
SUPPORTED_DEVICES := c20i
+ TPLINK_BOARD_ID := ArcherC20i
KERNEL := $(KERNEL_DTB)
- KERNEL_INITRAMFS := $(KERNEL_DTB) | tplink-header ArcherC20i -c
- IMAGE/factory.bin := append-kernel | tplink-header ArcherC20i -j
- IMAGE/sysupgrade.bin := append-kernel | tplink-header ArcherC20i -j -s | append-metadata
+ KERNEL_INITRAMFS := $(KERNEL_DTB) | tplink-v2-header
+ IMAGE/factory.bin := tplink-v2-image
+ IMAGE/sysupgrade.bin := tplink-v2-image -s | append-metadata
IMAGES += factory.bin
DEVICE_TITLE := TP-Link ArcherC20i
endef
define Device/ArcherC50
DTS := ArcherC50
SUPPORTED_DEVICES := c50
+ TPLINK_BOARD_ID := ArcherC50
KERNEL := $(KERNEL_DTB)
- KERNEL_INITRAMFS := $(KERNEL_DTB) | tplink-header ArcherC50 -c
- IMAGE/factory.bin := append-kernel | tplink-header ArcherC50 -j
- IMAGE/sysupgrade.bin := append-kernel | tplink-header ArcherC50 -j -s | append-metadata
+ KERNEL_INITRAMFS := $(KERNEL_DTB) | tplink-v2-header
+ IMAGE/factory.bin := tplink-v2-image
+ IMAGE/sysupgrade.bin := tplink-v2-image -s | append-metadata
IMAGES += factory.bin
DEVICE_TITLE := TP-Link ArcherC50
endef
define Device/ArcherMR200
DTS := ArcherMR200
SUPPORTED_DEVICES := mr200
+ TPLINK_BOARD_ID := ArcherMR200
KERNEL := $(KERNEL_DTB)
- KERNEL_INITRAMFS := $(KERNEL_DTB) | tplink-header ArcherMR200 -c
- IMAGE/sysupgrade.bin := append-kernel | tplink-header ArcherMR200 -j -s | append-metadata
+ KERNEL_INITRAMFS := $(KERNEL_DTB) | tplink-v2-header
+ IMAGE/sysupgrade.bin := tplink-v2-image -s | append-metadata
DEVICE_PACKAGES := kmod-usb2 kmod-usb-net kmod-usb-net-rndis kmod-usb-serial kmod-usb-serial-option adb-enablemodem
DEVICE_TITLE := TP-Link ArcherMR200
endef