Scope check-rebuild.sh by target and refresh a1120 images

This commit is contained in:
Luxferre committed 2026-11-16 22:19:04 +02:00
1 parent edc8c5a6fc
commit 0030dc3910
6 files changed
+180 -47

No files matched your search

+9 -4
View File
@@ -58,13 +58,18 @@ Upcoming release build (`a1120` / `cocojamboo` via `scripts/version.sh`) targeti
- **Eliminate Stage 2 `udevd` missing-module console errors**: added executable hook `overlay/rootfs/etc/boot-deploy/hooks/10-initramfs-depmod.sh` so `boot-deploy` unpacks each staged `initramfs` cpio archive, runs `depmod -b` against its `6.12.1-msm8916` module subset (`27` modules on `nokia-argon`, `30` on `nokia-beatles`), verifies every `modules.dep` entry exists in the archive, and repacks it before creating `boot.img` or copying `/boot/initramfs`. This eliminates the `<27>` `udevd` `No such file or directory` boot console errors on `qcom_pil_info.ko.zst` and `snd-soc-qcom-common.ko.zst`.
- **Module install hygiene, Alpine 3.24 chroot `depmod` libs, and image verification**: updated `scripts/apply-bananarchy-overlay.sh` to remove stale uncompressed `.ko` files and copy only `*.ko.zst` across all prebuilt module directories; updated `rebuild-image.sh` to stage `libz.so*` and `libcrypto.so*` from both `/lib/` and `/usr/lib/` (`-aL`) into `/tmp/hostbin/` with guaranteed chroot failure cleanup; added initramfs cpio `modules.dep`/`modules.alias` and `.ko*` guards in `scripts/check-rebuild.sh`; earlier intermediate `a1114` builds are superseded by the `a1120` / `cocojamboo` images below.
### Target-scoped rebuild preflight and `dtc` / clean-clone guards
- **Target-scoped `scripts/check-rebuild.sh [target]` preflight (`rebuild-image.sh`, `scripts/check-rebuild.sh`)**: added positional / `--device` / `--target` filtering (`check_target()`, `artifact_matches_target()`) and `--for-rebuild` mode so `./rebuild-image.sh <target>` validates invariants for `<target>` without enforcing unrelated `nokia-beatles`, `nokia-argon`, or `nokia-sparkler` hardware checks on `nokia-coconut`, while plain `./scripts/check-rebuild.sh` still checks all targets and pinned image hashes.
- **Cross-version `dtc`, host tool, and clean-clone guards (`scripts/check-rebuild.sh`, `scripts/build-beatles-no-cover-dtb.py`)**: guarded the remaining `nokia-beatles` `dtc` and `gcc` invocations, replaced the hardcoded `/tmp/bantam/...` cover scratch directory with `mktemp -d`, skipped gitignored `keys/phone_id_ed25519.pub` comparisons on clean clones, and normalized `\0`-delimited `dtc -I dtb -O dts` multi-string arrays in rollback/DTB validation.
### Image persistence and upcoming `a1120` (`cocojamboo`) release archives
- **Verified `a1120` / `cocojamboo` image set (`--mkinitfs`) and packaged archives**:
- `images/bananarchy-nokia-argon.img`: SHA-256 `640127f7d49e25906df1d9bb9e63fb2c07374bfa908092658d0e763c7ac87a94` (packaged in `bananarchy-nokia-argon-a1120-cocojamboo.zip`, SHA-256 `80c1284f5f8ba305065085ed9e4cb5e2494797ab21a2aeb6582d2f43cca21145`, alongside `bootloader/lk2nd-msm8909.img`).
- `images/bananarchy-nokia-beatles.img`: SHA-256 `289698c31daf25adceba6af8fcdc93cd85673d0a24faf5c848ef0c0bb659fab7`, `images/boot-bananarchy-nokia-beatles.img`: SHA-256 `cc0678bcdcd3fbafe54a4e5236f104d647dd6965aa05dfe4de56217095b8eba8`, and `images/boot-lk2nd-nokia-beatles-display.img`: SHA-256 `b5549698c20f4de7603fc746d32bb5baa96ec377e41e74407823c98506fc185d` (packaged in `bananarchy-nokia-beatles-a1120-cocojamboo.zip`, SHA-256 `dfb10c9938c586cc89939f667ecb005a34bad9eb29903b33b6c6e9f2996c963e`).
- `images/bananarchy-nokia-coconut.img`: SHA-256 `1f36243dc318fb024650c55e64202941c761227bf528fbb3128a1b5063eead0d`, `images/boot-bananarchy-nokia-coconut.img`: SHA-256 `e38cba2eaf502eaccf4c6b8b4b3dc97145cde1aefed940546385793ef25035e0`, and `images/boot-lk2nd-nokia-coconut-display.img`: SHA-256 `e876424b38b0782f589756b4107337b24f27f7c37d624cc7d3907a5331df050a` (packaged in `bananarchy-nokia-coconut-a1120-cocojamboo.zip`, SHA-256 `f68d3703f7e8d89602a7181b71c233a3a5c3bfa2c625fa0ddb0aded304d7344b`).
- `images/bananarchy-nokia-sparkler.img`: SHA-256 `170e1ef659755b7c10571a926211ff14352e194eaf92ecc8177c04003936091d`, `images/boot-bananarchy-nokia-sparkler.img`: SHA-256 `8ebfb07dd3d3a5108e47962e90a4594c43e66343986175791097542828d016e3`, and `images/boot-lk2nd-nokia-sparkler-display.img`: SHA-256 `bc41c2ddd1079246a7e91a40222fcafb82b0b52965c8ee8081872767d006748f` (packaged in `bananarchy-nokia-sparkler-a1120-cocojamboo.zip`, SHA-256 `895cc86195c6e55d46f256cb559c1a8bcb06f38de2420157d00fd3730f135dd0`).
- `images/bananarchy-nokia-argon.img`: SHA-256 `6b5c17059bf0341fdeb84c85dca08e64eb6b634e71add27fb9b7a93d17fb7ed8` (packaged in `bananarchy-nokia-argon-a1120-cocojamboo.zip`, SHA-256 `5b5c9eb85992a4531e960d3f00e4551366ec9abcf787f521e3400e81e5a8cbc5`, alongside `bootloader/lk2nd-msm8909.img`).
- `images/bananarchy-nokia-beatles.img`: SHA-256 `c6dad8d28ab3ab478869a0adb78dac1af4e19c111ab60a066687656c103e5723`, `images/boot-bananarchy-nokia-beatles.img`: SHA-256 `4fd4b19d525677b2e2880346b391d9a13447d62f8ad61ee0088421a100ec08dc`, and `images/boot-lk2nd-nokia-beatles-display.img`: SHA-256 `b5549698c20f4de7603fc746d32bb5baa96ec377e41e74407823c98506fc185d` (packaged in `bananarchy-nokia-beatles-a1120-cocojamboo.zip`, SHA-256 `476dd86e7078488126c08151a586cebc94f52a03d588cb0b18d7589430cee252`).
- `images/bananarchy-nokia-coconut.img`: SHA-256 `77addc7d48e40cdd017dc247969131e9ab7bc87ad590faf879d36c03b66df65c`, `images/boot-bananarchy-nokia-coconut.img`: SHA-256 `a5869b63de5cbfca3f6d87583aba162023670945f69a57276b597e1a7b85c5b2`, and `images/boot-lk2nd-nokia-coconut-display.img`: SHA-256 `e876424b38b0782f589756b4107337b24f27f7c37d624cc7d3907a5331df050a` (packaged in `bananarchy-nokia-coconut-a1120-cocojamboo.zip`, SHA-256 `70b6330654490843c07e9a47b5d509811038f5152d8030fdb8740437485e2df6`).
- `images/bananarchy-nokia-sparkler.img`: SHA-256 `a41a6ed4c2a04d521cf44d5229680f292972a4fc06ff3ad177cc3a13659295d1`, `images/boot-bananarchy-nokia-sparkler.img`: SHA-256 `e950788360e1044d5ef128d1a170b868620aa5c356354aa6ac7178218e4d8e38`, and `images/boot-lk2nd-nokia-sparkler-display.img`: SHA-256 `bc41c2ddd1079246a7e91a40222fcafb82b0b52965c8ee8081872767d006748f` (packaged in `bananarchy-nokia-sparkler-a1120-cocojamboo.zip`, SHA-256 `1e1c1f9f28b8d891b25701a01baeaebb54dee3368f40e6e12564fc53243a76a4`).
---
+2 -2
View File
@@ -663,13 +663,13 @@ bananarchy-gps-time-sync.sh status # source, last fix, modem capabili
A fresh `git clone` is enough to produce a flashable image. Docker, Python 3, and network access are the only host requirements; no pre-existing `rootfs/`, `images/`, or EDL checkout is needed.
```bash
./scripts/check-rebuild.sh # optional offline preflight
./scripts/check-rebuild.sh [target] # optional offline preflight (all targets by default)
./rebuild-image.sh nokia-argon # builds images/bananarchy-nokia-argon.img
```
`rebuild-image.sh` runs the following steps automatically:
1. Verifies shell and Python syntax, the `armv7` package list, plugin artifacts, overlay sync, and the ignored local agent config (`scripts/check-rebuild.sh`).
1. Verifies shell and Python syntax, the `armv7` package list, plugin artifacts, overlay sync, the ignored local agent config, and target-scoped invariants (`scripts/check-rebuild.sh <target>`; running `scripts/check-rebuild.sh` with no arguments validates all targets).
2. Mirrors `prebuilt/` into `overlay/rootfs/` (`scripts/sync-prebuilt-overlay.sh`).
3. Creates a complete `armv7` rootfs from `scripts/rootfs-packages.txt` when `rootfs/` is missing or stale (`scripts/bootstrap-rootfs.sh`), including system accounts, OpenRC runlevels, base configuration, the overlay, and prebuilt kernel modules.
4. Applies the overlay, regenerates the initramfs with `mkinitfs`, and assembles the partitioned MBR image in `images/`.
+2 -2
View File
@@ -130,13 +130,13 @@ bananarchy/
A fresh `git clone` contains everything required to produce a flashable image. Docker, Python 3, and network access are the only host requirements:
```bash
./scripts/check-rebuild.sh # optional offline preflight
./scripts/check-rebuild.sh [target] # optional offline preflight (all targets by default)
./rebuild-image.sh nokia-argon # bootstraps rootfs/, then builds images/
```
`rebuild-image.sh` performs the whole pipeline without manual preparation:
1. Runs `scripts/check-rebuild.sh` to validate shell and Python syntax, the package list, plugin artifacts, overlay sync, and the ignored local agent config.
1. Runs `scripts/check-rebuild.sh <target>` to validate shell and Python syntax, the package list, plugin artifacts, overlay sync, the ignored local agent config, and checks scoped to the requested device (passing no argument validates all targets).
2. Mirrors `prebuilt/` into `overlay/rootfs/` with `scripts/sync-prebuilt-overlay.sh` so the tracked overlay snapshot never drifts.
3. Creates a complete `armv7` rootfs from `scripts/rootfs-packages.txt` when `rootfs/` is missing or stale, using `scripts/bootstrap-rootfs.sh` (rootless Docker, Alpine `edge` and postmarketOS `v26.06` repositories, and the trusted keys in `keys/`).
4. Applies the overlay and prebuilt artifacts, regenerates the initramfs, and writes `images/bananarchy-<device>.img`.
+1 -1
View File
@@ -121,7 +121,7 @@ ensure_prebuilt_artifacts
"$BANANARCHY_DIR/scripts/sync-prebuilt-overlay.sh"
# Verify that this clone can rebuild before touching any rootfs data.
"$BANANARCHY_DIR/scripts/check-rebuild.sh"
"$BANANARCHY_DIR/scripts/check-rebuild.sh" --for-rebuild "$TARGET_DEVICE"
# Create a complete armv7 rootfs from scratch when it is missing or stale.
"$BANANARCHY_DIR/scripts/bootstrap-rootfs.sh" "$ROOTFS_HOST" "$TARGET_DEVICE"
+1 -1
View File
@@ -38,7 +38,7 @@ def main():
if proc.returncode:
sys.stderr.write("FAIL: %s\n%s" % (" ".join(cmd), proc.stderr))
return 1
text = dec.read_text(encoding="utf-8", errors="replace")
text = dec.read_text(encoding="utf-8", errors="replace").replace(r"\0", '", "')
for token in ('display@0 {', 'spidev@1 {', 'status = "okay";',
'qcom,msm-id = <0x14b 0x00>;',
'reg = <0x80000000 0x20000000>;'):
+165 -37
View File
@@ -5,6 +5,76 @@ set -eu
BASE_DIR="$(cd "$(dirname "$0")/.." && pwd)"
FAILURES=0
TARGET_FILTER="${BANANARCHY_CHECK_TARGET:-all}"
SKIP_PINNED_HASHES=0
while [ "$#" -gt 0 ]; do
case "$1" in
--for-rebuild)
SKIP_PINNED_HASHES=1
;;
--target|--device)
shift
if [ "$#" -eq 0 ]; then
echo "Usage: $0 [--for-rebuild] [--device <target>|all|nokia-argon|nokia-beatles|nokia-coconut|nokia-sparkler|nokia-leo]" >&2
exit 1
fi
TARGET_FILTER="$1"
;;
--target=*|--device=*)
TARGET_FILTER="${1#*=}"
;;
*)
TARGET_FILTER="$1"
;;
esac
shift
done
case "$TARGET_FILTER" in
""|all|sxmo)
TARGET_FILTER="all"
;;
nokia-argon|argon)
TARGET_FILTER="nokia-argon"
;;
nokia-beatles|beatles)
TARGET_FILTER="nokia-beatles"
;;
nokia-coconut|nokia-tough|coconut|tough)
TARGET_FILTER="nokia-coconut"
;;
nokia-sparkler|sparkler)
TARGET_FILTER="nokia-sparkler"
;;
nokia-leo|leo)
TARGET_FILTER="nokia-leo"
;;
*)
echo "Usage: $0 [--device <target>|all|nokia-argon|nokia-beatles|nokia-coconut|nokia-sparkler|nokia-leo]" >&2
exit 1
;;
esac
check_target() {
[ "$TARGET_FILTER" = "all" ] && return 0
for _target in "$@"; do
[ "$TARGET_FILTER" = "$_target" ] && return 0
done
return 1
}
artifact_matches_target() {
[ "$TARGET_FILTER" = "all" ] && return 0
case "$1" in
*nokia-argon*) check_target nokia-argon ;;
*nokia-beatles*) check_target nokia-beatles ;;
*nokia-coconut*) check_target nokia-coconut ;;
*nokia-leo*) check_target nokia-leo ;;
*nokia-sparkler*) check_target nokia-sparkler nokia-leo ;;
*) return 0 ;;
esac
}
fail() {
echo "FAIL: $1"
FAILURES=$((FAILURES + 1))
@@ -258,6 +328,7 @@ fi
if ! grep -q 'if method == "lk2nd" and device in DEVICE_LK2ND_IMAGES:' "$BASE_DIR/flash-edl.py"; then
fail "flash-edl.py no longer writes lk2nd to both slots on 2720/800 Tough"
fi
if check_target nokia-beatles; then
for variant in normal diagnostic display; do
case "$variant" in
normal)
@@ -286,6 +357,7 @@ for variant in normal diagnostic display; do
fail "$label validation failed"
fi
done
fi
if ! grep -qF 'BEATLES_LK2ND_IMAGE = "images/boot-lk2nd-nokia-beatles-display.img"' \
"$BASE_DIR/flash-edl.py"; then
fail "flash-edl.py no longer defaults to the display-enabled lk2nd image"
@@ -322,6 +394,7 @@ if ! grep -qF 'SPARKLER_LK2ND_IMAGE = "images/boot-lk2nd-nokia-sparkler-display.
"$BASE_DIR/flash-edl.py"; then
fail "flash-edl.py no longer references the display-enabled sparkler lk2nd image"
fi
if check_target nokia-coconut; then
for variant in normal diagnostic display; do
case "$variant" in
normal)
@@ -350,6 +423,8 @@ for variant in normal diagnostic display; do
fail "$label validation failed"
fi
done
fi
if check_target nokia-sparkler nokia-leo; then
for variant in normal diagnostic display; do
case "$variant" in
normal)
@@ -378,6 +453,7 @@ for variant in normal diagnostic display; do
fail "$label validation failed"
fi
done
fi
if [ -f "$BASE_DIR/scripts/make-beatles-lk2nd-bootimg.py" ]; then
fail "obsolete binary-patch lk2nd script is still present"
fi
@@ -475,24 +551,30 @@ fi
# and by an explicit image build; the overlay script above is the source of
# truth for the applet symlinks, so avoid extracting a 1.3 GiB partition here.
RAW_IMAGE="$BASE_DIR/images/bananarchy-nokia-beatles.img"
if [ -f "$RAW_IMAGE" ] && [ "$(stat -c %s "$RAW_IMAGE")" -lt 1000000000 ]; then
if check_target nokia-beatles && [ -f "$RAW_IMAGE" ] && [ "$(stat -c %s "$RAW_IMAGE")" -lt 1000000000 ]; then
fail "the shipped raw image is truncated"
fi
echo "[check] Known-good flashable image set..."
for pair in \
"640127f7d49e25906df1d9bb9e63fb2c07374bfa908092658d0e763c7ac87a94 images/bananarchy-nokia-argon.img" \
"289698c31daf25adceba6af8fcdc93cd85673d0a24faf5c848ef0c0bb659fab7 images/bananarchy-nokia-beatles.img" \
"cc0678bcdcd3fbafe54a4e5236f104d647dd6965aa05dfe4de56217095b8eba8 images/boot-bananarchy-nokia-beatles.img" \
"6b5c17059bf0341fdeb84c85dca08e64eb6b634e71add27fb9b7a93d17fb7ed8 images/bananarchy-nokia-argon.img" \
"c6dad8d28ab3ab478869a0adb78dac1af4e19c111ab60a066687656c103e5723 images/bananarchy-nokia-beatles.img" \
"4fd4b19d525677b2e2880346b391d9a13447d62f8ad61ee0088421a100ec08dc images/boot-bananarchy-nokia-beatles.img" \
"b5549698c20f4de7603fc746d32bb5baa96ec377e41e74407823c98506fc185d images/boot-lk2nd-nokia-beatles-display.img" \
"1f36243dc318fb024650c55e64202941c761227bf528fbb3128a1b5063eead0d images/bananarchy-nokia-coconut.img" \
"e38cba2eaf502eaccf4c6b8b4b3dc97145cde1aefed940546385793ef25035e0 images/boot-bananarchy-nokia-coconut.img" \
"77addc7d48e40cdd017dc247969131e9ab7bc87ad590faf879d36c03b66df65c images/bananarchy-nokia-coconut.img" \
"a5869b63de5cbfca3f6d87583aba162023670945f69a57276b597e1a7b85c5b2 images/boot-bananarchy-nokia-coconut.img" \
"e876424b38b0782f589756b4107337b24f27f7c37d624cc7d3907a5331df050a images/boot-lk2nd-nokia-coconut-display.img" \
"170e1ef659755b7c10571a926211ff14352e194eaf92ecc8177c04003936091d images/bananarchy-nokia-sparkler.img" \
"8ebfb07dd3d3a5108e47962e90a4594c43e66343986175791097542828d016e3 images/boot-bananarchy-nokia-sparkler.img" \
"a41a6ed4c2a04d521cf44d5229680f292972a4fc06ff3ad177cc3a13659295d1 images/bananarchy-nokia-sparkler.img" \
"e950788360e1044d5ef128d1a170b868620aa5c356354aa6ac7178218e4d8e38 images/boot-bananarchy-nokia-sparkler.img" \
"bc41c2ddd1079246a7e91a40222fcafb82b0b52965c8ee8081872767d006748f images/boot-lk2nd-nokia-sparkler-display.img"; do
set -- $pair
want=$1
artifact_matches_target "$2" || continue
if [ "$SKIP_PINNED_HASHES" -eq 1 ]; then
case "$2" in
images/bananarchy-*.img|images/boot-bananarchy-*.img) continue ;;
esac
fi
path="$BASE_DIR/$2"
if [ ! -f "$path" ]; then
echo "[skip] local build output $2 is absent; prepare-release.sh will rebuild it"
@@ -648,19 +730,24 @@ fi
if ! grep -q 'bananarchy-volume-keys' "$BASE_DIR/overlay/rootfs/etc/init.d/bananarchy-volume-keys"; then
fail "the volume-key service is missing"
fi
if ! grep -q 'spidev@1' "$BASE_DIR/devices/nokia-beatles/qcom-msm8905-nokia-beatles.dts" || \
! dtc -I dtb -O dts "$BASE_DIR/devices/nokia-beatles/qcom-msm8905-nokia-beatles.dtb" 2>/dev/null | \
grep -q 'spidev@1'; then
if check_target nokia-beatles; then
if ! grep -q 'spidev@1' "$BASE_DIR/devices/nokia-beatles/qcom-msm8905-nokia-beatles.dts"; then
fail "the cover panel spidev@1 node is missing from the shipping DTS/DTB"
elif command -v dtc >/dev/null 2>&1 && \
! dtc -q -I dtb -O dts "$BASE_DIR/devices/nokia-beatles/qcom-msm8905-nokia-beatles.dtb" 2>/dev/null | \
sed 's/\\0/", "/g' | grep -q 'spidev@1'; then
fail "the cover panel spidev@1 node is missing from the shipping DTS/DTB"
fi
if ! dtc -I dtb -O dts "$BASE_DIR/devices/nokia-beatles/qcom-msm8905-nokia-beatles.dtb" 2>/dev/null | \
sed -n '/display@0 {/,/^ };/p' | \
if command -v dtc >/dev/null 2>&1 && \
! dtc -q -I dtb -O dts "$BASE_DIR/devices/nokia-beatles/qcom-msm8905-nokia-beatles.dtb" 2>/dev/null | \
sed 's/\\0/", "/g' | sed -n '/display@0 {/,/^ };/p' | \
grep -q 'spi-max-frequency = <0x17d7840>'; then
fail "the beatles main panel lost its 25 MHz high-backlight-safe SPI timing"
fi
if ! grep -q '^dc_gpio = -1' "$BASE_DIR/overlay/rootfs/etc/bananarchy/cover-display.conf"; then
fail "the cover daemon config would collide with the internal panel DC GPIO"
fi
fi
echo "[check] USB SSH access and boot splash..."
PAM_SSHD="$BASE_DIR/overlay/rootfs/etc/pam.d/sshd"
@@ -673,6 +760,7 @@ if [ ! -f "$SSHD_ACCESS" ] || \
! grep -q '^KbdInteractiveAuthentication yes' "$SSHD_ACCESS"; then
fail "sshd access drop-in no longer enables password authentication"
fi
if [ -f "$BASE_DIR/keys/phone_id_ed25519.pub" ]; then
for ak in "$BASE_DIR"/overlay/rootfs/etc/skel/.ssh/authorized_keys \
"$BASE_DIR"/overlay/rootfs/home/user/.ssh/authorized_keys \
"$BASE_DIR"/overlay/rootfs/root/.ssh/authorized_keys; do
@@ -680,6 +768,9 @@ for ak in "$BASE_DIR"/overlay/rootfs/etc/skel/.ssh/authorized_keys \
fail "${ak#$BASE_DIR/} no longer carries the phone SSH key"
fi
done
else
echo "[skip] local SSH key keys/phone_id_ed25519.pub is absent; password SSH remains enabled"
fi
if ! grep -q 'chmod 700 "$ssh_home"' "$BASE_DIR/scripts/apply-bananarchy-overlay.sh" || \
! grep -q 'chown -R 10000:10000' "$BASE_DIR/scripts/apply-bananarchy-overlay.sh"; then
fail "the overlay no longer fixes authorized_keys ownership/modes"
@@ -699,19 +790,10 @@ if ! grep -q "Plymouth never starts" "$BASE_DIR/scripts/check-beatles-bootimg.py
fail "check-beatles-bootimg.py no longer guards the splash cmdline"
fi
echo "[check] 2720 Flip keypad and cover display support..."
echo "[check] Keypad and Xorg DRM card pinning..."
for f in overlay/rootfs/usr/lib/udev/rules.d/99-bananarchy-keypad.rules \
overlay/rootfs/usr/share/X11/xorg.conf.d/60-bananarchy-keypad.conf \
overlay/rootfs/usr/bin/bananarchy-keypad-diagnose.sh \
overlay/rootfs/usr/bin/bananarchy-coverd \
overlay/rootfs/usr/bin/bananarchy-cover-msg \
overlay/rootfs/usr/bin/bananarchy-lid-gate.sh \
overlay/rootfs/usr/bin/bananarchy-lid-state.sh \
overlay/rootfs/etc/init.d/bananarchy-cover-display \
overlay/rootfs/etc/bananarchy/cover-display.conf \
devices/nokia-beatles/cover-panel.dtsi \
devices/nokia-beatles/nokia,beatles-gc9305-ext-panel.bin \
devices/nokia-beatles/nokia,beatles-gc9305-ext-panel.txt; do
overlay/rootfs/usr/bin/bananarchy-keypad-diagnose.sh; do
if [ ! -f "$BASE_DIR/$f" ]; then
fail "missing $f"
fi
@@ -728,6 +810,26 @@ if ! grep -q 'TAG+="seat"' \
"$BASE_DIR/overlay/rootfs/etc/udev/rules.d/99-bananarchy-input-seat.rules"; then
fail "the input seat udev rule no longer tags event nodes for elogind"
fi
if ! grep -qF 'Option "kmsdev" "/dev/dri/card0"' \
"$BASE_DIR/overlay/rootfs/etc/X11/xorg.conf.d/10-bananarchy-msm8909.conf"; then
fail "Xorg no longer pins the main DRM card"
fi
if check_target nokia-beatles; then
echo "[check] 2720 Flip keypad and cover display support..."
for f in overlay/rootfs/usr/bin/bananarchy-coverd \
overlay/rootfs/usr/bin/bananarchy-cover-msg \
overlay/rootfs/usr/bin/bananarchy-lid-gate.sh \
overlay/rootfs/usr/bin/bananarchy-lid-state.sh \
overlay/rootfs/etc/init.d/bananarchy-cover-display \
overlay/rootfs/etc/bananarchy/cover-display.conf \
devices/nokia-beatles/cover-panel.dtsi \
devices/nokia-beatles/nokia,beatles-gc9305-ext-panel.bin \
devices/nokia-beatles/nokia,beatles-gc9305-ext-panel.txt; do
if [ ! -f "$BASE_DIR/$f" ]; then
fail "missing $f"
fi
done
if [ "$(head -c 4 "$BASE_DIR/overlay/rootfs/usr/bin/bananarchy-coverd" | od -An -tx1 | tr -d ' \n')" != "7f454c46" ]; then
fail "bananarchy-coverd is no longer the compiled armv7 daemon"
fi
@@ -746,26 +848,27 @@ if ! grep -qF 'LID_PROFILE="slider"' "$BASE_DIR/scripts/apply-bananarchy-overlay
"$BASE_DIR/scripts/apply-bananarchy-overlay.sh"; then
fail "apply-bananarchy-overlay.sh no longer isolates flip vs slider lid profiles"
fi
COVER_SCRATCH="/tmp/bantam/9064bb701d9e9f7c6412f0ea6846d88a"
if command -v dtc >/dev/null 2>&1; then
COVER_SCRATCH="$(mktemp -d "${TMPDIR:-/tmp}/bananarchy-cover-check.XXXXXX")"
COVER_DTBO="$COVER_SCRATCH/cover-panel-check.dtbo"
COVER_DTS="$COVER_SCRATCH/beatles-cover-check.dts"
COVER_DTS_BUILD="$COVER_SCRATCH/beatles-dts-check.dtb"
BEATLES_DTB="$BASE_DIR/devices/nokia-beatles/qcom-msm8905-nokia-beatles.dtb"
BEATLES_DTS="$BASE_DIR/devices/nokia-beatles/qcom-msm8905-nokia-beatles.dts"
mkdir -p "$COVER_SCRATCH"
if ! dtc -@ -I dts -O dtb -o "$COVER_DTBO" \
"$BASE_DIR/devices/nokia-beatles/cover-panel.dtsi" >/dev/null 2>&1; then
fail "devices/nokia-beatles/cover-panel.dtsi does not compile"
fi
if ! dtc -I dts -O dtb -o "$COVER_DTS_BUILD" "$BEATLES_DTS" >/dev/null 2>&1; then
fail "the shipping beatles DTS does not compile"
fi
if ! cmp -s "$COVER_DTS_BUILD" "$BEATLES_DTB"; then
elif ! cmp -s "$COVER_DTS_BUILD" "$BEATLES_DTB"; then
fail "the shipping beatles DTB drifted from its DTS source"
fi
if ! dtc -I dtb -O dts -o "$COVER_DTS" "$BEATLES_DTB" >/dev/null 2>&1; then
fail "the shipping beatles DTB cannot be decompiled"
fi
else
sed 's/\\0/", "/g' "$COVER_DTS" > "$COVER_DTS.norm"
mv "$COVER_DTS.norm" "$COVER_DTS"
for token in 'qcom,msm-id = <0x14b 0x00>;' \
'qcom,board-id = <0x1000b 0x100>;' \
'qcom,pmic-id = <0x1000d 0x00 0x00 0x00>;'; do
@@ -781,26 +884,24 @@ fi
if ! grep -A4 'spidev@1 {' "$COVER_DTS" | grep -qF 'status = "okay"'; then
fail "the shipping beatles DTB lost the spidev@1 diagnostic fallback"
fi
fi
rm -rf "$COVER_SCRATCH"
fi
for f in "$BASE_DIR/overlay/rootfs/usr/share/mkinitfs/files/00-nokia-argon-display.files" \
"$BASE_DIR/devices/nokia-beatles/00-nokia-beatles-display.files"; do
if ! grep -qxF '/lib/firmware/nokia,beatles-gc9305-ext-panel.bin' "$f"; then
fail "${f#"$BASE_DIR/"} no longer ships the cover firmware in the initramfs"
fi
done
if ! grep -qF 'Option "kmsdev" "/dev/dri/card0"' \
"$BASE_DIR/overlay/rootfs/etc/X11/xorg.conf.d/10-bananarchy-msm8909.conf"; then
fail "Xorg no longer pins the main DRM card"
fi
rm -f "$COVER_DTBO" "$COVER_DTS" "$COVER_DTS_BUILD"
for opt in CONFIG_MULTIPLEXER=m CONFIG_MUX_GPIO=m CONFIG_SPI_MUX=m; do
if ! grep -qxF "$opt" "$BASE_DIR/patches/kernel/config-bananarchy-msm8909.armv7"; then
fail "kernel config is missing $opt (cover panel spi-mux)"
fi
done
fi
if check_target nokia-beatles; then
echo "[check] 2720 Flip appended DTB..."
BEATLES_DTS="$BASE_DIR/devices/nokia-beatles/qcom-msm8905-nokia-beatles.dts"
if ! grep -qF 'qcom,msm-id = <0x14b 0x00>;' "$BEATLES_DTS"; then
fail "nokia-beatles DTS lost the stock MSM8905 msm-id"
@@ -828,7 +929,9 @@ if [ -f "$BASE_DIR/images/bananarchy-nokia-beatles.img" ]; then
else
echo "[skip] local build output images/bananarchy-nokia-beatles.img is absent; prepare-release.sh will rebuild it"
fi
fi
if check_target nokia-coconut; then
echo "[check] 800 Tough (nokia-coconut) appended DTB..."
COCONUT_DTS="$BASE_DIR/devices/nokia-coconut/qcom-msm8905-nokia-coconut.dts"
if ! grep -qF 'qcom,msm-id = <0x14b 0x00>;' "$COCONUT_DTS"; then
@@ -860,7 +963,9 @@ if [ -f "$BASE_DIR/images/bananarchy-nokia-coconut.img" ]; then
else
echo "[skip] local build output images/bananarchy-nokia-coconut.img is absent; prepare-release.sh will rebuild it"
fi
fi
if check_target nokia-sparkler nokia-leo; then
echo "[check] 8000 4G (nokia-sparkler) appended DTB..."
SPARKLER_DTS="$BASE_DIR/devices/nokia-sparkler/qcom-msm8909-nokia-sparkler.dts"
if ! grep -qF 'qcom,msm-id = <0xf5 0x00>;' "$SPARKLER_DTS"; then
@@ -894,6 +999,7 @@ if [ -f "$BASE_DIR/images/bananarchy-nokia-sparkler.img" ]; then
else
echo "[skip] local build output images/bananarchy-nokia-sparkler.img is absent; prepare-release.sh will rebuild it"
fi
fi
echo "[check] Release hygiene..."
KCONFIG="$BASE_DIR/patches/kernel/config-bananarchy-msm8909.armv7"
@@ -974,12 +1080,14 @@ if ! grep -qF 'set_kernel_reboot_mode "bootloader"' \
"$BASE_DIR/overlay/rootfs/usr/bin/sxmo_power.sh"; then
fail "sxmo_power.sh no longer reboots through the canonical bootloader mode"
fi
if check_target nokia-beatles; then
for stale in images/boot-bananarchy-nokia-beatles-debug.img \
images/boot-bananarchy-nokia-beatles-ramoops.img; do
if [ -f "$BASE_DIR/$stale" ]; then
fail "stale diagnostic boot image is still present: $stale"
fi
done
fi
LK2ND_PATCH="$BASE_DIR/bootloader/lk2nd/nokia-beatles.patch"
if ! grep -qF 'platform/msm_shared/reboot.c' "$LK2ND_PATCH" || \
@@ -1064,6 +1172,7 @@ if grep -qE '"\$\{?BASE_DIR\}?/prebuilt/kernel-6\.12\.1-msm8916/(leds|camera)/"\
fail "apply-bananarchy-overlay.sh still copies uncompressed .ko files via *.ko* wildcard"
fi
for dev_img in images/bananarchy-nokia-argon.img images/bananarchy-nokia-beatles.img images/bananarchy-nokia-coconut.img images/bananarchy-nokia-sparkler.img; do
artifact_matches_target "$dev_img" || continue
if [ ! -f "$BASE_DIR/$dev_img" ]; then
echo "[skip] local build output $dev_img is absent; skipping initramfs depmod check"
continue
@@ -1209,6 +1318,7 @@ if [ "$FOCUS_CALLS" -lt 2 ]; then
fail "link focus and wrap toggle must both call ensureFocusedLinkVisible"
fi
if check_target nokia-beatles; then
echo "[check] Flip lid responsiveness..."
LID_SRC="$BASE_DIR/src/bananarchy-daemons/bananarchy-lid.c"
for token in '#define LID_DEBOUNCE_MS 20' '#define HALL_EDGE_MS 20' \
@@ -1289,6 +1399,7 @@ if [ ! -x "$LID_WRAPPER" ] || \
! grep -qF 'lid-generation' "$LID_SRC"; then
fail "the guarded lid hook wrapper / generation check is missing"
fi
fi
echo "[check] Fast X startup and boot keypad state..."
if ! grep -q '^rc_parallel="YES"' "$BASE_DIR/overlay/rootfs/etc/rc.conf"; then
@@ -1484,6 +1595,7 @@ for dts in \
"$BASE_DIR/devices/nokia-coconut/qcom-msm8905-nokia-coconut.dts" \
"$BASE_DIR/devices/nokia-sparkler/qcom-msm8909-nokia-sparkler.dts" \
"$BASE_DIR/devices/nokia-sparkler/qcom-msm8909-nokia-leo.dts"; do
artifact_matches_target "$dts" || continue
if ! grep -qF 'qcom,msm8909-bimc' "$dts" || \
! grep -qF 'qcom,msm8909-pcnoc' "$dts" || \
! grep -qF 'qcom,msm8909-snoc' "$dts" || \
@@ -1571,6 +1683,7 @@ for dts in \
"$BASE_DIR/devices/nokia-coconut/qcom-msm8905-nokia-coconut.dts" \
"$BASE_DIR/devices/nokia-sparkler/qcom-msm8909-nokia-sparkler.dts" \
"$BASE_DIR/devices/nokia-sparkler/qcom-msm8909-nokia-leo.dts"; do
artifact_matches_target "$dts" || continue
if [ "$(grep -c 'clock-latency-ns' "$dts" 2>/dev/null || echo 0)" -ne 8 ]; then
fail "${dts#"$BASE_DIR/"} must declare clock-latency-ns on all 8 opp nodes"
fi
@@ -1581,6 +1694,7 @@ for dts in \
"$BASE_DIR/devices/nokia-beatles/qcom-msm8905-nokia-beatles-cover.dts" \
"$BASE_DIR/devices/nokia-coconut/qcom-msm8905-nokia-coconut.dts" \
"$BASE_DIR/devices/nokia-sparkler/qcom-msm8909-nokia-sparkler.dts"; do
artifact_matches_target "$dts" || continue
if ! grep -A 3 'dai-link-multimedia3 {' "$dts" | grep -qF 'status = "disabled";'; then
fail "${dts#"$BASE_DIR/"} must keep dai-link-multimedia3 disabled"
fi
@@ -1612,6 +1726,7 @@ for dts in \
"$BASE_DIR/devices/nokia-coconut/qcom-msm8905-nokia-coconut.dts" \
"$BASE_DIR/devices/nokia-sparkler/qcom-msm8909-nokia-sparkler.dts" \
"$BASE_DIR/devices/nokia-sparkler/qcom-msm8909-nokia-leo.dts"; do
artifact_matches_target "$dts" || continue
if ! grep -qF 'compatible = "qcom,mpm";' "$dts" || \
! grep -qF 'qcom,msm8909-saw2-v3.0-scu' "$dts" || \
! grep -qF 'compatible = "qcom,msm8916-rpm-stats";' "$dts" || \
@@ -1997,6 +2112,7 @@ if [ -x "$BASE_DIR/scripts/test-time-timezone-sync.py" ] && \
fail "host network time and live timezone sync test failed"
fi
if check_target nokia-beatles; then
echo "[check] Cover display behaviour..."
COVER_SRC="$BASE_DIR/src/bananarchy-daemons/bananarchy-cover-idle.c"
VOL_SRC="$BASE_DIR/src/bananarchy-daemons/bananarchy-volume-keys.c"
@@ -2115,7 +2231,9 @@ if ! grep -qF 'bananarchy-cover-dpms.sh' \
"$BASE_DIR/src/bananarchy-daemons/bananarchy-lid.c"; then
fail "the lid daemon no longer re-initialises the kernel panel on open"
fi
if [ ! -x "$BASE_DIR/scripts/test-cover-kernel.py" ] || \
if [ ! -x "$BASE_DIR/scripts/test-cover-kernel.py" ]; then
fail "missing host test scripts/test-cover-kernel.py"
elif command -v gcc >/dev/null 2>&1 && \
! "$BASE_DIR/scripts/test-cover-kernel.py" >/dev/null 2>&1; then
fail "host kernel-owned cover panel test failed"
fi
@@ -2200,6 +2318,7 @@ if ! grep -qF 'parser.add_argument("--dtb"' \
"$BASE_DIR/scripts/sync-beatles-bootfs.py"; then
fail "sync-beatles-bootfs.py lost its DTB/boot-image overrides"
fi
fi
echo "[check] Lock call-preservation and Power menu hygiene..."
LOCK_HOOK="$BASE_DIR/overlay/rootfs/usr/share/sxmo/default_hooks/sxmo_hook_lock.sh"
@@ -2240,6 +2359,7 @@ for dts in \
"$BASE_DIR/devices/nokia-coconut/qcom-msm8905-nokia-coconut.dts" \
"$BASE_DIR/devices/nokia-sparkler/qcom-msm8909-nokia-sparkler.dts" \
"$BASE_DIR/devices/nokia-sparkler/qcom-msm8909-nokia-leo.dts"; do
artifact_matches_target "$dts" || continue
if [ "$(grep -c 'regulator-allow-set-load;' "$dts" 2>/dev/null || echo 0)" -lt 3 ]; then
fail "${dts#"$BASE_DIR/"} is missing regulator-allow-set-load on l8/l12"
fi
@@ -2268,6 +2388,7 @@ for dts in \
"$BASE_DIR/devices/nokia-coconut/qcom-msm8905-nokia-coconut.dts" \
"$BASE_DIR/devices/nokia-sparkler/qcom-msm8909-nokia-sparkler.dts" \
"$BASE_DIR/devices/nokia-sparkler/qcom-msm8909-nokia-leo.dts"; do
artifact_matches_target "$dts" || continue
if grep -qF 'cd-gpios' "$dts" || grep -qF 'sdc2-cd-' "$dts" || grep -qF 'broken-cd' "$dts"; then
fail "${dts#"$BASE_DIR/"} still uses cd-gpios, sdc2-cd-*, or broken-cd on microSD"
fi
@@ -2278,6 +2399,7 @@ done
if command -v dtc >/dev/null 2>&1; then
for dtb in "$BASE_DIR"/prebuilt/kernel-6.12.1-msm8916/dtbs/*.dtb; do
[ -f "$dtb" ] || continue
artifact_matches_target "$dtb" || continue
dec_dts="$(dtc -q -I dtb -O dts "$dtb" 2>/dev/null | sed 's/\\0/", "/g' || true)"
if [ -z "$dec_dts" ]; then
fail "failed to decompile ${dtb#"$BASE_DIR/"}"
@@ -2289,6 +2411,7 @@ if command -v dtc >/dev/null 2>&1; then
done
fi
if check_target nokia-coconut; then
echo "[check] Nokia 800 Tough (nokia-coconut) 4x6 keypad DTS/DTB & dual LED invariants..."
COCONUT_DTS="$BASE_DIR/devices/nokia-coconut/qcom-msm8905-nokia-coconut.dts"
if ! grep -qF '"gpio0", "gpio3", "gpio7", "gpio99", "gpio6", "gpio1"' "$COCONUT_DTS" || \
@@ -2329,7 +2452,9 @@ if ! grep -qF 'of_machine_is_compatible("nokia,coconut")' "$TORCH_SRC" || \
! grep -qF '/sys/class/leds/camera:flash/brightness' "$BASE_DIR/overlay/rootfs/usr/bin/bananarchy-photo"; then
fail "nokia-coconut dual LED separation (GPIO_13 white:torch vs GPIO_32 camera:flash) is incomplete"
fi
fi
if check_target nokia-sparkler nokia-leo; then
echo "[check] Nokia 8000 4G (nokia-sparkler) keypad, audio, initfs, DRM & dual-GPIO torch invariants..."
SPARKLER_DEVINFO="$BASE_DIR/devices/nokia-sparkler/deviceinfo"
SPARKLER_INITFS="$BASE_DIR/devices/nokia-sparkler/modules-initfs"
@@ -2384,6 +2509,7 @@ if ! grep -qF 'of_machine_is_compatible("nokia,sparkler")' "$TORCH_SRC" || \
{ [ -f "$TORCH_KO" ] && ! grep -qaF 'GPIO_32/GPIO_31 (BC847BS)' "$TORCH_KO"; }; then
fail "nokia-sparkler dual-GPIO BC847BS torch support in leds-msm8905-torch is incomplete"
fi
fi
echo "[check] Universal keypad-friendly timer (sxmo_timer.sh, dmenu, hooks)..."
TIMER_SH="$BASE_DIR/overlay/rootfs/usr/bin/sxmo_timer.sh"
@@ -2406,6 +2532,8 @@ if ! python3 "$BASE_DIR/scripts/test-timer.py" >/dev/null 2>&1; then
fi
echo "[check] Quagr NeoUI pager plugin, opt-in daemon, and cover alerts..."
COVER_SRC="$BASE_DIR/src/bananarchy-daemons/bananarchy-cover-idle.c"
COVER_EVENT="$BASE_DIR/overlay/rootfs/usr/bin/bananarchy-cover-event.sh"
for artifact in \
src/dwm-plugins/quagr_plugin.cpp \
prebuilt/sxmo-x11/usr/lib/dwm/plugins/quagr.so \