See also:
An OpenWrt sysupgrade will replace the entire current OpenWrt installation with a new version. This includes the Linux kernel and SquashFS/ext4/ubifs/JFFS2/other OS partition/s. This is NOT the same as a first time installation (factory).
Sysupgrade via LuCI or CLI works by optionally saving specified configuration files, wiping the entire file system, installing the new version of OpenWrt and then restoring back the saved configuration files. This means that any parts of the file system that are not specifically saved will be lost.
In particular, any manually installed software packages you may have installed after the initial OpenWrt installation have to be reinstalled after an OpenWrt upgrade. That way everything will match, e.g. the updated Linux kernel and any installed kernel modules.
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.
IMPORTANT: Most of the upgrade procedure can be automated by using the attended.sysupgrade service. Attended sysupgrade will request the build of custom image including all your currently installed packages from a central server, download it when ready, and install it keeping your settings. The service can be accessed from LuCI by installing the `luci-app-attendedsysupgrade` package, or from the shell with the `auc` package. Note that you can upgrade systems using attended sysupgrade via LuCI even if they are not connected to the internet, as long as your browser has internet access.
See this howto about extroot procedure.
For Dual Firmware Devices please consult your device page for additional information.
By compiling your own custom image with an OpenWrt buildroot or generating with the imagebuilder, it is possible to remove the need to perform many of the steps above.
The first part of the upgrade process is to prepare for the upgrade.
This includes documenting programs and settings that will need to be re-installed or restored after the upgrade, locating and downloading the correct OpenWrt upgrade image for your hardware.
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.
Next is the actual upgrade. The two common upgrade methods to perform the upgrade are:
sysupgrade
command over console or ssh
Both use the same ...sysupgrade.bin/img.gz
file (more below).
After the OS upgrade, there are usually some additional configuration steps required to;
Please see the section below with more details.
See also: Upgrade compatibility
Most of the time you can, jumping several versions, downgrading, if the release notes or upgrade message informs you it's not possible, then you will need to plan ahead of time and factor in the time and information required to re-apply some or most of your previous configuration manually.
A time may come when you attempt an upgrade and for whatever reason it is unsuccessful. Contingency planning is a good skill for anything in IT.
Follow Backup and restore, or skip this section if you do not want to preserve existing configuration.
In most cases, platforms that support sysupgrade, have a downloadable image labelled ...-sysupgrade.bin
...
For x86, use the same image you used for your initial installation of OpenWrt as the sysupgrade image as well (that is, there is no “factory” versus “sysupgrade” variant in contrast to most embedded devices). So, if you installed OpenWrt x86-64 openwrt-version-number-x86-64-combined-ext4.img.gz
, you need to choose same image to do a sysupgrade; if you installed Openwrt with openwrt-version-number-x86-64-combined-squashfs.img.gz
, you need that image to do a firmware upgrade.
WARNING: Double check you have the exact model number and in some cases country... If in any doubt about compatibility, read instructions on your device page thoroughly. If your are still unsure ask on the Forum.
NOTE: Keep a copy of images you use, you never know if you may need them again and that may be difficult if your internet is down!
See also: Upgrading OpenWrt firmware using LuCI
OpenWrt provides sysupgrade utility for firmware upgrade procedure.
/tmp
directory is stored in RAM (using tmpfs), not in the permanent flash storage.# example downloading the OpenWrt 15.05 upgrade image for a TP-LINK TL-WR1043ND ver. 1.x router cd /tmp wget http://downloads.openwrt.org/chaos_calmer/15.05/ar71xx/generic/openwrt-15.05-ar71xx-generic-tl-wr1043nd-v1-squashfs-sysupgrade.bin # check the integrity of the image file via md5sums (older images) wget http://downloads.openwrt.org/chaos_calmer/15.05/ar71xx/generic/md5sums md5sum -c md5sums 2> /dev/null | grep OK # check the integrity of the image file via sha256sums wget http://downloads.openwrt.org/chaos_calmer/15.05/ar71xx/generic/sha256sums sha256sum -c sha256sums 2> /dev/null | grep OK # the desired result is that the downloaded firmware filename is listed with "OK" afterwards #################################################### # Initiate sysupgrade with your desired options # by default ( no -n ) settings are kept #################################################### sysupgrade -v /tmp/openwrt-15.05-ar71xx-generic-tl-wr1043nd-v1-squashfs-sysupgrade.bin
NOTE: see extras at end of page for low memory device workarounds
Follow: Upgrading packages
After the initial update, it is good to check for any updated packages released after the base OS firmware image was built.
Note that on a device with only 4MB of NVRAM, these updates may not fit – check free space first with df -h /
and ensure there is at least 600KB or so free.
See also: Preserving packages
After a successful upgrade, you will need to reinstall all previously installed and saved packages.
See also: Comparing configurations
The new package installations will have installed new, default versions of package configuration files.
If existing configuration files are in place, opkg displays a warning about this and saves the new configuration file versions under /etc/config/*-opkg
filenames.
The new package-provided config files should be compared with your older customized files to merge in any new options or changes of syntax.
The diff
tool is helpful for this.