From: Alexander Couzens Date: Fri, 13 Oct 2017 02:32:06 +0000 (+0200) Subject: ar71xx/tplink_pharos_check_image: extend check to allow different magics X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=90a4fcd7f6bb8d94e10abd77db7937956e457128;p=openwrt%2Fstaging%2Flynxis.git ar71xx/tplink_pharos_check_image: extend check to allow different magics The cpe210v2 will have a different magic, but the same model string check. Signed-off-by: Alexander Couzens --- diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh index 1ffd1bde42..adb920c393 100755 --- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh +++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh @@ -94,9 +94,10 @@ tplink_get_image_boot_size() { } tplink_pharos_check_image() { - local magic_long="$(get_magic_long "$1")" - [ "$magic_long" != "7f454c46" ] && { - echo "Invalid image magic '$magic_long'" + local image_magic="$(get_magic_long "$1")" + local board_magic="$2" + [ "$image_magic" != "$board_magic" ] && { + echo "Invalid image magic '$image_magic'. Expected '$board_magic'." return 1 } @@ -544,7 +545,8 @@ platform_check_image() { eap120|\ wbs210|\ wbs510) - tplink_pharos_check_image "$1" && return 0 + # magic = .ELF + tplink_pharos_check_image "$1" "7f454c46" && return 0 return 1 ;; a40|\