Reference modules

The swud utility is packaged with a set of reference modules. Together, these components provide a reference implementation, based on the QNX CAR platform, for performing USB-based software updates.

swud-usb.so

The swud-usb.so module monitors USB mass-storage devices for software update packages and notifies the swu-core library when they're discovered. This module has limitations. For example, it loads the first manifest file it finds and looks only in the root directory of the USB device.

The module relies on the mcd service to detect when mass-storage devices are attached. The QNX CAR target image contains the following entry in /etc/mcd.conf to search for manifest files on mass-storage devices:

[UPDATE]
Callout         = FNAME_PATTERN
Argument        = depth=1,*.manifest
Match Rule      = INSERTED
Fail Rule       = INSERTED

The Argument key in this sample mcd configuration entry contains argument values matching the default arguments given to swud-usb.so. Your system integrator may configure mcd differently; if so, you should ensure that the arguments passed to swud-usb.so match the mcd configuration.

You can load the module with the following optional arguments:

swud-usb.so [manifest_file_extension insertion_path ejection_path]

Note: Either all or none of these arguments must be present.

These arguments have the following meanings:

manifest_file_extension
The file extension that the module looks for to recognize manifest files. The default is .manifest.
insertion_path
The path for mcd to write notifications of inserted USB devices containing software update packages. The default is /dev/mcd/UPDATE.
ejection_path
The path for mcd to write notifications of ejected USB devices containing software update packages. The default is /dev/mcd/EJECTED.

swud-legacy-hmi.so

The swud-legacy-hmi.so module provides a PPS bridge between the swu-core library and the Settings app in the HMI. The Settings app has some functionality limits, one of which is its ability to display only the first update in the list to the user. The module publishes notifications to the HMI through the /pps/services/update/status object and subscribes to HMI-issued commands through the /pps/services/update/control object.

You can load the module with the following optional argument:

swud-legacy-hmi.so [pps_base_path]

where pps_base_path is the root path of the PPS subsystem. The default value is /pps. All PPS objects used by this module are located in pps_base_path/services/update/.

swud-client-config.so

The swud-client-config.so module allows the following parameters to be configured in the swu-core library using PPS:

This module both publishes and subscribes to these parameters in the /pps/services/update/settings PPS object.

You can load the module with the following optional argument:

swud-client-config.so [pps_base_path]

Here, pps_base_path is the root path of the PPS subsystem. The default value is /pps. All PPS objects used by this module are located in pps_base_path/services/update/.

swud-self-update-hmi.so

The swud-self-update-hmi.so module provides a basic HMI that's displayed when the QNX CAR platform updates itself. The HMI shows a simple progress bar while a software update is being applied.

To specify the target to update, provide the following arguments when the module is loaded:

swud-self-update-hmi.so vendor_id hardware_id

These mandatory arguments have the following meanings:

vendor_id
A vendor-defined string identifying the vendor of the self-update target.
hardware_id
A vendor-defined string identifying the hardware of the self-update target.

swud-simple-self-update.so

The swud-simple-self-update.so module reads a manifest file, loads it, and then installs the first update defined in the file. An example use case is when you want the system to resume applying an incomplete update after it gets interrupted, for example, by an unexpected power cycle. This resumed self-update is initiated by launching swud with the swud-simple-self-update.so module during system startup.

Load this module with the following argument:

swud-simple-self-update.so manifest_path

where manifest_path is the path where the manifest file to be processed is located.

rb-self-update.so

The rb-self-update.so module applies a software update. You must provide a delta file, which you can obtain from your system provider or generate using Red Bend tools. To update your system through the HMI, you must also provide a manifest file.

You can load this module with the following optional arguments:

rb-self-update.so [delta=delta_path] [temp=temp_path] [pps_target=ppstarget] [persist=persist_file_path]

These arguments have the following meanings:

delta_path
The path where the delta file will be copied to. The default path is /dos/mydelta.mld.
temp_path
The path used by Red Bend when working with the delta file. The default path is /dos/updAgentTmp.
ppstarget
The path for storing the target information, which consists of the hardware ID, vendor ID, and a serial number. The default path is /pps/services/update/target.
persist
The output path for a persistent manifest file to support resuming the update in case of an unexpected system restart. The default path is /dos/swu_persist.manifest.