I'm developing an update / upgrade service with an offline SDK for Linux devices.
The idea is to replicate the update / upgrade Linux services into an offline device. The "offline" device is capable to reach "internet" but only through message exchange using the SDK and through other devices (multi-hop). Devices are from different architectures, therefore the device that has "internet" capabilities (gateway) has to be capable to request and download the packages to be upgraded to/from a different architecture. the gateway device has to be capable to cache the downloaded requested packages from updates (to act as a CDN), avoiding repo requests.
The offline device doesn't have have IP address and the way it communicates is irrelevant, because the offline SDK guaranties internet reachability over multi-hop.
What I need - I need someone to provide me some help or guidance about the update / upgrade work flow on Linux.
What I found so far:
update
- update command loads the /etc/apt/sources.list
- don't know how update resolves each line on /etc/apt/sources.list, it seems it has a function where it loads the "deb" a "link" and "arguments" that match the corresponding repo folders.
- after that it starts to download all the corresponding "Packages" files in each resolved link.
upgrade
- makes a comparison between the updated local "Packages" files and the "Packages" files in the repo.
Is there any source code from update / upgrade available ? I did some web search on the apt repos, but I couldn't find the update / upgrade functions.