AR71XX_MODEL="$machine"
}
+cybertan_get_hw_magic() {
+ local part
+
+ part=$(find_mtd_part firmware)
+ [ -z "$part" ] && return 1
+
+ dd bs=8 count=1 skip=0 if=$part 2>/dev/null | hexdump -v -n 8 -e '1/1 "%02x"'
+}
+
tplink_get_hwid() {
local part
get_image "$@" | dd bs=1 count=4 skip=53 2>/dev/null | hexdump -v -n 4 -e '1/1 "%02x"'
}
+cybertan_get_image_magic() {
+ get_image "$@" | dd bs=8 count=1 skip=0 2>/dev/null | hexdump -v -n 8 -e '1/1 "%02x"'
+}
+
+cybertan_check_image() {
+ local magic="$(cybertan_get_image_magic "$1")"
+ local fw_magic="$(cybertan_get_hw_magic)"
+
+ [ "$fw_magic" != "$magic" ] && {
+ echo "Invalid image, ID mismatch, got:$magic, but need:$fw_magic"
+ return 1
+ }
+
+ return 0
+}
+
platform_check_image() {
local board=$(ar71xx_board_name)
local magic="$(get_magic_word "$1")"
dir825b_check_image "$1" && return 0
;;
+ mynet-rext)
+ cybertan_check_image "$1" && return 0
+ return 1
+ ;;
+
mynet-n600)
[ "$magic_long" != "5ea3a417" ] && {
echo "Invalid image, bad magic: $magic_long"