diff options
Diffstat (limited to 'target/linux/ramips/image/mt7621.mk')
-rw-r--r-- | target/linux/ramips/image/mt7621.mk | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index df89877c9a..96bfab3fef 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -62,6 +62,29 @@ define Build/iodata-mstc-header ) endef +define Build/znet-header + $(eval version=$(word 1,$(1))) + ( \ + data_size_crc="$$(dd if=$@ 2>/dev/null | gzip -c | \ + tail -c 8 | od -An -N4 -tx4 --endian big | tr -d ' \n')"; \ + payload_len="$$(dd if=$@ bs=4 count=1 skip=1 2>/dev/null | od -An -tdI --endian big | tr -d ' \n')"; \ + payload_size_crc="$$(dd if=$@ ibs=1 count=$$payload_len 2>/dev/null | gzip -c | \ + tail -c 8 | od -An -N4 -tx4 --endian big | tr -d ' \n')"; \ + echo -ne "\x5A\x4E\x45\x54" | dd bs=4 count=1 conv=sync 2>/dev/null; \ + echo -ne "$$(printf '%08x' $$(stat -c%s $@) | fold -s2 | xargs -I {} echo \\x{} | tac | tr -d '\n')" | \ + dd bs=4 count=1 conv=sync 2>/dev/null; \ + echo -ne "$$(echo $$data_size_crc | sed 's/../\\x&/g')" | \ + dd bs=4 count=1 conv=sync 2>/dev/null; \ + echo -ne "$$(echo $$payload_size_crc | sed 's/../\\x&/g')" | \ + dd bs=4 count=1 conv=sync 2>/dev/null; \ + echo -ne "\x12\x34\x56\x78" | dd bs=4 count=1 conv=sync 2>/dev/null; \ + echo -ne "$(version)" | dd bs=28 count=1 conv=sync 2>/dev/null; \ + dd if=/dev/zero bs=262096 count=1 conv=sync 2>/dev/null | tr "\000" "\377"; \ + cat $@; \ + ) > $@.new + mv $@.new $@ +endef + define Build/belkin-header $(eval magic=$(word 1,$(1))) $(eval hw_ver=$(word 2,$(1))) @@ -2875,3 +2898,19 @@ define Device/zyxel_wap6805 IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata endef TARGET_DEVICES += zyxel_wap6805 + +define Device/zyxel_wsm20 + $(Device/dsa-migration) + BLOCKSIZE := 128k + PAGESIZE := 2048 + KERNEL_SIZE := 8192k + IMAGE_SIZE := 41943040 + UBINIZE_OPTS := -E 5 + DEVICE_VENDOR := ZyXEL + DEVICE_MODEL := WSM20 + DEVICE_PACKAGES := kmod-mt7915-firmware + KERNEL := kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb | znet-header V1.00(ABZF.0)C0 + KERNEL_INITRAMFS := kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb | znet-header V1.00(ABZF.0)C0 + IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata +endef +TARGET_DEVICES += zyxel_wsm20 |