|
@@ -52,33 +52,6 @@ define Build/uboot-fit
|
|
|
@mv [email protected] $@
|
|
|
endef
|
|
|
|
|
|
-# Append header to a D-Link M32/R32 Kernel 1 partition
|
|
|
-define Build/m32-r32-recovery-header-kernel1
|
|
|
- $(eval header_start=$(word 1,$(1)))
|
|
|
-# create [email protected] without the checksum
|
|
|
- echo -en "$(header_start)\x00\x00" > "[email protected]"
|
|
|
-# Calculate checksum over data area ($@) and append it to the header.
|
|
|
-# The checksum is the 2byte-sum over the whole data area.
|
|
|
-# Every overflow during the checksum calculation must increment the current checksum value by 1.
|
|
|
- od -v -w2 -tu2 -An --endian little "$@" | awk '{ s+=$$1; } END { s%=65535; printf "%c%c",s%256,s/256; }' >> "[email protected]"
|
|
|
- echo -en "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x8D\x57\x30\x0B" >> "[email protected]"
|
|
|
-# Byte 0-3: Erase Start 0x002C0000
|
|
|
-# Byte 4-7: Erase Length 0x02D00000
|
|
|
-# Byte 8-11: Data offset: 0x002C0000
|
|
|
-# Byte 12-15: Data Length: 0x02D00000
|
|
|
- echo -en "\x00\x00\x2C\x00\x00\x00\xD0\x02\x00\x00\x2C\x00\x00\x00\xD0\x02" >> "[email protected]"
|
|
|
-# Only zeros
|
|
|
- echo -en "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" >> "[email protected]"
|
|
|
-# Last 16 bytes, but without checksum
|
|
|
- echo -en "\x42\x48\x02\x00\x00\x00\x08\x00\x00\x00\x00\x00\x60\x6E" >> "[email protected]"
|
|
|
-# Calculate and append checksum: The checksum must be set so that the 2byte-sum of the whole header is 0.
|
|
|
-# Every overflow during the checksum calculation must increment the current checksum value by 1.
|
|
|
- od -v -w2 -tu2 -An --endian little "[email protected]" | awk '{s+=65535-$$1;}END{s%=65535;printf "%c%c",s%256,s/256;}' >> "[email protected]"
|
|
|
- cat "[email protected]" "$@" > "[email protected]"
|
|
|
- mv "[email protected]" "$@"
|
|
|
- rm "[email protected]"
|
|
|
-endef
|
|
|
-
|
|
|
define Build/mt7622-gpt
|
|
|
cp $@ [email protected] 2>/dev/null || true
|
|
|
ptgen -g -o [email protected] -a 1 -l 1024 \
|
|
@@ -210,7 +183,7 @@ define Device/dlink_eagle-pro-ai-m32-a1
|
|
|
$(Device/dlink_eagle-pro-ai-ax3200-a1)
|
|
|
DEVICE_MODEL := EAGLE PRO AI M32
|
|
|
DEVICE_DTS := mt7622-dlink-eagle-pro-ai-m32-a1
|
|
|
- IMAGE/recovery.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi | pad-to $$(IMAGE_SIZE) | m32-r32-recovery-header-kernel1 DLK6E6010001
|
|
|
+ IMAGE/recovery.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi | pad-to $$(IMAGE_SIZE) | dlink-ai-recovery-header DLK6E6010001 \x8D\x57\x30\x0B \x00\x00\x2C\x00 \x00\x00\xD0\x02 \x60\x6E
|
|
|
endef
|
|
|
TARGET_DEVICES += dlink_eagle-pro-ai-m32-a1
|
|
|
|
|
@@ -218,7 +191,7 @@ define Device/dlink_eagle-pro-ai-r32-a1
|
|
|
$(Device/dlink_eagle-pro-ai-ax3200-a1)
|
|
|
DEVICE_MODEL := EAGLE PRO AI R32
|
|
|
DEVICE_DTS := mt7622-dlink-eagle-pro-ai-r32-a1
|
|
|
- IMAGE/recovery.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi | pad-to $$(IMAGE_SIZE) | m32-r32-recovery-header-kernel1 DLK6E6015001
|
|
|
+ IMAGE/recovery.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi | pad-to $$(IMAGE_SIZE) | dlink-ai-recovery-header DLK6E6015001 \x8D\x57\x30\x0B \x00\x00\x2C\x00 \x00\x00\xD0\x02 \x60\x6E
|
|
|
endef
|
|
|
TARGET_DEVICES += dlink_eagle-pro-ai-r32-a1
|
|
|
|