Skip to main content

Module aboot

Module aboot 

Source
Expand description

Persistent Aboot state relative to the physical root:

state/boot/aboot/
  slots/a                 observed deployment ID for slot A
  slots/b                 observed deployment ID for slot B
  pending                 staged deployment, payload hashes, and finalization lock
  attempted               deployment attempt and the boot ID which initiated it
  rollback                queued rollback deployment and originating boot ID

state/deploy/<deployment ID>/aboot/
  aboot.img               staged boot partition payload
  vbmeta.img              optional staged vbmeta payload

A missing slot file means that slot has no known valid mapping. Pending and attempted state retain an update until a later boot observes its result. /run/composefs/staged-deployment is a transient version of pending state used by the common status and finalization code.

Update staging first creates the deployment state, then writes and hashes the boot (and optional vbmeta payloads) below that deployment. Only after those writes are durable does it publish pending and the transient staged view. No boot partitions are written during staging.

At shutdown the finalizer verifies the staged payload hashes, writes attempted, invalidates the non-booted slot mapping, and invokes aboot-deploy. On the next boot, observing the candidate consumes pending, its staged payload directory, and attempted. Observing another deployment retains them without automatically retrying the write; an explicit update or switch can discard them after that reboot. An unattempted pending update is projected back into /run and rearmed unless it was staged download-only.

StructsΒ§

AbootState πŸ”’
An open fd to the persistent Aboot state
ArtifactPaths πŸ”’
Absolute paths to staged payloads after their hashes have been verified.
AttemptedDeployment πŸ”’
Records an attempted deployment and the system boot id which initiated it.
PendingDeployment πŸ”’
Durable staged-deployment state and hashes of the payloads to flash to the boot partitions.
QueuedRollback πŸ”’

EnumsΒ§

ReconcileAction πŸ”’
Slot πŸ”’
Logical A/B slot observed from the running kernel command line.

ConstantsΒ§

ABOOT_CONFIG πŸ”’
SLOT_SUFFIX πŸ”’

FunctionsΒ§

boot_id πŸ”’
bootloader_from_config πŸ”’
get_bootloader πŸ”’
Determine the host bootloader from the running system’s aboot configuration.
require_aboot_deploy_in_image πŸ”’
Require update and rollback tooling in every installed or staged aboot image.