Page 1 of 1

How to preserve plugins across minor upgrades

Posted: Wed Aug 28, 2019 7:33 am
by altruizine
I'm looking for a way to keep the installed plugins enabled (and their configuration preserved) across minor upgrades.

I often rebuild Gargoyle with an updated OpenWrt-18.06 branch to benefit from kernel updates on that branch [1]. I'd like to do automated minor upgrades between these updated versions of Gargoyle 1.11.X.

Right now, it appears that after an upgrade, the plugins are disabled but still installed. In order to reactivate them, I need to uninstall, reinstall, and then manually reconfigure them; which is what I want to get rid of.

In most cases, I'd expect the installed plugins to continue to work after a sysupgrade despite not updating the plugins at the same time (the plugins I use, ddns and openvpn, have no kernel dependencies); but if necessary, I'd update them along with the system image. I have a local plugin repository available over HTTP, but I could copy the updated plugin IPKs to the router as part of my automated process as well.

Would it be sufficient to have a bunch of /lib/upgrade/keep.d files that preserve a few strategically important files to keep installed plugins intact?

Any other ideas?

Thanks!

[1] https://github.com/openwrt/openwrt/comm ... nwrt-18.06

Re: How to preserve plugins across minor upgrades

Posted: Wed Aug 28, 2019 8:36 am
by Lantis
Plugins are not still installed after a sysupgrade. They might still be visible in the menu system, but there is generally nothing behind them. This is supposed to be cleaned up by the Gargoyle init script on first boot after sysupgrade: https://github.com/ericpaulbishop/gargo ... e-init#L80

This behaviour might look a little strange if you are using extroot, but the full intent is that they are not preserved across a sysupgrade. This is consistent with the upstream Openwrt project.

Plugin config files may still be present after a sysupgrade as the config directory is preserved. This in theory allows you to reinstall the plugin and keep the same settings.

I'll also need to pull you up on Openvpn having no Kernel dependencies, as it relies on kmod-tun in the very least.
DDNS relies on ewget, which relies on libopenssl, which is controlled by upstream, and could rather suddenly and unexpectedly undergo an ABI change. ewget is included by default so this will probably not cause you problems, but it is certainly something to keep in mind.

I wouldn't recommend what you're trying to achieve. However if you're keen and have the know how (and if you're compiling your own then you're at least half way), then have at it.

At this stage, unless Openwrt changes its stance on this matter, i'm not moved to try and include this type of functionality in Gargoyle by default.

Re: How to preserve plugins across minor upgrades

Posted: Wed Aug 28, 2019 8:56 am
by RomanHK
I do this as follows:
1. I will back up the configuration via GUI
2. Upgrade without retaining the settings
3. I will log in via ssh and install the plugins:

Code: Select all

gpkg update
gpkg install plugin-gargoyle-ddns
gpkg install plugin-gargoyle-openvpn
4. I will restore the backup via GUI
5. Restart the router

This should be an upgrade with plugins + settings (just note, if you install over ssh, you will not be able to remove packages via GUI, only over ssh).