A fresh clone can now bootstrap a complete armv7 rootfs, apply the Bananarchy overlay, regenerate boot artifacts, and produce a flashable image without local build artifacts. - Add a shared package list and Docker-based rootfs bootstrap, wired into rebuild-image.sh and chroot-shell.sh. - Add offline rebuild preflight checks and prebuilt-to-overlay artifact synchronization. - Vendor the patched EDL client and provision host flashing dependencies. - Remove the hardcoded credential from the power menu helper. - Refresh documentation and changelog for the autonomous workflow.
77 lines
2.1 KiB
Bash
Executable File
77 lines
2.1 KiB
Bash
Executable File
#!/bin/sh
|
|
# Autonomously create a complete armv7 Bananarchy rootfs from the repository.
|
|
# Safe to run repeatedly: an up-to-date rootfs is left untouched.
|
|
set -eu
|
|
|
|
BASE_DIR="$(cd "$(dirname "$0")/.." && pwd)"
|
|
PKGS_FILE="$BASE_DIR/scripts/rootfs-packages.txt"
|
|
CONTAINER_SCRIPT="$BASE_DIR/scripts/bootstrap-rootfs-container.sh"
|
|
BOOTSTRAP_VERSION="1"
|
|
MARKER_REL="etc/bananarchy/rootfs-bootstrap.done"
|
|
|
|
ROOTFS_DIR="${ROOTFS_DIR:-$BASE_DIR/rootfs}"
|
|
TARGET_DEVICE="nokia-argon"
|
|
FORCE=0
|
|
CHECK_ONLY=0
|
|
|
|
for arg in "$@"; do
|
|
case "$arg" in
|
|
--force|-f)
|
|
FORCE=1
|
|
;;
|
|
--check|-c)
|
|
CHECK_ONLY=1
|
|
;;
|
|
nokia-argon|nokia-beatles|nokia-tough|nokia-sparkler|nokia-leo)
|
|
TARGET_DEVICE="$arg"
|
|
;;
|
|
*)
|
|
if [ -z "${ROOTFS_DIR_SET:-}" ]; then
|
|
ROOTFS_DIR="$arg"
|
|
ROOTFS_DIR_SET=1
|
|
else
|
|
echo "Usage: $0 [rootfs-dir] [device] [--force|--check]" >&2
|
|
exit 1
|
|
fi
|
|
;;
|
|
esac
|
|
done
|
|
|
|
if [ ! -f "$PKGS_FILE" ] || [ ! -f "$CONTAINER_SCRIPT" ]; then
|
|
echo "Error: bootstrap inputs are missing from $BASE_DIR/scripts." >&2
|
|
exit 1
|
|
fi
|
|
|
|
mkdir -p "$ROOTFS_DIR"
|
|
ROOTFS_HOST="$(realpath "$ROOTFS_DIR")"
|
|
PKG_HASH="$(sha256sum "$PKGS_FILE" | awk '{print $1}')"
|
|
EXPECTED="$BOOTSTRAP_VERSION:$PKG_HASH"
|
|
MARKER="$ROOTFS_HOST/$MARKER_REL"
|
|
|
|
if [ "$FORCE" -eq 0 ] && [ -f "$MARKER" ] && [ "$(cat "$MARKER")" = "$EXPECTED" ]; then
|
|
echo "[bootstrap] Rootfs is already complete: $ROOTFS_HOST"
|
|
exit 0
|
|
fi
|
|
|
|
if [ "$CHECK_ONLY" -eq 1 ]; then
|
|
echo "[bootstrap] Rootfs needs bootstrapping: $ROOTFS_HOST"
|
|
exit 1
|
|
fi
|
|
|
|
if ! command -v docker >/dev/null 2>&1; then
|
|
echo "Error: Docker is required to bootstrap the armv7 rootfs." >&2
|
|
exit 1
|
|
fi
|
|
|
|
echo "[bootstrap] Building a complete rootfs at $ROOTFS_HOST for $TARGET_DEVICE..."
|
|
exec docker run --rm --network=host \
|
|
-e HOST_UID="$(id -u)" \
|
|
-e HOST_GID="$(id -g)" \
|
|
-e TARGET_DEVICE="$TARGET_DEVICE" \
|
|
-e BANANARCHY_USER_PASSWORD="${BANANARCHY_USER_PASSWORD:-147147}" \
|
|
-e BOOTSTRAP_VERSION="$BOOTSTRAP_VERSION" \
|
|
-e PKG_HASH="$PKG_HASH" \
|
|
-v "$ROOTFS_HOST:/rootfs" \
|
|
-v "$BASE_DIR:/bananarchy:ro" \
|
|
alpine:3.24 sh -eu /bananarchy/scripts/bootstrap-rootfs-container.sh
|