Software Update Configuration and Usage¶
The Welma software update service provides several interfaces for controlling and configuring the update process:
-
Runtime configurations and daemon behavior: Can be configured through
/etc/updated.confconfiguration file. -
The
updatectlcommand-line tool: Provides the primary user interface for managing software updates. -
D-Bus API: Allows applications to interact directly with the update daemon.
This page describes these interfaces and how they can be used to control and configure the Welma software update service.
Runtime configuration¶
The updated daemon supports two runtime configuration options
in /etc/updated.conf: confirm-timeout and allow-downgrade.
Confirm timeout¶
confirm-timeout defines the maximum time, in seconds, allowed to confirm an
update after the system boots on newly installed partitions. Once the system
has booted into the updated version, updated waits for a ConfirmUpdate request.
If the update is not confirmed within the configured timeout, a rollback is
triggered and the system returns to the previously installed version.
The confirmation timeout mechanism can be disabled by setting confirm-timeout
to 0 or to a negative value. When disabled, no automatic rollback is triggered
due to a missing update confirmation.
confirm-timeout is a required configuration entry in /etc/updated.conf.
Allow downgrade¶
allow-downgrade controls whether updated accepts an update that would
replace a module with an older version. Version comparison relies on the
version information provided by the Software Version Control
feature.
When allow-downgrade is set to true, installing a module whose version is lower
than the currently installed version is allowed. When set to false, updated
rejects such an update before installation.
This option is optional and defaults to true when it is not specified
in /etc/updated.conf.
Warning
By default, Welma allows downgrade updates. You can change this behavior by
adding allow-downgrade=false line in /etc/updated.conf
Example of /etc/updated.conf content¶
updatectl API¶
updatectl is the command-line interface for controlling the Welma software update
service.
It communicates with the updated daemon through its D-Bus API
and provides commands to configure updated, install software update
packages, inspect the current update status, confirm or abort an update, and
interact with the clearance mechanism.
It can be used directly from the command line or from scripts to manage the software update lifecycle.
Usage: updatectl install FILE [FILE ...]
updatectl confirm
updatectl abort
updatectl status [PROPERTY]
updatectl set [PROPERTY] [VALUE]
updatectl clearance-request REASON
updatectl clearance-notify RESPONSE
Commands:
confirm Confirm a software udpate under test
install Install a software update and schedule it for next reboot as under test
abort Abort a pending software update (scheduled or under test)
status Print update status
set Set a property to a specified value
Currently only "allow-downgrade" is supported.
clearance-notify
Send the clearance response.
clearance-request
Send a request for clearance.
Arguments:
FILE A software module to be installed.
PROPERTY A single property for which the status is needed
REASON download | install
RESPONSE ready | rejected | retry-later
Example of a manual installation scenario¶
-
Get the current update status
-
Install the update package
Installation logs are recorded in the system journal and can be viewed usingjournalctl -u updated. -
Check the update status state after the installation
-
Reboot
-
Check the update status after the reboot
Note that# updatectl status state under-test partitions-active /dev/mmcblk2p1 /dev/mmcblk2p3 /dev/mmcblk2p6 partitions-inactive /dev/mmcblk2p2 /dev/mmcblk2p4 /dev/mmcblk2p5 allow-downgrade true/dev/mmcblk2p6and/dev/mmcblk2p5switch roles between the active and inactive partitions. -
Confirm the update
D-Bus API¶
The updated daemon exposes a D-Bus API, described in this section.
Bus name:
Manager object:NAME TYPE SIGNATURE RESULT/VALUE FLAGS
com.witekio.update1.Manager interface - - -
.AbortUpdate method - - -
.BeginUpdate method - - -
.ConfirmUpdate method - - -
.InstallLocalFile method s - deprecated
.InstallLocalFiles method as - -
.MarkSlotUpdated method s - -
.NotifyClearance method s - -
.RequestClearance method s s -
.SubmitUpdate method - - -
.AllowDowngrade property b false emits-change writable
.ConfirmTimeoutSec property i 120 emits-change
.State property s "normal" emits-change
.ClearanceRequested signal s - -
Methods¶
-
AbortUpdateAborts a started update transaction, before or after reboot. Aborting an update after reboot leads to reboot and a rollback to the initial software system.
-
BeginUpdateStarts an update transaction, that shall be followed by:
- Installing packages, via
InstallLocalFiles - Submitting the update to the bootloader, via
SubmitUpdate - Rebooting
- Confirming the update of A/B partitions, via
ConfirmUpdate
- Installing packages, via
-
InstallLocalFileInstalls a package onto its inactive partition. Cannot be used in mode
mender-connected(seeMarkSlotUpdated).Warning
InstallLocalFileis deprecated. Please useInstallLocalFilesinstead -
InstallLocalFilesInstalls a list of package onto inactive partition. Used also to check all packages compatibilites before any installation (see This page for more details). Cannot be used in mode
mender-connected(seeMarkSlotUpdated). -
MarkSlotUpdatedMarks a slot (partition) as updated, when the installation was not made using
InstallLocalFileorInstallLocalFiles. This is typically used in modemender-connected.slot_namemust be a valid partition name of/etc/welma-partitions.conf. -
SubmitUpdateSubmits the update to bootflags, that tells the bootloader to do next boot on the newly installed partitions.
-
ConfirmUpdateMakes the update persistent. Rollback cannot be performed after this. Not applicable when only single mode packages were installed.
-
RequestClearanceRequests that the embedded system prepares itself for a significant update operation such as downloading or installing packages. It is typically called by a program in charge of downloading and installing packages when another program (application, GUI,...) is in charge of granting clearance (by calling
NotifyClearance).reasonmust be one of:download,install.responseis the status given byNotifyClearance(), ortimeoutif no response is received after 5 minutes.
Only one clearance request is allowed at a time. See an example of a typical clearance request sequence.
-
NotifyClearanceInforms the update subsystem about the status of the clearance request.
statusmust be one of:ready,rejected,retry-later. It is given as a response toRequestClearance. -
ClearanceRequestedSent out each time a clearance request is done.
reasonis the reason given in the clearance request (seeRequestClearancefor possible values).
Properties¶
-
StateContains the state of the update daemon, one of:
normal: Regular operational state, a new update procedure may be initiated byBeginUpdate.normal,ongoing-install: A package is being installed byInstallLocalFiles. Other installation or submit requests will be rejected.normal,aborting: An installation procedure is being aborted byAbortUpdate. Other requests will be rejected.normal,test-scheduled: An update procedure has been submitted bySubmitUpdateand awaits a reboot for taking effect.under-test: The system is running on packages that just got installed before the latest reboot, and the update daemon is waiting for a call toConfirmUpdate.
-
ConfirmTimeoutSecContains the time, in seconds, allowed to confirm an update. Read only property.
-
AllowDowngradeContains the current state of the allow-downgrade configuration. Can be updated using D-Bus interface or
updatectltool.