05-13-2013 05:24 AM
On OpenWRT there is a rather nifty little feature where you can specify paths to be preserved across an upgrade.
I was about to hack up a little script to do this but I thought I'm sure this would be useful for other people too and wondered if there's any chance of getting this done "properly" with vyatta CLI configuration options to specify files/paths and included in a future release.
Logic would be fairly simple, detect when an upgrade has occurred (test if a file exists that isn't in the image, bail if it does, create otherwise), then go through and copy said files/directories from /root.dev/w.o. I'm guessing most of this logic already exists somewhere for persisting /config and the like, any idea where?
05-13-2013 09:48 AM
Yeah something like this has been discussed before and we should be able to implement some kind of post-upgrade mechanism to preserve user customizations, for example, copying files, creating symlinks pointing to files in persistent location, installing packages, etc.
The upgrade script is "/usr/bin/ubnt-upgrade" and as you can see it copies the /config directory etc. near the end. This is not very flexible of course and a more generic mechanism (for example maybe similar to the post-config.d mechanism for running scripts on boot) would probably be better.