Commit Graph

3 Commits

Author SHA1 Message Date
Rafał Miłecki 30b168b9b8 bcm4908: sysupgrade: refactor handling different firmware formats
This results in setting format specific data (format info, extract
commands) in a single function. It should help maintaining sysupgrade
code.

This change has been tested on Asus GT-AC5300 and Netgear R8000P.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2021-12-02 09:17:43 +01:00
Sungbo Eo f432353850 bcm4908: fix calculation of new cferam index
The arithmetic expansion fails when idx becomes a two digit number.
Fix this by relying on expr command.

root@OpenWrt:/# echo $(((028 + 0) % 1000))
/bin/ash: arithmetic syntax error
root@OpenWrt:/# echo $(($(expr 028 + 0) % 1000))
28

Fixes: a6a0b252ba ("bcm4908: add sysupgrade support")
Signed-off-by: Sungbo Eo <mans0n@gorani.run>
2021-11-04 15:52:03 +01:00
Rafał Miłecki a6a0b252ba bcm4908: add sysupgrade support
It supports flashing OpenWrt images (bootfs & UBI upgrade) as well as
vendor images (whole MTD partition write).

Upgrading cferom is unsupported. It requires copying device specific
data (like MAC) to target image before flashing.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2021-04-07 14:44:20 +02:00