aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux
diff options
context:
space:
mode:
authorRafał Miłecki <rafal@milecki.pl>2019-09-06 12:44:49 +0200
committerRafał Miłecki <rafal@milecki.pl>2019-09-12 14:30:18 +0200
commit3dac34de2563be633d58c768c685ec70bc410c3f (patch)
tree562a62b2a604330b5e7457876d645124f591a74c /target/linux
parent87fe1a560ac3ad86e8315eab0efd1c90e879cf8e (diff)
downloadupstream-3dac34de2563be633d58c768c685ec70bc410c3f.tar.gz
upstream-3dac34de2563be633d58c768c685ec70bc410c3f.tar.bz2
upstream-3dac34de2563be633d58c768c685ec70bc410c3f.zip
bcm53xx: extend firmware validation
This provides TRX validation result to the validation JSON. It also prevents users from installing broken firmware files. Signed-off-by: Rafał Miłecki <rafal@milecki.pl> (cherry picked from commit c19b9f9a2623c110222210d04f75ace0e594c7e9)
Diffstat (limited to 'target/linux')
-rw-r--r--target/linux/bcm53xx/base-files/lib/upgrade/platform.sh12
1 files changed, 11 insertions, 1 deletions
diff --git a/target/linux/bcm53xx/base-files/lib/upgrade/platform.sh b/target/linux/bcm53xx/base-files/lib/upgrade/platform.sh
index 1d829c6519..a337889833 100644
--- a/target/linux/bcm53xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/bcm53xx/base-files/lib/upgrade/platform.sh
@@ -88,7 +88,10 @@ platform_check_image() {
if ! otrx check "$1" -o "$header_len"; then
echo "No valid TRX firmware in the CHK image"
+ notify_firmware_test_result "trx_valid" 0
error=1
+ else
+ notify_firmware_test_result "trx_valid" 1
fi
;;
"cybertan")
@@ -103,7 +106,10 @@ platform_check_image() {
if ! otrx check "$1" -o 32; then
echo "No valid TRX firmware in the CyberTAN image"
+ notify_firmware_test_result "trx_valid" 0
error=1
+ else
+ notify_firmware_test_result "trx_valid" 1
fi
;;
"safeloader")
@@ -133,11 +139,15 @@ platform_check_image() {
if ! otrx check "$1"; then
echo "Invalid (corrupted?) TRX firmware"
+ notify_firmware_test_result "trx_valid" 0
error=1
+ else
+ notify_firmware_test_result "trx_valid" 1
fi
;;
*)
- echo "Invalid image type. Please use only .trx files"
+ echo "Invalid image type. Please use firmware specific for this device."
+ notify_firmware_broken
error=1
;;
esac