|
Veethree D7 SDK
|
This page provides an overview of the software update process and adjacent topics, such as the A/B update scheme the D7 Platform uses and the validation that takes place after a software update.
For a short guide on creating a software update file, please see Creating software updates. Detailed information about the swugen utilities can be found at swugen.
For applying software updates, please see Applying a software update on a device.
The D7 Platform uses an A/B update scheme, so that if a software update fails, the device automatically reverts to the previous image.
When applying a software update, the rootfs is written to one of the two partitions, for instance to partition A. A subsequent software update will write the rootfs to partition B, and then the next update will write to parition A again.
When booting up after a software update, if the validation fails, the device will revert to the previous partition. More information on that in the Software update validation section below.
For more information on the partitioning scheme of the D7, please see Partitions on the D7 Platform.
After a software update is applied, the system will attempt to validate the stability of the update.
The logs for software updates are stored in /appdata/sys/swupdate/swupdate.log.
This partition is persistent across software updates, so the logs for a failed update can be inspected.
Reflashing the board, however, does overwrite the /appdata partition.
The swugen tool creates software updates that can be used on the device. It can produce images based on either the development or the release base image. See Differences between release and development images for a detailed description of the differences between the two.
swugen can accept two types of input:
Arguments:
Modes:
Image types:
Recovery images generated by swugen can be used to create a recovery USB stick using the procedure described here.
An example folder structure to be used as input for swugen is as follows:
For special files, ufw rules and systemd service unit files, they must be placed in the top-level directory. All other files may be structured as you wish.
Note: Unit files and ufw rules files will be moved according to the Standardized Update Package Structure. To be safe, all paths should be absolute paths that relate to the project install location which is /app.
Running swugen -i target-install -k keys/default-key -o my-app.swu will automatically generate the standardized package structure and create the .swu file.
When using directory input, swugen generates a standardized update package structure:
Directory processing (replaces the old appgen workflow):
Archive processing:
Recovery image:
When applied, the update will extract the contents of the update layout into the /app partition, recreating the folder structure exactly.
Note that the /app partition is formatted when applying a software update, along with the other partitions in the current step of the A/B scheme. As such, it should not be used to store persistent data.
Applications must write persistent data to the /appdata partition. See Partitions on the D7 Platform.