Skip to content

Latest commit

 

History

History
48 lines (32 loc) · 2.8 KB

swupdate.md

File metadata and controls

48 lines (32 loc) · 2.8 KB

Over The Air (OTA) Updates

SWUpdate is used for providing OTA updates.

SWUpdate Configuration

SWUpdate Tools

The following client tools are included:

U-Boot Integration

U-Boot Environment

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

Boot Script

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.

Linux Integration

Good Boot Verification

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.