Skip to content

Conversation

@meek2100
Copy link

No description provided.

@richb-hanover
Copy link
Owner

Hi! Thanks for this PR. I have a few thoughts/questions about it before I merge it. Specifically, I'd ask you to spend some time on the README to address the questions below:

  • I don't quite understand the purpose... Why would someone use this? I see that this lets you do upgrades "off-line", but how that differ from just downloading the new firmware binary and the .ipk's to your laptop? Why is that an important use-case?

  • Why not just use attended sysupgrade? What can this do that ASU won't? (I know that ASU requires an online connection...)

  • How does this work in the face of apk that's coming soon? (24.10 continues to use opkg, but apk is coming in the next release.)

Thanks!

Rich

@richb-hanover
Copy link
Owner

That was a good catch about the "?" in the file name. But I still don't understand what this PR is designed to accomplish. Please give me a paragraph or two of explanation. Thanks.

@meek2100
Copy link
Author

meek2100 commented Jan 16, 2026

@richb-hanover,

Thanks for the review, I appreciate you taking the time to look at this and sorry it has taken me so long to get back to you. I initially submitted it and then moved on to a new project and forgot until I was reviewing all my old open PRs and then discovered the bug with having a "?" in the name when I tried to reclone it to work on enhancing this with support for both opkg and apks.

The new solution is still a work in progress and I'll need to get a router flashed up to the latest dev builds of openWRT to verify it before I submit a PR, so I'll just stick with this one for now and answer your question for why I think this is still valuable even with ASU.

1. Why use this instead of downloading to a laptop?

The main advantage of doing this on the router (vs. a laptop) is dependency resolution and architecture matching.

  • Automation: When downloading manually to a laptop, one has to manually track down the exact URL for the router's specific architecture and manually identify every dependency (and their dependencies).
  • Accuracy: This script leverages the router's existing opkg database to ensure we fetch exactly the correct version and architecture for every package defined in IPK_CACHE_LIST. It eliminates the "dependency hell" of manually hunting for .ipk files on the OpenWrt download portal.
  • Portability: By saving these to a USB drive or persistent storage, I can take a "survival kit" of packages (like drivers for 4G modems, VPN tools, or editors) to a remote site. If I need to re-flash a router offline, I have the exact packages needed to get it back online without needing an internet connection first.

2. Why not just use Attended Sysupgrade (ASU)?

ASU is fantastic, but this covers a different "Stock Firmware + Local Packages" use case:

  • Offline/Air-gapped Provisioning: ASU requires an active internet connection at the moment of upgrade to build the image. This script allows me to "pre-load" a cache while I have internet, and then perform the upgrade and package installation later when the device might be offline (e.g., a cellular gateway where the modem driver is needed to even get online).
  • Stock Image Preference: Some users (myself included) prefer using the official, cryptographically signed stock firmware images rather than on-the-fly custom builds. This script allows us to stay on stock firmware while still automating the re-installation of our custom package set from a local source.
  • Recoverability: If an ASU build fails or a custom image has an issue, having the stock image + a folder of cached .ipk files provides a robust fallback method to restore functionality without external access.

3. How does this work with apk?

I'm working on evolving this script to support both opkg and apks (which would probably make sense to rename this once it supports both, but I still have a decent amount of development and testing to complete before that is ready.

I hope this clarifies the valid use cases I see especially around the offline setup & recovery.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants