- Cross-compile bantam-cpp master (0cd1a67, "Send stable x-opencode-session header based on project_id") for armv7 and refresh prebuilt/, overlay/rootfs/, and the target rootfs; the new binary carries the x-opencode-session header. - Rebuild images/bananarchy-nokia-argon.img with the updated agent (1.84 GiB, down from 2.01 GiB) and verify the binary inside the ext4 image by hash. - Fix a prune regression seen in the rebuild log: apk install_if re-adds imv-wayland, gstreamer-ptp-helper and libheif-rav1e, so apk del alone leaves the Wayland viewer and two Rust helpers installed. Pin them with negative !pkg world constraints and run apk fix after each purge. - Verify the constraints in check-rebuild.sh and document the fix.
143 lines
4.4 KiB
Bash
Executable File
143 lines
4.4 KiB
Bash
Executable File
#!/bin/sh
|
|
# Fast offline preflight: verify that a clean clone can rebuild Bananarchy.
|
|
set -eu
|
|
|
|
BASE_DIR="$(cd "$(dirname "$0")/.." && pwd)"
|
|
FAILURES=0
|
|
|
|
fail() {
|
|
echo "FAIL: $1"
|
|
FAILURES=$((FAILURES + 1))
|
|
}
|
|
|
|
echo "[check] Shell syntax..."
|
|
for script in "$BASE_DIR"/*.sh "$BASE_DIR"/scripts/*.sh; do
|
|
if ! sh -n "$script" 2>/dev/null; then
|
|
fail "shell syntax: $script"
|
|
fi
|
|
done
|
|
|
|
echo "[check] Python syntax..."
|
|
python3 - "$BASE_DIR" <<'PYEOF' || exit 1
|
|
import ast
|
|
import glob
|
|
import os
|
|
import sys
|
|
|
|
base = sys.argv[1]
|
|
paths = sorted(glob.glob(os.path.join(base, "scripts", "*.py")) +
|
|
glob.glob(os.path.join(base, "*.py")) +
|
|
glob.glob(os.path.join(base, "vendor", "edl", "*.py")) +
|
|
glob.glob(os.path.join(base, "vendor", "edl", "Library", "*.py")))
|
|
for path in paths:
|
|
with open(path, "r", encoding="utf-8", errors="replace") as handle:
|
|
try:
|
|
ast.parse(handle.read(), filename=path)
|
|
except SyntaxError as exc:
|
|
print("FAIL: python syntax: %s: %s" % (path, exc))
|
|
sys.exit(1)
|
|
print(" %d Python file(s) parsed" % len(paths))
|
|
PYEOF
|
|
|
|
echo "[check] Rootfs package list..."
|
|
PKGS_FILE="$BASE_DIR/scripts/rootfs-packages.txt"
|
|
PRUNE_FILE="$BASE_DIR/scripts/rootfs-prune-packages.txt"
|
|
if [ ! -f "$PKGS_FILE" ]; then
|
|
fail "missing $PKGS_FILE"
|
|
else
|
|
PKG_COUNT="$(grep -v '^[[:space:]]*#' "$PKGS_FILE" | grep -cv '^[[:space:]]*$' || true)"
|
|
if [ "$PKG_COUNT" -lt 80 ]; then
|
|
fail "package list has only $PKG_COUNT entries"
|
|
else
|
|
echo " $PKG_COUNT packages"
|
|
fi
|
|
for pkg in alpine-base postmarketos-ui-sxmo-de-dwm webkit2gtk-4.1 libwpe \
|
|
sudo imv-x11 fcitx5-gtk3 mesa-utils sfeed; do
|
|
if ! grep -Fxq "$pkg" "$PKGS_FILE"; then
|
|
fail "missing critical package: $pkg"
|
|
fi
|
|
done
|
|
# Pure X11 and Rust-free top-level package set.
|
|
for pkg in sudo-rs postmarketos-base-sudo-rs libwpebackend-fdo imv-wayland \
|
|
xwayland sxmo-utils-wayland wofi grim slurp; do
|
|
if grep -Fxq "$pkg" "$PKGS_FILE"; then
|
|
fail "forbidden Rust/Wayland package in package list: $pkg"
|
|
fi
|
|
done
|
|
fi
|
|
|
|
echo "[check] Rootfs prune list..."
|
|
if [ ! -f "$PRUNE_FILE" ]; then
|
|
fail "missing $PRUNE_FILE"
|
|
else
|
|
PRUNE_COUNT="$(grep -v '^[[:space:]]*#' "$PRUNE_FILE" | grep -cv '^[[:space:]]*$' || true)"
|
|
echo " $PRUNE_COUNT prune entries"
|
|
for pkg in sudo-rs libwpebackend-fdo imv-wayland; do
|
|
if ! grep -Fxq "$pkg" "$PRUNE_FILE"; then
|
|
fail "missing prune entry: $pkg"
|
|
fi
|
|
done
|
|
for deny in '!imv-wayland' '!gstreamer-ptp-helper' '!libheif-rav1e'; do
|
|
if ! grep -Fxq "$deny" "$PRUNE_FILE"; then
|
|
fail "missing negative world constraint: $deny"
|
|
fi
|
|
done
|
|
fi
|
|
if [ ! -x "$BASE_DIR/scripts/prune-rootfs-packages.sh" ]; then
|
|
fail "missing or non-executable scripts/prune-rootfs-packages.sh"
|
|
fi
|
|
|
|
echo "[check] Image residue guard..."
|
|
if ! grep -q 'strip_build_residue' "$BASE_DIR/rebuild-image.sh" || \
|
|
! grep -q 'apk cache/log still present' "$BASE_DIR/rebuild-image.sh"; then
|
|
fail "rebuild-image.sh is missing the apk cache/log guard"
|
|
fi
|
|
|
|
echo "[check] Vendored EDL client library..."
|
|
for module in usb gpt sahara firehose utils; do
|
|
if [ ! -f "$BASE_DIR/vendor/edl/Library/$module.py" ]; then
|
|
fail "missing vendor/edl/Library/$module.py"
|
|
fi
|
|
done
|
|
if [ ! -f "$BASE_DIR/vendor/edl/LICENSE" ]; then
|
|
fail "missing vendor/edl/LICENSE"
|
|
fi
|
|
|
|
echo "[check] Plugin artifacts..."
|
|
for source in "$BASE_DIR"/src/dwm-plugins/*_plugin.cpp; do
|
|
name="$(basename "$source" _plugin.cpp)"
|
|
if [ ! -f "$BASE_DIR/prebuilt/sxmo-x11/usr/lib/dwm/plugins/$name.so" ]; then
|
|
fail "missing prebuilt plugin: $name.so"
|
|
fi
|
|
done
|
|
|
|
echo "[check] Overlay artifact sync..."
|
|
if ! "$BASE_DIR/scripts/sync-prebuilt-overlay.sh" --check; then
|
|
fail "overlay/rootfs artifacts differ from prebuilt/"
|
|
fi
|
|
|
|
echo "[check] Local agent config stays ignored..."
|
|
if [ -d "$BASE_DIR/.git" ]; then
|
|
if ! git -C "$BASE_DIR" check-ignore -q .bantam.cfg; then
|
|
fail ".bantam.cfg is no longer gitignored"
|
|
fi
|
|
elif ! grep -qxF '.bantam.cfg' "$BASE_DIR/.gitignore"; then
|
|
fail ".bantam.cfg ignore rule is missing"
|
|
fi
|
|
|
|
echo "[check] Docker availability..."
|
|
if ! command -v docker >/dev/null 2>&1; then
|
|
fail "docker is not installed"
|
|
fi
|
|
|
|
echo "[check] Version helper..."
|
|
if ! "$BASE_DIR/scripts/version.sh" --print >/dev/null 2>&1; then
|
|
fail "scripts/version.sh --print failed"
|
|
fi
|
|
|
|
if [ "$FAILURES" -ne 0 ]; then
|
|
echo "[check] $FAILURES check(s) failed."
|
|
exit 1
|
|
fi
|
|
echo "[check] All rebuild preflight checks passed."
|