mirror of
git://projects.qi-hardware.com/openwrt-xburst.git
synced 2024-11-30 17:53:45 +02:00
ar71xx: reject TP-Link images containing a bootloader
The original TP-Link firmware images can be flashed via the sysupgrade command, however those may contain a bootloader. Flashing such an image via sysupgrade bricks the board, and it can't be recovered without a serial console. Signed-off-by: Gabor Juhos <juhosg@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@33944 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
parent
6be2a2971e
commit
bc21e5bca2
@ -65,6 +65,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"'
|
get_image "$@" | dd bs=4 count=1 skip=16 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"'
|
||||||
|
}
|
||||||
|
|
||||||
platform_check_image() {
|
platform_check_image() {
|
||||||
local board=$(ar71xx_board_name)
|
local board=$(ar71xx_board_name)
|
||||||
local magic="$(get_magic_word "$1")"
|
local magic="$(get_magic_word "$1")"
|
||||||
@ -174,6 +178,14 @@ platform_check_image() {
|
|||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
local boot_size
|
||||||
|
|
||||||
|
boot_size=$(tplink_get_image_boot_size "$1")
|
||||||
|
[ "$boot_size" != "00000000" ] && {
|
||||||
|
echo "Invalid image, it contains a bootloader."
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
;;
|
;;
|
||||||
wndr3700)
|
wndr3700)
|
||||||
|
Loading…
Reference in New Issue
Block a user