Skip to main content

Configuration

The Avocado config defines your project from board support to provisioning, and everything in between.

Precedence of supplied values

The Avocado CLI can be configured three ways, from highest to lowest precedence:

  1. CLI arguments
  2. Environment variables
  3. Configuration files

Configuration files

The Avocado CLI uses a single configuration file to define your project settings, build configurations, dependencies, and provisioning profiles.

By default, the CLI looks for a configuration file named avocado.yaml in the current working directory. This can be configured to use a different file name or location.

For detailed information about all available configuration options, see the config schema.

Environment variables

Environment variables take precedence over configuration file values. When set, they override the corresponding config field.

Environment variableConfig equivalentDescription
AVOCADO_TARGETdefault_targetTarget architecture for builds and deployments.
AVOCADO_RUNTIMEdefault_runtimeDefault runtime for commands that scope by runtime. Overrides default_runtime from config.
AVOCADO_REPO_URLdistro.repo.urlPackage repository URL.
AVOCADO_RELEASEVERdistro.repo.releaseverDNF releasever override (e.g., 2024/edge).
AVOCADO_DISTRO_RELEASEdistro.releaseDistribution feed year (e.g., 2024).
AVOCADO_DISTRO_CHANNELdistro.channelDistribution stability channel (e.g., edge, stable).

Legacy environment variables

The following environment variables are deprecated but still supported as fallbacks:

Legacy variableReplacement
AVOCADO_SDK_REPO_URLAVOCADO_REPO_URL
AVOCADO_SDK_REPO_RELEASEAVOCADO_RELEASEVER

Default runtime

Set default_runtime to avoid passing --runtime on every invocation. Resolution order from highest to lowest precedence:

  1. CLI -r/--runtime argument
  2. AVOCADO_RUNTIME environment variable
  3. default_runtime config value
  4. Auto-resolved sole runtime (when exactly one runtime is defined)
default_runtime: dev

runtimes:
dev:
# ...
prod:
# ...

When default_runtime is set, the CLI validates at startup that it references a runtime defined in runtimes:.

Connect configuration

The connect section stores defaults for Avocado Connect platform commands, so you don't need to pass --org and --project on every invocation. This section is typically populated by running avocado connect init.

connect:
org: my-org-id
project: my-project-id
server_key: <hex-encoded TUF public key>
FieldDescription
orgDefault organization ID for avocado connect commands
projectDefault project ID for avocado connect commands
server_keyConnect server's TUF signing public key (hex). Per-runtime signing.server_key overrides this

Rootfs configuration

The rootfs section configures the shared rootfs sysroot used by runtime builds.

rootfs:
filesystem: erofs-lz4 # default
overlay: overlays/rootfs # optional: merged into sysroot after package install
packages:
avocado-pkg-rootfs: '*'
FieldDefaultDescription
filesystemerofs-lz4Image format: erofs-lz4 or erofs-zst
overlayPath or object — see Overlay below
packagesMap of package names to version constraints

Initramfs configuration

The initramfs section configures the initramfs sysroot used for the early boot environment.

initramfs:
filesystem: cpio.zst # default
overlay: overlays/initramfs # optional: merged into sysroot after package install
packages:
avocado-pkg-initramfs: '*'
FieldDefaultDescription
filesystemcpio.zstImage format: cpio, cpio.zst, cpio.lz4, or cpio.gz
overlayPath or object — see Overlay below
packagesMap of package names to version constraints

Overlay

The overlay field on rootfs and initramfs merges a source directory from your project into the sysroot after package installation. Two forms are supported:

# Short form — merge mode (rsync -a: adds/replaces files, leaves unrelated files alone)
rootfs:
overlay: overlays/rootfs

# Long form — explicit mode
initramfs:
overlay:
dir: overlays/initramfs
mode: opaque # cp -r: fully replaces directory contents
FieldDefaultDescription
dir(required)Path relative to project root (src_dir)
modemergemerge (rsync -a) or opaque (cp -r, replaces contents)

