Provisioning
Avocado Linux provisioning encompasses the processes and methodologies for preparing target hardware to run Avocado OS. This reference covers provisioning concepts, target hardware considerations, and programming environment requirements for reliable deployment.
Concepts
Provisioning transforms build artifacts into deployable images and handles the physical installation process onto target hardware. The provisioning pipeline includes image generation, bootloader configuration, partition layout, and hardware-specific optimizations.
Provisioning profiles
Provisioning profiles define deployment strategies for different hardware interfaces and deployment scenarios. Available profiles depend on the specific target hardware - some targets may support SD card provisioning for development workflows, while others require specialized interfaces for on-board storage like eMMC. Virtual targets using QEMU or similar environments typically don't require physical hardware interfaces. Additionally, custom profiles can be created for hardware-specific provisioning procedures or specialized deployment scenarios.
Pick the profile with avocado provision --profile <name>. avocado provision --list shows the profiles your target offers. It needs avocado install to have run first.
The profile is read when provisioning runs, not when the image is built. --profile reaches the target's provision script as the AVOCADO_PROVISION_PROFILE environment variable. avocado build does not record it, so give it on the avocado provision run itself. Without --profile, the target's default profile is used.
--env KEY=VALUE passes other variables to the same provision process. Repeat it for each variable. Since avocado-cli 1.2.0, the values also fill {{ env.KEY }} in avocado.yaml, ahead of your shell's environment, so a profile can template on them without you exporting them too.
What a provision script receives
Besides AVOCADO_PROVISION_PROFILE and your --env values, the CLI sets these for the provision script (avocado-cli 1.2.0 or later):
| Variable | Value |
|---|---|
AVOCADO_PROVISION_FORCE | 1 under --force, 0 without it. A script can ask for confirmation before an erasing flash unless the operator already confirmed. |
AVOCADO_PROVISION_DRY_RUN | 1 under --dry-run. |
AVOCADO_PROVISION_HOST_MOUNTS | The path of a read-only copy of the host's mount table, in /proc/self/mounts format, so a script can read it and refuse to write a disk that is mounted. Read the file; the variable itself holds only the path. Set only on a Linux host running Docker directly. It is unset on Docker Desktop, under the avocado VM and with --runs-on, so a script cannot rely on it. |
Check a profile without writing
avocado provision dev --profile sd --dry-run
--dry-run runs every check of the profile and writes nothing. The script gets AVOCADO_PROVISION_DRY_RUN=1, and the CLI skips its own SD card write. The CLI refuses --dry-run for a profile whose provisioning manifest does not declare config.dry_run: true, because such a script would not know to hold back. It runs only locally: a bundle replay or a hub job would write.
Container settings for a profile
A provision profile can set its container's access by name with a container: block, spelled as Docker Compose spells it. sdk takes the same block:
provision:
sd:
container:
privileged: true
volumes:
- /dev:/dev
environment:
DEBUG: '1'
The keys are privileged, network_mode, volumes, devices, extra_hosts, cap_add and environment. container_args still works, and remains the place for any flag without a key. Where both set the same thing, the block wins.
NVIDIA Jetson: the profile picks the boot media
On Jetson, the tegraflash profile decides which disk gets flashed:
| Profile | Flashes |
|---|---|
tegraflash (default), tegraflash-nvme | NVMe |
tegraflash-emmc, tegraflash-mmc | eMMC |
tegraflash-sd | microSD |
tegraflash-usb | USB drive (2024 release only) |
Not every board offers every profile. ICAM-540 offers only tegraflash and tegraflash-nvme. Run avocado provision --list to see yours.
--profile flashes NVMeWith no --profile, a Jetson gets the default tegraflash profile, which flashes NVMe. Provisioning still succeeds. If you meant to flash an SD card or eMMC, the board then fails to boot, or boots an older OS from another disk. Pass the profile on every avocado provision run:
avocado provision dev --profile tegraflash-sd
Reliable provisioning
Provisioning requirements
Hardware provisioning workflows have varying requirements depending on the target hardware and deployment scenario. Some provisioning processes require physical hardware interfaces like USB connections for programming devices or accessing removable storage like SD cards. Others may provision virtual targets that need no physical hardware interaction. Many provisioning workflows include containers as part of their processes, while some require specialized kernel drivers or manufacturer-specific programming tools to interface with hardware programming modes.
Platform constraints
These diverse provisioning requirements create challenges on macOS and Windows due to their virtualization architectures. Containerization platforms on these systems run inside lightweight hypervisors, creating VM-in-VM architectures that introduce additional abstraction layers between applications and physical hardware interfaces. Device enumeration becomes less reliable as hardware management is mediated through virtualization layers, requiring manual passthrough configuration that can fail or timeout during provisioning workflows. Manufacturer-specific programming interfaces that require kernel-level access or specialized driver stacks may not function consistently in virtualized environments.
Auto-mounting considerations
On a Linux host, some desktop environments auto-mount mass storage devices, which can interfere with provisioning. Disable auto-mounting first — see Linux Auto-Mounting.
Recommended approach
There are two reliable paths to provisioning hardware:
- macOS — Avocado Desktop. Avocado Desktop bundles a build VM with USB passthrough, so it provisions real hardware directly on macOS without a native Linux machine. This is the recommended path on macOS and avoids the VM-in-VM frictions described above.
- Linux — Avocado CLI. On a native Linux host, the Avocado CLI provisions hardware directly. Native Linux provides consistent device enumeration and reliable access for containers, kernel drivers, and manufacturer programming tools — running Linux directly on hardware rather than inside a VM on macOS or Windows.
Using the Avocado CLI with Docker Desktop on macOS or Windows is possible, but the virtualization layers make hardware enumeration and manufacturer programming interfaces less reliable for provisioning; prefer Avocado Desktop on macOS, or a native Linux host.