I-O DATA WN-DAX3000GR has a MSTC (Mitra Star Technology Corp.) specific
header with a different length than ELECOM WRC-X3000GS2.
Make the header length configurable by parameterizing on
Build/mstc-header.
- WRC-X3000GS2: 0x400
- WN-DAX3000GR: 0x480
Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/19053
Signed-off-by: Robert Marko <robimarko@gmail.com>
DEVICE_VARS += BOOT_SCRIPT
define Build/mstc-header
- $(eval version=$(1))
+ $(eval version=$(word 1,$(1)))
+ $(eval hdrlen=$(if $(word 2,$(1)),$(word 2,$(1)),0x400))
gzip -c $@ | tail -c8 > $@.crclen
( \
printf "CMOC"; \
dd bs=64 count=1 conv=sync 2>/dev/null; \
printf "$(version)" | \
dd bs=64 count=1 conv=sync 2>/dev/null; \
- dd if=/dev/zero bs=884 count=1 2>/dev/null; \
+ dd if=/dev/zero bs=$$(($(hdrlen) - 0x8c)) count=1 2>/dev/null; \
cat $@; \
) > $@.new
mv $@.new $@