brcm47xx: extend firmware validation
[openwrt/staging/dedeckeh.git] / target / linux / brcm47xx / base-files / lib / upgrade / platform.sh
index dfd4e97ed2e3c3aabbcea7b922c2aa1eef1416db..537bac23288e1b3f0f56344cdf929f5d7d03fc22 100644 (file)
@@ -98,7 +98,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")
@@ -113,17 +116,24 @@ 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
                ;;
                "trx")
                        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