build: add date-based release versioning script and remove hardcoded version

This commit is contained in:
Luxferre
2026-10-22 20:20:16 +03:00
parent 48aaacf04f
commit b12cd738af
9 changed files with 61 additions and 9 deletions
+1
View File
@@ -29,6 +29,7 @@ All cross-compilation scripts run inside rootless Docker (`alpine:3.24` `armv7`
- `./scripts/build-xlibre.sh` — Builds Xlibre `Xorg` and `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 (`<year-letter><MM><DD>` with `2026 = a`) and substitutes `@BANANARCHY_VERSION@` in `etc/os-release`, `etc/issue`, and `etc/motd` (invoked automatically during overlay application and image builds).
- `./chroot-shell.sh` — Opens an `armv7` container shell to manage packages in `rootfs/` (`pkg-add`, `pkg-del`, `pkg-search`).
- `./rebuild-image.sh <device> [--mkinitfs]` — Applies `overlay/rootfs/` + `prebuilt/` into `rootfs/` and produces flashable images in `images/`.
- `sudo ./flash-edl.sh [device]` — Flashes `lk2nd` and the system image over Qualcomm USB EDL (`05c6:9008`).
+1 -1
View File
@@ -2,7 +2,7 @@
![Bananarchy Banner](artwork/banner-800x240.png)
This manual covers flashing, operating, and customizing **Bananarchy Linux** (`v0.0.1`, Sxmo `240x320` native edition) on **Qualcomm MSM8905 / MSM8909** Nokia feature phones:
This manual covers flashing, operating, and customizing **Bananarchy Linux** (Sxmo `240x320` native edition) on **Qualcomm MSM8905 / MSM8909** Nokia feature phones:
- **Nokia 8110 4G (`nokia-argon`)**
- **Nokia 2720 Flip (`nokia-beatles`)**
- **Nokia 800 Tough (`nokia-tough` / `nokia-coconut`)**
-2
View File
@@ -30,8 +30,6 @@ Bananarchy targets an ultra-lightweight **Sxmo X11 (`sxmo-de-dwm`)** environment
- **Pre-integrated Bantam AI agent**: cross-compiled from `https://code.luxferre.top/luxferre/bantam-cpp` and integrated into the Sxmo **Apps** menu (`Applications -> Bantam`, launching in an `st` terminal with `$HOME` as its default working directory).
- **Complete on-device development & scripting stack**: `git`, `gcc`/`g++`, `make`, GNU `coreutils`, `nano` (`$EDITOR`, pre-configured in `/etc/nanorc` with `-FEDSMAGic/max%_T2`), `ed`, `less` (`$PAGER="less -RXF"`), `rlwrap`, `frotz` (Z-machine interactive fiction interpreter), `janet` + `jpm`, `perl` + `IO::Socket::SSL`, `tcl` + `tcllib`/`tcl-tls`/`sqlite-tcl`, `sqlite`, `i2c-tools`, and `v4l-utils`.
The current Bananarchy version is `v0.0.1`.
---
## Supported MSM8909 / MSM8905 devices
+1 -1
View File
@@ -1,2 +1,2 @@
Welcome to Bananarchy Linux v0.0.1 (msm8909) on \l
Welcome to Bananarchy Linux @BANANARCHY_VERSION@ (msm8909) on \l
+1 -1
View File
@@ -1,5 +1,5 @@
============================================================
BANANARCHY LINUX v0.0.1 (Qualcomm MSM8905 / MSM8909)
BANANARCHY LINUX @BANANARCHY_VERSION@ (Qualcomm MSM8905 / MSM8909)
240x320 Native Sxmo * Multi-Mode T9 * QDSP6 Voice
------------------------------------------------------------
* Keypad '#' cycles T9 modes: abc / Abc / ABC / Sym / Ctl / 123
+3 -3
View File
@@ -1,7 +1,7 @@
PRETTY_NAME="Bananarchy Linux v0.0.1 (msm8909)"
PRETTY_NAME="Bananarchy Linux @BANANARCHY_VERSION@ (msm8909)"
NAME="Bananarchy"
VERSION_ID="v0.0.1"
VERSION="v0.0.1 (msm8909)"
VERSION_ID="@BANANARCHY_VERSION@"
VERSION="@BANANARCHY_VERSION@ (msm8909)"
ID="bananarchy"
ID_LIKE="postmarketos alpine"
HOME_URL="https://bananahackers.net/"
+5 -1
View File
@@ -55,11 +55,15 @@ if [ -x "$BANANARCHY_DIR/scripts/apply-bananarchy-overlay.sh" ]; then
"$BANANARCHY_DIR/scripts/apply-bananarchy-overlay.sh" "$ROOTFS_HOST" "$TARGET_DEVICE"
fi
BANANARCHY_VERSION="$("$BANANARCHY_DIR/scripts/version.sh" --print)"
"$BANANARCHY_DIR/scripts/version.sh" "$ROOTFS_HOST" >/dev/null
exec docker run --rm --network=host \
-e HOST_UID="$(id -u)" \
-e HOST_GID="$(id -g)" \
-e TARGET_DEVICE="$TARGET_DEVICE" \
-e RUN_MKINITFS="$RUN_MKINITFS" \
-e BANANARCHY_VERSION="$BANANARCHY_VERSION" \
-v "$ROOTFS_HOST:/rootfs" \
-v "$IMAGES_HOST:/images" \
-v "$BANANARCHY_DIR:/bananarchy:ro" \
@@ -92,7 +96,7 @@ EOF
ROOT_UUID="a1b2c3d4-8110-4000-8000-000000000002"
echo "============================================================"
echo "Building Bananarchy Linux (Sxmo 240x320) for: $TARGET_DEVICE"
echo "Building Bananarchy Linux $BANANARCHY_VERSION (Sxmo 240x320) for: $TARGET_DEVICE"
echo "Source rootfs: $ROOTFS"
echo "============================================================"
+3
View File
@@ -42,6 +42,9 @@ esac
echo "[1/4] Installing Bananarchy rootfs overlay (artwork, branding, Sxmo 240x320, UCM, udev)..."
rm -f "$TARGET_ROOTFS/usr/bin/bantam" "$TARGET_ROOTFS/usr/local/bin/bantam" "$TARGET_ROOTFS/etc/doas.d/wheel.conf"
cp -af "$BASE_DIR/overlay/rootfs/." "$TARGET_ROOTFS/"
if [ -x "$BASE_DIR/scripts/version.sh" ]; then
"$BASE_DIR/scripts/version.sh" "$TARGET_ROOTFS"
fi
chown -R 10000:10000 "$TARGET_ROOTFS/home/user" 2>/dev/null || true
chown 0:0 "$TARGET_ROOTFS/etc/doas.d/50-sxmo.conf" 2>/dev/null || true
chmod 640 "$TARGET_ROOTFS/etc/doas.d/50-sxmo.conf" 2>/dev/null || true
+46
View File
@@ -0,0 +1,46 @@
#!/bin/sh
# Compute and apply the Bananarchy Linux release version:
# <year-letter><MM><DD>
# where <year-letter> is 'a'..'z' for (year - 2026) mod 26 (2026 = 'a'),
# followed by the two-digit local month and two-digit local day.
set -eu
BASE_DIR="$(cd "$(dirname "$0")/.." && pwd)"
YEAR="$(date +%Y)"
MONTH="$(date +%m)"
DAY="$(date +%d)"
LETTER_IDX=$(( ((YEAR - 2026) % 26 + 26) % 26 ))
YEAR_LETTER="$(printf "\\$(printf '%03o' $(( 97 + LETTER_IDX )))")"
VERSION="${BANANARCHY_VERSION:-${YEAR_LETTER}${MONTH}${DAY}}"
if [ "${1:-}" = "--print" ] || [ "${1:-}" = "-p" ]; then
printf '%s\n' "$VERSION"
exit 0
fi
TARGET_ROOTFS="${1:-${ROOTFS_DIR:-$BASE_DIR/rootfs}}"
apply_template() {
src_tpl="$1"
dst_file="$2"
if [ -f "$src_tpl" ]; then
mkdir -p "$(dirname "$dst_file")"
sed "s/@BANANARCHY_VERSION@/$VERSION/g" "$src_tpl" > "$dst_file"
elif [ -f "$dst_file" ]; then
sed -i -E \
-e "s/@BANANARCHY_VERSION@/$VERSION/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
apply_template "$BASE_DIR/overlay/rootfs/$rel" "$TARGET_ROOTFS/$rel"
done
echo "Applied Bananarchy version $VERSION to $TARGET_ROOTFS"
else
printf '%s\n' "$VERSION"
fi