System Updates
Nexigon Agent installs system updates with Rugix Ctrl or RAUC. The update engine writes a bundle, the file that contains an update, to the inactive copy of the system and makes the device boot that copy. The agent decides which bundle to install and when, and reports the result. Set Up System Updates shows how to prepare an image and its releases.
The agent implements the OTA update contract of
Nexigon Hub. Operators set the desired release and update policies in the
dev.nexigon.ota.config device property. The agent applies this property over
the defaults from its own configuration, so an image can ship with a default
release and be switched to another one later. It publishes its progress in the
dev.nexigon.ota.status property and records each installation and its
outcome as an event in the ota category.
The Check Cycle
The agent checks for updates after it connects to Nexigon Hub, every
check-interval-secs, when a deferred update becomes due, and when the
nexigon.ota.check command runs. Each check:
- Commits a newly booted system, if one awaits its commit. Committing confirms to the update engine that the new system works.
- Determines the name and version of the running system.
- Resolves the configured release to a package version and stops if the device already runs it. If the release requires that the device first runs a checkpoint release, the agent installs the checkpoint first.
- Waits while a hold, a maintenance window, a retry delay, or a spread defers the update.
- Has the update engine download and install the bundle for the running system, and reboots the device.
Scheduled checks wait for an additional random delay of up to
check-jitter-secs, so that devices whose checks fall due at the same time,
for example when a maintenance window opens, do not reach Nexigon Hub at once.
Without a configured release, the device does not update.
After the reboot, the next check reports whether the device runs the installed version or has rolled back to the previous one. Because the agent reads the running version from the image on every check, the report is correct even after a rollback or a manual installation.
The Running System
The agent identifies the running system by its system name and version
string. It reads them from /etc/rugix/system-build-info.json, which Rugix
Bakery writes into every image, and otherwise from IMAGE_ID and
IMAGE_VERSION in /etc/os-release.
The system name selects the bundle of a release: <name>.rugixb for Rugix
Ctrl or <name>.raucb for RAUC, unless asset sets another filename. The
device runs a package version when its version string equals the
imageVersion metadata of that version. To find the package version that it
runs, the agent resolves the version string as a tag of the package.
Installation and Commit
| Step | Rugix Ctrl | RAUC |
|---|---|---|
| Install | rugix-ctrl update install with the bundle’s download URL | rauc install with the bundle’s download URL, by streaming |
| Reboot | rugix-ctrl system reboot --spare, which boots the new system once on trial | systemctl reboot |
| Commit | rugix-ctrl system commit once the agent has connected to Nexigon Hub | The rauc-mark-good service, independently of the agent |
With Rugix Ctrl, a new system that cannot connect to Nexigon Hub is never
committed, so a reboot returns the device to the previous system. With RAUC,
the default rauc-mark-good service commits any system that boots.
Rollback describes how to roll back
systems that boot but do not work.
With use-bundle-hash, the agent passes the rugix.bundleHash metadata of the
bundle to Rugix Ctrl, which then verifies the bundle against this hash instead
of a signature. This option is not available for RAUC.
The status describes the update engine in updater: its version, its slots,
the booted slot, and the slot that the device boots next. See
Update System.
Failures
Failures of the integration do not stop the agent. With invalid settings, for
example with both integrations enabled, the agent logs an error and runs
without system updates. When a check fails, the agent logs the error and
retries after a delay, or within check-jitter-secs after it reconnects to
Nexigon Hub. A failed installation counts toward the
retry policy of the
configuration. Calls of rugix-ctrl, rauc, and systemctl that do not
finish within 10 minutes fail, except installations, which include the
download.
Stopping the agent, for example when the device shuts down, interrupts an
installation in progress, and the agent does not reboot. Its next check keeps
the running system active and reports a failed attempt with the failure code
interrupted. RAUC finishes an installation in the background even after the
agent stops rauc install, so the check first waits until RAUC is idle. A
lost connection or a hold lets an installation finish.
Settings
System Updates lists the
settings of the integration. Enable at most one of
[integrations.rugix.system-updates] and [integrations.rauc.system-updates].