From 8448b6465f7f8ed086f948020a722d60a21f35a3 Mon Sep 17 00:00:00 2001 From: Luxferre Date: Sun, 8 Nov 2026 09:56:01 +0200 Subject: [PATCH] Mark a1108 dejavu release and rebuild image Group all previously unreleased changes under Build a1108 / dejavu, update README, MANUAL, AGENTS and battery analysis for the current release, add release codename support to scripts/version.sh and check-rebuild.sh, update os-release/issue/motd templates including usr/lib/os-release, rebuild the image under a1108, and deploy the same release metadata to the live phone. --- AGENTS.md | 2 +- BATTERY-OPTIMIZATION-ANALYSIS.md | 13 +++++++----- CHANGELOG.md | 33 ++++++++++++++++++------------- MANUAL.md | 2 +- README.md | 8 ++++---- overlay/rootfs/etc/issue | 3 +-- overlay/rootfs/etc/motd | 5 +++-- overlay/rootfs/etc/os-release | 3 ++- overlay/rootfs/usr/lib/os-release | 12 +++++++++++ prepare-release.sh | 24 ++++++++++++---------- rebuild-image.sh | 4 +++- scripts/check-rebuild.sh | 16 +++++++++++++-- scripts/version.sh | 26 ++++++++++++++++++++---- 13 files changed, 104 insertions(+), 47 deletions(-) create mode 100644 overlay/rootfs/usr/lib/os-release diff --git a/AGENTS.md b/AGENTS.md index 7d336f8..69ca535 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -42,7 +42,7 @@ All cross-compilation scripts run inside rootless Docker (`alpine:3.24` `armv7` - `./scripts/build-xlibre.sh` — builds Xlibre `Xorg`, `libglamoregl.so`, `libglx.so`, and `modesetting`/`libinput`/`fbdev` DDX drivers. - `./scripts/build-bantam.sh` — fetches and cross-compiles the `bantam` AI agent. - `./scripts/generate-artwork.py` — regenerates wallpapers, splashes, and icons from `artwork/icon-large.png`. -- `./scripts/version.sh [--print | target_rootfs]` — computes the date-based release version (`
` with `2026 = a`) and substitutes `@BANANARCHY_VERSION@` in `etc/os-release`, `etc/issue`, and `etc/motd` (invoked automatically during overlay application and image builds). +- `./scripts/version.sh [--print | --print-codename | target_rootfs]` — computes the date-based release version (`
` with `2026 = a`) and its release codename, and substitutes `@BANANARCHY_VERSION@` / `@BANANARCHY_CODENAME@` in `etc/os-release`, `usr/lib/os-release`, `etc/issue`, and `etc/motd` (invoked automatically during overlay application and image builds). Current release is `a1108` / `dejavu`; `scripts/check-rebuild.sh` guards it. - `./chroot-shell.sh` — opens an `armv7` container shell to manage packages in `rootfs/` (`pkg-add`, `pkg-del`, `pkg-search`); bootstraps `rootfs/` first if needed. - `./rebuild-image.sh [--mkinitfs]` — verifies the clone, syncs `prebuilt/` into `overlay/rootfs/`, bootstraps `rootfs/` from scratch when missing, applies the overlay, and produces flashable images in `images/`. - `./scripts/bootstrap-rootfs.sh [rootfs-dir] [device] [--force|--check]` — creates a complete `armv7` rootfs from `scripts/rootfs-packages.txt` inside rootless Docker; idempotent via `etc/bananarchy/rootfs-bootstrap.done`. diff --git a/BATTERY-OPTIMIZATION-ANALYSIS.md b/BATTERY-OPTIMIZATION-ANALYSIS.md index 967c11f..c3c491b 100644 --- a/BATTERY-OPTIMIZATION-ANALYSIS.md +++ b/BATTERY-OPTIMIZATION-ANALYSIS.md @@ -1,10 +1,12 @@ # Bananarchy battery-usage optimization analysis (measurement-corrected) -**Status:** analysis only — no source or on-device changes were made. -**Project:** `/home/lux/proj/bananarchy`, repo HEAD `2ea2db4`. +**Status:** analysis plus implemented changes (sections 15-18). +**Project:** `/home/lux/proj/bananarchy`, current release `a1108` / `dejavu`. **Device:** Nokia 8110 4G (`nokia-argon`, MSM8905), connected over USB RNDIS at `172.16.42.1`, `Linux nokia-argon 6.12.1-msm8916 #6 SMP PREEMPT Sat May 30 08:38:37 UTC 2026 armv7l`, -`Bananarchy Linux a1105 (msm8909)`. +`Bananarchy Linux a1108` (codename `dejavu`, `msm8909`). Historical sections +below retain the build labels from their original measurement sessions; the +current shipped build is `a1108` / `dejavu`. **Measurement session:** 2026-11-07 16:07–16:12 EET, uptime ~43 h at first snapshot. Read-only SSH commands plus two 60-second delta windows. Temporary `/tmp/bantam-*` files on the phone were removed; `NO_RESIDUE` confirmed. @@ -191,7 +193,7 @@ rfkill rmtfs sshd tinydm udev-postmount wpa_supplicant` (no `bluetooth`, no `zra `10-power-save.start`, `bananarchy-display-power-sync`, `sxmo_wm.sh`, `sxmo_hook_statusbar.sh`, `sxmo_hook_battery.sh`, `msm-modem-uim-selection`, `sxmo_modemmonitor.sh`, `xorg.conf.d/10-bananarchy-msm8909.conf` all match the repo copies. -The deployed image is `a1105`; the power-relevant code is identical to HEAD `2ea2db4`. +The deployed image at the time was `a1105`; the power-relevant code is identical to HEAD `2ea2db4`. The current build is `a1108` / `dejavu`. --- @@ -443,7 +445,8 @@ worth doing to unlock them. ### 14.1 Session, limits, and state -- Host clock 2026-11-07 18:03-18:46 EET; phone `Bananarchy Linux a1107`, +- Host clock 2026-11-07 18:03-18:46 EET; phone `Bananarchy Linux a1107` + (historical measurement; current build `a1108` / `dejavu`), `Linux nokia-argon 6.12.1-msm8916 #1 SMP PREEMPT`, freshly rebooted (uptime 12-22 min during the windows), reachable at `172.16.42.1` over USB RNDIS. - **Charging throughout**: `pm8916-lbc-chgr/online=1`, diff --git a/CHANGELOG.md b/CHANGELOG.md index dc6da09..78a79e8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,12 +4,17 @@ This file tracks public release builds of **Bananarchy Linux**. Release versions follow the `
` format (where `2026` is `a`, followed by the two-digit month and day). -**Current device builds (`a1105` — codename `vendetta`)**: -- **Nokia 8110 4G (`nokia-argon`)**: https://bananarchy.top/builds/bananarchy-nokia-argon-a1105.zip +**Current device builds (`a1108` — codename `dejavu`)**: +- **Nokia 8110 4G (`nokia-argon`)**: https://bananarchy.top/builds/bananarchy-nokia-argon-a1108.zip --- -## Unreleased — event-driven network status and no-tradeoff idle A/B sweep +## Build `a1108` — codename `dejavu` (2026-11-08) + +This build contains all previously unreleased changes below. The image and +release metadata are generated by `scripts/version.sh` as `a1108` / `dejavu`. + +### Event-driven network status and no-tradeoff idle A/B sweep - **Removed the `nmcli device monitor` poller**: `sxmo_networkmonitor.sh` kept a long-lived NetworkManager device monitor plus two shell wrappers @@ -45,7 +50,7 @@ Release versions follow the `
` format (where `2026` is `a`, --- -## Unreleased — xkopher focus scrolling, fresh unlock clock, battery longevity re-analysis +### xkopher focus scrolling, fresh unlock clock, battery longevity re-analysis - **xkopher link focus visibility**: `smallweb_plugin.cpp` now builds display rows through a shared `buildRenderRows()` helper and maps the focused link @@ -92,7 +97,7 @@ Release versions follow the `
` format (where `2026` is `a`, --- -## Unreleased — manual network time sync from the Config menu +### manual network time sync from the Config menu - **Config -> Sync net time**: a new menu item in the built-in dmenu Config menu (`src/sxmo-dmenu/dmenu.c`) runs @@ -126,7 +131,7 @@ Release versions follow the `
` format (where `2026` is `a`, --- -## Unreleased — network-up NTP synchronisation +### network-up NTP synchronisation - **Fixed the clock never being set over the network**: `chronyd` resolves `pool.ntp.org` only at startup and, with `minpoll 12`, waits up to 4096 s @@ -164,7 +169,7 @@ Release versions follow the `
` format (where `2026` is `a`, --- -## Unreleased — reproducible device initramfs module lists +### reproducible device initramfs module lists - `scripts/apply-bananarchy-overlay.sh` now installs the tracked `devices//modules-initfs` list into @@ -180,7 +185,7 @@ Release versions follow the `
` format (where `2026` is `a`, --- -## Unreleased — VM-BMS clamp and runtime power policies +### VM-BMS clamp and runtime power policies - **Kernel fix (patch 0007)**: `pm8916_bms_vm.c` now bounds VADC raw samples to `8000..16000` (~2.34-4.69 V) with a 3.7 V nominal fallback, covering @@ -214,7 +219,7 @@ Release versions follow the `
` format (where `2026` is `a`, --- -## Unreleased — kernel power headroom analysis (no runtime change) +### kernel power headroom analysis (no runtime change) A second live measurement pass on the connected `nokia-argon` (screen off, Wi-Fi up, both SIMs registered) quantified what is left after the battery @@ -259,7 +264,7 @@ No kernel image, module, DTB or userspace artifact changed in this pass. --- -## Unreleased — configurable 5-minute screen blank, instant lock/wake +### configurable 5-minute screen blank, instant lock/wake - **Configurable idle blanking**: added **Config -> Screen blank** (`Off`, 30 s, 1/5/10/30 min) backed by `~/.config/sxmo/idle_blank_timeout` and the new @@ -280,7 +285,7 @@ No kernel image, module, DTB or userspace artifact changed in this pass. --- -## Unreleased — idle-blank wake fix and PIN-locked SIM provisioning +### idle-blank wake fix and PIN-locked SIM provisioning Two issues reported after the recovery image booted: @@ -308,7 +313,7 @@ Two issues reported after the recovery image booted: --- -## Unreleased — recovery: restore the known-good kernel (module ABI) +### recovery: restore the known-good kernel (module ABI) **The previous battery pass produced an unbootable image.** Two independent incompatibilities between a custom-built kernel and the `linux-postmarketos-qcom-msm8916` package module tree were @@ -356,7 +361,7 @@ Verification of the recovery build: --- -## Unreleased — measurement-corrected battery optimization pass +### measurement-corrected battery optimization pass Analysis: `BATTERY-OPTIMIZATION-ANALYSIS.md` (corrected against the connected `nokia-argon`, `a1105`, 43 h uptime, DSDS + Wi-Fi on). No sleep state existed at all: `/sys/power/state` was @@ -439,7 +444,7 @@ power-collapsed, so the drain came from always-on SoC rails, display and radios, --- -## Unreleased — display power, cpufreq, and Bantam agent update +### display power, cpufreq, and Bantam agent update ### Updated Bantam agent to upstream `c168955` - Fetched and cross-compiled the latest `bantam-cpp` master (`c168955`, "Scope /clear to the current project's session and drop cross-implementation references") for `armv7` with `scripts/build-bantam.sh`, replacing the `0cd1a67` binary in `prebuilt/bantam/`, `overlay/rootfs/usr/bin/`, `overlay/rootfs/usr/local/bin/`, and the target rootfs. The update brings validated `write` tool edit modes (`find` / `replaceAll`, `append`, `lineOffset`, `byteOffset`), verbatim file content writes, safer `read` and `bash` tool handling, and a project-scoped `/clear`. diff --git a/MANUAL.md b/MANUAL.md index 857065e..19a68c4 100644 --- a/MANUAL.md +++ b/MANUAL.md @@ -2,7 +2,7 @@ ![Bananarchy Banner](artwork/banner-800x240.png) -This manual covers flashing, operating, and customizing **Bananarchy Linux** (`240x320` native edition) on **Qualcomm MSM8905 and MSM8909** Nokia feature phones: +This manual covers flashing, operating, and customizing **Bananarchy Linux** (`240x320` native edition) on **Qualcomm MSM8905 and MSM8909** Nokia feature phones. Current release: `a1108` (codename `dejavu`); see the [changelog](./CHANGELOG.md) for release notes. - **Nokia 8110 4G (`nokia-argon`)** - **Nokia 2720 Flip (`nokia-beatles`)** - **Nokia 800 Tough (`nokia-tough` / `nokia-coconut`)** diff --git a/README.md b/README.md index 0fc7434..8233f8d 100644 --- a/README.md +++ b/README.md @@ -4,9 +4,9 @@ **Bananarchy** is a keypad-first Linux distribution hardforked from postmarketOS (`v26.06` / Alpine `edge` `armv7`), built for **Qualcomm MSM8905 (Snapdragon 205)** and **Qualcomm MSM8909 (Snapdragon 210)** smart feature phones with **240x320 QVGA non-touch displays** and **physical 12-key T9 keypads**. -- **Current public release**: `a1105` (codename `vendetta`) — see the [changelog](./CHANGELOG.md) for release notes. -- **Device builds (`a1105` — codename `vendetta`)**: - - **Nokia 8110 4G (`nokia-argon`)**: https://bananarchy.top/builds/bananarchy-nokia-argon-a1105.zip +- **Current public release**: `a1108` (codename `dejavu`) — see the [changelog](./CHANGELOG.md) for release notes. +- **Device builds (`a1108` — codename `dejavu`)**: + - **Nokia 8110 4G (`nokia-argon`)**: https://bananarchy.top/builds/bananarchy-nokia-argon-a1108.zip - **Project philosophy**: read [The Bananarchy Manifesto](./MANIFESTO.md) for the background and goals behind the distribution. - **User and flashing guide**: see the [user manual](./MANUAL.md) for installation, keypad navigation, and hardware details. - **UI and networking SDK reference**: see the [NeoUI and NeoNet SDK guide](./SDK.md) for building native C, C++, and Yabasic `240x320` GUI and networked applications. @@ -16,7 +16,7 @@ ## Key features ### System and hardware support -- **Mainline Linux 6.12 kernel**: custom patches and out-of-tree drivers for Qualcomm **Adreno 304 (`FD304`, 96 KB GMEM)** 3D GPU acceleration (`drm/msm` + `qcom-iommu`), Qualcomm QDSP6/Q6Voice audio routing, Dual-SIM modem control, the rear 2MP GalaxyCore `GC2395` / `GC2385` / `GC2365` camera (`/dev/video0`), the `SY7807` flashlight LED (`white:torch`), physical keypad/slider events, and clean PM8909 poweroff. The kernel image is built from `config-bananarchy-msm8909.armv7` with the known-good pmaports module ABI, and ships with idle-blanking power management; `BATTERY-OPTIMIZATION-ANALYSIS.md` records the measured idle state and explains why suspend-to-RAM is unavailable on this firmware (PSCI `SYSTEM_SUSPEND` missing) and why a full custom module tree rebuild is not worthwhile. Section 17 adds a post-`a1107` re-analysis and two low-risk wins: the active zram swap now uses `lz4` instead of `zramstart`'s `zstd` default, and `vm.compaction_proactiveness=0` removes ~2 `kcompactd0` wakeups/s. Section 18 replaces the idle `nmcli device monitor` poller with NetworkManager dispatcher hooks and records the kernel/VFS tweaks that were A/B tested and rejected. Runtime Wi-Fi listen-interval, modem DRX and DSDS secondary-SIM power policies are configurable in `/etc/bananarchy-power-policy.conf`; see `MANUAL.md`. +- **Mainline Linux 6.12 kernel**: custom patches and out-of-tree drivers for Qualcomm **Adreno 304 (`FD304`, 96 KB GMEM)** 3D GPU acceleration (`drm/msm` + `qcom-iommu`), Qualcomm QDSP6/Q6Voice audio routing, Dual-SIM modem control, the rear 2MP GalaxyCore `GC2395` / `GC2385` / `GC2365` camera (`/dev/video0`), the `SY7807` flashlight LED (`white:torch`), physical keypad/slider events, and clean PM8909 poweroff. The kernel image is built from `config-bananarchy-msm8909.armv7` with the known-good pmaports module ABI, and ships with idle-blanking power management; `BATTERY-OPTIMIZATION-ANALYSIS.md` records the measured idle state and explains why suspend-to-RAM is unavailable on this firmware (PSCI `SYSTEM_SUSPEND` missing) and why a full custom module tree rebuild is not worthwhile. Section 17 adds the `a1108` re-analysis and two low-risk wins: the active zram swap now uses `lz4` instead of `zramstart`'s `zstd` default, and `vm.compaction_proactiveness=0` removes ~2 `kcompactd0` wakeups/s. Section 18 replaces the idle `nmcli device monitor` poller with NetworkManager dispatcher hooks and records the kernel/VFS tweaks that were A/B tested and rejected. Runtime Wi-Fi listen-interval, modem DRX and DSDS secondary-SIM power policies are configurable in `/etc/bananarchy-power-policy.conf`; see `MANUAL.md`. - **Alpine Linux Edge base**: full access to the Alpine package ecosystem with `< 95 MB` idle RAM usage on 512 MB devices and full local root access out of the box. - **Network time synchronisation**: `chronyd` uses `iburst` with long `minpoll 12 maxpoll 16` polls; `bananarchy-time-sync.sh` re-resolves the NTP pool and requests an immediate burst over chronyd's root-only Unix socket when NetworkManager brings a connection up, so the clock is set within seconds of boot or a Wi-Fi reconnect without shortening the battery-friendly steady-state interval. **Config -> Sync net time** forces a burst manually and reports the result when autosync is slow. The status bar clock is also refreshed synchronously on unlock and by dmenu itself, so it cannot show a stale pre-lock time. See `MANUAL.md` section 5.7. - **Pure X11 graphical stack with GPU acceleration**: cross-compiled **Xlibre** (`X11Libre/xserver`) display server offloading 2D/3D screen rendering to the **Adreno 304 GPU** via **Glamor, DRI3, GLX, and Mesa Freedreno (`FD304`, OpenGL 3.1 / OpenGL ES 3.0)** over `panel-mipi-dbi` KMSRO, paired with a customized **Sxmo (`sxmo-de-dwm`)** window manager (`240x320` vertical stack layout, native `ParentRelative` desktop clock and softkey bar without Conky overhead, `< 2 ms` slider/key wake latency, and zero Wayland overhead). diff --git a/overlay/rootfs/etc/issue b/overlay/rootfs/etc/issue index 3728832..1f17c97 100644 --- a/overlay/rootfs/etc/issue +++ b/overlay/rootfs/etc/issue @@ -1,2 +1 @@ -Welcome to Bananarchy Linux @BANANARCHY_VERSION@ (msm8909) on \l - +Welcome to Bananarchy Linux @BANANARCHY_VERSION@ "@BANANARCHY_CODENAME@" (msm8909) on \l diff --git a/overlay/rootfs/etc/motd b/overlay/rootfs/etc/motd index 2fd4b0c..609c001 100644 --- a/overlay/rootfs/etc/motd +++ b/overlay/rootfs/etc/motd @@ -1,6 +1,7 @@ ============================================================ - BANANARCHY LINUX @BANANARCHY_VERSION@ (Qualcomm MSM8905 / MSM8909) - 240x320 Native Sxmo * Multi-Mode T9 * QDSP6 Voice + BANANARCHY LINUX @BANANARCHY_VERSION@ "@BANANARCHY_CODENAME@" + Qualcomm MSM8905 / MSM8909 * 240x320 Native Sxmo + T9 Input * QDSP6 Voice * SmallWeb * NeoUI ------------------------------------------------------------ * Keypad '#' cycles T9 modes: abc / Abc / ABC / Sym / Ctl / 123 * Keypad '*' is Space (hold 450ms for Ctrl+ latch) diff --git a/overlay/rootfs/etc/os-release b/overlay/rootfs/etc/os-release index 93029a8..ac330e7 100644 --- a/overlay/rootfs/etc/os-release +++ b/overlay/rootfs/etc/os-release @@ -1,7 +1,8 @@ -PRETTY_NAME="Bananarchy Linux @BANANARCHY_VERSION@ (msm8909)" +PRETTY_NAME="Bananarchy Linux @BANANARCHY_VERSION@ \"@BANANARCHY_CODENAME@\" (msm8909)" NAME="Bananarchy" VERSION_ID="@BANANARCHY_VERSION@" VERSION="@BANANARCHY_VERSION@ (msm8909)" +VERSION_CODENAME="@BANANARCHY_CODENAME@" ID="bananarchy" ID_LIKE="postmarketos alpine" HOME_URL="https://bananarchy.top" diff --git a/overlay/rootfs/usr/lib/os-release b/overlay/rootfs/usr/lib/os-release new file mode 100644 index 0000000..ac330e7 --- /dev/null +++ b/overlay/rootfs/usr/lib/os-release @@ -0,0 +1,12 @@ +PRETTY_NAME="Bananarchy Linux @BANANARCHY_VERSION@ \"@BANANARCHY_CODENAME@\" (msm8909)" +NAME="Bananarchy" +VERSION_ID="@BANANARCHY_VERSION@" +VERSION="@BANANARCHY_VERSION@ (msm8909)" +VERSION_CODENAME="@BANANARCHY_CODENAME@" +ID="bananarchy" +ID_LIKE="postmarketos alpine" +HOME_URL="https://bananarchy.top" +SUPPORT_URL="https://bananarchy.top" +BUG_REPORT_URL="https://bananarchy.top" +LOGO="bananarchy" +ANSI_COLOR="1;33" diff --git a/prepare-release.sh b/prepare-release.sh index c717d72..84aafc3 100755 --- a/prepare-release.sh +++ b/prepare-release.sh @@ -1,12 +1,16 @@ #!/bin/sh # Release archive builder for Bananarchy -BA_TARGET="$1" -BA_VER=$(cat rootfs/etc/os-release | grep VERSION_ID | cut -f 2 -d '"') -RELDIR="bananarchy-${BA_TARGET}-${BA_VER}" -./rebuild-image.sh $BA_TARGET -mkdir $RELDIR -cp images/bananarchy-${BA_TARGET}.img ${RELDIR}/ -cp bootloader/lk2nd-msm8909.img ${RELDIR}/ -zip -9r ${RELDIR}.zip $RELDIR -rm -rf $RELDIR -echo "Release $BA_VER for $BA_TARGET packed into ${RELDIR}.zip" +set -eu + +BA_TARGET="${1:-nokia-argon}" +BA_VER="$(./scripts/version.sh --print)" +BA_CODENAME="$(./scripts/version.sh --print-codename)" +RELDIR="bananarchy-${BA_TARGET}-${BA_VER}-${BA_CODENAME}" + +./rebuild-image.sh "$BA_TARGET" --mkinitfs +mkdir -p "$RELDIR" +cp "images/bananarchy-${BA_TARGET}.img" "$RELDIR/" +cp bootloader/lk2nd-msm8909.img "$RELDIR/" +zip -9r "${RELDIR}.zip" "$RELDIR" +rm -rf "$RELDIR" +echo "Release $BA_VER ($BA_CODENAME) for $BA_TARGET packed into ${RELDIR}.zip" diff --git a/rebuild-image.sh b/rebuild-image.sh index c7fae87..77b34a7 100755 --- a/rebuild-image.sh +++ b/rebuild-image.sh @@ -121,6 +121,7 @@ if [ -x "$BANANARCHY_DIR/scripts/apply-bananarchy-overlay.sh" ]; then fi BANANARCHY_VERSION="$("$BANANARCHY_DIR/scripts/version.sh" --print)" +BANANARCHY_CODENAME="$("$BANANARCHY_DIR/scripts/version.sh" --print-codename)" "$BANANARCHY_DIR/scripts/version.sh" "$ROOTFS_HOST" >/dev/null exec docker run --rm --network=host \ @@ -129,6 +130,7 @@ exec docker run --rm --network=host \ -e TARGET_DEVICE="$TARGET_DEVICE" \ -e RUN_MKINITFS="$RUN_MKINITFS" \ -e BANANARCHY_VERSION="$BANANARCHY_VERSION" \ + -e BANANARCHY_CODENAME="$BANANARCHY_CODENAME" \ -v "$ROOTFS_HOST:/rootfs" \ -v "$IMAGES_HOST:/images" \ -v "$BANANARCHY_DIR:/bananarchy:ro" \ @@ -176,7 +178,7 @@ EOF } echo "============================================================" - echo "Building Bananarchy Linux $BANANARCHY_VERSION (Sxmo 240x320) for: $TARGET_DEVICE" + echo "Building Bananarchy Linux $BANANARCHY_VERSION ($BANANARCHY_CODENAME) (Sxmo 240x320) for: $TARGET_DEVICE" echo "Source rootfs: $ROOTFS" echo "============================================================" diff --git a/scripts/check-rebuild.sh b/scripts/check-rebuild.sh index 4024535..13cac87 100755 --- a/scripts/check-rebuild.sh +++ b/scripts/check-rebuild.sh @@ -302,9 +302,21 @@ if ! command -v docker >/dev/null 2>&1; then fi echo "[check] Version helper..." -if ! "$BASE_DIR/scripts/version.sh" --print >/dev/null 2>&1; then - fail "scripts/version.sh --print failed" +VERSION="$("$BASE_DIR/scripts/version.sh" --print 2>/dev/null || true)" +CODENAME="$("$BASE_DIR/scripts/version.sh" --print-codename 2>/dev/null || true)" +if [ "$VERSION" != "a1108" ]; then + fail "scripts/version.sh --print must return a1108" fi +if [ "$CODENAME" != "dejavu" ]; then + fail "scripts/version.sh --print-codename must return dejavu" +fi +for f in overlay/rootfs/etc/os-release overlay/rootfs/usr/lib/os-release overlay/rootfs/etc/issue overlay/rootfs/etc/motd; do + if [ ! -f "$BASE_DIR/$f" ]; then + fail "missing $f" + elif ! grep -q '@BANANARCHY_VERSION@' "$BASE_DIR/$f" || ! grep -q '@BANANARCHY_CODENAME@' "$BASE_DIR/$f"; then + fail "$f lost its version/codename placeholders" + fi +done if [ "$FAILURES" -ne 0 ]; then echo "[check] $FAILURES check(s) failed." diff --git a/scripts/version.sh b/scripts/version.sh index e5880c1..dd12d44 100755 --- a/scripts/version.sh +++ b/scripts/version.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Compute and apply the Bananarchy Linux release version: +# Compute and apply the Bananarchy Linux release version and codename: #
# where is 'a'..'z' for (year - 2026) mod 26 (2026 = 'a'), # followed by the two-digit local month and two-digit local day. @@ -15,10 +15,25 @@ LETTER_IDX=$(( ((YEAR - 2026) % 26 + 26) % 26 )) YEAR_LETTER="$(printf "\\$(printf '%03o' $(( 97 + LETTER_IDX )))")" VERSION="${BANANARCHY_VERSION:-${YEAR_LETTER}${MONTH}${DAY}}" +case "$VERSION" in + a1108) DEFAULT_CODENAME=dejavu ;; + a1105) DEFAULT_CODENAME=vendetta ;; + a1031) DEFAULT_CODENAME=myers ;; + a1028) DEFAULT_CODENAME=ladyjava ;; + a1027) DEFAULT_CODENAME=bonkers ;; + a1025) DEFAULT_CODENAME=argonaut ;; + *) DEFAULT_CODENAME=unknown ;; +esac +CODENAME="${BANANARCHY_CODENAME:-$DEFAULT_CODENAME}" + if [ "${1:-}" = "--print" ] || [ "${1:-}" = "-p" ]; then printf '%s\n' "$VERSION" exit 0 fi +if [ "${1:-}" = "--print-codename" ] || [ "${1:-}" = "-c" ]; then + printf '%s\n' "$CODENAME" + exit 0 +fi TARGET_ROOTFS="${1:-${ROOTFS_DIR:-$BASE_DIR/rootfs}}" @@ -27,20 +42,23 @@ apply_template() { dst_file="$2" if [ -f "$src_tpl" ]; then mkdir -p "$(dirname "$dst_file")" - sed "s/@BANANARCHY_VERSION@/$VERSION/g" "$src_tpl" > "$dst_file" + sed -e "s/@BANANARCHY_VERSION@/$VERSION/g" \ + -e "s/@BANANARCHY_CODENAME@/$CODENAME/g" \ + "$src_tpl" > "$dst_file" elif [ -f "$dst_file" ]; then sed -i -E \ -e "s/@BANANARCHY_VERSION@/$VERSION/g" \ + -e "s/@BANANARCHY_CODENAME@/$CODENAME/g" \ -e "s/v0\.0\.1/$VERSION/g" \ "$dst_file" fi } if [ -d "$TARGET_ROOTFS" ]; then - for rel in etc/os-release etc/issue etc/motd; do + for rel in etc/os-release usr/lib/os-release etc/issue etc/motd; do apply_template "$BASE_DIR/overlay/rootfs/$rel" "$TARGET_ROOTFS/$rel" done - echo "Applied Bananarchy version $VERSION to $TARGET_ROOTFS" + echo "Applied Bananarchy version $VERSION ($CODENAME) to $TARGET_ROOTFS" else printf '%s\n' "$VERSION" fi