Atomic update avoids that power-cuts and network losses can brick your device. New software is always fully installed or update is interrupted keeping the device running. There is no partial software update as with package-based update.
Zero copy
SWUpdate has a small footprint – if configured, it does not create temporary copies and the incoming packets are directly installed on the storage. The whole process (decompression, decryption) is done in chunks in memory, making life harder for potential attackers.
Authenticity of update
Update packages are signed and verified by SWUpdate to authenticate authorized and trusted updates. SWUpdate supports signing with RSA keys and with cerificates using its own PKI infrastructure.
Update everything
SWUpdate is able to update all components of your device:
Bootloader
Linux Kernel
Root filesystem
Application
Reliable
Atomic update avoids that power-cuts and network losses can brick your device (except bootloader and rescue system).
Hardware compatibility
SWUpdate verifies that delivered software can be applied to the device. A hardware compatibility map is applied to any release.
Backup System
SWUpdate can backup your entire system into a swu file
Rescue System
With the rescue system the device can be restored at any time
Concept
With the SWUpdate concept, multiple partitions are now available in the internal memory.
The partition rootfs is the area which is used in normal operation and contains your settings and applications.
The new partition rescue is a minimal life system, which is only used for a backup or restore of the system.
With this new partition, we have the possibility to easily provide a backup in only one file, this is the swu file.
The live system that is provided can simply be added as an additional rescue card that contains the already created swu file.
In addition to the classic restore of a device, an upgrade is now also possible.
With this new feature, the settings of the device are restored after the update.
The swu files are signed and are therefore unchangeable (integrity).
After an update, the system is restarted and checked. If necessary it is reinstalled.
A swu file can be written either completely on the internal flash or only the newer areas of the swu file, except the rootfs partition, which is always overwritten.
The rescue partition where the swu file is executed contains a GUI for the display as well as a web interface where an update can be optionaly started.
The SWUpdate GUI with webinterface is in the RescueOS (rescue) and RescueCard available.
GUI Local System
Main Page
The Main Page is the entry Point of the GUI.
The Page shows the active network configuration an the URL used for the swupdate webserver.
Install Page
The Install Page is used to start the update process manualy by choosing a swu file located on any pluged microSD Card or USB Stick.
Network Page
With the Network Page the ip address of the network interfaces can be changed.
The new settings will not saved persistently.
Reboot Menu
The Reboot Menu is used to manualy boot into the rootfs (Productive System) or reboot into the RescueOS.
Progress Page
The Progress Page is automaticaly visible when a update process is running and shows the progress state and errors in the Messages History.
GUI WebInterface
The swupdate webserver interface shows the progress state and errors in the Messages.
The update process can be manualy started dropping a swu file into the image area.
The Restart System Menu is used to manualy boot into the rootfs (Productive System) or reboot into the RescueOS.
WebServer StandBy
WebServer Progress
More about swupdate
Partition scheme on eMMC/NANDFLASH
Name
Description
Rescue
The rescue partition contains a minimal linux system, which is responsible for the execution of the swu files.
This partition is used in case of an update or backup of the system.
RootFS
The RootFS partition contains the productive system with the corresponding application, qiwi, codesys, etc..
In normal operation, this partition is used.
swupdate-data
This partition is only used for the common data of the rescue and rootfs partition, e.g. the network configuration and export files.
In addition, the versions of the individual parts that are installed are stored here.
Update File swu Format
Name
Description
cpio-header
The swu file is a cpio archive.
This is the cpio-header.
sw-description
The sw-description contains meta information about each single image and the global information.
Global Versions
Version of each image
Hardware Compatibility Info
Signature of each image
rootfs zipped
Zipped content of the productive system.
This Content will always installed in case of a update or a complete installation.
bootloader binary
Bootloader
This Content will only installed if the bootloader on the device has an older version than the bootloader in the swu file or if a complete installation is used.
rescue zipped
Zipped content of the rescue system.
This Content will only installed if the bootloader on the device has an older version than the bootloader in the swu file or if a complete installation is used.
bootloader environment
Bootloader environment variables.
This Content will only installed if the bootloader on the device has an older version than the bootloader in the swu file or if a complete installation is used.
Boot procedure behavior
Normal Boot
Backup
Restore/Update
Log Files
Log File of a swu-create or swu-update process are saved in swupdate-data partition.
Complete Installation
if the device is empty, contains a image without swupdate support or the device does not boot according corrupt content.
Remove microSD Card or USB Stick used to restore your device.
Creating a RescueCard for a microSD Card for your device
Used as a lifeline when the system stops responding.
This image includes the *.swu and the LiveSystem.
With the RescueCard the Complete System will always be restored.
Download the rescue image from the FTP server (Use the same as your image version is).
Write the rescue image to a microSD card with the USB Image Tool.
Replace the exsiting swu file on the microSD, card with your backup swu file (backup created with the webconfig or the commandline).
Save the rescue image to a microSD card with the USB Image Tool.
This tool creates a SWU file (backup) from the current system.
--bootenv-skip=LIST
Comma separated list of regualar expressions. All boot
variables that match a regular expression are not
backed up.
--desc=DESC
Sets the description property of the swu file.
If it is not defined, it is generated from the data from
/opt/version/image-release.
--enckey=ENCKEYFILE
File with key and initialization vector hex values to
be used for encrypt.
--enclist=LIST
Comma separated list of artefacts to be encrypted.
Parameter --enckey must be defined. By default,
all included artefacts are encrypted.
--key=KEYFILE
File with the private rsa key used to sign the image.
-h, --help
display this help message
--list=LIST
Comma separated list of artefacts to include to the
swu image. By default, all artefacts supported by the
HW are included. Following artefacts are supported:
bootenv bootenvironment
bootloader boot partition
rescue rescue partition
rootfs rootfs partition
sram sram device
--log=DIR
If the rescue system is needed to create the swu file, it
will store the system messages to directory DIR
--pw=PWFILE
password file for the private key
-y, --yes
Assume "yes" as answer to all prompts and run
non-interactively.
This tool starts the software update process.
Without parameters, the tool only starts the web server
and rescue GUI without automatically starting an update
process.
-e <sw>,<mode> --select=<sw>,<mode>
install rule to use, possible values depend on the SWU file and strategy
stable,clean:
create partitions and install all
components (rootfs, rescue, bootenv, bootloader)
stable,complete:
create partitions if not exists and install all components
stable,update:
create partitions if not exists and install all components while considering the installed version.
install rescue, bootenv and bootloader components only if version to install is newer
always install rootfs component
-h, --help
display this help message
-i FILE
update with image from local .swu file
-d CMD
starts download client with command line CMD to download
.swu file before update
--log=DIR
The rescue system stores the system messages to
directory DIR
-k KEYFILE
The file contains public key to be used to verify images.
By Default, the key file stored in the system is used.
-K KEYFILE
The file contains the symmetric key to be used to decript
images. By Default, the key file stored in the system is used.
This tool starts the software update process in dry-run mode, in which no changes are made to the hardware. The tool checks the SWU file for compatibility with the hardware and the keys used for signing and encryption.
Below is the command line syntax:
$ swu-verify -h
Usage: swu-verify [-i FILE | -d CMD ] [-e <sw>,<mode>]
[-k KEYFILE] [-K KEYFILE] [-v]
swu-verify -h|--help
This tool starts the software update process in dry-run
mode. This mode performs no changes to the hardware.
Options:
-d CMD
starts download client with command line CMD to download
.swu file before verify
-e <sw>,<mode> --select=<sw>,<mode>
select the install rule from the sw description file to use.
e.g. stable,update
-h, --help
display this help message
-i FILE
verify with image from local .swu file
-k KEYFILE
The file contains public key to be used to verify images.
By Default, the key file stored in the system is used.
-K KEYFILE
The file contains the symmetric key to be used to decript
images. By Default, the key file stored in the system is used.
-v
Activate verbose output.
Comparison Livesystem Backup/Restore vs. swupdate
Single File Concept
Signed Files
Update over HTTP/FTP
No Additional Tools/SW
No Internet Connection neccessary using the WebConfig
livesystem
-
-
-
-
-
swupdate
x
x
x
x
x
Login (rescue Partition)
User: root
Password: rescue
Update Versions in Images
Both versions will work with the newest images.
Image
Swupdate Backup/Restore (new Version)
LiveSystem Backup/Restore (old Version)
01028
>= 01028 0E
<= 01028 0D
01056
>= 01056 0C
<= 01056 0B
01023
--
01023 0x
01071
>= 01071 0C
<= 01071 0B
01070
>= 01070 0C
<= 01070 0B
01085
>= 01085 0A
--
01021
--
01021 0x
00947
--
00947 0x
01009
--
01009 0x
01007
--
01007 0x
01013
>= 01013 0L
<= 01013 0K
01026
--
01026 0x
00948
--
00948 0x
01024
--
01024 0x
01010
--
01010 0x
Remarks
If the RescueCard is started from an USB stick, the bootloader on the internal flash is always used.
Not all USB sticks are supported (the normal system is booted and not the LiveSystem)
If the bootloader or rescue part is not installed correctly (for example in case of power loss), the system can brick.
Check log files in case of errors.
If you have a imx6ul and imx6ull solution, you will have to create for each cpu type a backup.
Best Practice
Create a RescueCard with your backup in case a device can not boot anymore.
Use the WebConfiguration to backup/restore/upgrade your system.
Use a microSD Card for a first Installation.
Error Handling
The RescueCard does not boot from usb stick or the execution is faulty