Files
os-build/scripts/validate.sh
Blake Ridgway 0ea8b713dd feat: graphical installer in the live ISO
The ISO now boots straight into a GTK installer instead of dropping to a
tty. Structure:

- installer/arcline-installer: small GTK3 (Python) frontend that drives
  scripts/deploy-disk.sh — pick a disk, choose boot mode, type the device
  path to confirm, watch the deploy log, reboot. Pure helper logic is
  tested against lsblk (lowercase keys, pseudo-devices filtered).
- scripts/build-live.sh: builds build/rootfs/<edition>-live by cloning the
  CLEAN rootfs and layering on live-boot, a minimal X session (Xorg +
  openbox), the installer, and the deploy tooling under /usr/lib/arcline
  (deploy-disk.sh + btrfs/init.sh + edition fstabs, laid out so the
  scripts' own path resolution works unchanged).
- overlays/live/: arcline-installer.service + session script that start
  Xorg on vt1 (with -allow-root) and run the installer as the X client.
- build-iso.sh: builds the live rootfs for the squashfs AND stages the
  clean rootfs archive into isofiles/install/ — the installer deploys the
  clean archive, so what's installed is the hardened system, never the
  live session with the installer in it.
- Refactor: ARCLINE_LIVE handling removed from build-rootfs.sh and
  configure-system.sh (now lives entirely in build-live.sh).
- validate.sh now checks overlays shell scripts + installer python.
- docs updated (building.md, architecture.md, installer/README.md).
2026-08-21 20:24:09 -05:00

72 lines
3.0 KiB
Bash
Executable File

#!/usr/bin/env bash
# ─────────────────────────────────────────────────────────────────────────────
# Arcline OS — fast, offline validation of the build tree.
#
# scripts/validate.sh
#
# Runs on any machine (no root, no network). Checks:
# * every shell script parses (bash -n)
# * every edition has a complete manifest (metadata, packages, cmdline, fstab)
# * package lists reference no obvious duplicate lines
# * the Makefile + versions.mk parse
# ─────────────────────────────────────────────────────────────────────────────
set -euo pipefail
source "$(dirname "${BASH_SOURCE[0]}")/common.sh"
fail=0
note_fail() { warn "$1"; fail=1; }
log "validating shell scripts…"
while IFS= read -r -d '' s; do
if ! bash -n "$s"; then
note_fail "syntax error in $s"
fi
done < <(find "$ROOT/scripts" "$ROOT/btrfs" "$ROOT/toolchain" "$ROOT/tests" "$ROOT/overlays" \
-type f \( -name '*.sh' -o -name 'arcline-installer-session' \) -print0 2>/dev/null)
log "validating installer (python syntax)…"
if command -v python3 >/dev/null 2>&1; then
python3 -m py_compile "$ROOT/installer/arcline-installer" 2>/dev/null \
|| note_fail "python syntax error in installer/arcline-installer"
rm -rf "$ROOT/installer/__pycache__"
fi
log "validating editions…"
for e in "${EDITIONS[@]}"; do
ed="$(edition_dir "$e")"
for f in metadata.yaml packages.list kernel.cmdline fstab; do
[[ -f "$ed/$f" ]] || note_fail "edition '$e' missing $f"
done
# package list sanity: no blank-or-comment duplicates
if [[ -f "$ed/packages.list" ]]; then
dup="$(grep -vE '^\s*(#|$)' "$ed/packages.list" | sort | uniq -d)"
[[ -z "$dup" ]] || note_fail "edition '$e' has duplicate package entries: $(echo "$dup" | tr '\n' ' ')"
fi
done
log "validating top-level Makefile / versions.mk…"
make -C "$ROOT" -n check >/dev/null 2>&1 || note_fail "Makefile dry-run failed (make -n check)"
log "validating YAML manifests (if python3 + pyyaml available)…"
if python3 -c 'import yaml' 2>/dev/null; then
python3 - "$ROOT" <<'PYEOF' || note_fail "YAML manifest parse failed"
import sys, glob, yaml
root = sys.argv[1]
for f in sorted(glob.glob(root + "/editions/*/metadata.yaml")):
d = yaml.safe_load(open(f))
assert d.get("edition") and d.get("codename"), f"{f}: missing edition/codename"
assert d.get("image", {}).get("type"), f"{f}: missing image.type"
assert "services" in d, f"{f}: missing services"
assert isinstance(d["services"].get("enabled", []), list)
PYEOF
else
warn "python3/pyyaml not available — skipping YAML parse (structural checks above still apply)"
fi
if [[ $fail -eq 0 ]]; then
log "validation passed ✓"
else
die "validation found problems"
fi