From 8078f211e5b486b964be9e36d12fa139b3e298f2 Mon Sep 17 00:00:00 2001 From: Luxferre Date: Thu, 5 Nov 2026 15:08:13 +0200 Subject: [PATCH] Remove the remaining optional scripting runtimes, pin the core tools - Drop perl, perl-io-socket-ssl, tcl-lib, tcl-tls, sqlite-tcl, lua5.4, lua5.4-dev, lua5.5, lua5.5-dev and sqlite (CLI) from the package set and add them to the prune denylist: 13 packages / 49.45 MiB including dependents. sqlite-libs, tcl, and all paramount runtimes stay. - Promote curl to an explicit world entry and pin curl, bc, ed, rlwrap, mandoc, nano, less and frotz as core tools in check-rebuild.sh. - Remove the lua/luac symlink creation and the lua5.5 critical-binary check from the build scripts; apply-bananarchy-overlay.sh deletes stale links. - Drop four legacy pmbootstrap-era so: world constraints (@ entries in the prune list); so:libperl.so was pinning perl and blocking its removal. - Update README.md, MANUAL.md, AGENTS.md, SDK.md section 7 and CHANGELOG.md. - Rebuild images/bananarchy-nokia-argon.img (1.59 GiB, down from 1.66 GiB) and verify with qemu-arm that yabasic, neoui.yab, neonet.yab, curl, bc and ed still work while perl, lua, sqlite3, gcc and janet are gone. --- AGENTS.md | 1 + CHANGELOG.md | 7 ++++++ MANUAL.md | 2 +- README.md | 2 +- SDK.md | 33 ++++++++++++++++----------- rebuild-image.sh | 6 +---- scripts/apply-bananarchy-overlay.sh | 2 ++ scripts/bootstrap-rootfs-container.sh | 2 -- scripts/check-rebuild.sh | 19 +++++++++++---- scripts/prune-rootfs-packages.sh | 7 +++++- scripts/rootfs-packages.txt | 14 +++--------- scripts/rootfs-prune-packages.txt | 25 ++++++++++++++++++++ 12 files changed, 81 insertions(+), 39 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 8f82549..295bc80 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -61,5 +61,6 @@ All cross-compilation scripts run inside rootless Docker (`alpine:3.24` `armv7` - **Package hygiene**: keep `scripts/rootfs-packages.txt` free of Rust-based top-level packages (use C `sudo`, never `sudo-rs`) and Wayland-purpose packages; `libwpe` and the `wayland-libs-*` shared libraries stay because GTK3/WebKitGTK link them directly, but no Wayland compositor, backend, or viewer is shipped. `scripts/check-rebuild.sh` enforces this. - **Image residue**: `rebuild-image.sh` strips `/var/cache/apk`, all `apk.log*` files, and unused gettext locale trees before `mke2fs` and aborts the build if any apk cache/log remains; never add an `apk` call after that guard. - **No on-device compiler**: `scripts/rootfs-packages.txt` ships no `gcc`/`g++`/`musl-dev`/`make` and no Janet runtime (`janet`, `janet-dev`, `jpm`); cross-compile native code with `scripts/build-*.sh`. On-device development uses the Yabasic FFI SDK (`neoui.yab` / `neonet.yab`), which requires `yabasic`, `libffi`, `libneoui.so`, and `libcurl.so.4` — never remove those. `scripts/check-rebuild.sh` guards both sides. +- **Core tools**: `curl`, `bc`, `ed`, `rlwrap`, `mandoc`, `nano`, `less`, and `frotz` are pinned core tools asserted by `scripts/check-rebuild.sh`. Perl, Lua, optional Tcl extensions, and the `sqlite` CLI are excluded, while `tcl`, `python3`, `bash`, `luajit`, `gawk`, `jq`, `gojq`, and `quickjs` remain as hard runtime dependencies. - **Local agent config**: `.bantam.cfg` is a local, gitignored credential file. Never read, edit, commit, or unignore it; `scripts/check-rebuild.sh` verifies that its ignore rule stays in place. - **Sentence case**: always use sentence case in subheadings and list items across all documentation files (`README.md`, `MANUAL.md`, `SDK.md`, `CHANGELOG.md`, `AGENTS.md`). diff --git a/CHANGELOG.md b/CHANGELOG.md index 6ffe72f..ef7e557 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,13 @@ Release versions follow the `
` format (where `2026` is `a`, ## Unreleased +### Remove the remaining optional scripting runtimes +- Removed `perl`, `perl-io-socket-ssl`, `tcl-lib`, `tcl-tls`, `sqlite-tcl`, `lua5.4`, `lua5.4-dev`, `lua5.5`, `lua5.5-dev`, and `sqlite` (CLI) from `scripts/rootfs-packages.txt` and added them to the prune denylist: 13 packages / 49.45 MiB including dependents. `sqlite-libs`, `tcl`, and all paramount runtimes stay. +- Promoted `curl` to an explicit world entry and pinned `curl`, `bc`, `ed`, `rlwrap`, `mandoc`, `nano`, `less`, and `frotz` as core tools in `scripts/check-rebuild.sh`. +- Removed the `lua` / `luac` symlink creation and the `lua5.5` critical-binary check from `rebuild-image.sh` and `scripts/bootstrap-rootfs-container.sh`; `scripts/apply-bananarchy-overlay.sh` now deletes any stale symlinks. `scripts/check-rebuild.sh` guards against reintroducing them. +- Updated `README.md`, `MANUAL.md`, `AGENTS.md`, and `SDK.md` section 7 (removed runtimes plus deliberately kept core tools). +- Dropped four legacy pmbootstrap-era `so:` world constraints (`@` entries in `scripts/rootfs-prune-packages.txt`). `so:libperl.so` was pinning `perl` and prevented its removal; the other three providers (`elogind-common`, `expect`, `libpulse`) remain as hard dependencies. + ### Drop the on-device GCC suite and Janet runtime - Removed `gcc`, `g++`, `musl-dev`, `make`, `janet`, `janet-dev`, and `jpm` from `scripts/rootfs-packages.txt` and added them to `scripts/rootfs-prune-packages.txt`; together with their toolchain-only dependencies this frees 143.86 MiB (14 packages). No overlay script or world package depends on them at runtime. - Verified the Yabasic runtime is fully functional by executing the actual `armv7` binaries under `qemu-arm` in a chroot of the target rootfs: `yabasic 2.92.1`, basic `print`, `import neonet` + `neonet_version$()` (libffi -> `libcurl.so.4`), and `import neoui` + `neoui_adjust_rgb()` (libffi -> `libneoui.so`). All `DT_NEEDED` libraries of `yabasic`, `libneoui.so`, and `libcurl.so.4` come from packages that remain. diff --git a/MANUAL.md b/MANUAL.md index ae7d6e1..dd408b2 100644 --- a/MANUAL.md +++ b/MANUAL.md @@ -34,7 +34,7 @@ This manual covers flashing, operating, and customizing **Bananarchy Linux** (`2 - **QDSP6 / Q6Voice audio and Dual-SIM modem**: loudspeaker, boosted (+6 dB) earpiece, internal MEMS and headset microphones, `ModemManager` + `q6voiced` call audio routing, and direct Qualcomm QMI UIM Dual-SIM Dual Standby (DSDS), instant default SIM switching, Primary/Secondary GW (`4G/Data`) slot swapping, PIN/PUK management, and SIM phonebook access. - **Rear 2MP camera and torch LED**: `msm8905-cam` V4L2 driver (`/dev/video0` `800x600` `RGB3` for GalaxyCore `GC2395` / `GC2385` / `GC2365`) and `leds-msm8905-torch` (`white:torch` + PM8909 clean poweroff). 5. **Preinstalled developer and utility stack**: - - `git`, GNU `coreutils`, GNU `bc`/`dc`, `nano`, `ed`, `less`, `rlwrap`, `lua` (`5.5` and `5.4`), `yabasic` (with the `neoui.yab` / `neonet.yab` FFI wrappers), `bantam` coding agent, `perl` (`IO::Socket::SSL`), `tcl` (`tcllib`, `tcl-tls`, `sqlite-tcl`), `sqlite3`, `frotz`, `ffmpeg`, `mpv`, `imv`, standalone `snake`, `tetris`, and `scoundrel` X11 games, the `gambatte` Game Boy / Game Boy Color emulator, and the **ReMEdy (`remedy` / `j2me`)** `240x320` J2ME (MIDP 2.0 / CLDC 1.1) emulator. No on-device compiler or Janet runtime is shipped; native code is cross-compiled with `scripts/build-*.sh`. + - `curl`, `git`, GNU `coreutils`, GNU `bc`/`dc`, `nano`, `ed`, `less`, `rlwrap`, `mandoc`, `yabasic` (with the `neoui.yab` / `neonet.yab` FFI wrappers), `bantam` coding agent, `tcl` (runtime for `expect`), `frotz`, `ffmpeg`, `mpv`, `imv`, standalone `snake`, `tetris`, and `scoundrel` X11 games, the `gambatte` Game Boy / Game Boy Color emulator, and the **ReMEdy (`remedy` / `j2me`)** `240x320` J2ME (MIDP 2.0 / CLDC 1.1) emulator. No on-device compiler, Janet, Perl, Lua, or `sqlite3` CLI is shipped; native code is cross-compiled with `scripts/build-*.sh`. `curl`, `bc`, `ed`, `rlwrap`, `mandoc`, `nano`, `less`, and `frotz` are the pinned core tools. --- diff --git a/README.md b/README.md index fe90561..0aecb7d 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ Instead of spawning slow shell scripts for everyday phone tasks, Bananarchy runs ### Input, terminal, and developer tools - **6-mode `fcitx5-t9` keypad input**: press `#` to cycle between `abc`, `Abc`, `ABC`, `Sym` (all 32 ASCII punctuation symbols), `Ctl` (`Ctrl` sequences, arrows, `PageUp`/`PageDown`, `F1`–`F12`), and `123` numeric modes with a fixed bottom candidate bar. - **First-class Linux terminal (`st`)**: patched with HarfBuzz OpenType ligatures (`Fira Code` as the default system and terminal font), XIM T9 input, and live theme reloading. -- **On-device scripting, tools, and gaming**: preinstalled `git`, GNU `coreutils`, GNU `bc`/`dc`, `mandoc`, `nano`, `ed`, `sqlite3`, `lua` (`5.5` and `5.4`), `yabasic` (with full `yabasic-doc` manual and HTML documentation plus the `neoui.yab` / `neonet.yab` FFI wrappers), `perl`, `tcl`, the [Bantam](https://bantam.luxferre.top/) coding agent, `frotz` (interactive fiction), OpenGL / OpenGL ES hardware diagnostics (`glxinfo`, `eglinfo`, `glxgears`), standalone X11 keypad games (`Snake`, `Tetris`, and `Scoundrel` roguelike solitaire), a full-featured Gambatte-based Game Boy / Game Boy Color emulator (`gambatte` / `gbemu`) with readjustable keypad controls (`B=8`, `Turbo B=5`, `A=9`, `Turbo A=6`, `D-pad`, `Start=2`, `Select=3`, `Palette=*`), 10 color palettes, save states, and file manager `.gb`/`.gbc` integration, and **ReMEdy (`remedy` / `j2me`)**, a native `240x320` J2ME (MIDP 2.0 / CLDC 1.1) emulator with Adreno 304 hardware-accelerated JSR-184 M3G 3D graphics, NeoUI-themed high-level LCDUI widgets, socket/HTTP networking (`Connector`), `RecordStore` (RMS) persistence, MMAPI audio, readjustable keypad controls, and `.jar`/`.jad` file manager integration. No on-device compiler or Janet runtime is shipped: native code is cross-compiled with `scripts/build-*.sh`, while on-device programming uses the Yabasic FFI SDK. +- **On-device scripting, tools, and gaming**: preinstalled `curl`, `git`, GNU `coreutils`, GNU `bc`/`dc`, `mandoc`, `nano`, `less`, `ed`, `rlwrap`, `yabasic` (with full `yabasic-doc` manual and HTML documentation plus the `neoui.yab` / `neonet.yab` FFI wrappers), `tcl` (runtime for `expect`), the [Bantam](https://bantam.luxferre.top/) coding agent, `frotz` (interactive fiction), OpenGL / OpenGL ES hardware diagnostics (`glxinfo`, `eglinfo`, `glxgears`), standalone X11 keypad games (`Snake`, `Tetris`, and `Scoundrel` roguelike solitaire), a full-featured Gambatte-based Game Boy / Game Boy Color emulator (`gambatte` / `gbemu`) with readjustable keypad controls (`B=8`, `Turbo B=5`, `A=9`, `Turbo A=6`, `D-pad`, `Start=2`, `Select=3`, `Palette=*`), 10 color palettes, save states, and file manager `.gb`/`.gbc` integration, and **ReMEdy (`remedy` / `j2me`)**, a native `240x320` J2ME (MIDP 2.0 / CLDC 1.1) emulator with Adreno 304 hardware-accelerated JSR-184 M3G 3D graphics, NeoUI-themed high-level LCDUI widgets, socket/HTTP networking (`Connector`), `RecordStore` (RMS) persistence, MMAPI audio, readjustable keypad controls, and `.jar`/`.jad` file manager integration. No on-device compiler, Janet, Perl, Lua, or `sqlite3` CLI is shipped: native code is cross-compiled with `scripts/build-*.sh`, while on-device programming uses the Yabasic FFI SDK. `curl`, `bc`, `ed`, `rlwrap`, `mandoc`, `nano`, `less`, and `frotz` remain as pinned core tools. - **NeoUI `240x320` UI SDK (`libneoui.so` + `/usr/include/neoui.h` + `neoui.yab`) and NeoNet (`neonet.yab`)**: unified C-compatible FFI and C++20 UI SDK wrapping Xlib, Xft, Pango, `libjpeg`/`libpng`, `.Xresources` / `~/.xthemes/*.xth` live theme resolution, offscreen `Pixmap` double buffering, standardized OS shell widgets (headers, tabs, softkey bars, list/toggle/slider rows, input boxes, progress bars, scrollbars, modals, popup menus, and toasts), keypad/softkey chord handling, and multi-tap text entry—usable from C, C++, or Yabasic (`~/Projects/neoui.yab`, `~/Projects/neoui_demo.yab`, and `~/Projects/bulls_cows.yab`), paired with **NeoNet (`~/Projects/neonet.yab` and `~/Projects/neonet_demo.yab`)** for `libcurl`-based HTTP/HTTPS requests with custom headers and TCP/TLS/UDP socket exchange in Yabasic. See [SDK.md](./SDK.md) for full documentation. --- diff --git a/SDK.md b/SDK.md index e11871b..36eb258 100644 --- a/SDK.md +++ b/SDK.md @@ -679,9 +679,10 @@ r = neonet_cleanup() ## 7. On-device scripting runtime inventory Bananarchy no longer ships an on-device compiler (`gcc`, `g++`, `musl-dev`, -`make`) or the Janet runtime (`janet`, `janet-dev`, `jpm`). Native code is -cross-compiled with `scripts/build-*.sh`; on-device development goes through -the Yabasic FFI SDK in sections 5 and 6. +`make`), the Janet runtime (`janet`, `janet-dev`, `jpm`), Perl, Lua, the +optional Tcl extensions, or the `sqlite3` CLI. Native code is cross-compiled +with `scripts/build-*.sh`; on-device development goes through the Yabasic FFI +SDK in sections 5 and 6. The core tools in section 7.3 are pinned. ### 7.1 Absolutely paramount (hard runtime dependencies) @@ -697,17 +698,23 @@ the Yabasic FFI SDK in sections 5 and 6. | `gojq` | Hard dep of `postmarketos-base-ui-networkmanager`. | | `quickjs` | Hard dep of the `yt-dlp-ejs` chain pulled in by `sxmo-utils-common`. | -### 7.2 Removable without on-device regressions +### 7.2 Removed in the lean build | Packages | Approx. size | Notes | | --- | --- | --- | -| `perl`, `perl-io-socket-ssl` | 31.8 MiB | `git` itself does not depend on Perl; only the optional `git svn` / `git send-email` helpers (`git-perl`, `perl-git`) would go. No overlay script invokes Perl. | -| `tcl-lib`, `tcl-tls`, `sqlite-tcl` | 12.1 MiB | Optional Tcl extensions with no reverse dependencies and no usage; `tcl` itself must stay for `expect`. | -| `lua5.4`, `lua5.4-dev`, `lua5.5`, `lua5.5-dev` | 3.0 MiB | No runtime callers; `mpv` uses `luajit`, not these. Removing them also requires dropping the `lua`/`luac` symlinks in `bootstrap-rootfs-container.sh` / `rebuild-image.sh` and the `lua5.5` critical-binary check. | -| `sqlite` (CLI) | 1.3 MiB | `sqlite-libs` stays (hard dep of WebKitGTK and Python); only the interactive CLI is unused. | -| `bc`, `ed`, `rlwrap` | 0.3 MiB | Interactive conveniences with no runtime callers. | -| `frotz`, `mandoc`, `nano`, `less` | small | Documented user-facing tools, not runtimes; removable only with matching documentation changes. | +| `perl`, `perl-io-socket-ssl` | 31.8 MiB | `git` itself does not depend on Perl; only the optional `git svn` / `git send-email` helpers (`git-perl`, `perl-git`) went away. No overlay script invokes Perl. | +| `tcl-lib`, `tcl-tls`, `sqlite-tcl` | 12.1 MiB | Optional Tcl extensions with no reverse dependencies; `tcl` itself stays because `expect` (a hard dep of `sxmo-utils-common`) needs `libtcl8.6.so`. | +| `lua5.4`, `lua5.4-dev`, `lua5.5`, `lua5.5-dev` | 3.0 MiB | No runtime callers; `mpv` uses `luajit`. The `lua` / `luac` symlinks and the `lua5.5` critical-binary check were removed from the build scripts. | +| `sqlite` (CLI) | 1.3 MiB | `sqlite-libs` stays as a hard dep of WebKitGTK, Python, `libsoup3`, and `nss`. | -These are recommendations, not applied changes: the current package set still -contains them so that the documented on-device scripting environment stays -intact. +Together with their dependents (`perl-mozilla-ca`, `perl-net-ssleay`, +`lua5.5-libs`, and the install-if `git-perl` / `perl-git` helpers) this freed +49.45 MiB across 13 packages. + +### 7.3 Deliberately kept core tools + +`curl`, `bc`, `ed`, `rlwrap`, `mandoc`, `nano`, `less`, and `frotz` are pinned in +`scripts/rootfs-packages.txt` and asserted by `scripts/check-rebuild.sh`. +`curl` was promoted from a transitive dependency of `sxmo-utils` to an explicit +world entry so it cannot disappear if that dependency changes. `frotz` remains +solely as the interactive-fiction game engine. diff --git a/rebuild-image.sh b/rebuild-image.sh index 14d8a65..ab04074 100755 --- a/rebuild-image.sh +++ b/rebuild-image.sh @@ -219,7 +219,7 @@ EOF [ -e "$ROOTFS/usr/sbin/ip6tables" ] || [ -L "$ROOTFS/usr/sbin/ip6tables" ] || MISSING_PKGS="$MISSING_PKGS ip6tables" [ -e "$ROOTFS/sbin/ip" ] || [ -L "$ROOTFS/sbin/ip" ] || MISSING_PKGS="$MISSING_PKGS iproute2" [ -e "$ROOTFS/usr/bin/yabasic" ] || [ -L "$ROOTFS/usr/bin/yabasic" ] || MISSING_PKGS="$MISSING_PKGS yabasic" - [ -e "$ROOTFS/usr/bin/lua5.5" ] || [ -L "$ROOTFS/usr/bin/lua5.5" ] || MISSING_PKGS="$MISSING_PKGS lua5.5" + [ -e "$ROOTFS/usr/bin/curl" ] || [ -L "$ROOTFS/usr/bin/curl" ] || MISSING_PKGS="$MISSING_PKGS curl" [ -e "$ROOTFS/usr/bin/scrot" ] || [ -L "$ROOTFS/usr/bin/scrot" ] || MISSING_PKGS="$MISSING_PKGS scrot" # Scan ELF binaries and plugins for missing shared libraries (so:) @@ -245,14 +245,10 @@ EOF echo " -> Installing missing dependencies into $ROOTFS:$MISSING_PKGS" # shellcheck disable=SC2086 apk --root "$ROOTFS" --arch armv7 add --no-scripts $MISSING_PKGS - ln -sf lua5.5 "$ROOTFS/usr/bin/lua" - ln -sf luac5.5 "$ROOTFS/usr/bin/luac" /bananarchy/scripts/apply-bananarchy-overlay.sh "$ROOTFS" "$TARGET_DEVICE" else echo " -> All target rootfs packages and shared libraries are present." fi - 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 diff --git a/scripts/apply-bananarchy-overlay.sh b/scripts/apply-bananarchy-overlay.sh index 5b958a9..34b38a5 100755 --- a/scripts/apply-bananarchy-overlay.sh +++ b/scripts/apply-bananarchy-overlay.sh @@ -239,6 +239,8 @@ for path in glob.glob(os.path.join(rootfs, "usr/lib/libgallium-*.so")): print(f"Patched {os.path.basename(path)} with Adreno 304 (FD304) device descriptor.") PYEOF rm -rf \ + "$TARGET_ROOTFS/usr/bin/lua" \ + "$TARGET_ROOTFS/usr/bin/luac" \ "$TARGET_ROOTFS/usr/bin/sxmo_swayinitconf.sh" \ "$TARGET_ROOTFS/usr/bin/sxmo_swayinit.sh" \ "$TARGET_ROOTFS/usr/bin/sxmo_riverinit.sh" \ diff --git a/scripts/bootstrap-rootfs-container.sh b/scripts/bootstrap-rootfs-container.sh index 3e604e8..5582173 100755 --- a/scripts/bootstrap-rootfs-container.sh +++ b/scripts/bootstrap-rootfs-container.sh @@ -48,8 +48,6 @@ else # shellcheck disable=SC2086 apk --root "$ROOTFS" --arch armv7 add --no-scripts $PKGS >/dev/null fi -ln -sf lua5.5 "$ROOTFS/usr/bin/lua" -ln -sf luac5.5 "$ROOTFS/usr/bin/luac" "$REPO/scripts/prune-rootfs-packages.sh" "$ROOTFS" purge diff --git a/scripts/check-rebuild.sh b/scripts/check-rebuild.sh index cc3c21b..61de30b 100755 --- a/scripts/check-rebuild.sh +++ b/scripts/check-rebuild.sh @@ -46,13 +46,14 @@ 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 + if [ "$PKG_COUNT" -lt 70 ]; 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 yabasic yabasic-doc; do + sudo imv-x11 fcitx5-gtk3 mesa-utils sfeed yabasic yabasic-doc \ + curl bc ed rlwrap mandoc nano less frotz tcl; do if ! grep -Fxq "$pkg" "$PKGS_FILE"; then fail "missing critical package: $pkg" fi @@ -60,7 +61,9 @@ else # 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 \ - gcc g++ musl-dev make janet janet-dev jpm; do + gcc g++ musl-dev make janet janet-dev jpm \ + perl perl-io-socket-ssl tcl-lib tcl-tls sqlite-tcl sqlite \ + lua5.4 lua5.4-dev lua5.5 lua5.5-dev; do if grep -Fxq "$pkg" "$PKGS_FILE"; then fail "forbidden Rust/Wayland package in package list: $pkg" fi @@ -73,12 +76,12 @@ if [ ! -f "$PRUNE_FILE" ]; then 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 gcc janet; do + for pkg in sudo-rs libwpebackend-fdo imv-wayland gcc janet perl lua5.5 sqlite; 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 + for deny in '!imv-wayland' '!gstreamer-ptp-helper' '!libheif-rav1e' '@so:libperl.so'; do if ! grep -Fxq "$deny" "$PRUNE_FILE"; then fail "missing negative world constraint: $deny" fi @@ -88,6 +91,12 @@ if [ ! -x "$BASE_DIR/scripts/prune-rootfs-packages.sh" ]; then fail "missing or non-executable scripts/prune-rootfs-packages.sh" fi +echo "[check] Lua symlink removal..." +if grep -q 'lua5.5' "$BASE_DIR/rebuild-image.sh" || \ + grep -q 'lua5.5' "$BASE_DIR/scripts/bootstrap-rootfs-container.sh"; then + fail "build scripts still create dangling lua/luac symlinks" +fi + echo "[check] Yabasic FFI runtime..." for artifact in \ "$BASE_DIR/prebuilt/sxmo-x11/usr/lib/libneoui.so" \ diff --git a/scripts/prune-rootfs-packages.sh b/scripts/prune-rootfs-packages.sh index 220f1ef..6873d79 100755 --- a/scripts/prune-rootfs-packages.sh +++ b/scripts/prune-rootfs-packages.sh @@ -20,8 +20,9 @@ if [ ! -f "$PRUNE_FILE" ]; then echo "Error: missing $PRUNE_FILE" >&2 exit 1 fi -PRUNE_PKGS="$(grep -v '^[[:space:]]*#' "$PRUNE_FILE" | grep -v '^[[:space:]]*$' | grep -v '^!' | tr '\n' ' ')" +PRUNE_PKGS="$(grep -v '^[[:space:]]*#' "$PRUNE_FILE" | grep -v '^[[:space:]]*$' | grep -v '^[!@]' | tr '\n' ' ')" WORLD_DENY="$(grep '^!' "$PRUNE_FILE" | tr '\n' ' ')" +WORLD_DROP="$(grep '^@' "$PRUNE_FILE" | sed 's/^@//' | tr '\n' ' ')" DENY_NAMES="" for deny in $WORLD_DENY; do DENY_NAMES="$DENY_NAMES ${deny#!}" @@ -39,6 +40,10 @@ pin_world_constraints() { grep -vxF "!$pkg" "$WORLD_FILE.bananarchy-tmp" > "$WORLD_FILE.bananarchy-tmp2" || true mv "$WORLD_FILE.bananarchy-tmp2" "$WORLD_FILE.bananarchy-tmp" done + for entry in $WORLD_DROP; do + grep -vxF "$entry" "$WORLD_FILE.bananarchy-tmp" > "$WORLD_FILE.bananarchy-tmp2" || true + mv "$WORLD_FILE.bananarchy-tmp2" "$WORLD_FILE.bananarchy-tmp" + done for deny in $WORLD_DENY; do printf '%s\n' "$deny" >> "$WORLD_FILE.bananarchy-tmp" done diff --git a/scripts/rootfs-packages.txt b/scripts/rootfs-packages.txt index 00f599a..c7ef5d9 100644 --- a/scripts/rootfs-packages.txt +++ b/scripts/rootfs-packages.txt @@ -6,7 +6,8 @@ # Rust sudo-rs variant and its postmarketos-base-sudo-rs companion are excluded. # No on-device compiler or Janet runtime is shipped; native code is # cross-compiled with scripts/build-*.sh, and Yabasic FFI (neoui.yab / -# neonet.yab) is the on-device SDK path. +# neonet.yab) is the on-device SDK path. curl, bc, ed, rlwrap, mandoc, nano, +# less, and frotz are the pinned core tools and must not be removed. # scripts/rootfs-prune-packages.txt lists packages purged from existing rootfs # trees (Wayland-only components and retired packages). adwaita-icon-theme @@ -16,6 +17,7 @@ bash bc brightnessctl coreutils +curl doas ed evtest @@ -47,10 +49,6 @@ libxft libxinerama libxtst linux-postmarketos-qcom-msm8916 -lua5.4 -lua5.4-dev -lua5.5 -lua5.5-dev mandoc mesa-utils modemmanager @@ -58,8 +56,6 @@ nano openssh openssh-server-pam openvpn -perl -perl-io-socket-ssl postmarketos-base postmarketos-base-nofde postmarketos-base-ui @@ -79,12 +75,8 @@ soc-qcom-msm8916 soc-qcom-msm8916-rproc soc-qcom-msm8916-rproc-openrc soc-qcom-msm8916-ucm -sqlite -sqlite-tcl sudo tcl -tcl-lib -tcl-tls tor v4l-utils w3m diff --git a/scripts/rootfs-prune-packages.txt b/scripts/rootfs-prune-packages.txt index f8e1a2a..91fe02a 100644 --- a/scripts/rootfs-prune-packages.txt +++ b/scripts/rootfs-prune-packages.txt @@ -46,6 +46,31 @@ janet janet-dev jpm +# Retired scripting runtimes and optional extensions. The core tools +# (curl, bc, ed, rlwrap, mandoc, nano, less, frotz) and the paramount +# runtimes (yabasic, python3, bash, tcl, luajit, gawk, jq, gojq, quickjs) +# stay in scripts/rootfs-packages.txt. +perl +perl-io-socket-ssl +tcl-lib +tcl-tls +sqlite-tcl +lua5.4 +lua5.4-dev +lua5.5 +lua5.5-dev +sqlite + +# Legacy pmbootstrap-era so: world constraints. @ lines are dropped from +# etc/apk/world entirely: they are not packages and must not be passed to apk. +# so:libperl.so in particular pins perl and blocks its removal; the other +# three providers (elogind-common, expect, libpulse) are hard dependencies of +# remaining world packages and stay installed. +@so:libelogind-shared-255.24.so +@so:libexpect5.45.4.so +@so:libperl.so +@so:libpulsecommon-17.0.so + # Negative world constraints for install_if packages. apk del removes these # constraints, so the pruner restores them and runs apk fix after every purge. !imv-wayland