I have my custom image for the BPI-R4 setup using imagebuilder and a set of uci-defaults and other files.
Those configure the system exactly how I want it after the image has been flashed and booted.
Unfortunately, there are a couple of files I'd rather keep between updates to make my life easier.
Those are in particular the ssh hostkeys and allowed keys, as well as the wireguard keys and clients.
All the other configuration is replaced by the uci defaults, and I'd rather not "mix and match" keeping existing and possibly manually changed config files and the uci defaults from my config repo.
Now I noticed that sysupgrade doesn't just look at /etc/sysupgrade.conf but also a whole list of other config files based on different sources.
Is there a way to tell sysupgrade to explicitly only keep the files I tell it to? If not, would it make sense to create a patch / PR for that, or is that a feature that wouldn't make sense for most users?
My alternative idea currently is to backup the relevant files to my data partition on the eMMC, as it isn't touched by the sysupgrade. And hook that script somehow before a sysupgrade commences and read the results in my uci defaults.
Would it make sense to create a pull request to change that or is that a feature no one besides me would use and I should just patch it myself locally or use a workaround?
I read about someone who tried this, but couldn't find it again. Not sure if it was here in the forums, or a GitHub PR or the mailing list.
Even had some Luci changes with a list picker for the files to restore from backup.
Luci integration would of course be great. If I could select the files to backup with sysupgrade upfront. Would have to look into all that code and how much effort it is. Never touched any of this code base.
This is beside the point, but I've moved away from in-place upgrades entirely. Since the BPI-R4 can boot from an SD card, I build new firmware from source and put whatever extra files I need into the /files folder in buildroot. Then it's a matter of swapping SD cards with minimal resulting downtime, and every time there's a hot backup should something go wrong with the new build.