Files
bananarchy/scripts/version.sh
T
Luxferre 83c8db10f1 Release a1111 (lennon): isolate nokia-argon slider from 2720 Flip cover stack
- Write /usr/share/bananarchy/lid-profile per target in apply-bananarchy-overlay.sh (slider on nokia-argon, flip on nokia-beatles, none elsewhere), disable flip runlevel services, cover udev/config, and mux module loads on non-flip builds, and exit 0 immediately in flip daemons/init scripts when lid-profile != flip
- Guard startup Escape grab cleanup when locked and gate lid-state checks in display-power-sync, locker.so, and callscreen.so on lid-profile == flip so nokia-argon keeps pure a1108 sliding-lid behaviour
- Ship active-high shared cover backlight (kernel_backlight_invert = 0), active-black internal panel isolation (kernel_internal_sleep = 0), pixel-centered 240x240 cover UI, SW_LID hall sync, and shared Screen blank timeout on nokia-beatles
- Pin verified a1111 (lennon) image hashes for both nokia-argon and nokia-beatles and synchronize docs and host tests
2026-11-11 14:20:42 +02:00

66 lines
1.9 KiB
Bash
Executable File

#!/bin/sh
# Compute and apply the Bananarchy Linux release version and codename:
# <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}}"
case "$VERSION" in
a1111) DEFAULT_CODENAME=lennon ;;
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}}"
apply_template() {
src_tpl="$1"
dst_file="$2"
if [ -f "$src_tpl" ]; then
mkdir -p "$(dirname "$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 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 ($CODENAME) to $TARGET_ROOTFS"
else
printf '%s\n' "$VERSION"
fi