Skip to main content

Usage

stone reads a JSON manifest (conventionally manifest.json) and produces disk images, OS bundles, or a provisioned device. This page covers the manifest schema and overlays; for the commands that consume it, see Commands.

Manifest schema

A minimal manifest:

{
"runtime": {
"platform": "avocado-portable",
"architecture": "noarch"
},
"storage_devices": {
"rootdisk": {
"out": "rootdisk.img",
"build_args": { "type": "fwup", "template": "rootdisk.conf" },
"devpath": "/dev/mmcblk0",
"block_size": 512,
"images": {
"boot": {
"out": "boot.img",
"size": 128,
"size_unit": "mebibytes",
"build_args": {
"type": "fat",
"variant": "FAT32",
"files": ["bzImage", { "in": "cfg/grub.cfg", "out": "grub/grub.cfg" }]
}
},
"rootfs": "rootfs.img"
},
"partitions": [
{
"name": "boot",
"image": "boot",
"offset": 2048,
"offset_unit": "bytes",
"size": 128,
"size_unit": "mebibytes"
},
{
"name": "rootfs",
"image": "rootfs",
"size": 2,
"size_unit": "gibibytes",
"expand": "true"
}
]
}
}
}

runtime

FieldRequiredDescription
platformyesPlatform identifier (e.g. jetson-orin-nano), surfaced to fwup and written into bundle.json.
architectureyesTarget architecture (e.g. aarch64).
provisionnoLegacy single provision script path (use provision.profiles instead for new manifests).
provision_defaultnoName of the default profile in provision.profiles.
update_strategynoSlot strategy for bundles: uboot-ab (default) or tegra-ab. Selects slot ids (a/b vs 0/1).

storage_devices

A map of device name → device. Each device:

FieldRequiredDescription
outyesOutput filename for the built device image.
devpathyesDevice node the image targets (e.g. /dev/mmcblk0), written to bundle layout.
build_argsnoHow to build the whole-device image. Only fwup is valid at the device level.
block_sizenoBlock size in bytes (default 512); drives partition-offset math.
uuidnoDisk UUID passed to fwup as AVOCADO_DISK_UUID.
imagesyesMap of image name → image (see below).
partitionsyesOrdered partition list (see below).

Images

An image is either a string (a direct file reference copied as-is) or an object that is built:

FieldRequiredDescription
outyesOutput filename.
sizeyes*Numeric size (* required for object images).
size_unityes*bytes, kibibytes, mebibytes, gibibytes, kilobytes, megabytes, gigabytes.
build_argsnofat (build a FAT image from files) or fwup (build from a template). See note.
block_sizenoPassed to fwup as AVOCADO_DISK_BLOCK_SIZE.
uuidnoPassed to fwup as AVOCADO_DISK_UUID.
An object image should declare build_args

An object image without build_args is treated as a pre-generated output: create does not stage it and later steps expect the file to already exist, so a missing one is not caught until provision. Use a string image for a file that already exists, and an object with build_args for one stone builds.

A FAT build_args block takes:

  • variantFAT12, FAT16, or FAT32.
  • files — each entry either a filename string (placed at the same path in the image) or { "in": <source>, "out": <path-in-image> }.
  • files_append (optional) — extra entries merged onto files at bundle time, deduplicated by output path. An appended entry that reuses an output path with a different input is a hard error.
  • label (optional) — the FAT volume label.

Unknown keys inside build_args are rejected, not ignored.

Partitions

Ordered list; offsets default to sequential when omitted.

FieldRequiredDescription
namesee notePartition name. Uppercased, with - and spaces replaced by _, to form AVOCADO_PARTITION_<NAME>_* env vars for fwup (e.g. rootfs-aAVOCADO_PARTITION_ROOTFS_A_*).
imagenoImage key that fills this partition.
partition_typenoGPT/MBR partition type.
partition_uuidnoPartition UUID.
offset / offset_unitnoStart offset (bytes or blocks); sequential if omitted.
offset_redundant / offset_redundant_unitnoRedundant copy offset (e.g. for a U-Boot env).
size / size_unitsee notePartition size. Both must be present or both absent.
expandno"true" marks the partition as expandable to fill remaining space.
size_alignment / size_alignment_unitnoAlignment applied to an externally-supplied size. Default 4 mebibytes.
Omitting size

size/size_unit may be omitted only on the last partition of a device when it has expand: "true" and a name. The concrete size must then be supplied via --partition-size <name>=<bytes> (rounded up to size_alignment) — on both stone bundle and stone provision, which each abort if the override is missing.

provision

FieldRequiredDescription
profilesyesMap of profile name → { script, envs?, requires? }.
envsnoNamed environment blocks (name → { VAR: value }) that profiles reference by name.
filesnoExtra files staged alongside profile scripts (shared helper libraries, etc.).

A profile's envs is a list mixing named-block references (strings) and inline { VAR: value } maps; inline entries override named blocks. Values support ${VAR} expansion from the caller's environment (missing vars expand to empty and warn). requires declares host capabilities — currently only usb.

See the Provisioning Map for provision.fields, the optional UI-hint metadata consumed by external tooling.

update

Declares how OS artifacts map to A/B slots for OTA. stone copies this into the generated bundle.json.

FieldRequiredDescription
slot_detectionyesHow to detect the active slot: uboot-env, command, or sdboot-efi.
os_artifactsyesMap of artifact name → { image_key, slot_partitions }.
activateyesAction(s) to switch slots: uboot-env, command, mbr-switch, or efibootmgr.
rollbacknoAction(s) to revert a slot switch.

Manifest overlays

--overlay deep-merges JSON files onto the base manifest, applied left-to-right (last wins). Objects merge recursively; arrays of named objects (elements with a name field, such as partitions) merge by name and append new entries; files_append arrays concatenate; all other arrays and scalars replace. This lets one base manifest be specialized per target or environment without duplication.

stone bundle -m base.json --overlay target-jetson.json --overlay prod.json --os-release ./os-release