# Shared helper: run a command inside the roro9stack build container. IMAGE=roro9stack-build ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" docker build -q -t "$IMAGE" "$ROOT/docker" >/dev/null # The Debug Console token (ADR 0004): made once, kept with the OTA key, never committed. DEBUG_TOKEN_FILE="$HOME/.config/roro9stack/debug-token" if [ ! -s "$DEBUG_TOKEN_FILE" ]; then mkdir -p "$(dirname "$DEBUG_TOKEN_FILE")" (umask 077 && od -An -tx1 -N16 /dev/urandom | tr -d ' \n' > "$DEBUG_TOKEN_FILE") fi run_in_container() { docker run --rm \ -u "$(id -u):$(id -g)" -e HOME=/tmp \ -e RORO_DEBUG_TOKEN="$(cat "$DEBUG_TOKEN_FILE")" \ -v "$ROOT:/work" \ -v roro9stack-pio:/pio \ "${DOCKER_EXTRA[@]}" \ "$IMAGE" "$@" }