What avocado deploy does
avocado deploy --device root@192.168.55.1 devThe mechanics
Section titled “The mechanics”- The CLI builds a signed TUF repository for the runtime inside the SDK container.
- It serves that repository over plain HTTP from the container, on all interfaces, using a small Python server. The port comes from
AVOCADO_DEPLOY_REPO_PORT, or a default. - It works out an IP address the device can use to reach your machine.
AVOCADO_DEPLOY_REPO_HOSToverrides this. When the device address is loopback (a QEMU VM with a forwarded SSH port), it picks the machine’s first global IPv4 address instead. - It connects over SSH (
StrictHostKeyChecking=no) and runsavocadoctl runtime add --url http://<host-ip>:<port>on the device. - The device downloads what it’s missing, checks the hashes, stages the runtime and activates it.
Extension images are stored on the device by a content-derived image ID, not by name and version. Rebuilding an extension without bumping version: is still deployed correctly; you just can’t tell builds apart by version. Bump it anyway.
Reboot or not
Section titled “Reboot or not”| What changed | What the device does |
|---|---|
| Only extensions | Activates the runtime and refreshes extensions live, with no reboot |
| The OS: kernel, initramfs or rootfs | Applies the OS update and reboots |
| Nothing | Nothing; extensions aren’t refreshed either |
A live refresh doesn’t restart services that are already running. After the merge, systemd reloads its config, but an active service keeps running the old version until something restarts it or you reboot. So:
- A oneshot with
RemainAfterExit=yes(like a USB gadget setup) keeps its old configuration until you reboot. - The first reboot after deploying is when the new setup actually runs for the first time. Test that reboot deliberately.
Deploying over the link you’re changing
Section titled “Deploying over the link you’re changing”If you deploy over a link that one of your extensions provides (a USB gadget, a Wi-Fi config), the refresh generally keeps it up, because a live refresh doesn’t restart multi-user.target or anything else the way boot does (see Boot and extension merge). The one thing that can restart it anyway is the extension’s own on_merge, if it names that service or reloads something the link depends on (for example systemctl --no-block try-reload-or-restart systemd-networkd.service). Check your on_merge list before relying on this. The next reboot applies the change either way. If the new version doesn’t work, you’ve lost the link. Before that reboot, make sure you have another way in: a serial console, a working network path that doesn’t depend on the change, or be ready to reflash.
Other things to know
Section titled “Other things to know”- The device has to reach your machine. The device connects back to download the repo, so a firewall on your machine, or a route the device doesn’t have, makes the deploy fail after SSH has already succeeded. Set
AVOCADO_DEPLOY_REPO_HOSTwhen auto-detection picks the wrong address. It’s also needed for QEMU user-mode networking, where the host is10.0.2.2. - A dev runtime needs SSH.
avocado deployneeds root SSH on the device. That’s usuallyavocado-ext-sshd-dev, which allows root with an empty password. If the extension merge failed, sshd isn’t running, and you can’t deploy a fix: you have to reflash. See When the merge fails. --connect-signis for a device that has already accepted a Connect OTA. It needs a local signing key for the runtime.