Sysupgrade – Technical Reference
In contrast to opkg, mtd and others, sysupgrade is merely a shell script: /sbin/sysupgrade intended to facilitate easy updates.
Usage
You may want to read Sysupgrade – Usage instead.
Options
You can populate your /etc/sysupgrade.conf and issue additional options:
Usage: /sbin/sysupgrade [options] <image file or URL> Options: -d <delay> add a delay before rebooting -f <config> restore configuration from .tar.gz (file or url) -i interactive mode -c attempt to preserve all changed files in /etc/ -n do not save configuration over reflash -q less verbose -v more verbose
The list of files preserved is by default in /lib/upgrade/keep.d. Additionally files returned by opkg list-changed-conffiles are also preserved.
SAVE_OVERLAY saves the complete /overlay directory. There's no rule what needs to be saved… sometimes I install additional packages but then include them in the later firmware builds, so I don't have to preserve those. Sometimes files are modified and the new firmware already contains the modifications so those are also not needed. But config files are needed or router will boot with default settings. But those are preserved by default (unless using -n).
– Does this mean, I make an archive.tar.gz of /etc and /root for example and sysupgrade -f archive.tar.gz will flash the router and afterwards restores the configs from this archive?
That's what is says: 'restore configuration from .tar.gz (file or url)'. Anything archived in the tgz will be written to /overlay after the flash. This way you can hand-pick the files that will be the system after new firmware boot.
doc/techref/sysupgrade.txt · Last modified: 2012/02/22 04:36 by russell