2026-06-14 23:14:32 +02:00
|
|
|
# Live USB Colibri rebuild lane
|
|
|
|
|
|
|
|
|
|
This runbook documents how a running Clawdie live USB can rebuild and redeploy
|
|
|
|
|
Colibri without waiting for a full ISO rebuild.
|
|
|
|
|
|
|
|
|
|
Use this for **field repair and validation** when the USB boots but a Colibri
|
|
|
|
|
binary, rc.d script, or small runtime behavior needs testing. A successful live
|
|
|
|
|
rebuild does **not** replace the release ISO process; it proves the fix before
|
|
|
|
|
the next image is rebuilt.
|
|
|
|
|
|
|
|
|
|
## Why this exists
|
|
|
|
|
|
2026-06-15 09:10:52 +02:00
|
|
|
New live USB builds stage `/home/clawdie/ai/colibri` as a shallow git checkout
|
|
|
|
|
with a `.git` directory and a `.clawdie-source.json` provenance file. You can
|
|
|
|
|
rebuild directly from that checkout, or clone a separate working checkout such
|
|
|
|
|
as `/home/clawdie/ai/colibri-build` if you want to keep the shipped source
|
|
|
|
|
untouched while testing a branch.
|
2026-06-14 23:14:32 +02:00
|
|
|
|
|
|
|
|
## Required live packages
|
|
|
|
|
|
2026-06-15 07:37:16 +02:00
|
|
|
Live operator ISOs include these packages to make this path available out of the
|
2026-06-14 23:14:32 +02:00
|
|
|
box:
|
|
|
|
|
|
|
|
|
|
```text
|
|
|
|
|
rust
|
|
|
|
|
pkgconf
|
|
|
|
|
git
|
2026-06-15 09:03:22 +02:00
|
|
|
go
|
2026-06-14 23:14:32 +02:00
|
|
|
```
|
|
|
|
|
|
|
|
|
|
`git` is already in the live operator package list. `rust` provides `cargo` on
|
|
|
|
|
FreeBSD. `pkgconf` is needed by common Rust native dependency build scripts.
|
2026-06-15 09:03:22 +02:00
|
|
|
`go` builds the zot agent (see "Rebuild zot" below).
|
2026-06-14 23:14:32 +02:00
|
|
|
|
|
|
|
|
Optional if future dependencies need them:
|
|
|
|
|
|
|
|
|
|
```text
|
|
|
|
|
gmake
|
|
|
|
|
cmake
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
## One-time readiness check
|
|
|
|
|
|
|
|
|
|
Run on the live USB:
|
|
|
|
|
|
|
|
|
|
```sh
|
|
|
|
|
rustc --version
|
|
|
|
|
cargo --version
|
|
|
|
|
git --version
|
|
|
|
|
pkgconf --version
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
If `rustc` or `cargo` is missing, the current USB cannot rebuild Colibri from
|
2026-06-15 09:03:22 +02:00
|
|
|
source without installing packages first or using a newer ISO. Likewise check
|
|
|
|
|
`go version` before attempting a zot rebuild.
|
2026-06-14 23:14:32 +02:00
|
|
|
|
|
|
|
|
## Clone or update Colibri
|
|
|
|
|
|
|
|
|
|
Use HTTPS unless the live USB has an SSH key configured for Forgejo.
|
|
|
|
|
|
|
|
|
|
```sh
|
|
|
|
|
mkdir -p /home/clawdie/ai
|
|
|
|
|
cd /home/clawdie/ai
|
|
|
|
|
|
|
|
|
|
if [ ! -d colibri-build/.git ]; then
|
|
|
|
|
git clone https://code.smilepowered.org/clawdie/colibri.git colibri-build
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
cd /home/clawdie/ai/colibri-build
|
|
|
|
|
git fetch --prune origin
|
|
|
|
|
git switch main
|
|
|
|
|
git pull --ff-only
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
To test a specific commit or branch:
|
|
|
|
|
|
|
|
|
|
```sh
|
|
|
|
|
git checkout c967698
|
|
|
|
|
# or:
|
|
|
|
|
# git switch fix/some-branch
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
## Build Colibri release binaries
|
|
|
|
|
|
|
|
|
|
Minimal live USB build set:
|
|
|
|
|
|
|
|
|
|
```sh
|
|
|
|
|
cd /home/clawdie/ai/colibri-build
|
|
|
|
|
cargo build --release \
|
|
|
|
|
-p colibri-daemon \
|
|
|
|
|
-p colibri-client \
|
|
|
|
|
-p colibri-mcp \
|
|
|
|
|
-p colibri-glasspane-tui
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
Expected outputs:
|
|
|
|
|
|
|
|
|
|
```text
|
|
|
|
|
target/release/colibri-daemon
|
|
|
|
|
target/release/colibri
|
|
|
|
|
target/release/colibri-mcp
|
|
|
|
|
target/release/colibri-tui
|
2026-06-21 07:55:24 +02:00
|
|
|
# target/release/colibri-test-agent is installed only for explicit
|
|
|
|
|
# COLIBRI_STAGE_TEST_AGENT=YES validation builds.
|
2026-06-14 23:14:32 +02:00
|
|
|
```
|
|
|
|
|
|
|
|
|
|
## Install rebuilt Colibri into the running USB
|
|
|
|
|
|
|
|
|
|
The live USB does not use `sudo`. Privileged actions use `mdo`.
|
|
|
|
|
|
|
|
|
|
```sh
|
|
|
|
|
cd /home/clawdie/ai/colibri-build
|
|
|
|
|
|
|
|
|
|
mdo -u root service colibri_daemon stop || true
|
|
|
|
|
mdo -u root pkill -f colibri-daemon || true
|
|
|
|
|
mdo -u root rm -f /var/run/colibri/colibri.sock
|
|
|
|
|
mdo -u root rm -f /var/run/colibri/colibri-daemon.pid
|
|
|
|
|
mdo -u root rm -f /var/run/colibri/colibri-daemon-supervisor.pid
|
|
|
|
|
|
|
|
|
|
mdo -u root install -m 0555 target/release/colibri-daemon /usr/local/bin/colibri-daemon
|
|
|
|
|
mdo -u root install -m 0555 target/release/colibri /usr/local/bin/colibri
|
|
|
|
|
mdo -u root install -m 0555 target/release/colibri-mcp /usr/local/bin/colibri-mcp
|
2026-06-21 07:55:24 +02:00
|
|
|
if [ "${COLIBRI_STAGE_TEST_AGENT:-NO}" = "YES" ]; then
|
|
|
|
|
mdo -u root install -m 0555 target/release/colibri-test-agent /usr/local/bin/colibri-test-agent
|
|
|
|
|
fi
|
2026-06-14 23:14:32 +02:00
|
|
|
mdo -u root install -m 0555 target/release/colibri-tui /usr/local/bin/colibri-tui
|
|
|
|
|
mdo -u root install -m 0555 packaging/freebsd/colibri_daemon.in /usr/local/etc/rc.d/colibri_daemon
|
|
|
|
|
|
|
|
|
|
mdo -u root chown -R colibri:colibri /var/run/colibri /var/db/colibri /var/log/colibri
|
|
|
|
|
mdo -u root service colibri_daemon start
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
`service colibri_daemon start` should return to the shell after a few seconds. If
|
2026-06-14 23:24:41 +02:00
|
|
|
it does not, stop the command, collect the service file and daemon log, and hand
|
|
|
|
|
those back through git before continuing.
|
2026-06-14 23:14:32 +02:00
|
|
|
|
|
|
|
|
## Validate runtime
|
|
|
|
|
|
|
|
|
|
```sh
|
|
|
|
|
service colibri_daemon status
|
|
|
|
|
colibri status
|
|
|
|
|
colibri list-skills | head
|
|
|
|
|
colibri-mcp tools
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
Useful deeper checks:
|
|
|
|
|
|
|
|
|
|
```sh
|
|
|
|
|
service colibri_daemon health
|
|
|
|
|
tail -80 /var/log/colibri/daemon.log
|
|
|
|
|
ls -l /var/run/colibri
|
|
|
|
|
sockstat -u | grep colibri || true
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
## Record what was installed
|
|
|
|
|
|
|
|
|
|
After a successful live rebuild, write a small local manifest:
|
|
|
|
|
|
|
|
|
|
```sh
|
|
|
|
|
cd /home/clawdie/ai/colibri-build
|
|
|
|
|
commit=$(git rev-parse HEAD)
|
|
|
|
|
branch=$(git symbolic-ref --short -q HEAD || echo detached)
|
|
|
|
|
now=$(date -u +%Y-%m-%dT%H:%M:%SZ)
|
|
|
|
|
|
|
|
|
|
cat > /tmp/colibri-live-rebuild.json <<EOF
|
|
|
|
|
{
|
|
|
|
|
"repo": "https://code.smilepowered.org/clawdie/colibri.git",
|
|
|
|
|
"branch": "${branch}",
|
|
|
|
|
"commit": "${commit}",
|
|
|
|
|
"installed_at": "${now}",
|
|
|
|
|
"note": "Built and installed on running live USB"
|
|
|
|
|
}
|
|
|
|
|
EOF
|
|
|
|
|
|
|
|
|
|
mdo -u root install -m 0644 /tmp/colibri-live-rebuild.json /var/db/colibri/live-rebuild.json
|
|
|
|
|
mdo -u root sha256 /usr/local/bin/colibri-daemon /usr/local/bin/colibri /usr/local/bin/colibri-mcp /usr/local/bin/colibri-tui \
|
|
|
|
|
> /tmp/colibri-live-rebuild.sha256
|
|
|
|
|
mdo -u root install -m 0644 /tmp/colibri-live-rebuild.sha256 /var/db/colibri/live-rebuild.sha256
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
Report both files with validation notes when handing findings back through git.
|
|
|
|
|
|
2026-06-15 09:03:22 +02:00
|
|
|
## Rebuild zot (agent)
|
|
|
|
|
|
2026-06-15 09:10:52 +02:00
|
|
|
zot is the Go agent staged as a prebuilt binary at `/usr/local/bin/zot`. New
|
|
|
|
|
live USB builds seed `/home/clawdie/ai/zot` as a shallow git checkout with
|
|
|
|
|
`.clawdie-source.json` provenance, so you can rebuild there or clone a separate
|
|
|
|
|
`zot-build` checkout for branch testing.
|
2026-06-15 09:03:22 +02:00
|
|
|
|
|
|
|
|
```sh
|
|
|
|
|
mkdir -p /home/clawdie/ai
|
|
|
|
|
cd /home/clawdie/ai
|
|
|
|
|
if [ ! -d zot-build/.git ]; then
|
|
|
|
|
git clone https://code.smilepowered.org/clawdie/zot.git zot-build
|
|
|
|
|
fi
|
|
|
|
|
cd zot-build
|
|
|
|
|
git fetch --prune origin
|
2026-06-15 10:08:30 +02:00
|
|
|
git checkout v0.2.29 # the zot tag this image ships (see build-manifest.json)
|
2026-06-15 18:31:10 +02:00
|
|
|
ZOT_BUILD_VERSION="${ZOT_VERSION:-v0.2.29}"
|
|
|
|
|
VERSION="${ZOT_BUILD_VERSION#v}" make build
|
|
|
|
|
./bin/zot --version
|
2026-06-15 09:03:22 +02:00
|
|
|
```
|
|
|
|
|
|
|
|
|
|
Install into the running USB (privileged steps via `mdo`):
|
|
|
|
|
|
|
|
|
|
```sh
|
|
|
|
|
mdo -u root install -m 0555 bin/zot /usr/local/bin/zot
|
|
|
|
|
zot --version
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
zot has no rc.d service of its own — Colibri spawns it — so no service restart
|
|
|
|
|
is needed. Validate with `zot --version` and a Colibri spawn check.
|
|
|
|
|
|
2026-06-14 23:14:32 +02:00
|
|
|
## Fast rc.d-only repair
|
|
|
|
|
|
|
|
|
|
If only the service script is broken and no binary rebuild is needed, fetch the
|
|
|
|
|
current Colibri rc.d source directly:
|
|
|
|
|
|
|
|
|
|
```sh
|
|
|
|
|
mdo -u root fetch -o /usr/local/etc/rc.d/colibri_daemon \
|
|
|
|
|
https://code.smilepowered.org/clawdie/colibri/raw/branch/main/packaging/freebsd/colibri_daemon.in
|
|
|
|
|
mdo -u root chmod 555 /usr/local/etc/rc.d/colibri_daemon
|
|
|
|
|
mdo -u root service colibri_daemon restart
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
Sanity checks:
|
|
|
|
|
|
|
|
|
|
```sh
|
2026-06-14 23:24:41 +02:00
|
|
|
sh -n /usr/local/etc/rc.d/colibri_daemon
|
|
|
|
|
service colibri_daemon status
|
|
|
|
|
colibri status
|
2026-06-14 23:14:32 +02:00
|
|
|
```
|
|
|
|
|
|
|
|
|
|
Expected:
|
|
|
|
|
|
2026-06-14 23:24:41 +02:00
|
|
|
- the rc.d script has valid shell syntax.
|
|
|
|
|
- `service colibri_daemon start` returns to the shell.
|
|
|
|
|
- `colibri status` can connect to `/var/run/colibri/colibri.sock`.
|
2026-06-14 23:14:32 +02:00
|
|
|
|
2026-06-15 18:04:32 +02:00
|
|
|
## One-command helper
|
|
|
|
|
|
|
|
|
|
The whole Colibri runbook above is wrapped in `colibri-live-rebuild`, staged at
|
|
|
|
|
`/usr/local/bin/colibri-live-rebuild` whenever the image carries the Colibri
|
|
|
|
|
service. It clones/updates a build checkout, optionally checks out a ref, builds
|
|
|
|
|
the release binaries, stops the daemon, installs binaries + rc.d, clears stale
|
|
|
|
|
socket/pid files, restarts, validates `colibri status`, and writes
|
|
|
|
|
`/var/db/colibri/live-rebuild.json`.
|
|
|
|
|
|
|
|
|
|
```sh
|
|
|
|
|
colibri-live-rebuild # rebuild from the build checkout's HEAD
|
|
|
|
|
colibri-live-rebuild --ref main # check out a branch/tag/commit first
|
|
|
|
|
colibri-live-rebuild --build-dir DIR # use an alternate build checkout
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
The manual steps above remain the reference for partial repairs (e.g. the zot
|
|
|
|
|
rebuild or the rc.d-only fix). This keeps the live USB usable as a self-hosted
|
|
|
|
|
Colibri validation target while preserving ISO rebuilds for release artifacts.
|