I have made a few scripts a while back for LEDE 17.01.4, I had to update a few for OpenWRT 18.06 (specifically, opkg now requires a lock file in root (-o) so I had to change how I made the manfest).
Anyway, I'll list them in the order I believe they are most useful:
- This is meant to somewhat mimic 'apt upgrade' on Debian. It'll run 'opkg update' to fetch the latest package lists, run 'opkg list-upgradable', show you what is available, and allow you to press 'y' to upgrade any packages in which updates are available, or pre ^C (CTRL-C) to cancel.
The following are made with an extroot in mind. They were not tested on ubi internal storage:
- This script will check which packages are pre-installed into the ROM, and which packages you have installed now, and compare them. It only checks the package name, not the version, by design, so that updates to ROM packages are NOT included.
- This script used to not require many writes on 17.01.4, but due to an update in how opkg works in 18.06.1, we now have to copy the contents of /rom to /tmp/opkginstalled (/tmp is ramfs, so no flash writes), so that it can write it's silly lockfile as we check its installed package list. We then clean up our mess.
- The output of this file is considered a manifest, which will work with the next script:
This is a simple script that can read back the manifest created by the last script, and attempt to install everything in it. Useful when restoring a clean backup. (clean settings + restore manifest (packages) + restore luci backup = happy restore)
Or, if you like dirty backups, there is also:
- WARNING: By default this writes to /root, which is not the /tmp RAM, therefore if you are using ubi or flash drives, this is consuming write cycles.
- This will create a tar.gz of your entire overlay, excluding itself, of course.
- This script also depends on opkg-list-installed-extroot, listed above. Or you could comment that out.