summaryrefslogtreecommitdiff
path: root/target/linux/bcm53xx/base-files/lib
diff options
context:
space:
mode:
authorRafał Miłecki <zajec5@gmail.com>2015-04-07 14:14:02 +0000
committerRafał Miłecki <zajec5@gmail.com>2015-04-07 14:14:02 +0000
commit7abd77973089c991ec0aa80039e51bdbb4fab067 (patch)
treed7881e878bbc7e490a8d0b8f70a34b6042e0d1b8 /target/linux/bcm53xx/base-files/lib
parenta19b69a717e277fe517d71e50807c71b84ac9738 (diff)
downloadmtk-20170518-7abd77973089c991ec0aa80039e51bdbb4fab067.zip
mtk-20170518-7abd77973089c991ec0aa80039e51bdbb4fab067.tar.gz
mtk-20170518-7abd77973089c991ec0aa80039e51bdbb4fab067.tar.bz2
bcm53xx: display all errors (not just the 1st one) when checking image
Signed-off-by: Rafał Miłecki <zajec5@gmail.com> SVN-Revision: 45291
Diffstat (limited to 'target/linux/bcm53xx/base-files/lib')
-rw-r--r--target/linux/bcm53xx/base-files/lib/upgrade/platform.sh18
1 files changed, 8 insertions, 10 deletions
diff --git a/target/linux/bcm53xx/base-files/lib/upgrade/platform.sh b/target/linux/bcm53xx/base-files/lib/upgrade/platform.sh
index 17456b6..8055b4f 100644
--- a/target/linux/bcm53xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/bcm53xx/base-files/lib/upgrade/platform.sh
@@ -64,6 +64,7 @@ platform_check_image() {
local file_type=$(platform_identify "$1")
local magic
+ local error=0
case "$file_type" in
"chk")
@@ -75,16 +76,14 @@ platform_check_image() {
[ -n "$dev_board_id" -a "chk $board_id" != "$dev_board_id" ] && {
echo "Firmware board_id doesn't match device board_id ($dev_board_id)"
- return 1
+ error=1
}
magic=$(get_magic_long_at "$1" "$header_len")
[ "$magic" != "48445230" ] && {
echo "No valid TRX firmware in the CHK image"
- return 1
+ error=1
}
-
- return 0
;;
"cybertan")
local pattern=$(dd if="$1" bs=1 count=4 2>/dev/null | hexdump -v -e '1/1 "%c"')
@@ -93,25 +92,24 @@ platform_check_image() {
[ -n "$dev_pattern" -a "cybertan $pattern" != "$dev_pattern" ] && {
echo "Firmware pattern doesn't match device pattern ($dev_pattern)"
- return 1
+ error=1
}
magic=$(get_magic_long_at "$1" 32)
[ "$magic" != "48445230" ] && {
echo "No valid TRX firmware in the CyberTAN image"
- return 1
+ error=1
}
-
- return 0
;;
"trx")
- return 0
;;
*)
echo "Invalid image type. Please use only .trx files"
- return 1
+ error=1
;;
esac
+
+ return $error
}
# Extract TRX and use stadard upgrade method