Author: rmilecki
Date: 2015-04-09 07:22:04 +0200 (Thu, 09 Apr 2015)
New Revision: 45316

Modified:
   trunk/target/linux/brcm47xx/Makefile
   trunk/target/linux/brcm47xx/base-files/lib/upgrade/platform.sh
Log:
brcm47xx: switch to the otrx for verifying TRX images

This adds checking CRC32 of provided firmware image.

Signed-off-by: Rafa?\197?\130 Mi?\197?\130ecki <[email protected]>

Modified: trunk/target/linux/brcm47xx/Makefile
===================================================================
--- trunk/target/linux/brcm47xx/Makefile        2015-04-09 05:21:55 UTC (rev 
45315)
+++ trunk/target/linux/brcm47xx/Makefile        2015-04-09 05:22:04 UTC (rev 
45316)
@@ -22,7 +22,7 @@
        Build firmware images for Broadcom based BCM47xx/53xx routers with MIPS 
CPU, *not* ARM.
 endef
 
-DEFAULT_PACKAGES += swconfig wpad-mini nvram \
+DEFAULT_PACKAGES += swconfig wpad-mini nvram otrx \
        kmod-leds-gpio kmod-gpio-button-hotplug \
        kmod-ledtrig-default-on kmod-ledtrig-timer kmod-ledtrig-netdev
 

Modified: trunk/target/linux/brcm47xx/base-files/lib/upgrade/platform.sh
===================================================================
--- trunk/target/linux/brcm47xx/base-files/lib/upgrade/platform.sh      
2015-04-09 05:21:55 UTC (rev 45315)
+++ trunk/target/linux/brcm47xx/base-files/lib/upgrade/platform.sh      
2015-04-09 05:22:04 UTC (rev 45316)
@@ -77,20 +77,6 @@
        echo "unknown"
 }
 
-# $(1): image that should contain trx
-# $(2): trx offset in image
-platform_check_image_trx() {
-       local magic=$(get_magic_long_at "$1" $2)
-
-       [ "$magic" != "48445230" ] && {
-               return 1
-       }
-
-       # TODO: Check crc32
-
-       return 0
-}
-
 platform_check_image() {
        [ "$#" -gt 1 ] && return 1
 
@@ -111,7 +97,7 @@
                                error=1
                        }
 
-                       if ! platform_check_image_trx "$1" "$header_len"; then
+                       if ! otrx -c "$1" -o "$header_len"; then
                                echo "No valid TRX firmware in the CHK image"
                                error=1
                        fi
@@ -126,7 +112,7 @@
                                error=1
                        }
 
-                       if ! platform_check_image_trx "$1" 32; then
+                       if ! otrx -c "$1" -o 32; then
                                echo "No valid TRX firmware in the CyberTAN 
image"
                                error=1
                        fi
_______________________________________________
openwrt-commits mailing list
[email protected]
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-commits

Reply via email to