diff --git a/CHANGELOG.md b/CHANGELOG.md index d55f941..93e1ca5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 ` validates invariants for `` 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`). --- diff --git a/MANUAL.md b/MANUAL.md index fee4b10..0c73f02 100644 --- a/MANUAL.md +++ b/MANUAL.md @@ -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 -./rebuild-image.sh nokia-argon # builds images/bananarchy-nokia-argon.img +./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 `; 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/`. diff --git a/README.md b/README.md index 605981d..18ac1a8 100644 --- a/README.md +++ b/README.md @@ -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 -./rebuild-image.sh nokia-argon # bootstraps rootfs/, then builds images/ +./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 ` 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-.img`. diff --git a/rebuild-image.sh b/rebuild-image.sh index 545083c..4270c33 100755 --- a/rebuild-image.sh +++ b/rebuild-image.sh @@ -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" diff --git a/scripts/build-beatles-no-cover-dtb.py b/scripts/build-beatles-no-cover-dtb.py index 0239209..01de7d5 100755 --- a/scripts/build-beatles-no-cover-dtb.py +++ b/scripts/build-beatles-no-cover-dtb.py @@ -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>;'): diff --git a/scripts/check-rebuild.sh b/scripts/check-rebuild.sh index 1fc2a01..b37dccb 100755 --- a/scripts/check-rebuild.sh +++ b/scripts/check-rebuild.sh @@ -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 |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 |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,34 +328,36 @@ 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 -for variant in normal diagnostic display; do - case "$variant" in - normal) - image="$BASE_DIR/images/boot-lk2nd-nokia-beatles.img" - opts="--expect-fastboot 0" - label="source-built nokia-beatles lk2nd" - ;; - diagnostic) - image="$BASE_DIR/images/boot-lk2nd-nokia-beatles-diagnostic.img" - opts="--expect-fastboot 1" - label="nokia-beatles forced-fastboot diagnostic image" - ;; - display) - image="$BASE_DIR/images/boot-lk2nd-nokia-beatles-display.img" - opts="--expect-fastboot 0 --expect-display 1" - label="nokia-beatles display lk2nd image with Fastboot reboot cookie" - ;; - esac - if [ ! -f "$image" ]; then - echo "[skip] local build output ${image#"$BASE_DIR/"} is absent; prepare-release.sh will rebuild it" - continue - fi - # shellcheck disable=SC2086 - if ! python3 "$BASE_DIR/scripts/check-lk2nd-beatles.py" \ - --image "$image" $opts; then - fail "$label validation failed" - fi -done +if check_target nokia-beatles; then + for variant in normal diagnostic display; do + case "$variant" in + normal) + image="$BASE_DIR/images/boot-lk2nd-nokia-beatles.img" + opts="--expect-fastboot 0" + label="source-built nokia-beatles lk2nd" + ;; + diagnostic) + image="$BASE_DIR/images/boot-lk2nd-nokia-beatles-diagnostic.img" + opts="--expect-fastboot 1" + label="nokia-beatles forced-fastboot diagnostic image" + ;; + display) + image="$BASE_DIR/images/boot-lk2nd-nokia-beatles-display.img" + opts="--expect-fastboot 0 --expect-display 1" + label="nokia-beatles display lk2nd image with Fastboot reboot cookie" + ;; + esac + if [ ! -f "$image" ]; then + echo "[skip] local build output ${image#"$BASE_DIR/"} is absent; prepare-release.sh will rebuild it" + continue + fi + # shellcheck disable=SC2086 + if ! python3 "$BASE_DIR/scripts/check-lk2nd-beatles.py" \ + --image "$image" $opts; then + 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,62 +394,66 @@ 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 -for variant in normal diagnostic display; do - case "$variant" in - normal) - image="$BASE_DIR/images/boot-lk2nd-nokia-coconut.img" - opts="--expect-fastboot 0" - label="source-built nokia-coconut lk2nd" - ;; - diagnostic) - image="$BASE_DIR/images/boot-lk2nd-nokia-coconut-diagnostic.img" - opts="--expect-fastboot 1" - label="nokia-coconut forced-fastboot diagnostic image" - ;; - display) - image="$BASE_DIR/images/boot-lk2nd-nokia-coconut-display.img" - opts="--expect-fastboot 0 --expect-display 1" - label="nokia-coconut display lk2nd image with Fastboot reboot cookie" - ;; - esac - if [ ! -f "$image" ]; then - echo "[skip] local build output ${image#"$BASE_DIR/"} is absent; prepare-release.sh will rebuild it" - continue - fi - # shellcheck disable=SC2086 - if ! python3 "$BASE_DIR/scripts/check-lk2nd-coconut.py" \ - --image "$image" $opts; then - fail "$label validation failed" - fi -done -for variant in normal diagnostic display; do - case "$variant" in - normal) - image="$BASE_DIR/images/boot-lk2nd-nokia-sparkler.img" - opts="--expect-fastboot 0" - label="source-built nokia-sparkler lk2nd" - ;; - diagnostic) - image="$BASE_DIR/images/boot-lk2nd-nokia-sparkler-diagnostic.img" - opts="--expect-fastboot 1" - label="nokia-sparkler forced-fastboot diagnostic image" - ;; - display) - image="$BASE_DIR/images/boot-lk2nd-nokia-sparkler-display.img" - opts="--expect-fastboot 0 --expect-display 1" - label="nokia-sparkler display lk2nd image with Fastboot reboot cookie" - ;; - esac - if [ ! -f "$image" ]; then - echo "[skip] local build output ${image#"$BASE_DIR/"} is absent; prepare-release.sh will rebuild it" - continue - fi - # shellcheck disable=SC2086 - if ! python3 "$BASE_DIR/scripts/check-lk2nd-sparkler.py" \ - --image "$image" $opts; then - fail "$label validation failed" - fi -done +if check_target nokia-coconut; then + for variant in normal diagnostic display; do + case "$variant" in + normal) + image="$BASE_DIR/images/boot-lk2nd-nokia-coconut.img" + opts="--expect-fastboot 0" + label="source-built nokia-coconut lk2nd" + ;; + diagnostic) + image="$BASE_DIR/images/boot-lk2nd-nokia-coconut-diagnostic.img" + opts="--expect-fastboot 1" + label="nokia-coconut forced-fastboot diagnostic image" + ;; + display) + image="$BASE_DIR/images/boot-lk2nd-nokia-coconut-display.img" + opts="--expect-fastboot 0 --expect-display 1" + label="nokia-coconut display lk2nd image with Fastboot reboot cookie" + ;; + esac + if [ ! -f "$image" ]; then + echo "[skip] local build output ${image#"$BASE_DIR/"} is absent; prepare-release.sh will rebuild it" + continue + fi + # shellcheck disable=SC2086 + if ! python3 "$BASE_DIR/scripts/check-lk2nd-coconut.py" \ + --image "$image" $opts; then + 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) + image="$BASE_DIR/images/boot-lk2nd-nokia-sparkler.img" + opts="--expect-fastboot 0" + label="source-built nokia-sparkler lk2nd" + ;; + diagnostic) + image="$BASE_DIR/images/boot-lk2nd-nokia-sparkler-diagnostic.img" + opts="--expect-fastboot 1" + label="nokia-sparkler forced-fastboot diagnostic image" + ;; + display) + image="$BASE_DIR/images/boot-lk2nd-nokia-sparkler-display.img" + opts="--expect-fastboot 0 --expect-display 1" + label="nokia-sparkler display lk2nd image with Fastboot reboot cookie" + ;; + esac + if [ ! -f "$image" ]; then + echo "[skip] local build output ${image#"$BASE_DIR/"} is absent; prepare-release.sh will rebuild it" + continue + fi + # shellcheck disable=SC2086 + if ! python3 "$BASE_DIR/scripts/check-lk2nd-sparkler.py" \ + --image "$image" $opts; then + 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,18 +730,23 @@ 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 - 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' | \ - 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" +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 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..." @@ -673,13 +760,17 @@ if [ ! -f "$SSHD_ACCESS" ] || \ ! grep -q '^KbdInteractiveAuthentication yes' "$SSHD_ACCESS"; then fail "sshd access drop-in no longer enables password authentication" fi -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 - if [ ! -f "$ak" ] || ! cmp -s "$ak" "$BASE_DIR/keys/phone_id_ed25519.pub"; then - fail "${ak#$BASE_DIR/} no longer carries the phone SSH key" - fi -done +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 + if [ ! -f "$ak" ] || ! cmp -s "$ak" "$BASE_DIR/keys/phone_id_ed25519.pub"; then + 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,171 +810,195 @@ 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 [ "$(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 -if ! cmp -s "$BASE_DIR/prebuilt/bananarchy-coverd/usr/bin/bananarchy-coverd" \ - "$BASE_DIR/overlay/rootfs/usr/bin/bananarchy-coverd"; then - fail "the cover daemon binary drifted from prebuilt/" -fi -if ! grep -q 'lid-profile' "$BASE_DIR/overlay/rootfs/etc/init.d/bananarchy-cover-display" || \ - ! grep -q 'lid-profile' "$BASE_DIR/overlay/rootfs/etc/init.d/bananarchy-lid" || \ - ! grep -q 'lid-profile' "$BASE_DIR/overlay/rootfs/etc/init.d/bananarchy-volume-keys"; then - fail "the flip-device services lost their lid-profile gate" -fi -if ! grep -qF 'LID_PROFILE="slider"' "$BASE_DIR/scripts/apply-bananarchy-overlay.sh" || \ - ! grep -qF 'LID_PROFILE="flip"' "$BASE_DIR/scripts/apply-bananarchy-overlay.sh" || \ - ! grep -qF '$TARGET_ROOTFS/usr/share/bananarchy/lid-profile' \ - "$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" -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 - 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 -for token in 'qcom,msm-id = <0x14b 0x00>;' \ - 'qcom,board-id = <0x1000b 0x100>;' \ - 'qcom,pmic-id = <0x1000d 0x00 0x00 0x00>;'; do - if ! grep -qF "$token" "$COVER_DTS"; then - fail "the shipping beatles DTB lost a stock Qualcomm ID ($token)" - fi -done -if grep -qF 'compatible = "spi-mux"' "$COVER_DTS" || \ - grep -qF 'compatible = "gpio-mux"' "$COVER_DTS" || \ - grep -qF 'display@1 {' "$COVER_DTS"; then - fail "the shipping beatles DTB applies the hardware-gated cover overlay" -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 -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 -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" -fi -if ! grep -qF 'qcom,board-id = <0x1000b 0x100>;' "$BEATLES_DTS"; then - fail "nokia-beatles DTS lost the exact stock QRD SKUB board-id" -fi -if ! grep -qF 'qcom,pmic-id = <0x1000d 0x00 0x00 0x00>;' "$BEATLES_DTS"; then - fail "nokia-beatles DTS lost the stock pmic-id" -fi -if ! grep -qF 'reg = <0x80000000 0x20000000>;' "$BEATLES_DTS"; then - fail "nokia-beatles DTS lost the 512 MiB memory fallback" -fi -if [ -f "$BASE_DIR/images/boot-bananarchy-nokia-beatles.img" ]; then - if ! python3 "$BASE_DIR/scripts/check-beatles-bootimg.py"; then - fail "2720 boot image validation failed" +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 -else - echo "[skip] local build output images/boot-bananarchy-nokia-beatles.img is absent; prepare-release.sh will rebuild it" -fi -if [ -f "$BASE_DIR/images/bananarchy-nokia-beatles.img" ]; then - if ! python3 "$BASE_DIR/scripts/sync-beatles-bootfs.py" --check --raw-image "$BASE_DIR/images/bananarchy-nokia-beatles.img"; then - fail "2720 raw image pmOS_boot filesystem is damaged or stale" + if ! cmp -s "$BASE_DIR/prebuilt/bananarchy-coverd/usr/bin/bananarchy-coverd" \ + "$BASE_DIR/overlay/rootfs/usr/bin/bananarchy-coverd"; then + fail "the cover daemon binary drifted from prebuilt/" fi -else - echo "[skip] local build output images/bananarchy-nokia-beatles.img is absent; prepare-release.sh will rebuild it" + if ! grep -q 'lid-profile' "$BASE_DIR/overlay/rootfs/etc/init.d/bananarchy-cover-display" || \ + ! grep -q 'lid-profile' "$BASE_DIR/overlay/rootfs/etc/init.d/bananarchy-lid" || \ + ! grep -q 'lid-profile' "$BASE_DIR/overlay/rootfs/etc/init.d/bananarchy-volume-keys"; then + fail "the flip-device services lost their lid-profile gate" + fi + if ! grep -qF 'LID_PROFILE="slider"' "$BASE_DIR/scripts/apply-bananarchy-overlay.sh" || \ + ! grep -qF 'LID_PROFILE="flip"' "$BASE_DIR/scripts/apply-bananarchy-overlay.sh" || \ + ! grep -qF '$TARGET_ROOTFS/usr/share/bananarchy/lid-profile' \ + "$BASE_DIR/scripts/apply-bananarchy-overlay.sh"; then + fail "apply-bananarchy-overlay.sh no longer isolates flip vs slider lid profiles" + fi + 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" + 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" + 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" + 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 + if ! grep -qF "$token" "$COVER_DTS"; then + fail "the shipping beatles DTB lost a stock Qualcomm ID ($token)" + fi + done + if grep -qF 'compatible = "spi-mux"' "$COVER_DTS" || \ + grep -qF 'compatible = "gpio-mux"' "$COVER_DTS" || \ + grep -qF 'display@1 {' "$COVER_DTS"; then + fail "the shipping beatles DTB applies the hardware-gated cover overlay" + 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 + 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 -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 - fail "nokia-coconut DTS lost the stock MSM8905 msm-id" -fi -if ! grep -qF 'qcom,board-id = <0x1000b 0x100>;' "$COCONUT_DTS"; then - fail "nokia-coconut DTS lost the exact stock QRD SKUB board-id" -fi -if ! grep -qF 'qcom,pmic-id = <0x1000d 0x00 0x00 0x00>;' "$COCONUT_DTS"; then - fail "nokia-coconut DTS lost the stock pmic-id" -fi -if ! grep -qF 'reg = <0x80000000 0x20000000>;' "$COCONUT_DTS"; then - fail "nokia-coconut DTS lost the 512 MiB memory fallback" -fi -if grep -q 'switch-lid-' "$COCONUT_DTS"; then - fail "nokia-coconut DTS still carries phantom slider lid-switch nodes" -fi -if [ -f "$BASE_DIR/images/boot-bananarchy-nokia-coconut.img" ]; then - if ! python3 "$BASE_DIR/scripts/check-beatles-bootimg.py" --device nokia-coconut; then - fail "800 Tough boot image validation failed" +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" fi -else - echo "[skip] local build output images/boot-bananarchy-nokia-coconut.img is absent; prepare-release.sh will rebuild it" -fi -if [ -f "$BASE_DIR/images/bananarchy-nokia-coconut.img" ]; then - if ! python3 "$BASE_DIR/scripts/sync-beatles-bootfs.py" --check --device nokia-coconut --raw-image "$BASE_DIR/images/bananarchy-nokia-coconut.img"; then - fail "800 Tough raw image pmOS_boot filesystem is damaged or stale" + if ! grep -qF 'qcom,board-id = <0x1000b 0x100>;' "$BEATLES_DTS"; then + fail "nokia-beatles DTS lost the exact stock QRD SKUB board-id" + fi + if ! grep -qF 'qcom,pmic-id = <0x1000d 0x00 0x00 0x00>;' "$BEATLES_DTS"; then + fail "nokia-beatles DTS lost the stock pmic-id" + fi + if ! grep -qF 'reg = <0x80000000 0x20000000>;' "$BEATLES_DTS"; then + fail "nokia-beatles DTS lost the 512 MiB memory fallback" + fi + if [ -f "$BASE_DIR/images/boot-bananarchy-nokia-beatles.img" ]; then + if ! python3 "$BASE_DIR/scripts/check-beatles-bootimg.py"; then + fail "2720 boot image validation failed" + fi + else + echo "[skip] local build output images/boot-bananarchy-nokia-beatles.img is absent; prepare-release.sh will rebuild it" + fi + if [ -f "$BASE_DIR/images/bananarchy-nokia-beatles.img" ]; then + if ! python3 "$BASE_DIR/scripts/sync-beatles-bootfs.py" --check --raw-image "$BASE_DIR/images/bananarchy-nokia-beatles.img"; then + fail "2720 raw image pmOS_boot filesystem is damaged or stale" + fi + else + echo "[skip] local build output images/bananarchy-nokia-beatles.img is absent; prepare-release.sh will rebuild it" fi -else - echo "[skip] local build output images/bananarchy-nokia-coconut.img is absent; prepare-release.sh will rebuild it" fi -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 - fail "nokia-sparkler DTS lost the stock MSM8909 msm-id" -fi -if ! grep -qF 'qcom,board-id = <0x08 0x100>;' "$SPARKLER_DTS"; then - fail "nokia-sparkler DTS lost the stock MTP board-id" -fi -if ! grep -qF 'qcom,pmic-id = <0x1000d 0x00 0x00 0x00>;' "$SPARKLER_DTS"; then - fail "nokia-sparkler DTS lost the stock pmic-id" -fi -if ! grep -qF 'reg = <0x80000000 0x20000000>;' "$SPARKLER_DTS"; then - fail "nokia-sparkler DTS lost the 512 MiB memory fallback" -fi -for node in 'sound@7702000' 'vibrator@c000' 'audio-codec@f000'; do - if ! grep -qF "$node" "$SPARKLER_DTS"; then - fail "nokia-sparkler DTS is missing $node" +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 + fail "nokia-coconut DTS lost the stock MSM8905 msm-id" fi -done -if [ -f "$BASE_DIR/images/boot-bananarchy-nokia-sparkler.img" ]; then - if ! python3 "$BASE_DIR/scripts/check-beatles-bootimg.py" --device nokia-sparkler; then - fail "8000 4G boot image validation failed" + if ! grep -qF 'qcom,board-id = <0x1000b 0x100>;' "$COCONUT_DTS"; then + fail "nokia-coconut DTS lost the exact stock QRD SKUB board-id" + fi + if ! grep -qF 'qcom,pmic-id = <0x1000d 0x00 0x00 0x00>;' "$COCONUT_DTS"; then + fail "nokia-coconut DTS lost the stock pmic-id" + fi + if ! grep -qF 'reg = <0x80000000 0x20000000>;' "$COCONUT_DTS"; then + fail "nokia-coconut DTS lost the 512 MiB memory fallback" + fi + if grep -q 'switch-lid-' "$COCONUT_DTS"; then + fail "nokia-coconut DTS still carries phantom slider lid-switch nodes" + fi + if [ -f "$BASE_DIR/images/boot-bananarchy-nokia-coconut.img" ]; then + if ! python3 "$BASE_DIR/scripts/check-beatles-bootimg.py" --device nokia-coconut; then + fail "800 Tough boot image validation failed" + fi + else + echo "[skip] local build output images/boot-bananarchy-nokia-coconut.img is absent; prepare-release.sh will rebuild it" + fi + if [ -f "$BASE_DIR/images/bananarchy-nokia-coconut.img" ]; then + if ! python3 "$BASE_DIR/scripts/sync-beatles-bootfs.py" --check --device nokia-coconut --raw-image "$BASE_DIR/images/bananarchy-nokia-coconut.img"; then + fail "800 Tough raw image pmOS_boot filesystem is damaged or stale" + fi + else + echo "[skip] local build output images/bananarchy-nokia-coconut.img is absent; prepare-release.sh will rebuild it" fi -else - echo "[skip] local build output images/boot-bananarchy-nokia-sparkler.img is absent; prepare-release.sh will rebuild it" fi -if [ -f "$BASE_DIR/images/bananarchy-nokia-sparkler.img" ]; then - if ! python3 "$BASE_DIR/scripts/sync-beatles-bootfs.py" --check --device nokia-sparkler --raw-image "$BASE_DIR/images/bananarchy-nokia-sparkler.img"; then - fail "8000 4G raw image pmOS_boot filesystem is damaged or stale" + +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 + fail "nokia-sparkler DTS lost the stock MSM8909 msm-id" + fi + if ! grep -qF 'qcom,board-id = <0x08 0x100>;' "$SPARKLER_DTS"; then + fail "nokia-sparkler DTS lost the stock MTP board-id" + fi + if ! grep -qF 'qcom,pmic-id = <0x1000d 0x00 0x00 0x00>;' "$SPARKLER_DTS"; then + fail "nokia-sparkler DTS lost the stock pmic-id" + fi + if ! grep -qF 'reg = <0x80000000 0x20000000>;' "$SPARKLER_DTS"; then + fail "nokia-sparkler DTS lost the 512 MiB memory fallback" + fi + for node in 'sound@7702000' 'vibrator@c000' 'audio-codec@f000'; do + if ! grep -qF "$node" "$SPARKLER_DTS"; then + fail "nokia-sparkler DTS is missing $node" + fi + done + if [ -f "$BASE_DIR/images/boot-bananarchy-nokia-sparkler.img" ]; then + if ! python3 "$BASE_DIR/scripts/check-beatles-bootimg.py" --device nokia-sparkler; then + fail "8000 4G boot image validation failed" + fi + else + echo "[skip] local build output images/boot-bananarchy-nokia-sparkler.img is absent; prepare-release.sh will rebuild it" + fi + if [ -f "$BASE_DIR/images/bananarchy-nokia-sparkler.img" ]; then + if ! python3 "$BASE_DIR/scripts/sync-beatles-bootfs.py" --check --device nokia-sparkler --raw-image "$BASE_DIR/images/bananarchy-nokia-sparkler.img"; then + fail "8000 4G raw image pmOS_boot filesystem is damaged or stale" + fi + else + echo "[skip] local build output images/bananarchy-nokia-sparkler.img is absent; prepare-release.sh will rebuild it" fi -else - echo "[skip] local build output images/bananarchy-nokia-sparkler.img is absent; prepare-release.sh will rebuild it" fi echo "[check] Release hygiene..." @@ -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 -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 +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,85 +1318,87 @@ if [ "$FOCUS_CALLS" -lt 2 ]; then fail "link focus and wrap toggle must both call ensureFocusedLinkVisible" fi -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' \ - '#define LID_LOOP_MS 20' 'BA_EVIOCGSW' 'LID_STATE_FILE' \ - 'LOCKER_FIFO' 'hall_observed' 'fast_until' \ - 'if(edge)' 'write_session_file(state, "screenoff")' \ - 'write_session_file(state, "lock")' 'cover_send("OPEN")' \ - 'locker_send("LOCK\n")' 'run_sxmo_state("lock", "open")' \ - 'LID_GENERATION_FILE' 'run_dpms' \ - 'bananarchy-lid-state.sh'; do - if ! grep -qF "$token" "$LID_SRC"; then - fail "the compiled lid daemon lost the instant EV_SW/hall path ($token)" +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' \ + '#define LID_LOOP_MS 20' 'BA_EVIOCGSW' 'LID_STATE_FILE' \ + 'LOCKER_FIFO' 'hall_observed' 'fast_until' \ + 'if(edge)' 'write_session_file(state, "screenoff")' \ + 'write_session_file(state, "lock")' 'cover_send("OPEN")' \ + 'locker_send("LOCK\n")' 'run_sxmo_state("lock", "open")' \ + 'LID_GENERATION_FILE' 'run_dpms' \ + 'bananarchy-lid-state.sh'; do + if ! grep -qF "$token" "$LID_SRC"; then + fail "the compiled lid daemon lost the instant EV_SW/hall path ($token)" + fi + done + if grep -qF 'unlink(LOCK_FLAG)' "$LID_SRC"; then + fail "the lid daemon still auto-unlocks the desktop when the flip opens" + fi + if grep -qF 'closed != was_closed' "$LID_SRC" || \ + grep -qF '#define LID_STABLE_MS 600' "$LID_SRC" || \ + grep -qF '#define LID_STABLE_MS 80' "$LID_SRC" || \ + grep -qF 'observed = (switch_mask &' "$LID_SRC"; then + fail "the compiled lid daemon still oscillates on a stale EV_SW mask" fi -done -if grep -qF 'unlink(LOCK_FLAG)' "$LID_SRC"; then - fail "the lid daemon still auto-unlocks the desktop when the flip opens" -fi -if grep -qF 'closed != was_closed' "$LID_SRC" || \ - grep -qF '#define LID_STABLE_MS 600' "$LID_SRC" || \ - grep -qF '#define LID_STABLE_MS 80' "$LID_SRC" || \ - grep -qF 'observed = (switch_mask &' "$LID_SRC"; then - fail "the compiled lid daemon still oscillates on a stale EV_SW mask" -fi -echo "[check] Closed-flip main-panel gate..." -LID_GATE="$BASE_DIR/overlay/rootfs/usr/bin/bananarchy-lid-gate.sh" -if [ ! -x "$LID_GATE" ] || ! sh -n "$LID_GATE" 2>/dev/null; then - fail "bananarchy-lid-gate.sh is missing or has bad syntax" -fi -DPMS_SYNC="$BASE_DIR/overlay/rootfs/usr/bin/bananarchy-display-power-sync" -if ! grep -qF 'COVER_MARKER=/run/bananarchy/cover-backlight' "$DPMS_SYNC" || \ - ! grep -qF 'kernel_backlight_invert' "$DPMS_SYNC" || \ - ! grep -qF 'FORCE=0' "$DPMS_SYNC" || \ - ! grep -qF 'STATE_CACHE' "$DPMS_SYNC" || \ - ! grep -qF 'LIT_BR="$COVER_BL_LEVEL"' "$DPMS_SYNC" || \ - ! grep -qF 'LIT_BR=0' "$DPMS_SYNC" || \ - ! grep -qF 'exit 0' "$DPMS_SYNC"; then - fail "display-power-sync no longer handles the shared cover backlight" -fi -for f in overlay/rootfs/usr/bin/sxmo_wm.sh \ - overlay/rootfs/usr/bin/sxmo_state.sh \ - overlay/rootfs/usr/bin/bananarchy-screen-wake.sh \ - overlay/rootfs/usr/bin/bananarchy-display-power-sync \ - overlay/rootfs/usr/share/sxmo/default_hooks/sxmo_hook_inputhandler.sh \ - overlay/rootfs/etc/skel/.config/sxmo/hooks/sxmo_hook_inputhandler.sh; do - if ! grep -qF 'bananarchy-lid-gate.sh' "$BASE_DIR/$f"; then - fail "$f can still light the main panel with the flip closed" + echo "[check] Closed-flip main-panel gate..." + LID_GATE="$BASE_DIR/overlay/rootfs/usr/bin/bananarchy-lid-gate.sh" + if [ ! -x "$LID_GATE" ] || ! sh -n "$LID_GATE" 2>/dev/null; then + fail "bananarchy-lid-gate.sh is missing or has bad syntax" + fi + DPMS_SYNC="$BASE_DIR/overlay/rootfs/usr/bin/bananarchy-display-power-sync" + if ! grep -qF 'COVER_MARKER=/run/bananarchy/cover-backlight' "$DPMS_SYNC" || \ + ! grep -qF 'kernel_backlight_invert' "$DPMS_SYNC" || \ + ! grep -qF 'FORCE=0' "$DPMS_SYNC" || \ + ! grep -qF 'STATE_CACHE' "$DPMS_SYNC" || \ + ! grep -qF 'LIT_BR="$COVER_BL_LEVEL"' "$DPMS_SYNC" || \ + ! grep -qF 'LIT_BR=0' "$DPMS_SYNC" || \ + ! grep -qF 'exit 0' "$DPMS_SYNC"; then + fail "display-power-sync no longer handles the shared cover backlight" + fi + for f in overlay/rootfs/usr/bin/sxmo_wm.sh \ + overlay/rootfs/usr/bin/sxmo_state.sh \ + overlay/rootfs/usr/bin/bananarchy-screen-wake.sh \ + overlay/rootfs/usr/bin/bananarchy-display-power-sync \ + overlay/rootfs/usr/share/sxmo/default_hooks/sxmo_hook_inputhandler.sh \ + overlay/rootfs/etc/skel/.config/sxmo/hooks/sxmo_hook_inputhandler.sh; do + if ! grep -qF 'bananarchy-lid-gate.sh' "$BASE_DIR/$f"; then + fail "$f can still light the main panel with the flip closed" + fi + done + if ! grep -qF 'coverctl WAKE' \ + "$BASE_DIR/overlay/rootfs/usr/bin/bananarchy-cover-event.sh" || \ + ! grep -qF 'bananarchy-cover-event.sh ring' \ + "$BASE_DIR/overlay/rootfs/usr/share/sxmo/default_hooks/sxmo_hook_ring.sh" || \ + ! grep -qF 'bananarchy-cover-event.sh notification' \ + "$BASE_DIR/overlay/rootfs/usr/share/sxmo/default_hooks/sxmo_hook_notification.sh"; then + fail "closed-flip events are no longer forwarded to the cover display" + fi + if ! grep -qF 'cover_wake' "$BASE_DIR/src/bananarchy-daemons/bananarchy-cover-idle.c" || \ + ! grep -qF 'strcmp(command, "WAKE")' \ + "$BASE_DIR/src/bananarchy-daemons/bananarchy-cover-idle.c"; then + fail "the cover daemon no longer honours a closed-flip WAKE" + fi + if ! grep -qF 'probe_cases' \ + "$BASE_DIR/src/bananarchy-daemons/bananarchy-cover-idle.c" || \ + ! grep -qF 'spi_word_bits' \ + "$BASE_DIR/overlay/rootfs/etc/bananarchy/cover-display.conf" || \ + ! grep -qF 'KEY_POWER' "$BASE_DIR/src/bananarchy-daemons/common.h" || \ + [ ! -x "$BASE_DIR/overlay/rootfs/usr/bin/bananarchy-cover-probe.sh" ]; then + fail "the cover hardware sign-off probe, 9-bit mode or KEY_POWER watch is missing" + fi + if [ ! -x "$BASE_DIR/scripts/test-lid-gate.py" ] || \ + ! "$BASE_DIR/scripts/test-lid-gate.py" >/dev/null 2>&1; then + fail "host instant-lid / closed-flip gate test failed" + fi + LID_WRAPPER="$BASE_DIR/overlay/rootfs/usr/bin/bananarchy-lid-state.sh" + if [ ! -x "$LID_WRAPPER" ] || \ + ! grep -qF 'lid-generation' "$LID_WRAPPER" || \ + ! grep -qF 'lid-generation' "$LID_SRC"; then + fail "the guarded lid hook wrapper / generation check is missing" fi -done -if ! grep -qF 'coverctl WAKE' \ - "$BASE_DIR/overlay/rootfs/usr/bin/bananarchy-cover-event.sh" || \ - ! grep -qF 'bananarchy-cover-event.sh ring' \ - "$BASE_DIR/overlay/rootfs/usr/share/sxmo/default_hooks/sxmo_hook_ring.sh" || \ - ! grep -qF 'bananarchy-cover-event.sh notification' \ - "$BASE_DIR/overlay/rootfs/usr/share/sxmo/default_hooks/sxmo_hook_notification.sh"; then - fail "closed-flip events are no longer forwarded to the cover display" -fi -if ! grep -qF 'cover_wake' "$BASE_DIR/src/bananarchy-daemons/bananarchy-cover-idle.c" || \ - ! grep -qF 'strcmp(command, "WAKE")' \ - "$BASE_DIR/src/bananarchy-daemons/bananarchy-cover-idle.c"; then - fail "the cover daemon no longer honours a closed-flip WAKE" -fi -if ! grep -qF 'probe_cases' \ - "$BASE_DIR/src/bananarchy-daemons/bananarchy-cover-idle.c" || \ - ! grep -qF 'spi_word_bits' \ - "$BASE_DIR/overlay/rootfs/etc/bananarchy/cover-display.conf" || \ - ! grep -qF 'KEY_POWER' "$BASE_DIR/src/bananarchy-daemons/common.h" || \ - [ ! -x "$BASE_DIR/overlay/rootfs/usr/bin/bananarchy-cover-probe.sh" ]; then - fail "the cover hardware sign-off probe, 9-bit mode or KEY_POWER watch is missing" -fi -if [ ! -x "$BASE_DIR/scripts/test-lid-gate.py" ] || \ - ! "$BASE_DIR/scripts/test-lid-gate.py" >/dev/null 2>&1; then - fail "host instant-lid / closed-flip gate test failed" -fi -LID_WRAPPER="$BASE_DIR/overlay/rootfs/usr/bin/bananarchy-lid-state.sh" -if [ ! -x "$LID_WRAPPER" ] || \ - ! grep -qF 'lid-generation' "$LID_WRAPPER" || \ - ! grep -qF 'lid-generation' "$LID_SRC"; then - fail "the guarded lid hook wrapper / generation check is missing" fi echo "[check] Fast X startup and boot keypad state..." @@ -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,208 +2112,212 @@ if [ -x "$BASE_DIR/scripts/test-time-timezone-sync.py" ] && \ fail "host network time and live timezone sync test failed" fi -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" -COVER_CONF="$BASE_DIR/overlay/rootfs/etc/bananarchy/cover-display.conf" -COVER_EVENT="$BASE_DIR/overlay/rootfs/usr/bin/bananarchy-cover-event.sh" -COVER_STATUS="$BASE_DIR/overlay/rootfs/usr/bin/bananarchy-cover-status.sh" -COVER_INIT="$BASE_DIR/overlay/rootfs/etc/init.d/bananarchy-cover-display" -NET_EVENT="$BASE_DIR/overlay/rootfs/usr/bin/bananarchy-network-event.sh" -for token in 'BUTTON' 'NETWORK' 'blank_timeout_ms' 'set_backlight' \ - 'idle_blank_timeout' 'CLOCK_REDRAW_MS' 'FBIOBLANK' \ - 'FB_BLANK_POWERDOWN' 'cover_is_lit'; do - if ! grep -qF -- "$token" "$COVER_SRC"; then - fail "bananarchy-cover-idle.c is missing cover behaviour: $token" +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" + COVER_CONF="$BASE_DIR/overlay/rootfs/etc/bananarchy/cover-display.conf" + COVER_EVENT="$BASE_DIR/overlay/rootfs/usr/bin/bananarchy-cover-event.sh" + COVER_STATUS="$BASE_DIR/overlay/rootfs/usr/bin/bananarchy-cover-status.sh" + COVER_INIT="$BASE_DIR/overlay/rootfs/etc/init.d/bananarchy-cover-display" + NET_EVENT="$BASE_DIR/overlay/rootfs/usr/bin/bananarchy-network-event.sh" + for token in 'BUTTON' 'NETWORK' 'blank_timeout_ms' 'set_backlight' \ + 'idle_blank_timeout' 'CLOCK_REDRAW_MS' 'FBIOBLANK' \ + 'FB_BLANK_POWERDOWN' 'cover_is_lit'; do + if ! grep -qF -- "$token" "$COVER_SRC"; then + fail "bananarchy-cover-idle.c is missing cover behaviour: $token" + fi + done + for token in 'cover_button' 'lid_is_closed' 'KEY_POWER'; do + if ! grep -qF -- "$token" "$VOL_SRC"; then + fail "bananarchy-volume-keys.c no longer wakes the cover: $token" + fi + done + if ! grep -qF 'blank_timeout = auto' "$COVER_CONF" || \ + ! grep -qF 'wake_blank_timeout = 8' "$COVER_CONF" || \ + ! grep -qF 'backlight_path' "$COVER_CONF"; then + fail "cover display config no longer shares the Screen blank timeout" fi -done -for token in 'cover_button' 'lid_is_closed' 'KEY_POWER'; do - if ! grep -qF -- "$token" "$VOL_SRC"; then - fail "bananarchy-volume-keys.c no longer wakes the cover: $token" + for f in "$COVER_EVENT" "$COVER_STATUS" "$NET_EVENT" "$COVER_INIT"; do + if ! sh -n "$f" 2>/dev/null; then + fail "shell syntax: ${f#$BASE_DIR/}" + fi + done + if [ ! -x "$COVER_STATUS" ]; then + fail "bananarchy-cover-status.sh is missing or not executable" fi -done -if ! grep -qF 'blank_timeout = auto' "$COVER_CONF" || \ - ! grep -qF 'wake_blank_timeout = 8' "$COVER_CONF" || \ - ! grep -qF 'backlight_path' "$COVER_CONF"; then - fail "cover display config no longer shares the Screen blank timeout" -fi -for f in "$COVER_EVENT" "$COVER_STATUS" "$NET_EVENT" "$COVER_INIT"; do - if ! sh -n "$f" 2>/dev/null; then - fail "shell syntax: ${f#$BASE_DIR/}" + if ! grep -qF 'bananarchy-cover-status.sh' "$COVER_EVENT" || \ + ! grep -qF 'BUTTON' "$COVER_EVENT" || \ + ! grep -qF 'network)' "$COVER_EVENT"; then + fail "cover event bridge lost the network/button commands" fi -done -if [ ! -x "$COVER_STATUS" ]; then - fail "bananarchy-cover-status.sh is missing or not executable" -fi -if ! grep -qF 'bananarchy-cover-status.sh' "$COVER_EVENT" || \ - ! grep -qF 'BUTTON' "$COVER_EVENT" || \ - ! grep -qF 'network)' "$COVER_EVENT"; then - fail "cover event bridge lost the network/button commands" -fi -for token in 'mute-ring)' 'hangup-call)' 'HANGUP_CLOSE' 'MUTE_RING'; do - if ! grep -qF -- "$token" "$COVER_EVENT"; then - fail "cover event bridge is missing closed-flip call control: $token" + for token in 'mute-ring)' 'hangup-call)' 'HANGUP_CLOSE' 'MUTE_RING'; do + if ! grep -qF -- "$token" "$COVER_EVENT"; then + fail "cover event bridge is missing closed-flip call control: $token" + fi + done + if ! grep -qF 'bananarchy-cover-event.sh network' "$NET_EVENT" || \ + ! grep -qF 'bananarchy-cover-event.sh network' "$COVER_INIT"; then + fail "network indicators are not published to the cover daemon" fi -done -if ! grep -qF 'bananarchy-cover-event.sh network' "$NET_EVENT" || \ - ! grep -qF 'bananarchy-cover-event.sh network' "$COVER_INIT"; then - fail "network indicators are not published to the cover daemon" -fi -for f in "$BASE_DIR/prebuilt/bananarchy-daemons/usr/bin/bananarchy-cover-idle" \ - "$BASE_DIR/prebuilt/bananarchy-daemons/usr/bin/bananarchy-volume-keys"; do - if ! strings "$f" 2>/dev/null | grep -qF 'BUTTON'; then - fail "${f#$BASE_DIR/} is stale: rebuild with scripts/build-bananarchy-daemons.sh" + for f in "$BASE_DIR/prebuilt/bananarchy-daemons/usr/bin/bananarchy-cover-idle" \ + "$BASE_DIR/prebuilt/bananarchy-daemons/usr/bin/bananarchy-volume-keys"; do + if ! strings "$f" 2>/dev/null | grep -qF 'BUTTON'; then + fail "${f#$BASE_DIR/} is stale: rebuild with scripts/build-bananarchy-daemons.sh" + fi + done + if [ ! -x "$BASE_DIR/scripts/test-cover-idle.py" ]; then + fail "missing host integration test scripts/test-cover-idle.py" + fi + if command -v gcc >/dev/null 2>&1 && \ + ! "$BASE_DIR/scripts/test-cover-idle.py" >/dev/null 2>&1; then + fail "host cover display behaviour test failed" fi -done -if [ ! -x "$BASE_DIR/scripts/test-cover-idle.py" ]; then - fail "missing host integration test scripts/test-cover-idle.py" -fi -if command -v gcc >/dev/null 2>&1 && \ - ! "$BASE_DIR/scripts/test-cover-idle.py" >/dev/null 2>&1; then - fail "host cover display behaviour test failed" -fi -echo "[check] Closed-flip external panel backend..." -for token in 'cover_hw_release' 'cover_spi_draw' 'hw_init_panel' \ - 'mux_closed_level' 'reset_assert_level' 'spi_speed_hz' \ - 'BANANARCHY_COVER_SPI_SIM' 'BA_GPIO_GET_LINEHANDLE' \ - 'BA_SPI_IOC_MESSAGE' 'MIPI DBI' \ - 'cover_main_panel_is_off'; do - if ! grep -qF -- "$token" "$COVER_SRC"; then - fail "bananarchy-cover-idle.c lost the closed-flip spidev backend: $token" + echo "[check] Closed-flip external panel backend..." + for token in 'cover_hw_release' 'cover_spi_draw' 'hw_init_panel' \ + 'mux_closed_level' 'reset_assert_level' 'spi_speed_hz' \ + 'BANANARCHY_COVER_SPI_SIM' 'BA_GPIO_GET_LINEHANDLE' \ + 'BA_SPI_IOC_MESSAGE' 'MIPI DBI' \ + 'cover_main_panel_is_off'; do + if ! grep -qF -- "$token" "$COVER_SRC"; then + fail "bananarchy-cover-idle.c lost the closed-flip spidev backend: $token" + fi + done + for token in 'backend = kernel' 'main_fb_device = /dev/fb0' \ + 'kernel_dpms_helper = /usr/bin/bananarchy-cover-dpms.sh' \ + 'kernel_power_sync_helper = /usr/bin/bananarchy-display-power-sync' \ + 'kernel_command_path = /sys/kernel/debug/dri/0/command' \ + 'kernel_backlight_path = /sys/class/backlight/backlight/brightness' \ + 'kernel_backlight_power_path = /sys/class/backlight/backlight/bl_power' \ + 'kernel_backlight_marker = /run/bananarchy/cover-backlight' \ + 'kernel_backlight_level = 14' \ + 'kernel_backlight_invert = 0' \ + 'kernel_internal_sleep = 0' \ + 'gpiochip_device = auto' \ + 'spi_device = /dev/spidev0.1' \ + 'spi_mux_gpio = 13' 'spi_dc_gpio = 21' 'spi_reset_gpio = 23' \ + 'mux_closed_level = 1' 'mux_open_level = 0' \ + 'dc_command_level = 0' 'dc_data_level = 1' \ + 'reset_assert_level = 0' 'reset_idle_level = 1' \ + 'spi_speed_hz = 25000000'; do + if ! grep -qF -- "$token" "$COVER_CONF"; then + fail "cover display config lost the spidev polarity key: $token" + fi + done + if ! grep -qF 'flip_open' "$COVER_SRC" || \ + ! grep -qF 'cover_bus_release(hw)' "$COVER_SRC" || \ + ! grep -qF 'cover_draw(&hw, fb_path, &state)' "$COVER_SRC"; then + fail "the cover daemon no longer gates the shared bus on the flip state" fi -done -for token in 'backend = kernel' 'main_fb_device = /dev/fb0' \ - 'kernel_dpms_helper = /usr/bin/bananarchy-cover-dpms.sh' \ - 'kernel_power_sync_helper = /usr/bin/bananarchy-display-power-sync' \ - 'kernel_command_path = /sys/kernel/debug/dri/0/command' \ - 'kernel_backlight_path = /sys/class/backlight/backlight/brightness' \ - 'kernel_backlight_power_path = /sys/class/backlight/backlight/bl_power' \ - 'kernel_backlight_marker = /run/bananarchy/cover-backlight' \ - 'kernel_backlight_level = 14' \ - 'kernel_backlight_invert = 0' \ - 'kernel_internal_sleep = 0' \ - 'gpiochip_device = auto' \ - 'spi_device = /dev/spidev0.1' \ - 'spi_mux_gpio = 13' 'spi_dc_gpio = 21' 'spi_reset_gpio = 23' \ - 'mux_closed_level = 1' 'mux_open_level = 0' \ - 'dc_command_level = 0' 'dc_data_level = 1' \ - 'reset_assert_level = 0' 'reset_idle_level = 1' \ - 'spi_speed_hz = 25000000'; do - if ! grep -qF -- "$token" "$COVER_CONF"; then - fail "cover display config lost the spidev polarity key: $token" + for token in 'cover_kernel_draw' 'cover_kernel_command' \ + 'cover_kernel_replay_firmware' 'cover_kernel_reset' \ + 'cover_kernel_backlight' 'cover_kernel_open_backlight' \ + 'cover_kernel_marker' 'cover_kernel_power_sync' \ + 'cover_kernel_restore_internal' \ + 'cover_kernel_display_off' 'kernel_bl_invert' \ + 'KERNEL_REDRAW_MS 1000' 'cover_main_panel_is_off' \ + 'BA_GPIO_GET_CHIPINFO' 'hw_ensure_gpiochip'; do + if ! grep -qF "$token" "$COVER_SRC"; then + fail "the kernel-owned cover backend lost $token" + fi + done + if ! grep -qF 'reinit' \ + "$BASE_DIR/overlay/rootfs/usr/bin/bananarchy-cover-dpms.sh" || \ + [ ! -x "$BASE_DIR/overlay/rootfs/usr/bin/bananarchy-cover-dpms.sh" ]; then + fail "the kernel-owned cover backend or its DPMS re-init helper is missing" fi -done -if ! grep -qF 'flip_open' "$COVER_SRC" || \ - ! grep -qF 'cover_bus_release(hw)' "$COVER_SRC" || \ - ! grep -qF 'cover_draw(&hw, fb_path, &state)' "$COVER_SRC"; then - fail "the cover daemon no longer gates the shared bus on the flip state" -fi -for token in 'cover_kernel_draw' 'cover_kernel_command' \ - 'cover_kernel_replay_firmware' 'cover_kernel_reset' \ - 'cover_kernel_backlight' 'cover_kernel_open_backlight' \ - 'cover_kernel_marker' 'cover_kernel_power_sync' \ - 'cover_kernel_restore_internal' \ - 'cover_kernel_display_off' 'kernel_bl_invert' \ - 'KERNEL_REDRAW_MS 1000' 'cover_main_panel_is_off' \ - 'BA_GPIO_GET_CHIPINFO' 'hw_ensure_gpiochip'; do - if ! grep -qF "$token" "$COVER_SRC"; then - fail "the kernel-owned cover backend lost $token" + 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 -done -if ! grep -qF 'reinit' \ - "$BASE_DIR/overlay/rootfs/usr/bin/bananarchy-cover-dpms.sh" || \ - [ ! -x "$BASE_DIR/overlay/rootfs/usr/bin/bananarchy-cover-dpms.sh" ]; then - fail "the kernel-owned cover backend or its DPMS re-init helper is missing" -fi -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" ] || \ - ! "$BASE_DIR/scripts/test-cover-kernel.py" >/dev/null 2>&1; then - fail "host kernel-owned cover panel test failed" -fi -if [ ! -x "$BASE_DIR/scripts/test-cover-spidev.py" ]; then - fail "missing host test scripts/test-cover-spidev.py" -fi -if command -v gcc >/dev/null 2>&1 && \ - ! "$BASE_DIR/scripts/test-cover-spidev.py" >/dev/null 2>&1; then - fail "host closed-flip external panel backend test failed" -fi -for f in "$BASE_DIR/prebuilt/bananarchy-daemons/usr/bin/bananarchy-cover-idle" \ - "$BASE_DIR/overlay/rootfs/usr/bin/bananarchy-cover-idle"; do - if ! strings "$f" 2>/dev/null | grep -qF 'kernel cmd %s' || \ - ! strings "$f" 2>/dev/null | grep -qF 'kernel backlight %u'; then - fail "${f#"$BASE_DIR/"} is stale: rebuild with scripts/build-bananarchy-daemons.sh" + 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 -done -for f in "$BASE_DIR/prebuilt/bananarchy-daemons/usr/bin/bananarchy-lid" \ - "$BASE_DIR/overlay/rootfs/usr/bin/bananarchy-lid"; do - if ! strings "$f" 2>/dev/null | grep -qxF 'LOCK'; then - fail "${f#"$BASE_DIR/"} is stale: rebuild with scripts/build-bananarchy-daemons.sh" + if [ ! -x "$BASE_DIR/scripts/test-cover-spidev.py" ]; then + fail "missing host test scripts/test-cover-spidev.py" fi -done + if command -v gcc >/dev/null 2>&1 && \ + ! "$BASE_DIR/scripts/test-cover-spidev.py" >/dev/null 2>&1; then + fail "host closed-flip external panel backend test failed" + fi + for f in "$BASE_DIR/prebuilt/bananarchy-daemons/usr/bin/bananarchy-cover-idle" \ + "$BASE_DIR/overlay/rootfs/usr/bin/bananarchy-cover-idle"; do + if ! strings "$f" 2>/dev/null | grep -qF 'kernel cmd %s' || \ + ! strings "$f" 2>/dev/null | grep -qF 'kernel backlight %u'; then + fail "${f#"$BASE_DIR/"} is stale: rebuild with scripts/build-bananarchy-daemons.sh" + fi + done + for f in "$BASE_DIR/prebuilt/bananarchy-daemons/usr/bin/bananarchy-lid" \ + "$BASE_DIR/overlay/rootfs/usr/bin/bananarchy-lid"; do + if ! strings "$f" 2>/dev/null | grep -qxF 'LOCK'; then + fail "${f#"$BASE_DIR/"} is stale: rebuild with scripts/build-bananarchy-daemons.sh" + fi + done -echo "[check] 2720 Flip external panel (opt-in DT)..." -if [ ! -f "$BASE_DIR/devices/nokia-beatles/qcom-msm8905-nokia-beatles-cover.dts" ] || \ - [ ! -x "$BASE_DIR/scripts/build-beatles-cover-panel.py" ] || \ - [ ! -x "$BASE_DIR/scripts/test-cover-dt.py" ]; then - fail "missing the opt-in cover DT source or its host validation tools" -fi -if command -v dtc >/dev/null 2>&1; then - if ! "$BASE_DIR/scripts/build-beatles-cover-panel.py" --check >/dev/null 2>&1; then - fail "opt-in two-panel DTB validation failed" + echo "[check] 2720 Flip external panel (opt-in DT)..." + if [ ! -f "$BASE_DIR/devices/nokia-beatles/qcom-msm8905-nokia-beatles-cover.dts" ] || \ + [ ! -x "$BASE_DIR/scripts/build-beatles-cover-panel.py" ] || \ + [ ! -x "$BASE_DIR/scripts/test-cover-dt.py" ]; then + fail "missing the opt-in cover DT source or its host validation tools" fi - if ! "$BASE_DIR/scripts/test-cover-dt.py" >/dev/null 2>&1; then - fail "host 2720 Flip DT wiring validation failed" + if command -v dtc >/dev/null 2>&1; then + if ! "$BASE_DIR/scripts/build-beatles-cover-panel.py" --check >/dev/null 2>&1; then + fail "opt-in two-panel DTB validation failed" + fi + if ! "$BASE_DIR/scripts/test-cover-dt.py" >/dev/null 2>&1; then + fail "host 2720 Flip DT wiring validation failed" + fi fi -fi -echo "[check] Cover panel diagnostics..." -COVER_DIAG="$BASE_DIR/overlay/rootfs/usr/bin/bananarchy-cover-diagnose.sh" -if [ ! -x "$COVER_DIAG" ] || ! sh -n "$COVER_DIAG" 2>/dev/null; then - fail "bananarchy-cover-diagnose.sh is missing or has bad syntax" -fi -if ! grep -qF '/dev/fb1' "$COVER_DIAG" || \ - ! grep -qF '/sys/class/graphics/fb1' "$COVER_DIAG" || \ - ! grep -qF '/dev/spidev0.1' "$COVER_DIAG" || \ - ! grep -qF 'spi_mux_gpio' "$COVER_DIAG" || \ - ! grep -qF 'bananarchy-coverctl' "$COVER_DIAG"; then - fail "cover diagnostics no longer inspect fb1, spidev and the daemon" -fi -if ! grep -qF 'bananarchy-cover-diagnose.sh' \ - "$BASE_DIR/scripts/apply-bananarchy-overlay.sh"; then - fail "apply-bananarchy-overlay.sh no longer installs the cover diagnostics" -fi - -echo "[check] 2720 Flip initramfs mux modules..." -MODULES_INITFS="$BASE_DIR/devices/nokia-beatles/modules-initfs" -for mod in mux-core mux-gpio spi-mux panel-mipi-dbi; do - if ! grep -qxF "$mod" "$MODULES_INITFS"; then - fail "devices/nokia-beatles/modules-initfs no longer loads $mod in the initramfs" + echo "[check] Cover panel diagnostics..." + COVER_DIAG="$BASE_DIR/overlay/rootfs/usr/bin/bananarchy-cover-diagnose.sh" + if [ ! -x "$COVER_DIAG" ] || ! sh -n "$COVER_DIAG" 2>/dev/null; then + fail "bananarchy-cover-diagnose.sh is missing or has bad syntax" fi -done -for ko in "$BASE_DIR/overlay/rootfs/lib/modules/6.12.1-msm8916/kernel/drivers/mux/mux-core.ko.zst" \ - "$BASE_DIR/overlay/rootfs/lib/modules/6.12.1-msm8916/kernel/drivers/mux/mux-gpio.ko.zst" \ - "$BASE_DIR/overlay/rootfs/lib/modules/6.12.1-msm8916/kernel/drivers/spi/spi-mux.ko.zst"; do - if [ ! -f "$ko" ]; then - fail "${ko#"$BASE_DIR/"} is missing from the overlay module tree" + if ! grep -qF '/dev/fb1' "$COVER_DIAG" || \ + ! grep -qF '/sys/class/graphics/fb1' "$COVER_DIAG" || \ + ! grep -qF '/dev/spidev0.1' "$COVER_DIAG" || \ + ! grep -qF 'spi_mux_gpio' "$COVER_DIAG" || \ + ! grep -qF 'bananarchy-coverctl' "$COVER_DIAG"; then + fail "cover diagnostics no longer inspect fb1, spidev and the daemon" + fi + if ! grep -qF 'bananarchy-cover-diagnose.sh' \ + "$BASE_DIR/scripts/apply-bananarchy-overlay.sh"; then + fail "apply-bananarchy-overlay.sh no longer installs the cover diagnostics" fi -done -echo "[check] 2720 Flip single-panel rollback..." -if [ ! -x "$BASE_DIR/scripts/build-beatles-no-cover-dtb.py" ]; then - fail "missing rollback builder scripts/build-beatles-no-cover-dtb.py" -elif command -v dtc >/dev/null 2>&1 && \ - ! "$BASE_DIR/scripts/build-beatles-no-cover-dtb.py" --check >/dev/null 2>&1; then - fail "the single-panel rollback DTB failed validation" -fi -if ! grep -qF 'parser.add_argument("--dtb"' \ - "$BASE_DIR/scripts/sync-beatles-bootfs.py" || \ - ! grep -qF 'parser.add_argument("--boot-image"' \ - "$BASE_DIR/scripts/sync-beatles-bootfs.py"; then - fail "sync-beatles-bootfs.py lost its DTB/boot-image overrides" + echo "[check] 2720 Flip initramfs mux modules..." + MODULES_INITFS="$BASE_DIR/devices/nokia-beatles/modules-initfs" + for mod in mux-core mux-gpio spi-mux panel-mipi-dbi; do + if ! grep -qxF "$mod" "$MODULES_INITFS"; then + fail "devices/nokia-beatles/modules-initfs no longer loads $mod in the initramfs" + fi + done + for ko in "$BASE_DIR/overlay/rootfs/lib/modules/6.12.1-msm8916/kernel/drivers/mux/mux-core.ko.zst" \ + "$BASE_DIR/overlay/rootfs/lib/modules/6.12.1-msm8916/kernel/drivers/mux/mux-gpio.ko.zst" \ + "$BASE_DIR/overlay/rootfs/lib/modules/6.12.1-msm8916/kernel/drivers/spi/spi-mux.ko.zst"; do + if [ ! -f "$ko" ]; then + fail "${ko#"$BASE_DIR/"} is missing from the overlay module tree" + fi + done + + echo "[check] 2720 Flip single-panel rollback..." + if [ ! -x "$BASE_DIR/scripts/build-beatles-no-cover-dtb.py" ]; then + fail "missing rollback builder scripts/build-beatles-no-cover-dtb.py" + elif command -v dtc >/dev/null 2>&1 && \ + ! "$BASE_DIR/scripts/build-beatles-no-cover-dtb.py" --check >/dev/null 2>&1; then + fail "the single-panel rollback DTB failed validation" + fi + if ! grep -qF 'parser.add_argument("--dtb"' \ + "$BASE_DIR/scripts/sync-beatles-bootfs.py" || \ + ! grep -qF 'parser.add_argument("--boot-image"' \ + "$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..." @@ -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,100 +2411,104 @@ if command -v dtc >/dev/null 2>&1; then done fi -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" || \ - grep -qF '"gpio52", "gpio56"' "$COCONUT_DTS" || \ - ! grep -qF '0x3030067' "$COCONUT_DTS" || \ - ! grep -qF '0x304006c' "$COCONUT_DTS" || \ - ! grep -qF '0x105000e' "$COCONUT_DTS" || \ - ! grep -qF '0x500d4' "$COCONUT_DTS"; then - fail "devices/nokia-coconut/qcom-msm8905-nokia-coconut.dts is missing the 6-column 22-key keypad layout" -fi -if ! awk '/key-end \{/,/\};/ { if ($0 ~ /linux,code = <0x74>;/) found=1 } END { exit(found ? 0 : 1) }' \ - "$COCONUT_DTS"; then - fail "devices/nokia-coconut/qcom-msm8905-nokia-coconut.dts key-end (gpio98) must map to KEY_POWER (0x74)" -fi -if ! awk '/resin \{/,/\};/ { if ($0 ~ /linux,code = <0x6c>;/) found=1 } END { exit(found ? 0 : 1) }' \ - "$COCONUT_DTS"; then - fail "devices/nokia-coconut/qcom-msm8905-nokia-coconut.dts pm8941_resin must map to KEY_DOWN (0x6c)" -fi -COCONUT_DTB="$BASE_DIR/prebuilt/kernel-6.12.1-msm8916/dtbs/qcom-msm8905-nokia-coconut.dtb" -if command -v dtc >/dev/null 2>&1 && [ -f "$COCONUT_DTB" ]; then - dec_coco="$(dtc -q -I dtb -O dts "$COCONUT_DTB" 2>/dev/null | sed 's/\\0/", "/g' || true)" - if ! printf "%s\n" "$dec_coco" | grep -qF '"gpio0", "gpio3", "gpio7", "gpio99", "gpio6", "gpio1"' || \ - printf "%s\n" "$dec_coco" | grep -qF '"gpio52", "gpio56"' || \ - ! printf "%s\n" "$dec_coco" | grep -qF '0x3030067' || \ - ! printf "%s\n" "$dec_coco" | grep -qF '0x304006c' || \ - ! printf "%s\n" "$dec_coco" | grep -qF '0x105000e' || \ - ! printf "%s\n" "$dec_coco" | \ - awk '/key-end \{/,/\};/ { if ($0 ~ /linux,code = <0x74>;/) found=1 } END { exit(found ? 0 : 1) }' || \ - ! printf "%s\n" "$dec_coco" | \ - awk '/resin \{/,/\};/ { if ($0 ~ /linux,code = <0x6c>;/) found=1 } END { exit(found ? 0 : 1) }' - then - fail "prebuilt/kernel-6.12.1-msm8916/dtbs/qcom-msm8905-nokia-coconut.dtb drifted from the 4x6 keypad layout" +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" || \ + grep -qF '"gpio52", "gpio56"' "$COCONUT_DTS" || \ + ! grep -qF '0x3030067' "$COCONUT_DTS" || \ + ! grep -qF '0x304006c' "$COCONUT_DTS" || \ + ! grep -qF '0x105000e' "$COCONUT_DTS" || \ + ! grep -qF '0x500d4' "$COCONUT_DTS"; then + fail "devices/nokia-coconut/qcom-msm8905-nokia-coconut.dts is missing the 6-column 22-key keypad layout" + fi + if ! awk '/key-end \{/,/\};/ { if ($0 ~ /linux,code = <0x74>;/) found=1 } END { exit(found ? 0 : 1) }' \ + "$COCONUT_DTS"; then + fail "devices/nokia-coconut/qcom-msm8905-nokia-coconut.dts key-end (gpio98) must map to KEY_POWER (0x74)" + fi + if ! awk '/resin \{/,/\};/ { if ($0 ~ /linux,code = <0x6c>;/) found=1 } END { exit(found ? 0 : 1) }' \ + "$COCONUT_DTS"; then + fail "devices/nokia-coconut/qcom-msm8905-nokia-coconut.dts pm8941_resin must map to KEY_DOWN (0x6c)" + fi + COCONUT_DTB="$BASE_DIR/prebuilt/kernel-6.12.1-msm8916/dtbs/qcom-msm8905-nokia-coconut.dtb" + if command -v dtc >/dev/null 2>&1 && [ -f "$COCONUT_DTB" ]; then + dec_coco="$(dtc -q -I dtb -O dts "$COCONUT_DTB" 2>/dev/null | sed 's/\\0/", "/g' || true)" + if ! printf "%s\n" "$dec_coco" | grep -qF '"gpio0", "gpio3", "gpio7", "gpio99", "gpio6", "gpio1"' || \ + printf "%s\n" "$dec_coco" | grep -qF '"gpio52", "gpio56"' || \ + ! printf "%s\n" "$dec_coco" | grep -qF '0x3030067' || \ + ! printf "%s\n" "$dec_coco" | grep -qF '0x304006c' || \ + ! printf "%s\n" "$dec_coco" | grep -qF '0x105000e' || \ + ! printf "%s\n" "$dec_coco" | \ + awk '/key-end \{/,/\};/ { if ($0 ~ /linux,code = <0x74>;/) found=1 } END { exit(found ? 0 : 1) }' || \ + ! printf "%s\n" "$dec_coco" | \ + awk '/resin \{/,/\};/ { if ($0 ~ /linux,code = <0x6c>;/) found=1 } END { exit(found ? 0 : 1) }' + then + fail "prebuilt/kernel-6.12.1-msm8916/dtbs/qcom-msm8905-nokia-coconut.dtb drifted from the 4x6 keypad layout" + fi + fi + if ! grep -qF 'of_machine_is_compatible("nokia,coconut")' "$TORCH_SRC" || \ + ! grep -qF '.name = "camera:flash"' "$TORCH_SRC" || \ + ! grep -qF '/sys/class/leds/camera:flash/brightness' "$BASE_DIR/src/dwm-plugins/camera_plugin.cpp" || \ + ! 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 ! grep -qF 'of_machine_is_compatible("nokia,coconut")' "$TORCH_SRC" || \ - ! grep -qF '.name = "camera:flash"' "$TORCH_SRC" || \ - ! grep -qF '/sys/class/leds/camera:flash/brightness' "$BASE_DIR/src/dwm-plugins/camera_plugin.cpp" || \ - ! 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 -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" -SPARKLER_DTB="$BASE_DIR/prebuilt/kernel-6.12.1-msm8916/dtbs/qcom-msm8909-nokia-sparkler.dtb" -TORCH_KO="$BASE_DIR/prebuilt/kernel-6.12.1-msm8916/leds/leds-msm8905-torch.ko" -if ! grep -qxF 'deviceinfo_drm="true"' "$SPARKLER_DEVINFO"; then - fail "devices/nokia-sparkler/deviceinfo must set deviceinfo_drm=\"true\"" -fi -if ! grep -qxF 'matrix_keypad' "$SPARKLER_INITFS" || \ - ! grep -qxF 'matrix_keymap' "$SPARKLER_INITFS"; then - fail "devices/nokia-sparkler/modules-initfs must include matrix_keypad and matrix_keymap" -fi -if ! grep -qF '0x500d4' "$SPARKLER_DTS" || \ - ! grep -qF '0x100007f' "$SPARKLER_DTS" || \ - ! grep -qF '0x205000e' "$SPARKLER_DTS" || \ - ! grep -qF '0x301009e' "$SPARKLER_DTS" || \ - ! grep -qF 'clock-frequency = <1094400000>;' "$SPARKLER_DTS" || \ - ! awk '/vibrator@c000 \{/,/\};/ { if ($0 ~ /status = "disabled";/) found=1 } END { exit(found ? 0 : 1) }' "$SPARKLER_DTS" || \ - grep -qE '0x5008b|0x10002b8|0x20501be|0x30102b9' "$SPARKLER_DTS"; then - fail "devices/nokia-sparkler/qcom-msm8909-nokia-sparkler.dts drifted from Sxmo keypad, CPU clock, or haptic invariants" -fi -if command -v dtc >/dev/null 2>&1 && [ -f "$SPARKLER_DTB" ]; then - dec_sparkler="$(dtc -q -I dtb -O dts "$SPARKLER_DTB" 2>/dev/null | sed 's/\\0/", "/g' || true)" - if ! printf "%s\n" "$dec_sparkler" | grep -qF 'qcom,msm-id = <0xf5 0x00>;' || \ - ! printf "%s\n" "$dec_sparkler" | grep -qF 'qcom,board-id = <0x08 0x100>;' || \ - ! printf "%s\n" "$dec_sparkler" | grep -qF 'reg = <0x80000000 0x20000000>;' || \ - ! printf "%s\n" "$dec_sparkler" | grep -qF 'sound@7702000' || \ - ! printf "%s\n" "$dec_sparkler" | \ - awk '/vibrator@c000 \{/,/\};/ { if ($0 ~ /status = "disabled";/) found=1 } END { exit(found ? 0 : 1) }' || \ - ! printf "%s\n" "$dec_sparkler" | grep -qF 'audio-codec@f000' || \ - ! printf "%s\n" "$dec_sparkler" | grep -qF '0x500d4' || \ - ! printf "%s\n" "$dec_sparkler" | grep -qF '0x100007f' || \ - ! printf "%s\n" "$dec_sparkler" | grep -qF '0x205000e' || \ - ! printf "%s\n" "$dec_sparkler" | grep -qF '0x301009e' || \ - printf "%s\n" "$dec_sparkler" | grep -qE '0x5008b|0x10002b8|0x20501be|0x30102b9' - then - fail "prebuilt/kernel-6.12.1-msm8916/dtbs/qcom-msm8909-nokia-sparkler.dtb drifted from Sparkler DTS invariants" +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" + SPARKLER_DTB="$BASE_DIR/prebuilt/kernel-6.12.1-msm8916/dtbs/qcom-msm8909-nokia-sparkler.dtb" + TORCH_KO="$BASE_DIR/prebuilt/kernel-6.12.1-msm8916/leds/leds-msm8905-torch.ko" + if ! grep -qxF 'deviceinfo_drm="true"' "$SPARKLER_DEVINFO"; then + fail "devices/nokia-sparkler/deviceinfo must set deviceinfo_drm=\"true\"" + fi + if ! grep -qxF 'matrix_keypad' "$SPARKLER_INITFS" || \ + ! grep -qxF 'matrix_keymap' "$SPARKLER_INITFS"; then + fail "devices/nokia-sparkler/modules-initfs must include matrix_keypad and matrix_keymap" + fi + if ! grep -qF '0x500d4' "$SPARKLER_DTS" || \ + ! grep -qF '0x100007f' "$SPARKLER_DTS" || \ + ! grep -qF '0x205000e' "$SPARKLER_DTS" || \ + ! grep -qF '0x301009e' "$SPARKLER_DTS" || \ + ! grep -qF 'clock-frequency = <1094400000>;' "$SPARKLER_DTS" || \ + ! awk '/vibrator@c000 \{/,/\};/ { if ($0 ~ /status = "disabled";/) found=1 } END { exit(found ? 0 : 1) }' "$SPARKLER_DTS" || \ + grep -qE '0x5008b|0x10002b8|0x20501be|0x30102b9' "$SPARKLER_DTS"; then + fail "devices/nokia-sparkler/qcom-msm8909-nokia-sparkler.dts drifted from Sxmo keypad, CPU clock, or haptic invariants" + fi + if command -v dtc >/dev/null 2>&1 && [ -f "$SPARKLER_DTB" ]; then + dec_sparkler="$(dtc -q -I dtb -O dts "$SPARKLER_DTB" 2>/dev/null | sed 's/\\0/", "/g' || true)" + if ! printf "%s\n" "$dec_sparkler" | grep -qF 'qcom,msm-id = <0xf5 0x00>;' || \ + ! printf "%s\n" "$dec_sparkler" | grep -qF 'qcom,board-id = <0x08 0x100>;' || \ + ! printf "%s\n" "$dec_sparkler" | grep -qF 'reg = <0x80000000 0x20000000>;' || \ + ! printf "%s\n" "$dec_sparkler" | grep -qF 'sound@7702000' || \ + ! printf "%s\n" "$dec_sparkler" | \ + awk '/vibrator@c000 \{/,/\};/ { if ($0 ~ /status = "disabled";/) found=1 } END { exit(found ? 0 : 1) }' || \ + ! printf "%s\n" "$dec_sparkler" | grep -qF 'audio-codec@f000' || \ + ! printf "%s\n" "$dec_sparkler" | grep -qF '0x500d4' || \ + ! printf "%s\n" "$dec_sparkler" | grep -qF '0x100007f' || \ + ! printf "%s\n" "$dec_sparkler" | grep -qF '0x205000e' || \ + ! printf "%s\n" "$dec_sparkler" | grep -qF '0x301009e' || \ + printf "%s\n" "$dec_sparkler" | grep -qE '0x5008b|0x10002b8|0x20501be|0x30102b9' + then + fail "prebuilt/kernel-6.12.1-msm8916/dtbs/qcom-msm8909-nokia-sparkler.dtb drifted from Sparkler DTS invariants" + fi + fi + if ! grep -qF 'vibrate_haptic_audio' "$BASE_DIR/src/dwm-plugins/sxmo_vibrate.c" || \ + ! grep -qF '157.0' "$BASE_DIR/src/dwm-plugins/sxmo_vibrate.c" || \ + ! grep -qF 'nokia,sparkler' "$BASE_DIR/src/dwm-plugins/sxmo_vibrate.c" || \ + ! grep -qF 'SND_PCM_FORMAT_FLOAT_LE' "$BASE_DIR/src/dwm-plugins/sxmo_vibrate.c" || \ + ! grep -qF 'pa_sw_volume_to_linear' "$BASE_DIR/src/dwm-plugins/sxmo_vibrate.c" || \ + ! grep -qF 'HAPTIC_REF_RX3_VOL' "$BASE_DIR/src/dwm-plugins/sxmo_vibrate.c" || \ + ! grep -qF 'libpulse' "$BASE_DIR/scripts/build-dwm-plugins.sh" || \ + ! grep -qF 'libpulse' "$BASE_DIR/scripts/build-sxmo-x11.sh"; then + fail "sxmo_vibrate.c or plugin build lost volume-independent 157 Hz haptic audio support for nokia-sparkler" + fi + if ! grep -qF 'of_machine_is_compatible("nokia,sparkler")' "$TORCH_SRC" || \ + ! grep -qF 'MSM8905_TLMM_GPIO31_PHYS' "$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 -if ! grep -qF 'vibrate_haptic_audio' "$BASE_DIR/src/dwm-plugins/sxmo_vibrate.c" || \ - ! grep -qF '157.0' "$BASE_DIR/src/dwm-plugins/sxmo_vibrate.c" || \ - ! grep -qF 'nokia,sparkler' "$BASE_DIR/src/dwm-plugins/sxmo_vibrate.c" || \ - ! grep -qF 'SND_PCM_FORMAT_FLOAT_LE' "$BASE_DIR/src/dwm-plugins/sxmo_vibrate.c" || \ - ! grep -qF 'pa_sw_volume_to_linear' "$BASE_DIR/src/dwm-plugins/sxmo_vibrate.c" || \ - ! grep -qF 'HAPTIC_REF_RX3_VOL' "$BASE_DIR/src/dwm-plugins/sxmo_vibrate.c" || \ - ! grep -qF 'libpulse' "$BASE_DIR/scripts/build-dwm-plugins.sh" || \ - ! grep -qF 'libpulse' "$BASE_DIR/scripts/build-sxmo-x11.sh"; then - fail "sxmo_vibrate.c or plugin build lost volume-independent 157 Hz haptic audio support for nokia-sparkler" -fi -if ! grep -qF 'of_machine_is_compatible("nokia,sparkler")' "$TORCH_SRC" || \ - ! grep -qF 'MSM8905_TLMM_GPIO31_PHYS' "$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 echo "[check] Universal keypad-friendly timer (sxmo_timer.sh, dmenu, hooks)..." @@ -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 \