brcm47xx: detect (and still reject for now) CyberTAN fw format
Signed-off-by: Rafał Miłecki <zajec5@gmail.com> SVN-Revision: 43714
This commit is contained in:
parent
f310e02ab3
commit
a5b6b7e419
1 changed files with 12 additions and 0 deletions
|
@ -1,5 +1,11 @@
|
||||||
PART_NAME=firmware
|
PART_NAME=firmware
|
||||||
|
|
||||||
|
# $(1): file to read magic from
|
||||||
|
# $(2): offset in bytes
|
||||||
|
get_magic_long_at() {
|
||||||
|
dd if="$1" skip=$2 bs=1 count=4 2>/dev/null | hexdump -v -n 4 -e '1/1 "%02x"'
|
||||||
|
}
|
||||||
|
|
||||||
brcm47xx_identify() {
|
brcm47xx_identify() {
|
||||||
local magic
|
local magic
|
||||||
|
|
||||||
|
@ -15,6 +21,12 @@ brcm47xx_identify() {
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
magic=$(get_magic_long_at "$1" 14)
|
||||||
|
[ "$magic" = "55324e44" ] && {
|
||||||
|
echo "cybertan"
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
echo "unknown"
|
echo "unknown"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue