I'm new to OpenWRT and still figuring things out. I'm using 23.05.2 on a Linksys EA8300, and configuring it with all the necessary add-ons (opkg packages).
I want to be able to restore everything after an update, and after reading the wiki I decided to use opkgscript to create a list of installed packages and restore them after update. I have the script on a SSD connected to the router, and when I execute ./opkgscript.sh write, it creates the opkg.installed file in /etc/config
The file seems to contain all packages I installed, plus the ones in the image file, e.g.
But when I use ./opkgscript.sh script it doesn't add any package to the script (I see only #! /bin/sh). Also ./opkgscript.sh -t install doesn't do anything (should list a series of packages to install).
Looking at the script, this instruction if ! grep -q "^$PACKAGE\$" "$PREQLIST"; then seems not to work as expected. but I got lost trying to figure out why the lists is not built correctly.
First of all, is opkgscript the best way to reinstall all non-preinstalled pckages? If so, am I the only one with a problem? Should I open a bug in github for this script?
I'm not familiar with the opkgscript.sh script but see this post:
for an excellent way to get the list of added packages. You'll want to get and run the pkg-scan.shscript from @efahl at his github page. That referenced post also points to another forum thread with more discussion.
Thanks! I just tested, and using sh /etc/config/opkgscript.sh -u -v install I experience the same problem (nothing listed, even if I have plenty of packages installed and the opkg.install file looks good)
Attended sysupgrade looks exactly like what I was looking for. Will try for sure!
Replying to my own thread, probably bad etiquette but just as info for future users. Attended Sysupgrade does everything I need, including generating a list of installed packages. Thanks again for the suggestion