[LEDE-DEV] how to make sysupgrade not drop user-installed packages

Oswald Buddenhagen oswald.buddenhagen at gmx.de
Sun Jan 8 03:50:08 PST 2017


On Sat, Jan 07, 2017 at 11:31:01PM +0100, Magnus Kroken wrote:
> On 07.01.2017 19.04, Oswald Buddenhagen wrote:
> > the idea would be to simply dump the list of user-installed packages into
> > a config file which is preserved by sysupgrade. now, firstboot would see
> > that file and start opgk with it - that's usually going to just work, as
> > the network configuration is preserved as well.
> 
> 1. This relies on all packages and kernel modules needed to connect to 
> the internet being part of the image.
>
this is true, but not a deal breaker. the fact that not all users would
benefit from the feature doesn't mean that it shouldn't be provided. the
implementation is certainly cheap enough.

> 2. If you do build a custom image without all your packages, packages 
> you download from LEDE servers may be incompatible for various reasons - 
> kernel version, library versions, compile-time defined options and so on.
> 
it seems rather obvious to me that the feature's configuration would be
customized with the image itself.

> the default packages should be limited to what is useful and necessary
> to almost everyone - otherwise everyone would have lots of useless
> packages in their image that take up valuable space
>
that's correct, though i'd be surprised if supporting all reasonably
common _basic_ network access technologies would require more than a few
tens of kilobytes.

> (and devices with 4MB flash would be unsupported).
> 
well, you're losing that fight anyway.

> > of course, this immediately prompts the next question: why doesn't
> > luci's flash operations page have an auto-download option for the
> > sysupgrade image? the locations of the package feeds are also inside
> > the image, and automating the integrity check isn't rocket science,
> > either.
> 
> There have been recent discussions about a web interface to the image
> builder, based on or similar to Meshkit by Freifunk [1].

> LuCI/sysupgrade could add a feature to connect to this service, submit
> a list of installed packages and other needed information, and
> automatically download an image built with these packages.
> 
that's an interesting concept, but i don't think it scales. i'd limit it
to a pre-defined set of network configurations (which could be
referenced from an ISP table). packages beyond network access should be
still obtained separately. that makes it somewhat realistic to cache the
images and distribute them to multiple users.


anyway, there are more options besides downloading pre-built complete
images (which inherently requires lots of server infrastructure) and
amending the installation after the upgrade (which inherently has a
bootstrap problem if the image lacks required features):

- let the upgrade process download the required packages and append
  their unpacked contents to the freshly flashed image *before* reboot.
  that's what sysupgrade does to preserve the config files anyway.

- modern browsers actually provide pretty much a complete operating
  system environment. that means that it would be feasible to do the
  image building (from downloaded images and packages) within the client
  browser, and upload a complete image to the device for flashing.
  obviously, this comes with some caveats:
  - you can't do unattended upgrades this way. i guess many openwrt
    users would prefer it that way, but having the option to fully
    automate it (and even default to it within stable series) seems
    desirable.
  - i guess most openwrt developers aren't sufficiently familiar with
    these technologies to pull this off in reasonable time and to
    maintain it.


and now i had yet another idea, which would solve the upgrade problem
for me nicely ... i'll start another thread.



More information about the Lede-dev mailing list