From e3875350f3e4185020b64e0588bba521cd1d6e64 Mon Sep 17 00:00:00 2001 From: Stijn Tintel Date: Mon, 18 Jul 2016 19:39:57 +0200 Subject: ar71xx: add support for D-Link DAP-2695 rev. A1 Signed-off-by: Stijn Tintel Acked-by: John Crispin --- target/linux/ar71xx/base-files/lib/ar71xx.sh | 3 +++ target/linux/ar71xx/base-files/lib/upgrade/platform.sh | 13 +++++++++++++ 2 files changed, 16 insertions(+) (limited to 'target/linux/ar71xx/base-files/lib') diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh index fb375a5e15..f51d7db9c1 100755 --- a/target/linux/ar71xx/base-files/lib/ar71xx.sh +++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh @@ -511,6 +511,9 @@ ar71xx_board_detect() { *CR5000) name="cr5000" ;; + *"DAP-2695 rev. A1") + name="dap-2695-a1" + ;; *"DB120 reference board") name="db120" ;; diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh index 46f014306f..9c0f3f3bc5 100755 --- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh +++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh @@ -105,6 +105,10 @@ seama_get_type_magic() { get_image "$@" | dd bs=1 count=4 skip=53 2>/dev/null | hexdump -v -n 4 -e '1/1 "%02x"' } +wrgg_get_image_magic() { + get_image "$@" | dd bs=4 count=1 skip=8 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"' } @@ -531,6 +535,15 @@ platform_check_image() { return 0 ;; + dap-2695-a1) + local magic=$(wrgg_get_image_magic "$1") + [ "$magic" != "21030820" ] && { + echo "Invalid image, bad type: $magic" + return 1 + } + + return 0; + ;; esac echo "Sysupgrade is not yet supported on $board." -- cgit v1.2.3