X-Git-Url: http://git.openwrt.org/?p=openwrt%2Fopenwrt.git;a=blobdiff_plain;f=target%2Flinux%2Far71xx%2Fbase-files%2Flib%2Fupgrade%2Fplatform.sh;h=f171aa667c6ed50fdd0e8a4c2f2e94c7b9d4b8a7;hp=eae7382af7d206568fdf3918d0a9621deb53946a;hb=11a5128b983fdc78ffeac063bf9060116cad281b;hpb=991ec8e5b23366a8ecfb0af69603dd036f735e93 diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh index eae7382af7..f171aa667c 100755 --- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh +++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh @@ -97,10 +97,11 @@ tplink_pharos_check_support_list() { local image="$1" local offset="$2" local model="$3" + local trargs="$4" # Here $image is given to dd directly instead of using get_image; # otherwise the skip will take almost a second (as dd can't seek) - dd if="$image" bs=1 skip=$offset count=1024 2>/dev/null | ( + dd if="$image" bs=1 skip=$offset count=1024 2>/dev/null | tr -d "$trargs" | ( while IFS= read -r line; do [ "$line" = "$model" ] && exit 0 done @@ -110,17 +111,19 @@ tplink_pharos_check_support_list() { } 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 } - local model_string="$(tplink_pharos_get_model_string)" + local model_string="$3" + local trargs="$4" # New images have the support list at 7802888, old ones at 1511432 - tplink_pharos_check_support_list "$1" 7802888 "$model_string" || \ - tplink_pharos_check_support_list "$1" 1511432 "$model_string" || { + tplink_pharos_check_support_list "$1" 7802888 "$model_string" "$trargs" || \ + tplink_pharos_check_support_list "$1" 1511432 "$model_string" "$trargs" || { echo "Unsupported image (model not in support-list)" return 1 } @@ -212,6 +215,7 @@ platform_check_image() { archer-c60-v1|\ archer-c60-v2|\ archer-c7-v4|\ + archer-c7-v5|\ bullet-m|\ c-55|\ carambola2|\ @@ -246,8 +250,10 @@ platform_check_image() { dr531|\ dragino2|\ e1700ac-v2|\ + e558-v2|\ e600g-v2|\ e600gac-v2|\ + e750a-v4|\ ebr-2310-c1|\ ens202ext|\ epg5000|\ @@ -577,7 +583,11 @@ platform_check_image() { eap120|\ wbs210|\ wbs510) - tplink_pharos_check_image "$1" && return 0 + tplink_pharos_check_image "$1" "7f454c46" "$(tplink_pharos_get_model_string)" '' && return 0 + return 1 + ;; + cpe210-v2) + tplink_pharos_check_image "$1" "01000000" "$(tplink_pharos_v2_get_model_string)" '\0\xff\r' && return 0 return 1 ;; a40|\ @@ -688,6 +698,8 @@ platform_check_image() { # these boards use metadata images fritz300e|\ fritz4020|\ + fritz450e|\ + koala|\ rb-750-r2|\ rb-750p-pbr2|\ rb-750up-r2|\