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.
76 lines
2.3 KiB
Bash
Executable File
76 lines
2.3 KiB
Bash
Executable File
#!/bin/sh
|
|
# Bananarchy Linux Interactive Rootfs Customization Shell
|
|
set -eu
|
|
|
|
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
if [ -n "${ROOTFS_DIR:-}" ]; then
|
|
ROOTFS_PATH="$ROOTFS_DIR"
|
|
elif [ -d "$SCRIPT_DIR/rootfs-sxmo" ]; then
|
|
ROOTFS_PATH="$SCRIPT_DIR/rootfs-sxmo"
|
|
else
|
|
ROOTFS_PATH="$SCRIPT_DIR/rootfs"
|
|
fi
|
|
mkdir -p "$ROOTFS_PATH"
|
|
ROOTFS_HOST="$(realpath "$ROOTFS_PATH")"
|
|
BANANARCHY_DIR="$SCRIPT_DIR"
|
|
|
|
if [ "${1:-}" = "sxmo" ]; then
|
|
shift
|
|
fi
|
|
|
|
if [ "$#" -eq 0 ]; then
|
|
set -- /bin/sh
|
|
fi
|
|
|
|
# Ensure the armv7 rootfs exists and is complete before opening a shell.
|
|
"$BANANARCHY_DIR/scripts/bootstrap-rootfs.sh" "$ROOTFS_HOST"
|
|
|
|
exec docker run --rm -it --network=host \
|
|
-e HOST_UID="$(id -u)" \
|
|
-e HOST_GID="$(id -g)" \
|
|
-v "$ROOTFS_HOST:/rootfs" \
|
|
-v "$BANANARCHY_DIR:/bananarchy:ro" \
|
|
alpine:3.24 sh -eu -c '
|
|
ROOTFS="/rootfs"
|
|
cat > /etc/apk/repositories <<EOF
|
|
https://mirror.nura.eco/postmarketos/v26.06
|
|
https://dl-cdn.alpinelinux.org/alpine/edge/main
|
|
https://dl-cdn.alpinelinux.org/alpine/edge/community
|
|
https://dl-cdn.alpinelinux.org/alpine/edge/testing
|
|
EOF
|
|
cp /etc/apk/repositories "$ROOTFS/etc/apk/repositories" 2>/dev/null || true
|
|
cp /bananarchy/keys/* /etc/apk/keys/
|
|
|
|
echo "============================================================"
|
|
echo "Bananarchy Linux (MSM8909 / Sxmo) Customization Environment"
|
|
echo "Target rootfs: $ROOTFS"
|
|
echo ""
|
|
echo "Helpful commands inside this shell:"
|
|
echo " pkg-add <pkg...> : Install armv7 package(s) into $ROOTFS"
|
|
echo " pkg-del <pkg...> : Remove package(s) from $ROOTFS"
|
|
echo " pkg-search <query> : Search armv7 packages"
|
|
echo " cd /rootfs : Inspect or edit files directly"
|
|
echo ""
|
|
echo "After exiting, run ./rebuild-image.sh to repack images."
|
|
echo "============================================================"
|
|
|
|
cat > /usr/local/bin/pkg-add <<EOF
|
|
#!/bin/sh
|
|
exec apk --root "$ROOTFS" --arch armv7 add --no-scripts "\$@"
|
|
EOF
|
|
cat > /usr/local/bin/pkg-del <<EOF
|
|
#!/bin/sh
|
|
exec apk --root "$ROOTFS" --arch armv7 del --no-scripts "\$@"
|
|
EOF
|
|
cat > /usr/local/bin/pkg-search <<EOF
|
|
#!/bin/sh
|
|
exec apk --root "$ROOTFS" --arch armv7 search "\$@"
|
|
EOF
|
|
chmod +x /usr/local/bin/pkg-add /usr/local/bin/pkg-del /usr/local/bin/pkg-search
|
|
|
|
cd "$ROOTFS"
|
|
"$@" || true
|
|
chown -R "$HOST_UID:$HOST_GID" "$ROOTFS"
|
|
chmod -R u+rwX "$ROOTFS"
|
|
' -- "$@"
|