diff options
author | Rafał Miłecki <zajec5@gmail.com> | 2015-03-31 06:05:35 +0000 |
---|---|---|
committer | Rafał Miłecki <zajec5@gmail.com> | 2015-03-31 06:05:35 +0000 |
commit | dc93714809220682128d59890cd78e4a02ed7329 (patch) | |
tree | 5f3843057ae416dc82d5b38193344dba56cd102d | |
parent | 424fce3afe5f75c6a1dab64494e4414e6e65b8d4 (diff) | |
download | master-187ad058-dc93714809220682128d59890cd78e4a02ed7329.tar.gz master-187ad058-dc93714809220682128d59890cd78e4a02ed7329.tar.bz2 master-187ad058-dc93714809220682128d59890cd78e4a02ed7329.zip |
brcm47xx: display all errors (not just the 1st one) when checking image
This way people forcing upgrade will know what may go wrong.
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@45172 3c298f89-4303-0410-b956-a3cf2f4a3e73
-rw-r--r-- | target/linux/brcm47xx/base-files/lib/upgrade/platform.sh | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/target/linux/brcm47xx/base-files/lib/upgrade/platform.sh b/target/linux/brcm47xx/base-files/lib/upgrade/platform.sh index d4017b4980..9e8db8a137 100644 --- a/target/linux/brcm47xx/base-files/lib/upgrade/platform.sh +++ b/target/linux/brcm47xx/base-files/lib/upgrade/platform.sh @@ -89,6 +89,7 @@ platform_check_image() { local file_type=$(brcm47xx_identify "$1") local magic + local error=0 case "$file_type" in "chk") @@ -100,16 +101,14 @@ platform_check_image() { [ -n "$dev_board_id" -a "$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"') @@ -118,25 +117,24 @@ platform_check_image() { [ -n "$dev_pattern" -a "$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 } platform_do_upgrade_chk() { |