bitspire/deploy/nixos/build-iso.sh
Padreug 46e52f6598 chore: scrub "Lamassu" from shipped labels
The kiosk's <title> still read "Lamassu ATM" — visible as the browser tab
on the public demo, and inherited by the Electron window. The product has
been bitSpire since the rename; Lamassu belongs in the provenance credits
(README, the c0b69d1 boundary note), not on the artifact.

Rename the user-facing labels that ship: the page title, the flake
description (surfaces in `nix flake metadata`), the ISO build banner, the
header comments on the live-USB config / udev rules / app derivation that
land on the machine image, and the workspace packages' descriptions.

Deliberately NOT touched, because they are identifiers rather than labels
and renaming them has deployed-machine consequences:
- VITE_LAMASSU_MACHINE_MODEL / VITE_LAMASSU_FIAT_CODE (provisioned .env)
- LamassuEventKind (exported enum)
- localStorage keys lamassu-theme / lamassu-color-mode (would reset
  every machine's stored theme)
- docker container names + devenv scripts (dev-only)
- the packages/hal Cargo crate name
Hardware names in HAL driver comments ("Lamassu Sintra", "Douro", "Tejo")
stay: those are the physical machines' real names — that IS the credit.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013A6683cCHnQxFUosx1krY4
2026-09-19 09:58:42 +02:00

68 lines
2.2 KiB
Bash
Executable file

#!/usr/bin/env bash
# Build a bootable NixOS Live USB ISO for testing the ATM Electron app
# on physical hardware.
#
# The build is fully pure — no local pnpm or .env manipulation needed.
# After booting, provision credentials with: bash provision-atm.sh <atm-ip>
#
# Usage: bash build-iso.sh <model>
# bash build-iso.sh douro # Bay Trail, kernel 5.15, GTQ
# bash build-iso.sh tejo # UP4000, kernel 6.6, GTQ
# bash build-iso.sh sintra # UPBoard, kernel 6.6, EUR
# bash build-iso.sh batm3 # General Bytes BATM3, EBDS validator, USD
set -euo pipefail
MODEL="${1:-}"
if [ -z "$MODEL" ]; then
echo "Usage: bash build-iso.sh <model>"
echo " douro - Bay Trail Atom, kernel 5.15, eDP panel, GTQ"
echo " tejo - UP4000/UPBoard, kernel 6.6, GTQ"
echo " sintra - UPBoard, kernel 6.6, EUR"
echo " batm3 - General Bytes BATM3, EBDS validator, USD"
exit 1
fi
case "$MODEL" in
douro|tejo|sintra|batm3) ;;
*)
echo "ERROR: Unknown model '$MODEL'. Use 'douro', 'tejo', 'sintra', or 'batm3'."
exit 1
;;
esac
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
REPO_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
echo "=== Building bitSpire ATM Live USB ISO (model: $MODEL) ==="
echo ""
echo "This is a pure Nix build — no local pnpm required."
echo ""
cd "$REPO_ROOT"
nix build ".#iso-${MODEL}" --show-trace
# Print results
ISO_PATH=$(ls result/iso/*.iso 2>/dev/null | head -1)
if [ -z "$ISO_PATH" ]; then
echo "ERROR: ISO not found in result/iso/"
exit 1
fi
ISO_SIZE=$(du -h "$ISO_PATH" | cut -f1)
echo ""
echo "=== ISO built successfully ($MODEL) ==="
echo "File: $ISO_PATH"
echo "Size: $ISO_SIZE"
echo ""
echo "--- Write to USB flash drive ---"
echo "sudo dd if=$ISO_PATH of=/dev/sdX bs=4M status=progress oflag=sync"
echo ""
echo "--- Test in QEMU ---"
echo "qemu-system-x86_64 -enable-kvm -m 2G \\"
echo " -drive if=pflash,format=raw,readonly=on,file=/usr/share/edk2/x64/OVMF_CODE.4m.fd \\"
echo " -cdrom $ISO_PATH -display gtk,zoom-to-fit=on -vga std \\"
echo " -device e1000,netdev=net0 -netdev user,id=net0,hostfwd=tcp::2222-:22"
echo ""
echo "--- After booting, provision credentials ---"
echo "bash provision-atm.sh # QEMU (localhost:2222)"
echo "bash provision-atm.sh <atm-ip> 22 # Real hardware on LAN"