topgrade-rs / topgrade

Upgrade all the things
GNU General Public License v3.0
2.08k stars 140 forks source link

OpenWrt support (Opkg package manager) #745

Open GETandSELECT opened 8 months ago

GETandSELECT commented 8 months ago

Hi

Thank you very much for the great tool. I use topgrade to upgrade my macOS Desktop and the many different Raspberrys. I really like the remote_topgrades.

Unfortunately OpenWrt is not supported yet, there is neither an issue nor a comment about OpenWrt (opkg). I would love to upgrade OpenWrt packages this way too.

https://openwrt.org/docs/guide-user/additional-software/opkg

Have a great weekend!

SteveLauC commented 8 months ago

What commands should Topgrade use to support this tool?

From the doc and this post, it seems that:

$ opkg list-upgradable
$ opkg upgrade xxx

is the way to go.

Would you like to provide me an example output of opkg list-upgradeable so that I can parse it in Rust code rather than making Topgrade relies on the cut and xarg commands.

GETandSELECT commented 8 months ago

Thanks. I have two OpenWrt 23.05.0 devices and both show empty opkg list-upgradeable output. Sorry.

SteveLauC commented 8 months ago

I have two OpenWrt 23.05.0 devices and both show empty opkg list-upgradeable output.

No need to be sorry, though it is indeed needed to implement this step, so welcome to paste the output here when there are updates available:)

huyz commented 8 months ago

Careful, it may not be a good idea to automate openwrt upgrades frequently, depending on your device.

For example, https://forum.openwrt.org/t/belkin-rt3200-linksys-e8450-wifi-ax-discussion/94302/4469

You should use auc or luci-app-attendedsysupgrade instead which replace the whole image. And while it's true that NAND memory can only be written a few thousand times in the same place, I'm pretty sure that other things in this device will die first (such as electrolyte capacitors) before you exhaust the write-cycles of the flash, even if you update daily (which is more or less what I've been doing for years on that device).

SteveLauC commented 8 months ago

Label this issue: need discussion due to the last comment