Blank the cover fbdev when off and add panel diagnostics

This commit is contained in:
Luxferre committed 2026-11-10 14:11:00 +02:00
1 parent 7c52d616e7
commit 90e6771700
11 files changed
+121 -11

No files matched your search

+1 -1
View File
@@ -34,7 +34,7 @@ It uses a pure **X11 (`Xlibre` + `sxmo-de-dwm`)** stack (no Wayland) with **Adre
- `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, 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`). The shipping beatles DTS now includes the external panel behind `spi-mux`, so `/dev/fb1` exists for the cover renderer; `cover-panel.dtsi` is the compile-checked reference overlay for older DTBs. `scripts/test-cover-dt.py` guards the DT wiring, firmware, initramfs lists, mux modules and Xorg card0 pin.
- **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 now includes the external panel behind `spi-mux`, so `/dev/fb1` exists for the cover renderer; `cover-panel.dtsi` is the compile-checked reference overlay for older DTBs. `scripts/test-cover-dt.py` guards the DT wiring, 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()`. `spidev@1` is disabled because `spi-mux` owns chip select 1; the external panel is now a second `panel-mipi-dbi-spi` device on `/dev/fb1`. `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.dts` now ships the two-panel `spi-mux` layout. `scripts/check-rebuild.sh` verifies DTB/DTS sync and requires the cover wiring. 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.
+1
View File
@@ -20,6 +20,7 @@ Work since `a1108` has focused on reliable 2720 Flip hardware support and a repr
- **Provisioned the driver path**: `/lib/firmware/nokia,beatles-gc9305-ext-panel.bin` is now listed in `overlay/rootfs/usr/share/mkinitfs/files/00-nokia-argon-display.files` and `devices/nokia-beatles/00-nokia-beatles-display.files`, so `panel-mipi-dbi` (an initramfs module) can load it. `mux-core`, `mux-gpio` and `spi-mux` remain in `modules-load.d`/`local.d`, and `CONFIG_MULTIPLEXER`/`CONFIG_MUX_GPIO`/`CONFIG_SPI_MUX` stay `=m`.
- **Rebuilt and revalidated the boot artifacts**: the DTB was recompiled from the DTS and synced to `devices/`, `overlay/rootfs/boot/` and `prebuilt/kernel-6.12.1-msm8916/dtbs/`; `scripts/repack-beatles-bootimg.py` replaced the appended DTB in the standalone boot image and `scripts/sync-beatles-bootfs.py` refreshed `boot.img` and the DTB inside the raw image's `pmOS_boot` ext2 filesystem. The pinned beatles image hashes in `check-rebuild.sh` were updated, and `check-beatles-bootimg.py` plus `sync-beatles-bootfs.py --check` still pass. `devices/nokia-beatles/cover-panel.dtsi` was rewritten to mirror the shipping wiring and remains compile-checked as a reference for older DTBs.
- **Guards**: `scripts/test-cover-dt.py` validates the decompiled DTB (two displays, 25 MHz clocks, isolated gpio13, disabled spidev, stock IDs and 512 MiB memory fallback), DTB/DTS/copy consistency, initramfs firmware lists, kernel config, module loading and the Xorg card0 pin. `check-rebuild.sh` now requires the cover wiring instead of rejecting it.
- **Renderer "fully off" now uses fbdev blanking**: `bananarchy-cover-idle` calls `FBIOBLANK` with `FB_BLANK_POWERDOWN` after writing the black frame (and `FB_BLANK_UNBLANK` for a lit frame), so a real DRM fbdev powers the external connector down instead of just showing black. `cover_is_lit()` is the single source of truth for the frame, the optional `backlight_path` sysfs node and the blanking ioctl; the host state-machine test also guards these tokens. `/usr/bin/bananarchy-cover-diagnose.sh` reports `/dev/fb1`, its geometry, DRM cards, mux/panel modules, firmware, lid state and `bananarchy-coverctl STATUS` for the physical sign-off.
- **Still needs a live device**: gpio13 mux polarity, external reset polarity, the external panel init stream and the lk2nd boot splash (which drives QUP directly before Linux applies the mux pinctrl) cannot be confirmed offline. The DT and renderer are shipped; the physical sign-off remains the last validation step.
### 2720 Flip cover display behaviour
+1 -1
View File
@@ -456,7 +456,7 @@ Three native X11 games (`/usr/bin/snake`, `/usr/bin/tetris`, and `/usr/bin/scoun
- **X startup and keypad**: OpenRC starts independent services in parallel; `etc/init.d/local` replaces its stock `after *` dependency, which deadlocked with parallel startup on this image. `udev_settle_timeout=2` stops missing modem firmware from holding the display manager behind a long `udevadm settle`, and `bananarchy-sshd-debug` starts independently of `local.d`. A boot-open flip reads `/run/bananarchy/lid-state` and starts in `state=unlock` with no passcode screen, so the keypad is live as soon as `dwm` starts. If the keypad is dead, check `rc-service bananarchy-lid status`, `cat /run/bananarchy/lid-state`, `sxmo_state.sh get`, `/tmp/bananarchy_screen_locked`, `DISPLAY=:0 xwininfo -id 0xa00001` and `DISPLAY=:0 xinput list`.
- **Display distortion above 71% brightness**: the internal panel uses 25 MHz SPI on `nokia-beatles`, rather than the 50 MHz timing used by the other targets. This keeps the link stable when the MPP2 backlight PWM duty rises above the level-10/14 operating point. The brightness range remains 1–14 with no artificial cap, and panel offsets/init registers are unchanged. The timing can be checked with `dtc -I dtb -O dts /boot/qcom-msm8905-nokia-beatles.dtb | grep -A8 'display@0'`.
- **Closing the flip**: `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 the raw gpio36/gpio92 debugfs levels every 200 ms even while evdev is present. This covers missed edges and stale `EVIOCGSW` state without a busy-polling loop. On close it blanks the main panel and keypad LED immediately, runs `sxmo_state.sh set screenoff` and tells the cover daemon `LID CLOSED`; on open it clears the lock flag, restores both backlights, sends a trusted `CLOSE` to `locker.so` and runs `sxmo_state.sh set unlock`. Check `rc-service bananarchy-lid status`, `sxmo_state.sh get` and `grep -E " gpio(36|92) " /sys/kernel/debug/gpio`. If the hall polarity is inverted on your unit, set `BANANARCHY_LID_GPIO_FILE` to a different debugfs GPIO file for the fallback path.
- **Cover display status and behaviour**: `bananarchy-cover-idle` is the compiled 0%-CPU default daemon and answers `bananarchy-coverctl` (`PING`, `STATUS`, `LID CLOSED|OPEN`, `BUTTON`, `NETWORK`, `BATTERY`, `NOTIFY`, `BLANK`/`UNBLANK`, `TEST`); the native `bananarchy-coverd` is retained only for diagnostics. With the flip **open** the external panel is fully off (all-black frame plus backlight 0) and `BUTTON` is ignored. With the flip **closed** the panel stays off until an external side key is pressed: `bananarchy-volume-keys` reads `/run/bananarchy/lid-state` and sends the trusted `BUTTON` datagram instead of changing the volume, which shows the live clock, date, battery percentage and the compact main network indicators (`4G SIG75 WIFI`-style, published by `bananarchy-cover-status.sh` from the NetworkManager dispatcher and at service start). No further button blanks the cover after exactly the same **Config -> Screen blank** timeout that `dwm` uses (`~/.config/sxmo/idle_blank_timeout`, default 300 s, `0` = never; `blank_timeout = auto` in `/etc/bananarchy/cover-display.conf` selects it, a numeric value overrides it). The daemon blocks in `poll()` with no timer while off, so idle CPU stays at 0%. The renderer uses the 32-bpp fbdev `write()` path (not `mmap()`, which raises `SIGBUS` on the DRM fbdev). The shipping DTS now registers both panels on an `spi-mux`: `display@0` keeps the verified 240x320 internal panel at 25 MHz with gpio110 as D/C (Xorg still pins `/dev/dri/card0`), while `display@1` is the 240x240 external GC9305 at 25 MHz with its own gpio21 D/C line, gpio23 reset and `write-only` framebuffer, exposed as `/dev/fb1`. gpio13 selects the mux and has a dedicated pull-down pinctrl state so the internal panel stays selected until `gpio-mux` drives it; the external panel's pinctrl group no longer touches gpio13. `spidev@1` is disabled, the `mux-core`/`mux-gpio`/`spi-mux` modules are loaded, and the external panel firmware is included in the initramfs. `bananarchy-coverctl STATUS` should now report `backend=fb`. `scripts/test-cover-idle.py` verifies the state machine with a fake framebuffer and `scripts/test-cover-dt.py` validates the DTB, firmware lists and Xorg pin; the DTB, appended boot DTB and `pmOS_boot` copy are rebuilt together. Physical sign-off of gpio13 mux polarity, external reset polarity and the lk2nd boot splash is still required on a live 2720 Flip; `devices/nokia-beatles/cover-panel.dtsi` remains a compile-checked reference for older DTBs.
- **Cover display status and behaviour**: `bananarchy-cover-idle` is the compiled 0%-CPU default daemon and answers `bananarchy-coverctl` (`PING`, `STATUS`, `LID CLOSED|OPEN`, `BUTTON`, `NETWORK`, `BATTERY`, `NOTIFY`, `BLANK`/`UNBLANK`, `TEST`); the native `bananarchy-coverd` is retained only for diagnostics. With the flip **open** the external panel is fully off (all-black frame plus backlight 0) and `BUTTON` is ignored. With the flip **closed** the panel stays off until an external side key is pressed: `bananarchy-volume-keys` reads `/run/bananarchy/lid-state` and sends the trusted `BUTTON` datagram instead of changing the volume, which shows the live clock, date, battery percentage and the compact main network indicators (`4G SIG75 WIFI`-style, published by `bananarchy-cover-status.sh` from the NetworkManager dispatcher and at service start). No further button blanks the cover after exactly the same **Config -> Screen blank** timeout that `dwm` uses (`~/.config/sxmo/idle_blank_timeout`, default 300 s, `0` = never; `blank_timeout = auto` in `/etc/bananarchy/cover-display.conf` selects it, a numeric value overrides it). The daemon blocks in `poll()` with no timer while off, so idle CPU stays at 0%. The renderer uses the 32-bpp fbdev `write()` path (not `mmap()`, which raises `SIGBUS` on the DRM fbdev). The shipping DTS now registers both panels on an `spi-mux`: `display@0` keeps the verified 240x320 internal panel at 25 MHz with gpio110 as D/C (Xorg still pins `/dev/dri/card0`), while `display@1` is the 240x240 external GC9305 at 25 MHz with its own gpio21 D/C line, gpio23 reset and `write-only` framebuffer, exposed as `/dev/fb1`. gpio13 selects the mux and has a dedicated pull-down pinctrl state so the internal panel stays selected until `gpio-mux` drives it; the external panel's pinctrl group no longer touches gpio13. `spidev@1` is disabled, the `mux-core`/`mux-gpio`/`spi-mux` modules are loaded, and the external panel firmware is included in the initramfs. `bananarchy-coverctl STATUS` should now report `backend=fb`. `scripts/test-cover-idle.py` verifies the state machine with a fake framebuffer and `scripts/test-cover-dt.py` validates the DTB, firmware lists and Xorg pin; the DTB, appended boot DTB and `pmOS_boot` copy are rebuilt together. Physical sign-off of gpio13 mux polarity, external reset polarity and the lk2nd boot splash is still required on a live 2720 Flip; `devices/nokia-beatles/cover-panel.dtsi` remains a compile-checked reference for older DTBs. Run `bananarchy-cover-diagnose.sh` on the phone to check `/dev/fb1`, its geometry, the DRM cards, the loaded mux/panel modules, the firmware, the lid state and `bananarchy-coverctl STATUS` in one report. "Fully off" is a black frame plus `FBIOBLANK`/`FB_BLANK_POWERDOWN` on the fbdev (and the optional `backlight_path` sysfs node when present).
- **Camera app frozen / UI unresponsive**: check `top` for `bananarchy-volume-keys`. The daemon must be a single instance at 0% CPU; stale evdev fds are pruned by `prune_devices()`/`drop_device()` and guarded by `flock`. `rc-service bananarchy-volume-keys status` and `bananarchy-keypad-diagnose.sh` report its state. `xcamera` should return immediately and `bananarchy-photo <file>` should write a 600x800 JPEG.
- **Camera**: `/dev/video0` is provided by the out-of-tree `msm8905-cam` module, loaded at boot by `/etc/modules-load.d/bananarchy-hardware.conf` and `etc/local.d/10-bananarchy-hardware.start`. Check with `v4l2-ctl --list-devices`; a missing node means the module did not load (previously caused by a missing `/bin/sed` breaking the `modules` service).
- **Side volume keys**: the compiled evdev daemon `bananarchy-volume-keys` reads `KEY_VOLUMEUP`/`KEY_VOLUMEDOWN` directly and calls `sxmo_audio.sh vol up/down 5`; `sxmo_audio.sh` mirrors that percentage into the live PipeWire sink (the MSM8905 mainline kernel has no ALSA card yet). Press a side button and check `wpctl get-volume <sink-id>`; `bananarchy-keypad-diagnose.sh` reports the XKB mapping and both volume values.
+1 -1
View File
@@ -50,7 +50,7 @@ Instead of spawning slow shell scripts for everyday phone tasks, Bananarchy runs
- **Kopher SmallWeb browser (`xkopher` / `kopher` / `xsmallweb` / `smallweb.so`)**: multi-protocol SmallWeb client for **Gopher** (`gopher://`) with optional TLS (`gophers://`), **Gemini** (`gemini://`), **Spartan** (`spartan://`), and **Nex** (`nex://`), featuring WAP-style default keypad controls from [Kopher](https://code.luxferre.top/luxferre/kopher.git), user-adjustable keybindings (`~/.config/sxmo/smallweb_controls.tsv`), 10 bookmarks, custom homepage support, and link focus that always scrolls the viewport to the focused link in both wrapped and unwrapped modes.
- **Webarchy Web browser (`webarchy` / `xwebarchy` / `webarchy.so`)**: full-featured HTML5/CSS3/JS web browser built on WPE / WebKit (`webkit2gtk-4.1` + `libwpe-1.0`) with Adreno 304 hardware acceleration (`WEBKIT_HARDWARE_ACCELERATION_POLICY_ALWAYS`, WebGL, accelerated 2D canvas, and 512 MB RAM pressure tuning), default KaiOS 4.0 User-Agent (`Mozilla/5.0 (Mobile; rv:123.0) Gecko/123.0 Firefox/123.0 KAIOS/4.0`) with preset and custom User-Agent override (`~/.config/sxmo/webarchy_ua.txt`), `UTF-8` default encoding fallback, `Noto Sans` / `Noto Serif` (`font-noto` + `font-noto-emoji`) as the default non-monospace browser fonts and `Fira Code` with OpenType ligatures as the monospace font, full GStreamer multimedia (`MediaSource` / MSE, WebAudio, inline HTML5 `<video>`/`<audio>` autoplay without user gesture requirements), unobtrusive bookmarking (`*HTTPS`/`*HTTP` header badge, `*`+`0-9` save / `#`+`0-9` load chords, and bookmark manager), and dual navigation modes (keypad link-stepping mode with NeoUI multi-tap form input by default, plus an optional `*#` accelerated mouse cursor emulation mode), and a device-aware renderer profile: the 2720 Flip uses the WebKit CPU renderer (with automatic software fallback after a WebProcess crash) while the 8110 4G keeps Adreno 304 acceleration; `~/.config/sxmo/webarchy_software_renderer` forces the CPU profile on any target.
- **GPS-only system time**: **Config -> Time source** switches from NTP to GNSS only (stopping `chronyd` and disabling every network-up NTP burst) and **Config -> Sync GPS time** steps the clock from a ModemManager GPS UTC value or a valid RMC fix, writes the RTC and refreshes the status bar. All GPS queries now resolve the GNSS-capable modem through `bananarchy-gps-modem.sh` instead of the ambiguous `mmcli -m any`, which fixes empty GPS data on the dual-SIM 2720 Flip. See `MANUAL.md` sections 5.6 and 5.8.
- **2720 Flip cover display behaviour**: the compiled `bananarchy-cover-idle` renderer keeps the external panel fully off while the flip is open, waits for a side-button `BUTTON` event when closed, then shows the clock, battery and compact main network indicators until the same **Config -> Screen blank** timeout expires with no further button press. `bananarchy-volume-keys` turns the external keys into trusted cover wake events, `bananarchy-cover-status.sh` publishes modem/Wi-Fi indicators from network events, and the daemon blocks in `poll()` with no timer while off. The shipping DTS now exposes the external GC9305 as `/dev/fb1` behind `gpio-mux`/`spi-mux` (25 MHz, dedicated gpio21 D/C, gpio13 isolated, Xorg pinned to card0), with the panel firmware in the initramfs and the DTB/boot images rebuilt; `scripts/test-cover-idle.py` and `scripts/test-cover-dt.py` verify the renderer and DT wiring on the host.
- **2720 Flip cover display behaviour**: the compiled `bananarchy-cover-idle` renderer keeps the external panel fully off while the flip is open, waits for a side-button `BUTTON` event when closed, then shows the clock, battery and compact main network indicators until the same **Config -> Screen blank** timeout expires with no further button press. `bananarchy-volume-keys` turns the external keys into trusted cover wake events, `bananarchy-cover-status.sh` publishes modem/Wi-Fi indicators from network events, and the daemon blocks in `poll()` with no timer while off. The shipping DTS now exposes the external GC9305 as `/dev/fb1` behind `gpio-mux`/`spi-mux` (25 MHz, dedicated gpio21 D/C, gpio13 isolated, Xorg pinned to card0), with the panel firmware in the initramfs and the DTB/boot images rebuilt; `scripts/test-cover-idle.py` and `scripts/test-cover-dt.py` verify the renderer and DT wiring on the host, `FBIOBLANK` powers the fbdev down when the cover is off, and `bananarchy-cover-diagnose.sh` reports the live panel state for hardware sign-off.
- **GPS reception test utility (`bananarchy-gps`) and OpenStreetMap navigator (`xgps` / `xmaps` / `xnav` / `gps.so`)**: CLI GNSS/GPS diagnostic tool (`bananarchy-gps status|enable|disable|nmea|watch`) and 3-tab NeoUI GPS navigator (`1:GPS Status`, `2:OSM Map`, `3:Nav/Search`) with live NMEA/QMI PDS satellite and 3GPP cell telemetry, interactive `240x212` OpenStreetMap slippy-map tile viewer with offline PNG tile cache (`~/.cache/sxmo/osm_tiles/`), Nominatim place search, saved waypoints, and OSRM turn-by-turn route geometry and step navigation.
- **Themes (`xthemes`), wallpapers (`xwallpapers`), and ringtones (`xringtones`)**: installable `.Xresources` color and font themes (`~/.xthemes/*.xth`, 21 preinstalled schemes including `LynxLair.xth`) with live zero-restart reload across the entire UI, `dunst` notification popups (`bananarchy-sync-dunst-theme`), and terminal, alongside dedicated managers for desktop wallpapers and 3-tab call ringtones & notification/SMS alerts (`1:Ringtone`, `2:Notif/SMS`, `3:Settings`, supporting standard audio, tracker modules, and Nokia RTTTL `.nrt`/`.rtttl`/`.rtx`, Ericsson eMelody `.emy`, and IrDA iMelody `.imy` monophonic ringtones via `/usr/bin/bananarchy-melody`, wired into `sxmo_notifs.sh` and `sxmo_hook_notification.sh`) with 3-level vibration control.
+52
View File
@@ -0,0 +1,52 @@
#!/bin/sh
# Report the live state of the 2720 Flip external panel (/dev/fb1).
# Intended for the physical gpio13/reset/DC sign-off: it never changes state.
set -u
FB=/dev/fb1
SYSFS=/sys/class/graphics/fb1
FW=/lib/firmware/nokia,beatles-gc9305-ext-panel.bin
COVERCTL=/usr/bin/bananarchy-coverctl
printf '=== Bananarchy cover display diagnostics ===\n'
if [ -r /usr/share/bananarchy/lid-profile ]; then
printf 'lid-profile : %s\n' "$(cat /usr/share/bananarchy/lid-profile)"
else
printf 'lid-profile : missing (not a flip build?)\n'
fi
if [ -e "$FB" ]; then
printf 'framebuffer : %s present\n' "$FB"
for attr in virtual_size bits_per_pixel stride; do
if [ -r "$SYSFS/$attr" ]; then
printf ' %-20s: %s\n' "$attr" "$(cat "$SYSFS/$attr")"
else
printf ' %-20s: missing\n' "$attr"
fi
done
else
printf 'framebuffer : %s ABSENT (panel-mipi-dbi did not probe)\n' "$FB"
fi
printf 'DRM cards : %s\n' "$(ls /dev/dri/card* 2>/dev/null | tr '\n' ' ')"
printf 'fbdev nodes : %s\n' "$(ls /dev/fb* 2>/dev/null | tr '\n' ' ')"
for mod in mux_core mux_gpio spi_mux panel_mipi_dbi; do
if grep -q "^$mod " /proc/modules 2>/dev/null; then
printf 'module %-20s: loaded\n' "$mod"
else
printf 'module %-20s: not loaded\n' "$mod"
fi
done
if [ -r "$FW" ]; then
printf 'panel firmware : %s (%s bytes)\n' "$FW" "$(wc -c < "$FW")"
else
printf 'panel firmware : %s MISSING\n' "$FW"
fi
printf 'mux select (lid-state): %s\n' "$(cat /run/bananarchy/lid-state 2>/dev/null || printf 'unknown')"
if [ -x "$COVERCTL" ]; then
printf 'daemon : %s\n' "$("$COVERCTL" STATUS 2>/dev/null || printf 'not answering')"
else
printf 'daemon : %s missing\n' "$COVERCTL"
fi
if command -v rc-service >/dev/null 2>&1; then
rc-service bananarchy-cover-display status 2>&1 | sed 's/^/service : /'
fi
exit 0
Binary file not shown.
+1
View File
@@ -179,6 +179,7 @@ chmod 0755 "$TARGET_ROOTFS/usr/bin/bananarchy-idle-blank.sh" \
"$TARGET_ROOTFS/usr/bin/bananarchy-battery-charge-event.sh" \
"$TARGET_ROOTFS/usr/bin/bananarchy-cover-status.sh" \
"$TARGET_ROOTFS/usr/bin/bananarchy-cover-event.sh" \
"$TARGET_ROOTFS/usr/bin/bananarchy-cover-diagnose.sh" \
"$TARGET_ROOTFS/usr/bin/bananarchy-gps-modem.sh" \
"$TARGET_ROOTFS/usr/bin/bananarchy-gps-time-sync.sh" \
"$TARGET_ROOTFS/usr/bin/bananarchy-sync-gps-time.sh" \
+17 -1
View File
@@ -1274,7 +1274,8 @@ 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'; do
'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
@@ -1327,6 +1328,21 @@ elif command -v dtc >/dev/null 2>&1 && \
fail "host 2720 Flip /dev/fb1 DT validation failed"
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 'bananarchy-coverctl' "$COVER_DIAG"; then
fail "cover diagnostics no longer inspect fb1 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
if [ "$FAILURES" -ne 0 ]; then
echo "[check] $FAILURES check(s) failed."
exit 1
+6
View File
@@ -110,6 +110,12 @@ def main():
if vbuild.returncode:
sys.stderr.write(vbuild.stderr)
return 1
source = SRC.read_text(encoding="utf-8")
for token in ("FBIOBLANK", "FB_BLANK_POWERDOWN", "cover_is_lit",
"set_backlight"):
if token not in source:
sys.stderr.write("FAIL: cover daemon lost %s\n" % token)
return 1
print("[ok] host build of the compiled cover and volume-key daemons")
main_cfg = root / "idle_blank_timeout"
+41 -7
View File
@@ -18,6 +18,24 @@
#include <sys/socket.h>
#include <sys/un.h>
/* The armv7 cross sysroot does not always ship linux/fb.h. These UAPI
* values are stable; use the header when it exists, otherwise the numeric
* definitions from linux/fb.h (FBIOBLANK = _IO('F', 0x11) = 0x4611). */
#if defined(__has_include)
#if __has_include(<linux/fb.h>)
#include <linux/fb.h>
#endif
#endif
#ifndef FBIOBLANK
#define FBIOBLANK 0x4611
#endif
#ifndef FB_BLANK_UNBLANK
#define FB_BLANK_UNBLANK 0
#endif
#ifndef FB_BLANK_POWERDOWN
#define FB_BLANK_POWERDOWN 4
#endif
#include "common.h"
#define COVER_LOCK "/run/bananarchy-cover-idle.lock"
@@ -222,9 +240,21 @@ struct state {
int backlight_level;
};
/* Fully off means both a black framebuffer and a zeroed backlight. A missing
* backlight node is normal while the cover panel DT overlay is hardware-gated;
* the black frame still leaves nothing visible on the panel. */
/* A lit cover needs a lit framebuffer, a lit backlight and an unblanked fbdev;
* everything else is "fully off". TEST modes are diagnostic overrides. */
static int cover_is_lit(const struct state *state)
{
if(state->test == 4)
return 0;
if(state->test == 1 || state->test == 2 || state->test == 3)
return 1;
return state->enabled && state->visible &&
strcmp(state->lid, "closed") == 0;
}
/* Fully off means a black framebuffer, a zeroed backlight and an fbdev
* FB_BLANK_POWERDOWN. An empty backlight_path is normal on hardware without
* a separate cover backlight sysfs node; fbdev blanking still powers it down. */
static void set_backlight(const struct state *state, int on)
{
char value[32];
@@ -289,8 +319,7 @@ static int draw_frame(const char *fb_path, const struct state *state)
} else if(state->test == 3) {
frame_rect(&fb, 0, 0, (int)width, (int)height,
rgb888(245, 245, 245));
} else if(state->test == 4 ||
strcmp(state->lid, "open") == 0 || !state->visible) {
} else if(!cover_is_lit(state)) {
frame_rect(&fb, 0, 0, (int)width, (int)height, rgb888(0, 0, 0));
} else {
frame_rect(&fb, 0, 0, (int)width, (int)height, rgb888(8, 12, 26));
@@ -319,6 +348,12 @@ static int draw_frame(const char *fb_path, const struct state *state)
return 0;
}
fsync(fd);
/* DRM fbdev emulation turns FB_BLANK_POWERDOWN into a DPMS-off on the
* external connector, so the cover is electrically dark as well as black.
* Unblank before drawing a lit frame; blank after writing the black one.
* Regular files (host tests / sim backends) simply ignore the ioctl. */
(void)ioctl(fd, FBIOBLANK,
cover_is_lit(state) ? FB_BLANK_UNBLANK : FB_BLANK_POWERDOWN);
free(mem);
close(fd);
return 1;
@@ -639,8 +674,7 @@ int main(int argc, char **argv)
redraw = 1;
}
if(redraw) {
set_backlight(&state, state.visible || state.test == 2 ||
state.test == 3 || state.test == 1);
set_backlight(&state, cover_is_lit(&state));
snprintf(state.backend, sizeof(state.backend), "%s",
draw_frame(fb_path, &state) ? "fb" : "none");
last_draw = now;