The string short form is equivalent to { dir: "...", mode: "merge" }. The overlay path is resolved as /opt/src/<path> inside the SDK container. Overlay config participates in the sysroot stamp, so changes trigger a reinstall.

Kernel configuration

The top-level kernel: block defines one or more kernel configurations that runtimes can reference. Two forms are accepted:

# Singleton form — synthesized as the implicit "default" kernel
kernel:
package: kernel-image
version: '*'

# Named map form — multiple kernels for different runtimes
kernel:
yocto-6-6:
package: kernel-image-6.6
version: '*'
yocto-5-15:
package: kernel-image-5.15
version: '*'

Kernel config fields

Two mutually exclusive modes:

Package mode — kernel installed from an RPM during runtime install:

FieldDescription
packagePackage name (e.g. kernel-image). Mutually exclusive with compile
versionVersion constraint (e.g. *, 6.6.*). Used with package

Compile mode — kernel cross-compiled via sdk.compile.<section> during runtime build:

FieldDescription
compileSDK compile section name (references sdk.compile.<section>). Mutually exclusive with package
installInstall script path — copies kernel artifacts to runtime build dir. Required when compile is set

Runtime kernel references

A runtime can reference a named top-level kernel entry or provide an inline override:

runtimes:
dev:
kernel: yocto-6-6 # named reference (string)

prod:
kernel: # inline override (object)
package: kernel-image
version: '6.6.*'

When kernel: is omitted on a runtime, the CLI falls back to the top-level default kernel entry, or — when no top-level kernel is configured — to the avocado-runtime meta-package's legacy bootfiles behavior.

Var partition configuration

The runtime var section configures the btrfs-formatted /var partition: a default compression algorithm and a map of subvolumes keyed by path (relative to the var root). Subvolumes can also be declared at the extension level, in which case they travel with the extension; runtime-level entries deep-merge on top and win on conflict.

extensions:
my-ext:
subvolumes:
lib/docker:
nodatacow: true
quota: '10G'
lib/myapp/cache: true # shorthand: writable with defaults

runtimes:
dev:
extensions: [my-ext]
var:
compression: 'zstd:3'
subvolumes:
lib/logs:
writable: true
compression: 'zstd:9' # per-subvolume override
lib/docker:
writable: false # override extension: make read-only

A built-in lib/avocado subvolume is always present (writable). Declaring it explicitly in runtime var.subvolumes suppresses the nested-path warning for extensions that live under it.

var fields

FieldDefaultDescription
compressionnonePartition-wide default compression (e.g. zstd, zstd:3, lzo, zlib:6, no). Overridden by per-subvolume set
subvolumesMap of path → subvolume entry. Paths are relative to the var root

Subvolume entry forms

Each map value can be a shorthand or a full object:

FormMeaning
trueEnabled, writable, inherits partition defaults
falseDisabled — suppresses an extension-declared subvolume from a runtime
"ro"Enabled, read-only, inherits partition defaults
object (see below)Full configuration

Subvolume object fields

FieldDefaultDescription
writabletruefalse makes the subvolume read-only (applied post-mkfs via btrfs property set ro true)
compressioninheritedPer-subvolume compression. Ignored (and skipped) when nodatacow: true — NOCOW disables COW
nodatacowfalseSet the NOCOW inode flag via chattr +C. Useful for databases, VM images, and other random-write workloads
quotanoneQgroup size limit (e.g. 500M, 5G, none). Enables btrfs quotas on the partition when any subvolume sets one
enabledtrueSet to false to suppress an extension-declared subvolume from a runtime

Resolution order

  1. Built-in lib/avocado (writable).
  2. Extensions from the runtime's extension list, in order — first-listed wins on path conflicts (a warning is emitted for collisions).
  3. Runtime var.subvolumes deep-merges on top, always winning.
  4. Partition-level var.compression applied as the default for subvolumes that don't set their own.
  5. Entries with enabled: false are filtered out.

Subvolume config is included in the runtime input hash, so changes trigger a proper var-image rebuild.

Examples

Example configuration files are available in the Avocado OS repository. These examples demonstrate common configuration patterns for different use cases and target platforms.