Runtime Lifecycle
A runtime progresses through several states during its lifecycle on a device. This page describes each state and the operations that transition between them.
Runtime States
- Staged -- A runtime manifest exists under
/var/lib/avocado/runtimes/{id}/but is not the active runtime. All referenced extension images (and optional OS bundle image) are present in the shared image pool. - Active -- The
/var/lib/avocado/activesymlink points to this runtime. Its extensions are merged into the running system. - Pending reboot -- An OS update has been written to the inactive partition slot and a reboot is required to complete activation. A
pending-update.jsonmarker file is present.
Adding a Runtime
Runtimes can be added to the device through two methods.
From a TUF Repository
Using runtime add --url:
- Load the local TUF trust anchor (
metadata/root.json). - Download and verify the TUF metadata chain:
timestamp.json->snapshot.json->targets.json. - Walk TUF delegations for extension targets.
- Download the manifest and all referenced
.rawextension images to a staging area (.update-staging/). - Verify SHA-256 hashes of all downloaded files.
- Install images from staging to the shared image pool (
/var/lib/avocado/images/), skipping any that already exist (content-addressable deduplication). - Create the runtime directory and write
manifest.json.
From a Local Manifest
Using runtime add --manifest:
- Read the manifest JSON file from the provided path.
- Validate that all referenced extension images and optional OS bundle image already exist on disk.
- Create the runtime directory and copy
manifest.json.
Listing Runtimes
Runtimes are listed with the active runtime first, then remaining runtimes sorted by build time (newest first). Each entry shows:
- Runtime name
- Version
- Short ID (first 8 characters)
- Whether it is active
Inspecting a Runtime
Inspect shows full details for a specific runtime or the active runtime (when ID is omitted). Details include:
- Manifest version
- Full ID
- Build timestamp
- Runtime name and version
- All extensions with their image IDs
- OS bundle information if present
Removing a Runtime
- The active runtime cannot be removed. Activate a different runtime first.
- Removing a runtime deletes the runtime directory (
/var/lib/avocado/runtimes/{id}/). - Shared images in
/var/lib/avocado/images/are not removed, as they may be referenced by other runtimes.
The Active Symlink
The active runtime is tracked by a symlink at /var/lib/avocado/active pointing to runtimes/{active_runtime_id}. This symlink is switched atomically during activation. Because it uses a single rename system call, there is no window where the symlink is missing or points to an invalid target.