Just wanted to inform people (even if it is obvious info, as it wasn't to me) that the /root
directory is not preserved when grabbing a sysupgrade image and upgrading (I did it via the web ui but assume it doesn't matter which way you go about upgrading for what happened here), in addition your packages are not preserved either (your configs are safe so all you need to do is re-install the packages and you should be fine (so long as you remember all the packages you installed, I did see an option to save the installed packages somewhere but it didn't cross my mind that it would remove my packages or I thought the list of packages would be in the backup) or for the package issue, I think the attended-sysupgrade luci app is designed to fix the packages thing, I did perform a backup but /root
was not included which is fair/expected but I didn't expect it would even touch /root
, so I did lose some scripts/files but nothing that major but just thought I'd let others know so they can learn from my mistake (or not as it is easy to forget given you don't.... typically? upgrade that often as in how frequently updates are pushed out, it wouldn't be surprising to forget this piece of trivia but yeah, hope this helps someone, if not, maybe it will make someone laugh, either way this is a great project and I am glad for everyone who puts in effort to support this project in one way or another (development, documentation, support/community) <3
Add whatever additional is needed to /etc/sysupgrade.conf.
Ahh so if you combine attended-sysupgrade with /etc/sysupgrade.conf
, you can ensure your important directories (such as /root
in my case) and your packages will be preserved when performing a sysupgrade?
Yeah, it’s a bummer when things disappear that you were kind of counting on. But I think the description for "Upgrading OpenWrt firmware using LuCI and CLI" is pretty clear about it:
"Any configuration files or data files placed in locations not specifically listed as being preserved below will also be lost in an OpenWrt upgrade. Be sure to check any files you have added or customized from a default OpenWrt install to back up these items before an upgrade."
"When it is possible to 'keep settings' sysupgrade will automatically preserve much of the OpenWrt OS configuration by saving and then restoring configuration files in specific common locations (including /etc/config
). This will preserve things like OpenWrt network settings, Wi-Fi settings, the device hostname, and so on. Some data files and directories for additional services will need to be configured manually." [meaning you have to manually make a backup before upgrading]
Yeah, that guide may have been of help, I just kind of upgraded on a whim, it had been a while, I checked and I was 3 minor versions (assuming they use semantic versioning) out of date so I just went and upgraded it not thinking of what approach would be taken in respect to sysupgrade, I just assumed it would only update the files necessary but thinking about it now, it does make more sense that it probably just completely overwrites the whole partition to ensure the router won't upgrade and then be in a locked state due to files being somewhere openwrt can't anticipate. Perhaps the link to the wiki can be added when upgrading or perhaps something more direct to get the users attention stating all of x files will be removed once this upgrade is performed, check the upgrade wiki page for how to ensure the files you wish to keep survive a sysupgrade.
Yeah, that kind of warning would definitely be a good idea!
Also, verify what will be backed up with sysupgrade -l
(I've got /root/bin
in my /etc/sysupgrade.conf
):
$ sysupgrade -l
/etc/collectd.conf
/etc/config/adblock
/etc/config/attendedsysupgrade
/etc/config/collectd
... hundred more files trimmed
/root/bin/uci-get.uc
/root/bin/uclient-test.uc
/root/bin/ucode-wget.uc
/root/bin/updater.sh
Oh, that is perfect, especially for the idea above of adding the files which will not be saved/will be deleted, you can just use find / | grep -E -v $(sysupgrade -l | tr '\n' '|' | sed 's/|$ //')
, not perfect due to things like needing to filter out /proc
, /sys
, etc. but a nice example command
Not at all, it will explode badly on the next larger sysupgrade.
Binaries are not compatible between OpenWrt versions, so your approach does not work to retain package contents. It's only suitable for configuration files, maybe some selected scripts and (passive) data - but size constraints apply, so this is not a carte blanch either.
I am not sure what you mean by explode badly? Although maybe you mean the fact that the command is no longer working since I closed out my last SSH session (even though it was working previously
Oh, so even attended sysupgrade will not preserve/build an image with my current packages but packages that are compatible with the newer image?
Right. ASU clients (LuCI AttendedSysupgrade app, auc
, owut
and Firmware Selector) supply the ASU server with device id and a list of packages to include in the build. The ASU server grabs the imagebuilder corresponding to your device, then builds a new image and does opkg install <all your packages>
on the new image. The clients (and sometimes the ASU server) will do package substitution on occasion (for example, firewall
-> firewall4
when upgrading from 21.02 to 22.03).
This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.