Skip to content

Commit

Permalink
lantiq: fritz_cal_extract with reverse option for AVM FritzBox 7430
Browse files Browse the repository at this point in the history
This implementation of fritz_cal_extract can also retrieve firmware
data stored in reverse byte order, as found in the AVM 7430 device.

This is done by intermediate storage in a buffer presumably large enough
to hold the complete data set. Currently, this buffer size is 128kB + 1kB
(some extra space for skipped data).

In the usual case of "forward" data, this implementation should behave
like the original implementation in all common cases. limit [-l] will
determine the amount of data read and size of buffer allocated.

However, if you are reading reversed data or didn't set a limit, the buffer
may be too small to hold all data. In this case, you can choose a higher
limit [-l] to enforce a sufficient buffer size.

Signed-off-by: Dustin Gathmann <[email protected]>
  • Loading branch information
dzzinstant committed Nov 27, 2024
1 parent 5eb8b77 commit fd053f4
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,14 @@ 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)
/usr/bin/fritz_cal_extract -r -i 4 -s 0x1e000 -e 0x207 -l 5120 -o /lib/firmware/$FIRMWARE $(find_mtd_chardev "urlader") || \
/usr/bin/fritz_cal_extract -r -i 4 -s 0x1e800 -e 0x207 -l 5120 -o /lib/firmware/$FIRMWARE $(find_mtd_chardev "urlader")
;;
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 fd053f4

Please sign in to comment.