Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/Djfe/FB7430' into lantiq-avm743…
Browse files Browse the repository at this point in the history
…0-23.05

Contains fix for reading reversed firmware data from `urlader`
partition (AVM Fritzbox 7430).
  • Loading branch information
dzzinstant committed Apr 29, 2024
2 parents 8695bc3 + 2c1c49a commit 463d3ad
Showing 1 changed file with 20 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,29 @@ case "$FIRMWARE" in
avm,fritz7360sl)
caldata_extract "urlader" 0x985 0x1000
;;
avm,fritz7412|\
avm,fritz7430)
avm,fritz7412)
/usr/bin/fritz_cal_extract -i 1 -s 0x1e000 -e 0x207 -l 5120 -o /lib/firmware/$FIRMWARE $(find_mtd_chardev "urlader") || \
/usr/bin/fritz_cal_extract -i 1 -s 0x1e800 -e 0x207 -l 5120 -o /lib/firmware/$FIRMWARE $(find_mtd_chardev "urlader")
;;
avm,fritz7430)
reversed=$( \
/usr/bin/fritz_cal_extract -i 1 -s 0x1e000 -e 0x207 -l 5120 $(find_mtd_chardev "urlader") || \
/usr/bin/fritz_cal_extract -i 1 -s 0x1e800 -e 0x207 -l 5120 $(find_mtd_chardev "urlader") | \
hexdump -v -e '/1 "%02x "')

caldata=""
i=0
count=$((${#reversed} / 3 - 4))
for byte in $reversed; do
i=$(($i+1))
if [ "$i" -gt "$count" ]; then
break
fi
caldata="\x${byte}${caldata}"
done

printf "%b" "$caldata" > /lib/firmware/$FIRMWARE
;;
bt,homehub-v5a)
caldata_extract_ubi "caldata" 0x1000 0x1000
ath9k_patch_mac_crc $(macaddr_add $(mtd_get_mac_binary_ubi caldata 0x110c) 2) 0x10c
Expand Down

0 comments on commit 463d3ad

Please sign in to comment.