It uses a pure **X11 (`Xlibre` + `sxmo-de-dwm`)** stack (no Wayland) with **Adreno 304 (`FD304`) Glamor + DRI3 + GLX GPU acceleration** over `panel-mipi-dbi` KMSRO, optimized for `< 2 ms` UI wakeup latency and `< 95 MB` idle RAM on 512 MB devices.
-`src/sxmo-dwm/`: patched `dwm` window manager (`240x320` vertical `bstack` layout, 24px Pango status bar, native `ParentRelative` desktop clock and `"Menu"`/`"Names"` softkey bar, C-level `evdev``SW_LID` slider and universal key wake handling, `*` + `#` screenshot chord via `bananarchy-screenshot`, live `.Xresources` reload, and `.so` plugin loader via `dwm_plugin.h`).
-`src/dwm-plugins/`: preloaded C++20 `240x320` DWM plugins linked against `libneoui.so` and shared headers:
-`theme.h`: header forwarding to `../neoui/neoui.h` for unified `.Xresources` / `~/.xthemes/*.xth` parsing, proportional font sizing (`theme.baseFontSize`), automatic shade derivation, and live Xft/Pango theme reloading (`PluginTheme`).
-`sms_plugin.cpp` (`sms.so` / `xsms`): threaded conversation view whose message bodies are drawn line by line and clipped to the bubble by `renderLayoutLines()`, with a per-message scroll offset (`msgScrollPx`) and right-edge scrollbar; `smsTextMetrics()` accounts GSM-7 septets versus UCS-2 UTF-16 units and concatenated part limits. Reads `sms.txt` logs written by the QMI WMS daemon after 8-bit/16-bit concatenated SMS reassembly.
- The stock `system` superblock is wiped by default for every flash method; `--no-wipe-system` is the opt-out and `--wipe-system` a redundant alias. In `recovery` mode the wiped `system` means a normal power-on hangs on the KaiOS logo and Volume Up is mandatory to boot Bananarchy.
-`nokia-beatles` boot chain: `images/boot-lk2nd-nokia-beatles.img` is built from upstream `msm8916-mainline/lk2nd` at pinned commit `cf45aefd22d744b2bf9b39455afae697ce430063` plus `bootloader/lk2nd/nokia-beatles.patch` (see `bootloader/lk2nd/README.md`; rebuild with `scripts/build-lk2nd-beatles.sh`). It keeps the upstream QCDT layout (both `0x14b` entries `0xb/0x100` and `0x1000b/0x100` sharing one `msm8905-qrd-skub` DTB, stock `qcom,board-id` order) with a compact `/lk2nd/nokia-beatles` node injected, and **adds `/cpus` with `cpu@0`..`cpu@3` and 4-byte `device_type` to the common `lk2nd.dtsi` so every QCDT DTB has it**. The 2720's MSM8905 is a partial-goods 2-core part and its aboot `ASSERT`s at `platform/msm_shared/partial_goods.c:80` when `/cpus`, `cpu@2` or `cpu@3` is missing — that was the actual "black screen / no fastboot" crash (Sahara MEMORY_DEBUG RLOG log, see `bootloader/lk2nd/README.md` and `backup/nokia-beatles-2720/crash-20261109/aboot-log.txt`). cmdline `lk2nd lk2nd.compatible=nokia,beatles`, `lk2nd,match-panel` for all three GC9305 panel names the aboot reports, and the single `qcom,mdss_spi_gc9305_v2_qvga_cmd` (the panel the live aboot reports) `lk2nd,panel-init` stream replayed on BLSP1 QUP5 (DC GPIO 110) only when aboot did not leave continuous splash enabled (or when `lk2nd.force-panel-init` is in the cmdline), so the 240x320 RGB565 main panel is initialized even without cont-splash. `spi-display.c` also paints the branded RGB565 boot splash into the framebuffer (without flushing during init): `DISABLE_SPLASH_PARTITION=1` plus `menu.c`'s bottom-only text means upstream lk2nd otherwise pushes a nearly black frame, which is what the "KaiOS logo then blank screen" is. `lk2nd/include/lk2nd/spi-panel-init.h` is shared with the host unit test; the repo copy is `bootloader/lk2nd/spi-panel-init.h` and `check-lk2nd-beatles.py` keeps them in sync and enforces that QCDT shape. Both the normal and diagnostic images carry `lk2nd.no-display` (RAM-only framebuffer, no QUP SPI before USB) because unbounded QUP/clock register polls used to wedge lk2nd with the boot vibrator stuck on. The port now bounds those polls (`QUP_FIFO_TIMEOUT`, `CLK_POLL_TIMEOUT`) and adds `oem display-init` / `oem display-test` / `oem scan-dtb` fastboot probes that run after USB is up, plus `oem screenshot` to verify the framebuffer. Live `oem display-init` confirmed the GC9305 v2 stream and the 240x320 RGB565 frame; a chain-loaded diagnostic falls back to the QCDT panel stream when aboot tags are absent, `oem scan-dtb` stages the final DTB after lk2nd DT updates, `oem ramoops console` validates and bounds pstore data, and the QUP per-word `SPEW` log is removed. The r3 port also makes `oem read-partition` block-safe: it rounds MMC reads up to the eMMC block size, rejects unaligned offsets and stages only the requested byte count. `images/boot-lk2nd-nokia-beatles-display.img` uses `lk2nd.display=on` for boot-time panel init via the downstream GC9305 v2 `lk2nd,panel-init` stream; flash it with `--lk2nd-image`. The diagnostic image additionally has `DEBUG=2 LK2ND_FORCE_FASTBOOT=1`. `check-lk2nd-beatles.py --expect-display` guards the display variant; `scripts/test-lk2nd-beatles-port.py` runs all three. lk2nd is confirmed working over live fastboot (`lk2nd:compatible=nokia,beatles`, `model=Nokia 2720 Flip`, panel `qcom,mdss_spi_gc9305_v2_qvga_cmd`, `unlocked=yes`). `flash-edl.py` defaults to `--method lk2nd` for every target; stock aboot accepts the port and lk2nd boots Bananarchy from `userdata` via `extlinux.conf` (`fdt /qcom-msm8905-nokia-beatles.dtb`). On `nokia-beatles` the default is now the Argon shape: lk2nd in `boot`, the standalone mainline `boot.img` in `recovery` (Volume Up fallback). `--method both` remains as a fallback that writes the standalone mainline `boot.img` to both slots. `--verify` reads back every slot and `--dump-diagnostics` saves small bootloader/config partitions for secure-boot analysis. `scripts/check-lk2nd-beatles.py` validates the boot header, both 2720 QCDT entries, `/cpus` in every QCDT DTB, the device node
-`bootloader/loaders/`: device-specific signed Firehose programmers; `DEVICE_LOADERS` in `flash-edl.py` maps each target codename to one (`8k.mbn` serves both `nokia-sparkler` and `nokia-leo`), and `DEVICE_LOADER_VARIANTS` maps `--variant us` on `nokia-beatles` to `2720v.mbn` (`Nokia_bts_us`). Never flash a different device's programmer: Sahara rejects the signature and `--list-loaders` shows the embedded attestation identity.
-`scripts/rootfs-packages.txt`: single source of truth for the `armv7` rootfs package set, read by both `bootstrap-rootfs.sh` and `rebuild-image.sh`. It intentionally contains no `device-*` package; `scripts/apply-bananarchy-overlay.sh` installs the per-device `devices/<device>/modules-initfs` list as `/usr/share/mkinitfs/modules/00-device-<device>.modules` (plus its `initramfs.load` mapping) so a clean-clone bootstrap still builds the correct initramfs. `scripts/check-rebuild.sh` guards this. The package set also includes `msm-firmware-loader`, its OpenRC companion and `msm-firmware-loader-wcnss`; explicit sysinit/boot links are required because packages are installed with `--no-scripts`. This mounts the stock `modem` and `persist` partitions before udev and supplies WCNSS/modem firmware plus factory Wi-Fi NV data, allowing both `wlan0` and `hci0` to enumerate. The package set explicitly contains `glib` and `gsettings-desktop-schemas`; because apk is invoked with `--no-scripts`, `apply-bananarchy-overlay.sh` must run `compile-gsettings-schemas.sh` to generate `gschemas.compiled`, otherwise WebKitGTK's network process aborts with an internal error. The package set also includes `util-linux-misc` for `script(1)` and `bluez-btmgmt` for `btmgmt`, which the live Bluetooth scan wrapper uses to keep a single interactive BlueZ client alive and enable LE discovery on the WCNSS controller.
-`scripts/rootfs-prune-packages.txt`: denylist of Wayland-only, Rust-based, and retired packages purged from existing rootfs trees by `bootstrap-rootfs-container.sh` and `rebuild-image.sh`.
-`scripts/prune-rootfs-packages.sh`: two-phase rootfs pruner (`world` before `apk add`, `purge` after) that reads the denylist and pins `install_if` packages with negative `!pkg` world constraints plus `apk fix`; the `world` phase is required so apk can atomically replace Rust `sudo-rs` with C `sudo`.
- **Flip lid and cover daemon**: the compiled C `bananarchy-lid` (service `bananarchy-lid`) reads the current `EV_SW` switch mask from `/dev/input/event2`, follows hall edge events with an 80 ms stability window and reconciles raw gpio36/gpio92 debugfs levels every 200 ms even when switch evdev is present, because the 2720 can miss edges or leave `EVIOCGSW` stale. The main beatles panel uses 25 MHz SPI (other targets stay at 50 MHz) to prevent high-backlight PWM noise from corrupting the display at brightness levels above 10/14. It publishes `/run/bananarchy/lid-state` so a boot-open flip starts X unlocked, directly blanks/restores the main backlight and `white:kbd_backlight`, clears the lock flag and sends a trusted `CLOSE` to `locker.so` on open, and broadcasts `LID CLOSED|OPEN` to the cover IPC. The compiled C `bananarchy-cover-idle` replaces the CPU-spinning native `bananarchy-coverd` in the default runlevel: it is a 0%-CPU Unix SOCK_DGRAM server implementing the `bananarchy-coverctl` protocol and renders a 240x240 XRGB8888 clock or `TEST bars` to the 32-bpp `/dev/fb1` with `write()`/`fsync()`. It keeps the cover fully off while the flip is open (black frame, `FBIOBLANK`/`FB_BLANK_POWERDOWN` and the optional `backlight_path` sysfs node driven from `cover_is_lit()`), shows clock/battery/network indicators only after a trusted `BUTTON` from `bananarchy-volume-keys` while closed, and blanks again after the same `~/.config/sxmo/idle_blank_timeout` used by `dwm` (`blank_timeout = auto` in `/etc/bananarchy/cover-display.conf`). `usr/bin/bananarchy-cover-diagnose.sh` reports the live `/dev/fb1` state for hardware sign-off. The shipping beatles DTS keeps the single-panel layout; the two-panel DT is opt-in (see above). `cover-panel.dtsi` is the compile-checked reference overlay. `scripts/test-cover-dt.py` guards both layouts, the firmware, initramfs lists, mux modules and Xorg card0 pin.
- **Camera, volume keys and cover spi-mux**: `etc/modules-load.d/bananarchy-hardware.conf` plus `etc/local.d/10-bananarchy-hardware.start` load `msm8905-cam` (registers `/dev/video0`) and `spidev`. The demosaic sampler rotates frames 180 degrees only when `of_machine_is_compatible("nokia,beatles")`, correcting the Flip's raw V4L2 orientation without changing other targets or adding a frame copy. `scripts/busybox-sbin-applets.txt` restores the missing `/sbin` applets including `reboot`/`poweroff`. The compiled C `bananarchy-volume-keys` (OpenRC service `bananarchy-volume-keys`) handles `KEY_VOLUMEUP`/`KEY_VOLUMEDOWN` straight from evdev because the dwm passive X grab is unreliable; `sxmo_audio.sh` mirrors the logical volume into the first live PipeWire sink via `bananarchy_set_sink_volume()` and debounces double steps with `bananarchy_vol_debounce()`. The shipping `spidev@1` stays enabled for diagnostics; it is disabled only in the opt-in two-panel DT where `spi-mux` owns chip select 1. `dc_gpio = -1` remains in `/etc/bananarchy/cover-display.conf` for the retained native spidev fallback.
- **BusyBox applet completeness**: `scripts/busybox-applets.txt` is the canonical `/bin` applet list and `apply-bananarchy-overlay.sh` recreates any missing symlinks. A rootfs snapshot without `/bin/ash` (the `user` login shell) or `/bin/grep` (used by `openrc-run.sh`) breaks sshd logins and prevents the sysinit `udev` service from starting; without udev, input nodes stay root-owned and untagged, elogind gives Xorg no devices and the keypad is dead. `overlay/rootfs/etc/udev/rules.d/99-bananarchy-input-seat.rules` forces `TAG+="seat"`, `GROUP="input"`, `MODE="0660"`; restart `tinydm` after starting udev. The lk2nd `paint_boot_banner()` in `bootloader/lk2nd/nokia-beatles.patch` draws the branded RGB565 boot splash, not the old striped test pattern.
- **First-boot access (2720 Flip)**: `overlay/rootfs/etc/pam.d/sshd` supplies an explicit `pam_unix` stack and `overlay/rootfs/etc/ssh/sshd_config.d/90-bananarchy-access.conf` enables password/keyboard-interactive auth, because `50-postmarketos-ui-policy.conf` sets `UsePAM yes` while the plain `/usr/sbin/sshd` rejects that directive; `overlay/rootfs/etc/conf.d/sshd` pins `/usr/sbin/sshd.pam`. `overlay/rootfs/etc/ssh/sshd_config_debug` plus `etc/local.d/20-bananarchy-sshd-debug.start` keep a USB-only (172.16.42.1:2222) PAM-free fallback login; `keys/phone_id_ed25519.pub` is pre-authorized for `user` and `root`. The shipping `extlinux.conf` must contain `quiet splash` (the pmOS initramfs defaults to `nosplash=y`); `scripts/sync-beatles-bootfs.py` restores it and `scripts/check-beatles-bootimg.py` rejects debug cmdlines. `overlay/rootfs/usr/lib/udev/rules.d/99-bananarchy-keypad.rules` and `usr/share/X11/xorg.conf.d/60-bananarchy-keypad.conf` force X to attach the GPIO matrix keypad; `usr/bin/bananarchy-keypad-diagnose.sh` collects live input state. The external 240x240 panel firmware lives in `devices/nokia-beatles/nokia,beatles-gc9305-ext-panel.bin/.txt` and is listed in both initramfs panel file lists; `devices/nokia-beatles/cover-panel.dtsi` is the compile-checked reference overlay, and `devices/nokia-beatles/qcom-msm8905-nokia-beatles-cover.dts` holds the opt-in two-panel layout. `scripts/check-rebuild.sh` verifies DTB/DTS sync and rejects an accidentally applied cover overlay in the shipping DTB. The `mux-core`, `mux-gpio` and `spi-mux` modules are built and loaded. The recovered native `usr/bin/bananarchy-coverd` is retained only for diagnostics; `dc_gpio = -1` keeps it from fighting `panel-mipi-dbi-spi` for gpio110. gpio13 mux polarity, the external reset polarity and the lk2nd boot splash still need a physical sign-off on a live 2720 Flip.
All cross-compilation scripts run inside rootless Docker (`alpine:3.24``armv7` sysroot) and write to `prebuilt/`; `build-sxmo-x11.sh`, `sync-prebuilt-overlay.sh`, and `rebuild-image.sh` mirror those artifacts into `overlay/rootfs/` (and `build-sxmo-x11.sh` also refreshes `rootfs/` when present):
-`./scripts/build-kernel-audio.sh` — builds `6.12.1-msm8916` Adreno 304 `drm/msm`, QDSP6 audio, torch LED, camera, gpio-mux and spi-mux `.ko` modules, device `.dtb` files, and the `zImage` kernel image from `patches/kernel/config-bananarchy-msm8909.armv7` (exported as `overlay/rootfs/boot/vmlinuz`, `config`, `System.map`). The resolved `.config` is written back to the config file so the module build and the shipped kernel never drift. **Never change `CONFIG_PREEMPT*`, `CONFIG_PM_SLEEP`/`CONFIG_SUSPEND`, `CONFIG_SMP`, `CONFIG_MODVERSIONS`, `CONFIG_MODULE_UNLOAD`, `CONFIG_ENERGY_MODEL`, `CONFIG_PERF_EVENTS`, `CONFIG_FUNCTION_GRAPH_TRACER` or `CONFIG_HZ` in that config without also rebuilding every module from the pmaports kernel package**: vermagic, `struct dev_pm_info` / `struct device` / `struct task_struct` layouts, and the `HZ` macro compiled into module inlines must match the untouched package modules. `CONFIG_SCHED_HRTICK` and `CONFIG_CPU_IDLE_GOV_TEO` are ABI-safe but effectively no-ops on this 2-core, 2-idle-state target. See `BATTERY-OPTIMIZATION-ANALYSIS.md` §14 for the full cost/benefit analysis.
-`./scripts/version.sh [--print | --print-codename | target_rootfs]` — computes the date-based release version (`<year-letter><MM><DD>` with `2026 = a`) and its release codename, and substitutes `@BANANARCHY_VERSION@` / `@BANANARCHY_CODENAME@` in `etc/os-release`, `usr/lib/os-release`, `etc/issue`, and `etc/motd` (invoked automatically during overlay application and image builds). Current release is `a1108` / `dejavu`; `scripts/check-rebuild.sh` guards it.
-`./chroot-shell.sh` — opens an `armv7` container shell to manage packages in `rootfs/` (`pkg-add`, `pkg-del`, `pkg-search`); bootstraps `rootfs/` first if needed.
-`./rebuild-image.sh <device> [--mkinitfs]` — verifies the clone, syncs `prebuilt/` into `overlay/rootfs/`, bootstraps `rootfs/` from scratch when missing, applies the overlay, and produces flashable images in `images/`.
-`./scripts/bootstrap-rootfs.sh [rootfs-dir] [device] [--force|--check]` — creates a complete `armv7` rootfs from `scripts/rootfs-packages.txt` inside rootless Docker; idempotent via `etc/bananarchy/rootfs-bootstrap.done`.
-`./scripts/compile-gsettings-schemas.sh [rootfs-dir]` — compiles the target rootfs's GSettings XML into `usr/share/glib-2.0/schemas/gschemas.compiled`; called by `apply-bananarchy-overlay.sh` and guarded by `check-rebuild.sh`.
-`./scripts/prune-rootfs-packages.sh <rootfs-dir> world|purge` — removes Wayland-only, Rust-based, and retired packages from a target rootfs inside the build container.
-`./scripts/build-bananarchy-daemons.sh` — cross-builds the three compiled ARM idle daemons (`bananarchy-lid`, `bananarchy-cover-idle`, `bananarchy-volume-keys`) from `src/bananarchy-daemons/`; `--check` validates the ARM ELF artifacts and overlay sync. No Python-based daemon runs in the idle system.
-`./scripts/build-lk2nd-beatles.sh` — cross-builds all three beatles lk2nd images (normal, diagnostic and display; the display image is the flasher default) from the pinned upstream lk2nd commit plus `bootloader/lk2nd/nokia-beatles.patch` in rootless Docker (`--check` validates all three shipped images, `--only normal|diagnostic|display` builds one, `--force-panel-init` forces the panel replay, `--with-display` enables SPI display during boot). Offline validators: `scripts/check-lk2nd-beatles.py` and `scripts/test-lk2nd-beatles-port.py`.
-`./scripts/build-beatles-cover-panel.py` — builds the opt-in two-panel DTB (and optionally a boot image / `pmOS_boot` patch) for the physical gpio13/reset sign-off.
-`./scripts/build-beatles-no-cover-dtb.py` — builds the verified single-panel rollback DTB (and optionally a boot image / `pmOS_boot` patch).
-`./scripts/test-webarchy-renderer.py`, `./scripts/test-webkit-gsettings.py`, `./scripts/test-idle-blank-lock.py`, `./scripts/test-bluetooth-scan.py`, `./scripts/test-bluetooth-live-scan.py`, `./scripts/test-battery-charge-event.py`, `./scripts/test-gps-time-sync.py`, `./scripts/test-cover-idle.py` and `./scripts/test-cover-dt.py` — host unit/integration tests for the Webarchy renderer profile and GSettings schema build, the idle-blank screenlock wiring, the Bluetooth discovery parser and live PTY wrapper, the charger plug/unplug icon refresh, the GPS-only time source, the cover display state machine and the external-panel DT wiring (all also run by `check-rebuild.sh`).
-`./scripts/sync-prebuilt-overlay.sh [--check]` — mirrors `prebuilt/` artifacts into `overlay/rootfs/`; `--check` only reports drift.
-`./scripts/bootstrap-flash-deps.sh` — installs `pyusb` and `pyserial` into the gitignored `.flash-deps/` directory for `flash-edl.py`.
-`sudo ./flash-edl.sh [device]` — flashes `lk2nd` and the system image over Qualcomm USB EDL (`05c6:9008`), using the vendored `vendor/edl/` library and auto-installed host dependencies.
- **Indentation**: always use 2-space indentation in C, C++, Python, Yabasic, and shell scripts (tabs only in Makefiles and TSV files).
- **No emojis**: never use emojis in source code, UI strings, logs, or commit messages (use Nerd Font PUA codepoints defined in `neoui.h` / `phone_data.h` / `dmenu.c` for UI icons).
- **Unified theming**: never hardcode UI colors or font sizes in `dwm`, `dmenu`, `st`, or any DWM plugin. Read colors and proportional font sizes from `PluginTheme` (`src/neoui/neoui.h` / `src/dwm-plugins/theme.h`) / `.Xresources` (`theme.*`), and handle `RELOAD_THEME` on the plugin FIFO.
- **Zero-lag plugin model**: phone UI apps must run as preloaded resident daemons (`--preload`) guarded by `/tmp/dwm_plugin_<name>.lock`, sleeping at 0% CPU on `poll()` over `ConnectionNumber(dpy)` and `/tmp/dwm_plugin_<name>.fifo`, and rendering into an offscreen `Pixmap` (`240x296` at `X=0, Y=24`) copied with `XCopyArea` to prevent flicker.
- **Multiline text rendering**: on the target Pango/Xft stack `pango_xft_render_layout()` only paints the first line of a long multiline layout, so wrapped bodies must be drawn line by line with `pango_xft_render_layout_line()` using a scroll offset and a bounded visible line count (see `sms_plugin.cpp`, `dialer_plugin.cpp`, `modem_plugin.cpp`, and `neoui_draw_text_wrapped()`). Where the widget has a fixed rectangle, clip with `XftDrawSetClipRectangles()` and reset the clip afterwards so the softkey bar still draws; keep measurement and rendering at the same layout width. Wrapped document views must also map link focus through the same row expansion used for rendering (`buildRenderRows()` / `ensureFocusedLinkVisible()` in `smallweb_plugin.cpp`), so focusing a link scrolls the viewport in both wrap modes. `scripts/check-rebuild.sh` guards `sms_plugin.cpp` and the xkopher focus path.
- **SMS text accounting**: never treat `std::string::size()` (UTF-8 bytes) as an SMS character count. Use code-point-aware logic such as `smsTextMetrics()`: GSM-7 septets (160 per part, 153 when concatenated) or UCS-2 UTF-16 units (70 per part, 67 when concatenated). SMS log headers are parsed by `parseSmsHeaderLine()`, which strips `[SIM n]` tags; do not write those tags back into `sms.txt`.
- **Documentation**: keep `README.md`, `MANUAL.md`, `SDK.md`, and `CHANGELOG.md` synchronized with any new user-facing features, SDK functions, or keybindings, and do not leave third-party `.md` files inside `src/` or `edl/`.
- **Artifact sources**: `prebuilt/` is the single source of truth for compiled artifacts and `scripts/rootfs-packages.txt` for the `armv7` package set. Never edit `overlay/rootfs/` copies of binaries by hand; run `./scripts/sync-prebuilt-overlay.sh` after changing `prebuilt/`.
- **Package hygiene**: keep `scripts/rootfs-packages.txt` free of Rust-based top-level packages (use C `sudo`, never `sudo-rs`) and Wayland-purpose packages; `libwpe` and the `wayland-libs-*` shared libraries stay because GTK3/WebKitGTK link them directly, but no Wayland compositor, backend, or viewer is shipped. `scripts/check-rebuild.sh` enforces this and guards the compiled WebKit GSettings database.
- **Power management**: idle blanking is `dwm`'s native evdev timer (`src/sxmo-dwm/dwm.c`) plus `bananarchy-idle-blank.sh`; the timeout lives in `~/.config/sxmo/idle_blank_timeout` (default 300 s, `0` = off), is edited via **Config -> Screen blank** / `bananarchy-idle-timeout.sh`, and is reloaded on `SIGUSR1`. `~/.cache/sxmo/sxmo.noidle` and `SXMO_UNLOCK_IDLE_TIME` still override it. `bananarchy-screen-wake.sh` (called from the ring and notification hooks) wakes the panel for calls/SMS and resets the timer; locking or closing the lid blanks immediately. A blank also arms `bananarchy-idle-lock.sh`: after `~/.config/sxmo/idle_lock_delay` seconds of dark panel (default 30, `0` = immediate, `off` = disabled) it runs the trusted `sxmo_state.sh set screenoff` so `locker.so` receives `LOCK_BLANK`; every wake path cancels the pending lock. Runtime power policy: `/etc/bananarchy-power-policy.conf` +
notifies the user, and the helper's `sync` mode reports the result. **Config -> Time source** (`network` default, `gps`) and **Config -> Sync GPS time** use `usr/bin/bananarchy-gps-time-sync.sh` to set the datetime solely from GNSS; in GPS mode chronyd is stopped and every NTP burst is skipped. All GPS queries resolve the GNSS-capable modem through `usr/bin/bananarchy-gps-modem.sh`, never `mmcli -m any` on dual-SIM targets. Keep DNS
network-up events, and keep `var/lib/chrony` owned by the `chrony` user. Network state changes are event-driven through `etc/NetworkManager/dispatcher.d/30-bananarchy-network-status.sh` + `usr/bin/bananarchy-network-event.sh`; keep `superctl disable sxmo_networkmonitor` in the session start hooks, and never reintroduce `superctl start sxmo_networkmonitor` or a long-lived `nmcli device monitor`. The status bar clock must be refreshed synchronously on unlock (`sxmo_hook_unlock.sh`), by dmenu's `update_t9_status_indicator()` before `XStoreName()`, and every minute by the `statusbar_clock` aligned job in the session start hooks; `sxmo_hook_statusbar.sh` forces a root-name refresh on `time` / `state_change`, and its `battery` and `refresh` actions republish the charge icon together with a fresh clock (`bananarchy-time-sync.sh` calls `refresh` after an NTP clock step). `postmarketos-zram-swap` uses `/usr/bin/zramstart`, not `/etc/conf.d/zram-init`: keep `deviceinfo_zram_swap_algo="lz4"` in every `devices/*/deviceinfo*` file. Keep `vm.compaction_proactiveness=0` in `etc/sysctl.d/99-bananarchy-power.conf` and `etc/local.d/10-power-save.start`; see `BATTERY-OPTIMIZATION-ANALYSIS.md` §17 and §18. Deep standby is `bananarchy-suspend.sh` / `bananarchy-deep-standby.sh` / `sxmo_autosuspend.sh` / `sxmo_suspend.sh`, gated by `/etc/bananarchy-no-deep-standby` (shipped present = disabled) and inert because `CONFIG_SUSPEND` is off. A full custom module tree rebuild is deliberately **not** planned: this firmware has no PSCI `SYSTEM_SUSPEND`, so `CONFIG_SUSPEND` would only give s2idle (`freeze`), not `mem` / DDR self-refresh, for <1 mA of saving (see `BATTERY-OPTIMIZATION-ANALYSIS.md` §14 and §17). Never force `sxmo.noidle`/`sxmo.nosuspend` from the session scripts and never reintroduce the infinite `sxmo_not_suspendable` wakelock. `/etc/bananarchy/` is root-only.
- **Image residue**: `rebuild-image.sh` strips `/var/cache/apk`, all `apk.log*` files, and unused gettext locale trees before `mke2fs` and aborts the build if any apk cache/log remains; never add an `apk` call after that guard.
- **No on-device compiler**: `scripts/rootfs-packages.txt` ships no `gcc`/`g++`/`musl-dev`/`make` and no Janet runtime (`janet`, `janet-dev`, `jpm`); cross-compile native code with `scripts/build-*.sh`. On-device development uses the Yabasic FFI SDK (`neoui.yab` / `neonet.yab`), which requires `yabasic`, `libffi`, `libneoui.so`, and `libcurl.so.4` — never remove those. `scripts/check-rebuild.sh` guards both sides.
- **Core tools**: `curl`, `bc`, `ed`, `rlwrap`, `mandoc`, `nano`, `less`, and `frotz` are pinned core tools asserted by `scripts/check-rebuild.sh`. Perl, Lua, optional Tcl extensions, and the `sqlite` CLI are excluded, while `tcl`, `python3`, `bash`, `luajit`, `gawk`, `jq`, `gojq`, and `quickjs` remain as hard runtime dependencies.
- **Local agent config**: `.bantam.cfg` is a local, gitignored credential file. Never read, edit, commit, or unignore it; `scripts/check-rebuild.sh` verifies that its ignore rule stays in place.
- **Sentence case**: always use sentence case in subheadings and list items across all documentation files (`README.md`, `MANUAL.md`, `SDK.md`, `CHANGELOG.md`, `AGENTS.md`).
-`images/bananarchy-nokia-beatles.img`, `images/boot-bananarchy-nokia-beatles.img`, and `images/boot-lk2nd-nokia-beatles-display.img` are the current verified release artifacts. Their hashes are pinned by `scripts/check-rebuild.sh`, and `images/bananarchy-nokia-argon.img` is pinned as the matching 8110 4G release image. These files are local build outputs, not tracked in git; clean clones rebuild them from source.
- The shipping display lk2nd image is rebuilt from the pinned source patch and must contain the low-bit reboot cookie. `scripts/check-lk2nd-beatles.py`, `scripts/build-lk2nd-beatles.sh`, `scripts/test-lk2nd-beatles-port.py`, and `scripts/check-rebuild.sh` reject a display image without it; `prepare-release.sh` rebuilds stale or missing lk2nd images before packaging.
-`scripts/set-bananarchy-hostname.sh` writes `/etc/hostname`, `/etc/hosts` and the OpenRC hostname runlevel link from the canonical target name. Both bootstrap and overlay application call it, and `check-rebuild.sh` verifies all five target codenames.
- The Power menu item is **Reboot to bootloader** and calls `sxmo_power.sh bootloader`. The torch module uses the low-bit cookie on `nokia,beatles` and both low/high lanes on other targets, preserving generic lk2nd compatibility. The default `147147` unlock passcode provisioning is guarded, and the locker/passcode path is unchanged.
-`src/sxmo-dwm/dwm.c` uses the known-good 350 ms wake guard. Do not reintroduce the 120 ms `WAKE_KEY_DEBOUNCE_MS` experiment: it allowed a cold-boot key to open a resident `dmenu` window that held the keyboard grab.
-`overlay/rootfs/usr/bin/bananarchy-x11-session.sh` performs one startup `dwm-plugin dmenu close`, trusted locker `CLOSE`, and `Escape` key to release stale startup keyboard grabs. It does not leave a background poller running.
-`prepare-release.sh` packages the verified images by default and copies `bootloader/lk2nd-msm8909.img` for non-beatles targets. Set `BA_REBUILD=1` only when intentionally regenerating images from source.
- Release cleanup removes `backup/`, `.lk2nd-build/`, `__pycache__/`, stale debug boot images, and scratch logs. All `images/` files are local build outputs and are not tracked in git; `prepare-release.sh` rebuilds missing artifacts from source, and `check-rebuild.sh` pins the physically verified hashes only when those local artifacts exist.