luci icon indicating copy to clipboard operation
luci copied to clipboard

Button in LuCi to install overlay packages defined in installed_packages.txt

Open shoulders opened this issue 4 years ago • 6 comments

It is now possible with sysupgrade to get a list of your user installed packages (on the overlay) and have this put in installed_packages.txt which is preserved during a firmware upgrade.

However there appears to be no easy way to install these missing packages (for newbies) so what I purpose is putting a button on the Backup / Flash Firmware page to allow end-users with one click to install these missing packages (assumes working internet).

It would also be useful to have the option to create the installed_packages.txt and update it if required when generating a config backup

relates to https://github.com/openwrt/luci/issues/4160

shoulders avatar Nov 18 '21 18:11 shoulders

This should be handled by sysupgrade itself, not by LuCI. It could start by a file which would contain a list of packages to install after a software update. You typically don't want to reinstall all packages anyways. You only want a few ones, and let opkg handle the dependencies.

zorxd avatar Nov 18 '21 21:11 zorxd

The button could run something like

# opkg update
# grep "\toverlay" /etc/backup/installed_packages.txt | cut -f1 | xargs -r opkg install
# rm /etc/backup/installed_packages.txt
# reboot

Taken from here https://www.mail-archive.com/[email protected]/msg43129.html

shoulders avatar Nov 19 '21 08:11 shoulders

well again, that would reinstall all packages, which is not what you typically want. Let say you want package A which depends on package B. After an update, it now depends on package C. Your script would install package B for no reason.

zorxd avatar Nov 19 '21 13:11 zorxd

I completely understand, but i am just thinking of the hobbyist at home who struggles to keep his OpenWrt router up to date because of the hoops that have to be jumped through. A good chunk of users like me only have installed what they want and just want a simple update process.

You could add a list with checkboxes when the button is click which still utilises this file, however this would be a lot more complicated to add that a button :)

shoulders avatar Nov 19 '21 13:11 shoulders

One of the problem is packages like libwolfssl4.7.0.66253b90. This is the package name. The version is 4.7.0-stable-2. There could well be a different libwolfssl after the next update.

I still think a list of packages to (tentatively) reinstall after the software update would be a better idea, and it should be built-in to sysupgrade, not LuCI.

zorxd avatar Nov 19 '21 18:11 zorxd

One of the problem is packages like libwolfssl4.7.0.66253b90. This is the package name. The version is 4.7.0-stable-2. There could well be a different libwolfssl after the next update.

In the real world, it just works. I've been doing that since before 19.07 when -k was upstreamed. If a failed package installation does not prevent others to be installed, it might work as expected. OpenWrt repos do not keep old versions. So, if a package is simply an old requirement and it is now missing, the real software will require the correct dependency.

I'm just more cautious between major release upgrades. I normally simply ignores all lib* packages during that reinstall, as it might include unnecessary packages, and let the system download the recent dependency. With minor releases, I simply do a blind "install all". Excluding reboot/download/install times, it take me less than a minute of attention for each upgrade.

I still think a list of packages to (tentatively) reinstall after the software update would be a better idea, and it should be built-in to sysupgrade, not LuCI.

I believe that Luci should not be the one responsible for coding that. It should be a standalone utility/service/hotplug script, probably optionally enabled during backup by a sysupgrade flag. For now, I wrote a "reinstall" reinstall.gz script that I'm carrying between upgrades ('sysupgrade -o'). It is not ready for upstream but it does get the job done. I manually run it after each upgrade, saving me a lot of time. It has a primitive text-based interface and it will do nothing you didn't asked it to do.

luizluca avatar Feb 27 '22 03:02 luizluca