SWUpdate is used for providing OTA updates.
- Build configuration: swupdate.config
- Runtime configuration: /etc/swupdate.cfg
The following client tools are included:
- Mongoose web server
- swupdate-client
- swupdate-progress
- swupdate-sysrestart
- swupdate-hawkbitcfg
- swupdate-sendtohawkbit
Key | Value | Description |
---|---|---|
bootcount | 0..n | U-Boot feature |
bootlimit | 3 | " |
altbootcmd | " | |
upgrade_available | 1 | " |
boot_system | A,B | Specifies the active system to boot |
The U-Boot boot script uboot-boot.ush reads the environment variables and loads either system A or B.
Failed boot handling with bootcount > bootlimit is handled by U-Boot itself. If the bootlimit is reached, the altbootcmd
is executed, which swaps the value in boot_system
.
After a system update the boot up is monitored to determine if the update suceeded. The good boot is confirmed by the /usr/libexec/reset-bootcount.sh script and triggered by systemd app-update-bootcount.service and app-update-bootcount.timer:
- The good boot verification is only active if
upgrade_available=1
is set. - If the app is still running 3 minutes after boot up, then this is considered a succesful update.
- The systemd app.service has a watchdog configured, which reboots the system if the app is restarted more than twice within a minute.