Release a1111 (lennon): isolate nokia-argon slider from 2720 Flip cover stack

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

No files matched your search

+109 -3
View File
@@ -12,6 +12,7 @@ import hashlib
import os
import pathlib
import socket
import struct
import subprocess
import sys
import tempfile
@@ -20,12 +21,13 @@ import time
BASE = pathlib.Path(__file__).resolve().parent.parent
SRC = BASE / "src/bananarchy-daemons/bananarchy-cover-idle.c"
VOL_SRC = BASE / "src/bananarchy-daemons/bananarchy-volume-keys.c"
COMMON_H = BASE / "src/bananarchy-daemons/common.h"
FB_WIDTH, FB_HEIGHT, FB_BPP = 240, 240, 32
FRAME_SIZE = FB_WIDTH * FB_HEIGHT * (FB_BPP // 8)
class Cover:
def __init__(self, root, exe, config, main_cfg):
def __init__(self, root, exe, config, main_cfg, lid_state=None):
self.root = root
self.sock_path = root / "cover.sock"
self.fb = root / "fb1"
@@ -37,7 +39,10 @@ class Cover:
"BANANARCHY_COVER_LOCK": str(root / "daemon.lock"),
"BANANARCHY_COVER_FB_GEOM": "%d,%d,%d" % (FB_WIDTH, FB_HEIGHT, FB_BPP),
"BANANARCHY_COVER_MAIN_BLANK_CFG": str(main_cfg),
"BANANARCHY_COVER_NOIDLE_PATH": str(root / "sxmo.noidle"),
})
if lid_state is not None:
self.env["BANANARCHY_COVER_LID_STATE"] = str(lid_state)
self.proc = subprocess.Popen([str(exe), "--config", str(config)],
env=self.env, stdout=subprocess.DEVNULL,
stderr=subprocess.DEVNULL)
@@ -116,6 +121,13 @@ def main():
if token not in source:
sys.stderr.write("FAIL: cover daemon lost %s\n" % token)
return 1
common_src = COMMON_H.read_text(encoding="utf-8")
if "struct timeval time;" in common_src or \
"unsigned long tv_sec;" not in common_src or \
"ba_input_event_abi" not in common_src:
sys.stderr.write(
"FAIL: struct input_event in common.h regressed to time64 timeval\n")
return 1
print("[ok] host build of the compiled cover and volume-key daemons")
main_cfg = root / "idle_blank_timeout"
@@ -160,7 +172,24 @@ def main():
if before == with_clock:
sys.stderr.write("FAIL: no frame was drawn on BUTTON\n")
return 1
print("[ok] external button: clock, battery and backlight on")
raw_fb = daemon.fb.read_bytes()
bg = struct.pack("<I", (8 << 16) | (12 << 8) | 26)
for band_name, y0, y1 in (("header", 20, 40),
("clock", 85, 130),
("date", 135, 160)):
xs = [x for y in range(y0, y1) for x in range(FB_WIDTH)
if raw_fb[(y * FB_WIDTH + x) * 4:(y * FB_WIDTH + x + 1) * 4] != bg]
if not xs:
sys.stderr.write("FAIL: missing %s ink on 240x240 frame\n" % band_name)
return 1
left_margin = min(xs)
right_margin = FB_WIDTH - 1 - max(xs)
if abs(left_margin - right_margin) > 1:
sys.stderr.write(
"FAIL: %s is off-center on 240x240 (left=%d right=%d)\n" %
(band_name, left_margin, right_margin))
return 1
print("[ok] external button: centered clock/date, battery and backlight on")
daemon.send("NETWORK 3G SIG20")
if not wait_for(lambda: daemon.frame()[0] != with_clock):
@@ -206,13 +235,24 @@ def main():
(sub / "cover.sock", sub / "fb1", sub / "backlight"),
encoding="utf-8")
main_cfg.write_text("0\n")
daemon2 = Cover(sub, exe, config2, main_cfg)
auth_lid = sub / "lid-state"
auth_lid.write_text("closed\n")
daemon2 = Cover(sub, exe, config2, main_cfg, lid_state=auth_lid)
try:
daemon2.send("LID CLOSED")
daemon2.send("BUTTON")
if not wait_for(lambda: daemon2.frame()[1]):
sys.stderr.write("FAIL: auto timeout daemon did not light the cover\n")
return 1
# A bogus LID OPEN (such as dwm misreading SW_KEYPAD_SLIDE=1 on close)
# must be ignored while bananarchy-lid's state file reports "closed".
daemon2.send("LID OPEN")
time.sleep(0.15)
if not daemon2.frame()[1] or "visible=1" not in daemon2.send("STATUS") or \
"lid=closed" not in daemon2.send("STATUS"):
sys.stderr.write(
"FAIL: bogus LID OPEN blanked the cover while lid-state=closed\n")
return 1
time.sleep(2.5)
if not daemon2.frame()[1] or "visible=1" not in daemon2.send("STATUS"):
sys.stderr.write("FAIL: Screen blank = 0 should keep the cover on\n")
@@ -221,6 +261,72 @@ def main():
sys.stderr.write("FAIL: auto timeout did not read the main Screen blank config\n")
return 1
print("[ok] auto timeout follows Config -> Screen blank (0 = never)")
# Changing Config -> Screen blank at runtime updates the live daemon.
noidle = sub / "sxmo.noidle"
main_cfg.write_text("1\n")
daemon2.send("REFRESH")
if not wait_for(lambda: not daemon2.frame()[1], timeout=3):
sys.stderr.write("FAIL: runtime Screen blank update did not blank cover\n")
return 1
if "blank_ms=1000" not in daemon2.send("STATUS") or \
"visible=0" not in daemon2.send("STATUS"):
sys.stderr.write("FAIL: runtime Screen blank update did not refresh blank_ms\n")
return 1
noidle.write_text("")
if "blank_ms=0" not in daemon2.send("STATUS"):
sys.stderr.write("FAIL: sxmo.noidle did not disable cover blanking\n")
return 1
noidle.unlink()
daemon2.send("BUTTON")
if not wait_for(lambda: daemon2.frame()[1]):
sys.stderr.write("FAIL: BUTTON after runtime config update did not wake cover\n")
return 1
if not wait_for(lambda: not daemon2.frame()[1], timeout=3):
sys.stderr.write("FAIL: cover did not blank after updated 1 s main timeout\n")
return 1
print("[ok] runtime Screen blank changes and sxmo.noidle apply live")
# End-to-end evdev binary record -> bananarchy-volume-keys -> cover wake.
ev_fifo = sub / "event0"
os.mkfifo(ev_fifo)
keep_w = os.open(ev_fifo, os.O_RDWR | os.O_NONBLOCK)
lid_file = sub / "lid-state"
lid_file.write_text("closed\n")
vol_env = dict(os.environ)
vol_env.update({
"BANANARCHY_VOLUME_LOCK": str(sub / "volume.lock"),
"BANANARCHY_LID_STATE": str(lid_file),
"BANANARCHY_COVER_SOCKET": str(sub / "cover.sock"),
"BANANARCHY_VOLUME_CLIENT_SOCKET": str(sub / "vol-client.sock"),
"BANANARCHY_INPUT_GLOB": str(ev_fifo),
})
vol_proc = subprocess.Popen(
[str(root / "volume-keys")], env=vol_env,
stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
try:
main_cfg.write_text("0\n")
daemon2.send("REFRESH")
time.sleep(0.15)
os.write(keep_w, struct.pack("LLHHi", 1, 0, 1, 115, 1))
if not wait_for(lambda: daemon2.frame()[1], timeout=3):
sys.stderr.write(
"FAIL: evdev KEY_VOLUMEUP did not wake cover via volume-keys\n")
return 1
daemon2.send("BLANK")
if not wait_for(lambda: not daemon2.frame()[1], timeout=3):
sys.stderr.write("FAIL: BLANK did not clear cover before camera key\n")
return 1
os.write(keep_w, struct.pack("LLHHi", 2, 0, 1, 212, 1))
if not wait_for(lambda: daemon2.frame()[1], timeout=3):
sys.stderr.write(
"FAIL: evdev KEY_CAMERA did not wake cover via volume-keys\n")
return 1
print("[ok] evdev outer side buttons wake cover end-to-end")
finally:
vol_proc.kill()
vol_proc.wait()
os.close(keep_w)
finally:
daemon2.close()
print("cover display behaviour: all checks passed")