Slim the armv7 rootfs: drop Rust and Wayland packages, dead code, and build residue

- Replace Rust sudo-rs with C sudo (sudo-virt provider at priority 100) and add
  a two-phase pruner so apk atomically swaps the conflicting provider.
- Remove Wayland-purpose libwpebackend-fdo from the runtime set and add imv-x11
  for the X11-only image viewer path.
- Drop unused mesa-demos, postmarketos-artwork-wallpapers, ttyescape/hkdm,
  clickclack/sdl3, and font-twemoji; keep sfeed, w3m, htop, non-Latin fonts,
  and the documented SDK toolchain to avoid functional regressions.
- Strip apk index caches, apk logs, and unused gettext locales before mke2fs,
  with a hard guard that fails the build if any residue survives.
- Harden check-rebuild.sh with critical/forbidden package and guard checks.
- Delete the unreferenced Sway-era configurator and patch; sync the docs.
This commit is contained in:
Luxferre committed 2026-11-05 14:18:59 +02:00
1 parent 0ab9367e28
commit 5d10b801ff
12 files changed
+187 -1024

No files matched your search

+27
View File
@@ -162,6 +162,19 @@ EOF
BOOT_UUID="a1b2c3d4-8110-4000-8000-000000000001"
ROOT_UUID="a1b2c3d4-8110-4000-8000-000000000002"
# Build-only residue: apk index caches, apk transaction logs, and gettext
# trees (the X11 session forces LANG/LC_ALL=C.UTF-8). apk re-fetches
# indexes on demand on the device. Safe to call more than once.
strip_build_residue() {
rm -rf "$ROOTFS/var/cache/apk" 2>/dev/null || true
mkdir -p "$ROOTFS/var/cache/apk"
rm -f "$ROOTFS/var/log"/apk.log* 2>/dev/null || true
if [ -d "$ROOTFS/usr/share/locale" ]; then
find "$ROOTFS/usr/share/locale" -mindepth 1 -maxdepth 1 \
-exec rm -rf {} + 2>/dev/null || true
fi
}
echo "============================================================"
echo "Building Bananarchy Linux $BANANARCHY_VERSION (Sxmo 240x320) for: $TARGET_DEVICE"
echo "Source rootfs: $ROOTFS"
@@ -224,6 +237,10 @@ EOF
fi
done
# Retired world entries must go first: apk cannot install C sudo while the
# Rust sudo-rs still owns cmd:sudo in world.
/bananarchy/scripts/prune-rootfs-packages.sh "$ROOTFS" world
if [ -n "$MISSING_PKGS" ]; then
echo " -> Installing missing dependencies into $ROOTFS:$MISSING_PKGS"
# shellcheck disable=SC2086
@@ -237,6 +254,9 @@ EOF
ln -sf lua5.5 "$ROOTFS/usr/bin/lua"
ln -sf luac5.5 "$ROOTFS/usr/bin/luac"
/bananarchy/scripts/prune-rootfs-packages.sh "$ROOTFS" purge
strip_build_residue
echo "[1/5] Normalizing rootfs permissions and UIDs/GIDs..."
chown -R 0:0 "$ROOTFS"
chmod 755 "$ROOTFS" 2>/dev/null || true
@@ -365,6 +385,13 @@ EOF
fi
echo "[3/5] Creating ext2 boot (256 MiB) and ext4 root filesystems..."
strip_build_residue
APK_CACHE_LEFT="$(ls -A "$ROOTFS/var/cache/apk" 2>/dev/null || true)"
APK_LOGS_LEFT="$(ls "$ROOTFS/var/log"/apk.log* 2>/dev/null || true)"
if [ -n "$APK_CACHE_LEFT" ] || [ -n "$APK_LOGS_LEFT" ]; then
echo "Error: apk cache/log still present in target rootfs" >&2
exit 1
fi
BOOT_IMG="/tmp/boot.ext2"
ROOT_IMG="/tmp/root.ext4"
rm -f "$BOOT_IMG" "$ROOT_IMG"