Skip to main content
Version: 029-rc4

Pantavisor State Format (state.json)

A Pantavisor revision is defined by a single JSON object called state.json. It acts as a virtual filesystem manifest where every key represents a relative file path within the revision, and every value is either a nested configuration object or a SHA256 identifier for a binary artifact.

1. Root Level (state.json)

These keys represent the files at the root of a revision.

KeyValue TypeMandatoryDescription
#specstringYesParser version. Must be "pantavisor-service-system@1".
README.mdstringNoDocumentation for the revision in Markdown format.
bsp/run.jsonBSP ManifestYesBoard Support Package configuration.
bsp/drivers.jsonDrivers ManifestNoAbstract driver mapping for the kernel.
device.jsonInfrastructure ManifestNoUnified physical storage and logical group definition.
groups.jsonGroups ManifestNo(Legacy) Logical container orchestration groups.
disks.jsonDisks ManifestNo(Legacy) Physical storage medium definitions.
<container>/run.jsonContainer ManifestYesIndividual container configuration.
<container>/services.jsonService ExportsNoServices exported to the xconnect mesh.
_sigs/<container>.jsonSignature ManifestNoSecurity signature for container artifacts.
_config/<container>/<path>stringNoInjects data into <path> inside the container's rootfs.
<any/other/path>stringNoSHA256 identifier for a binary artifact at that path.

2. BSP (bsp/run.json)

Defines the core system boot assets.

KeyValue TypeDescription
linuxpath stringPath to the Linux kernel image.
initrdpath stringPath to the Pantavisor initrd binary.
modulespath stringPath to the modules squashfs image.
firmwarepath stringPath to the firmware squashfs image.
fdtpath stringPath to the Flattened Device Tree binary.
fitpath stringPath to a FIT image (replaces linux/initrd/fdt).
rpiabpath stringPath to a Raspberry Pi boot image.
addonsarray of pathsList of CPIO addons to merge into the initrd rootfs.
initrd_configpath stringCustom configuration for the initrd process.

3. Drivers (bsp/drivers.json)

Maps abstract driver names to kernel modules based on hardware.

KeyValue TypeDescription
#specstringMust be "driver-aliases@1".
allobjectDefault module mappings for all hardware.
dtb:<name>objectModule mappings specific to a Device Tree model.
ovl:<name>objectModule mappings specific to a DT Overlay.

Example module list:

"wifi": [ "cfg80211", "brcmfmac ${user-meta:wifi.opts}" ]

4. Infrastructure (device.json)

The unified hardware and orchestration manifest.

KeyValue TypeDescription
disksarrayList of Disk Definitions. Strict parsing — unknown types are fatal.
disks_v2arraySame schema as disks, additive. Parsed independently.
disks_v3arraySame schema as disks with lenient parsing (unknown types are warned and skipped). Required for the dual type — old firmware safely ignores this key.
groupsarrayList of Orchestration Groups.
volumesobjectList of Persistent Volumes for Pantavisor itself.

5. Orchestration (groups.json)

Defines how containers are grouped and started.

KeyValue TypeDefaultDescription
namestringMandatoryUnique logical name for the group.
descriptionstringemptyHuman-readable description.
status_goalenumSTARTEDGoal for all members: MOUNTED, STARTED, READY.
restart_policyenumcontainerPolicy on failure: system, container.
timeoutinteger30Seconds to wait for members to reach status_goal.
auto_recoveryobjectnoneDefault auto-recovery for containers in this group. Inherited all-or-nothing by containers without their own auto_recovery.

6. Storage (disks.json)

Defines physical storage mediums. Each entry in the disks, disks_v2, or disks_v3 array uses this schema. See the Disks overview for type-specific details and examples.

