Skip to main content

Bundle Format

The bundle.json file inside an .aos archive describes how to apply the OS update. It is parsed by avocadoctl during the update process.

Full Example

{
"format_version": 1,
"platform": "jetson-orin-nano",
"architecture": "aarch64",
"os_build_id": "avocado-os-20260312",
"initramfs_build_id": "initramfs-20260312",
"update": {
"strategy": "a-b",
"slot_detection": {
"type": "uboot-env",
"var": "boot_slot"
},
"artifacts": [
{
"name": "rootfs",
"file": "rootfs.img",
"sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"size": 1073741824,
"slot_targets": {
"a": { "partition": "APP" },
"b": { "partition": "APP_b" }
}
}
],
"activate": [
{
"type": "uboot-env",
"set": { "boot_slot": "b" }
}
],
"rollback": [
{
"type": "uboot-env",
"set": { "boot_slot": "a" }
}
]
},
"verify": {
"type": "os-release",
"field": "AVOCADO_OS_BUILD_ID",
"expected": "avocado-os-20260312"
},
"verify_initramfs": {
"type": "os-release",
"field": "AVOCADO_INITRAMFS_BUILD_ID",
"expected": "initramfs-20260312"
}
}

Top-Level Fields

FieldTypeRequiredDescription
format_versionintegerYesBundle format version.
platformstringYesTarget hardware platform identifier.
architecturestringYesTarget CPU architecture (e.g., aarch64, x86-64).
os_build_idstringYesIdentifier for this rootfs build version.
initramfs_build_idstringNoIdentifier for this initramfs build version.
updateobjectNoUpdate configuration. Omit if the bundle is metadata-only.
verifyobjectNoPost-update verification for the rootfs.
verify_initramfsobjectNoPost-update verification for the initramfs.
layoutobjectNoPartition layout for MBR-based targets.

Slot Detection Strategies

The update.slot_detection object determines how avocadoctl identifies the currently active boot slot.

uboot-env

Reads a U-Boot environment variable to determine the active slot.

{
"type": "uboot-env",
"var": "boot_slot"
}
FieldDescription
varU-Boot environment variable name containing the active slot identifier (e.g., "a" or "b").

command

Runs a shell command whose stdout output is the active slot identifier.

{
"type": "command",
"command": ["/usr/bin/detect-slot"]
}
FieldDescription
commandArray of command and arguments to execute. The command's stdout is trimmed and used as the slot name.

sdboot-efi

Uses systemd-boot EFI partition mappings. Maps slot names to EFI partition device paths.

{
"type": "sdboot-efi",
"partitions": {
"a": "/dev/disk/by-partlabel/esp-a",
"b": "/dev/disk/by-partlabel/esp-b"
}
}
FieldDescription
partitionsMap of slot names to EFI partition device paths.

Artifacts

Each entry in update.artifacts describes a file to write to a partition.

FieldTypeRequiredDescription
namestringYesArtifact name (e.g., "rootfs", "initramfs").
filestringYesFilename within the .aos archive.
sha256stringYesExpected SHA-256 hash of the artifact file.
sizeintegerNoFile size in bytes.
slot_targetsobjectYesMap of slot names to target partitions.
slot_targets.{slot}.partitionstringYesPartition identifier (PARTLABEL for GPT, name for MBR layout).

Activation Actions

The update.activate array defines actions executed after artifacts are written to switch the boot target to the new slot. Actions are executed in order.

uboot-env

Set U-Boot environment variables.

{ "type": "uboot-env", "set": { "boot_slot": "b" } }

command

Run a shell command.

{ "type": "command", "command": ["/usr/bin/set-boot-slot", "b"] }

mbr-switch

Switch MBR partition layout by rewriting the partition table.

{
"type": "mbr-switch",
"devpath": "/dev/mmcblk0",
"slot_layouts": {
"a": ["layout-a.json"],
"b": ["layout-b.json"]
}
}

efibootmgr

Set the EFI boot entry for the target slot.

{
"type": "efibootmgr",
"slot_entries": {
"a": "0001",
"b": "0002"
}
}

Rollback Actions

The optional update.rollback array has the same format as activate. These actions are executed if verification fails after reboot to restore the previous boot slot.

Verification

The verify and verify_initramfs objects define how to confirm the OS update was successful after reboot.

FieldTypeDescription
typestringVerification type (e.g., os-release).
fieldstringField name to check in /etc/os-release.
expectedstringExpected value. Update is considered successful when the field matches.

Partition Layout (MBR)

The optional layout object is used on MBR-based systems where partitions are identified by offset rather than label.

FieldTypeDescription
devicestringBlock device path (e.g., /dev/mmcblk0).
block_sizeintegerOptional block size in bytes.
partitionsarrayList of partition definitions.
partitions[].namestringPartition name for referencing in slot_targets.
partitions[].offsetnumberPartition start offset.
partitions[].offset_unitstringUnit for offset (e.g., MiB, sectors).
partitions[].sizenumberPartition size.
partitions[].size_unitstringUnit for size (e.g., MiB, GiB).
partitions[].expandstringOptional expand strategy.