diff options
author | Gabor Juhos <juhosg@openwrt.org> | 2014-07-14 16:03:35 +0000 |
---|---|---|
committer | Gabor Juhos <juhosg@openwrt.org> | 2014-07-14 16:03:35 +0000 |
commit | f27f2fec4fe62411e427efb6fa737dd3292ca6cd (patch) | |
tree | e0dc92f2930d292204451ac9db590654847bcb29 /target/linux/ar71xx/base-files/lib | |
parent | 51c892053a13e8808fa9987f6bb07b67ee6a29b0 (diff) | |
download | mtk-20170518-f27f2fec4fe62411e427efb6fa737dd3292ca6cd.zip mtk-20170518-f27f2fec4fe62411e427efb6fa737dd3292ca6cd.tar.gz mtk-20170518-f27f2fec4fe62411e427efb6fa737dd3292ca6cd.tar.bz2 |
ar71xx: add user-space support for the Tube2H board
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
SVN-Revision: 41650
Diffstat (limited to 'target/linux/ar71xx/base-files/lib')
-rwxr-xr-x | target/linux/ar71xx/base-files/lib/ar71xx.sh | 3 | ||||
-rwxr-xr-x | target/linux/ar71xx/base-files/lib/upgrade/platform.sh | 30 |
2 files changed, 33 insertions, 0 deletions
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh index bc26d8b..94f758a 100755 --- a/target/linux/ar71xx/base-files/lib/ar71xx.sh +++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh @@ -625,6 +625,9 @@ ar71xx_board_detect() { *"TL-MR13U") name="tl-mr13u" ;; + *"Tube2H") + name="tube2h" + ;; *UniFi) name="unifi" ;; diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh index d42a704..910da52 100755 --- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh +++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh @@ -2,6 +2,7 @@ # Copyright (C) 2011 OpenWrt.org # +. /lib/functions/system.sh . /lib/ar71xx.sh PART_NAME=firmware @@ -106,6 +107,29 @@ platform_do_upgrade_compex() { fi } +alfa_check_image() { + local magic_long="$(get_magic_long "$1")" + local fw_part_size=$(mtd_get_part_size firmware) + + case "$magic_long" in + "27051956") + [ "$fw_part_size" != "16318464" ] && { + echo "Invalid image magic \"$magic_long\" for $fw_part_size bytes" + return 1 + } + ;; + + "68737173") + [ "$fw_part_size" != "7929856" ] && { + echo "Invalid image magic \"$magic_long\" for $fw_part_size bytes" + return 1 + } + ;; + esac + + return 0 +} + platform_check_image() { local board=$(ar71xx_board_name) local magic="$(get_magic_word "$1")" @@ -293,6 +317,12 @@ platform_check_image() { return 0 ;; + + tube2h) + alfa_check_image "$1" && return 0 + return 1 + ;; + uap-pro) [ "$magic_long" != "19852003" ] && { echo "Invalid image type." |