KeyValue TypeDefaultDescription
namestringMandatoryUnique name used in run.json storage keys and mount paths.
aliasesstring arrayemptyAdditional names this disk answers to. Volumes referring to any alias resolve to this disk. Aliases must not shadow another disk's name or be claimed by more than one disk; conflicts make the state refuse to boot. See Aliases in the overview.
typeenumMandatorydm-crypt-caam, dm-crypt-dcp, dm-crypt-versatile, swap-disk, volume-disk, dual.
pathstringMandatory (crypt, swap, vol with provision)Device/image path. CAAM v2: -v2 <img>,<size>,<key>. DCP/versatile: <img>,<size>,<key>. Not required for volume-disk without provision.
modeenumMandatory (crypt)mainline or nxp. Selects key subsystem.
formatenumext4Filesystem format: ext4, ext3, or swap.
provisionstringemptyBackend provisioning: zram, file, or a custom value. Required for swap; optional for volume-disk (absent → bind-mount backend).
provision_opsstringemptyBackend-specific options (e.g. disksize=128M comp_algorithm=lz4).
mount_targetpathemptyWhere to mount the disk on the host. Required for volume-disk.
mount_optionsstringemptyComma-separated mount flags (e.g. MS_NOATIME,MS_NOSUID).
format_optionsstringemptyArguments for the mkfs or mkswap command.
defaultstring"no"If "yes", this disk is used for all volumes without a disk key.
uuidstringemptyDisk UUID.
disksarrayMandatory (dual)Sub-disk names: ["primary-name", "secondary-name"].
init_orderarrayMandatory (dual)Actions tried in sequence: primary, secondary, create-primary, create-secondary, copy-once-to-primary.

7. Container (<container>/run.json)

Configures an individual container runtime.

KeyValue TypeMandatoryDescription
#specstringYesMust be "service-manifest-run@1".
namestringYesLogical name of the container.
typeenumYesRuntime type (currently only lxc).
configpath stringYesPath to the LXC configuration file.
root-volumepath stringYesPath to the rootfs squashfs artifact.
volumesarrayNoAdditional artifacts to mount as volumes.
groupstringNoOrchestration group name (from device.json).
status_goalenumNoTarget state: MOUNTED, STARTED, READY.
restart_policyenumNosystem (reboot on crash) or container (restart LXC).
rolesarrayNoCapability roles: mgmt (control API access) or nobody.
storageobjectYesPersistence settings for rootfs paths.
driversobjectNoRequirements: required, optional, or manual.
servicesobjectNoService mesh requirements.
logsarrayNoLogger configurations.
dev-logbooleanNoWhether to bind-mount /dev/log into this container. Overrides the global PV_LOG_AUTO_DEVLOG setting for this container.
exportsarrayNo(Boolean flag in code) Marks container as an exporter.
auto_recoveryobjectNoAuto-recovery configuration. If absent, inherited from group.

Auto-Recovery Object

Configures automatic restart behavior when a container crashes. See Auto-Recovery overview for the broader context.

KeyValue TypeDefaultDescription
policyenumnoRecovery policy: no, always, on-failure, unless-stopped. Note: the current implementation does not distinguish exit codes — on-failure behaves the same as always.
max_retriesinteger0Maximum restart attempts. 0 = unlimited.
retry_delayinteger0Initial delay in seconds before first restart.
backoff_factornumber1.0Multiplier applied to retry_delay on each subsequent retry.
reset_windowinteger0Seconds of continuous uptime after which the retry counter resets to 0.
stable_timeoutinteger0Seconds the container must survive after reaching its status goal to be considered stable. Used to gate TESTING commit.
backoff_policystringrebootAction after max_retries exhausted in steady state: reboot, never, or a duration string (10min, 1h, 30s).

Storage Object

Defines persistence for specific directories. Keys are paths relative to container root.

  • persistence: permanent (survives updates), revision (survives reboots), boot (volatile).
  • disk: Logical disk name from device.json.

Service Requirements

Under the services key in run.json.

  • required / optional: Arrays of service requirement objects.
    • name: Logical name of the service to find.
    • type: Protocol (rest, dbus, unix, drm, wayland).
    • target: Path where Pantavisor should inject the socket/resource.
    • role: Masquerade as this role when connecting.
    • interface: Protocol-specific identifier.

8. Service mesh (<container>/services.json)

Declares services this container provides to others.

KeyValue TypeDescription
#specstringMust be "service-manifest-xconnect@1".
servicesarrayList of service objects (name, type, socket).

9. Security (_sigs/<container>.json)

JWS-based artifact verification.

KeyValueDescription
#spec"pvs@2"Parser version.
protectedbase64 stringEncoded headers including alg, typ, and pvs path filters.
signaturebase64 stringThe cryptographic signature of the protected header and payload.
x5carray(In protected) Certificate chain for verification.
jwkobject(In protected) JSON Web Key for verification.