ar71xx: fix 82_patch_ath10k
authorJo-Philipp Wich <jow@openwrt.org>
Tue, 17 Feb 2015 21:26:39 +0000 (21:26 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Tue, 17 Feb 2015 21:26:39 +0000 (21:26 +0000)
The firware md5sum check never worked due to missing dollar signs.

Also suppress
  `md5sum: can't open '/lib/firmware/ath10k/QCA988X/hw2.0/firmware-3.bin'`
error on any board not using ath10k.

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
SVN-Revision: 44486

target/linux/ar71xx/base-files/lib/preinit/82_patch_ath10k

index 0455ecbcd9d2d9d88e6e2c66414c4e64509c8994..bed140ad95e62d153eac20c68fc083b8a471f9a7 100644 (file)
@@ -6,12 +6,18 @@
 
 do_patch_ath10k_firmware() {
        local firmware_file="/lib/firmware/ath10k/QCA988X/hw2.0/firmware-3.bin"
+
+       # bail out if firmware does not exist
+       [ -f "$firmware_file" ] || {
+               return
+       }
+
        local firmware_md5_orig="5163aa8de591f80b06c77f22e9777473"
        local firmware_md5_current="$(md5sum $firmware_file)"
        local firmware_md5_current="${firmware_md5_current%% *}"
 
        # verify md5sum before patching
-       [ "firmware_md5_orig" != "firmware_md5_current" ] || {
+       [ "$firmware_md5_orig" != "$firmware_md5_current" ] || {
                return
        }