A panel runs one mosquitto on /run/warden/bus/bus.sock (flare-edge S10bus) and every daemon and the UI talk over it; the rig had no broker, so the Rust warden-modbus and the UI's bus client could not run there (flare-edge #1754, the #1050 QEMU half). Stage-2 init now starts the broker before the payload daemons when the payload carries a static mosquitto, with the panel's paths: the socket under sock/ with the bus.sock link, and a fresh 0400 credential file per bus user under cred/. The rig broker takes any user and loads no plugin (the rig is a test instrument; a static broker loads none). A payload without a broker boots as before. qemu/tests/init-rig-bus-test.sh covers no broker, a listening broker (layout, modes, config), a broker that exits or never listens, bad user names and the init order, under sh and busybox sh; with WARDEN_TEST_MOSQUITTO_DIR a real mosquitto carries a message between two users logged in by credential file. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KerYPVh72hhNgKi3wS5ijG
Guest Payloads
Drop static musl armv7 binaries in this directory (contents are
gitignored; binaries are never committed); qemu/mkimage.sh copies everything
in this directory (except this README) into /usr/bin/ of both rootfs slots.
Static musl is the same target the device uses for its Rust daemons, so the
exact production binaries run unmodified in the VM.
Typical payload, built in a flare-edge checkout:
# flared (static musl armv7)
tools/build-flared.sh --local
# warden-modbus and friends: see tools/build-firmware.sh for the recipes
Then:
cp <flare-edge>/target/armv7-unknown-linux-musleabihf/release/warden-flared qemu/payload/
Or take them from a panel that already runs them: every daemon is a static
musl binary, so flare-edge tools/rig-pull-daemons.sh --host <panel> copies
/usr/bin/warden-* straight into this directory (recording the panel's
release and each md5 in PULLED.txt), minus warden-ui, which the rig
needs as the fbdev+evdev build.
A mosquitto here (the static armhf broker of flare-edge
tools/mosquitto-build.sh armhf) gives the guest the panel's device bus:
stage-2 init starts it on /run/warden/bus/bus.sock before any daemon and
writes a credential file per bus user to /run/warden/bus/cred/<user>
(warden_rig_bus in qemu/rootfs/etc/warden-lib.sh; the broker log is
/tmp/mosquitto.log). Without it the guest has no bus, as before.
Stage-2 init starts every warden-* daemon it finds here, in the panel's
own S-number order (ai, automation, modbus, mikrotik, asic, starlink,
stratum, flared), then warden-ui (the UI also needs --display on|headless + the virt.fragment kernel for /dev/fb0). Logs land in
/tmp/<name>.log inside the guest, readable over the control bridge with
ctl @cat /tmp/<name>.log. An empty payload is valid: the image boots
busybox-only.