Skip to content
Snippets Groups Projects
Select Git revision
  • b56b6640e6aab7d35e670acafbcc6e03f7a07bd8
  • v2018.2.x default
  • experimental
  • master
  • v2021.1.2-ffs
  • v2021.1.1-ffs
  • nrb/gluon-master-cpe510
  • v2021.1-ffs
  • v2020.2.3-ffs
  • nrbffs/fastd-remove-delay
  • v2020.2.2-ffs
  • v2020.2.1-ffs
  • v2020.2-ffs
  • v2020.2.x
  • v2020.1.3-ffs
  • v2020.1.1-ffs
  • v2020.1-ffs
  • v2019.1.2-ffs
  • v2019.1.1-ffs
  • nrb/test-radv-filter
  • v2019.1-ffs
  • nrbffs/netgear-ex6120
  • v2021.1.2-ffs0.2
  • v2021.1.2-ffs0.1
  • v2021.1.1-ffs0.4
  • v2021.1.1-ffs0.3
  • v2021.1.1-ffs0.2
  • v2021.1.1-ffs0.1
  • v2021.1-ffs0.1
  • v2020.2.3-ffs0.3
  • v2020.2.3-ffs0.2
  • v2020.2.3-ffs0.1
  • v2020.2.2-ffs0.1
  • v2020.2.1-ffs0.1
  • v2020.2-ffs0.1
  • v2020.2
  • v2020.2.x-ffs0.1
  • v2020.1.3-ffs0.1
  • v2020.1.1-ffs0.1
  • v2020.1-ffs0.1
  • v2019.1.2-ffs0.1
  • v2019.1.1-ffs0.1
42 results

0019-ar71xx-check-both-HWID-and-HWREV-on-upgrades-of-TP-LINK-devices.patch

Blame
  • Forked from firmware / FFS Gluon
    3723 commits behind the upstream repository.
    user avatar
    Matthias Schiffer authored
    b56b6640
    History
    0019-ar71xx-check-both-HWID-and-HWREV-on-upgrades-of-TP-LINK-devices.patch 1.60 KiB
    From: Matthias Schiffer <mschiffer@universe-factory.net>
    Date: Fri, 1 Apr 2016 23:16:13 +0200
    Subject: ar71xx: check both HWID and HWREV on upgrades of TP-LINK devices
    
    There's no reason for us to be more lenient than the stock firmware, so
    better check the HWREV as well to avoid bricked devices.
    
    Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
    
    Backport of r49105
    
    diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
    index d025632..c5c1871 100755
    --- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
    +++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
    @@ -66,6 +66,10 @@ tplink_get_image_hwid() {
     	get_image "$@" | dd bs=4 count=1 skip=16 2>/dev/null | hexdump -v -n 4 -e '1/1 "%02x"'
     }
     
    +tplink_get_image_mid() {
    +	get_image "$@" | dd bs=4 count=1 skip=17 2>/dev/null | hexdump -v -n 4 -e '1/1 "%02x"'
    +}
    +
     tplink_get_image_boot_size() {
     	get_image "$@" | dd bs=4 count=1 skip=37 2>/dev/null | hexdump -v -n 4 -e '1/1 "%02x"'
     }
    @@ -366,13 +370,17 @@ platform_check_image() {
     		}
     
     		local hwid
    -		local imageid
    +		local mid
    +		local imagehwid
    +		local imagemid
     
     		hwid=$(tplink_get_hwid)
    -		imageid=$(tplink_get_image_hwid "$1")
    +		mid=$(tplink_get_mid)
    +		imagehwid=$(tplink_get_image_hwid "$1")
    +		imagemid=$(tplink_get_image_mid "$1")
     
    -		[ "$hwid" != "$imageid" ] && {
    -			echo "Invalid image, hardware ID mismatch, hw:$hwid image:$imageid."
    +		[ "$hwid" != "$imagehwid" -o "$mid" != "$imagemid" ] && {
    +			echo "Invalid image, hardware ID mismatch, hw:$hwid $mid image:$imagehwid $imagemid."
     			return 1
     		}