User Tools

Site Tools



This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
doc:techref:sysupgrade [2013/01/02 19:24]
hnyman align options with r34975
doc:techref:sysupgrade [2017/02/22 17:13] (current)
Criten Updating the output from sysupgrade
Line 1: Line 1:
 +====== Sysupgrade – Technical Reference ======
 +In contrast to ''​opkg'',​ ''​mtd''​ and others, ''​sysupgrade''​ is merely a shell script: ''​[[https://​​browser/​trunk/​package/​base-files/​files/​sbin/​sysupgrade|/​sbin/​sysupgrade]]''​ intended to facilitate easy updates. ​
 +===== Usage =====
 +This page lists all ''​sysupgrade''​ command-line options. For the overall upgrade procedure and typical usage, please read [[doc/​howto/​generic.sysupgrade|OpenWrt OS upgrade procedure (sysupgrade or LuCI)]] instead.
 +===== Options =====
 +You can populate your ''​[[doc/​howto/​notuci.config#​etcsysupgrade.conf|/​etc/​sysupgrade.conf]]''​ and issue additional options (r34975):
 +Usage: /​sbin/​sysupgrade [<​upgrade-option>​...] <image file or URL>
 +       /​sbin/​sysupgrade [-q] [-i] <​backup-command>​ <​file>​
 +        -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
 +        -p           do not attempt to restore the partition table after flash.
 +        -T | --test
 +                     ​Verify image and config .tar.gz but do not actually flash.
 +        -F | --force
 +                     Flash image even if image checks fail, this is dangerous!
 +        -q           less verbose
 +        -v           more verbose
 +        -h | --help ​ display this help
 +        -b | --create-backup <​file>​
 +                     ​create .tar.gz of files specified in sysupgrade.conf
 +                     then exit. Does not flash an image. If file is '​-',​
 +                     i.e. stdout, verbosity is set to 0 (i.e. quiet).
 +        -r | --restore-backup <​file>​
 +                     ​restore a .tar.gz created with sysupgrade -b
 +                     then exit. Does not flash an image. If file is '​-',​
 +                     the archive is read from stdin.
 +        -l | --list-backup
 +                     list the files that would be backed up when calling
 +                     ​sysupgrade -b. Does not create a backup file.
 +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.