Implement 2720 Flip cover display behaviour

This commit is contained in:
Luxferre committed 2026-11-10 13:23:03 +02:00
1 parent a50c01b416
commit ec55fb1457
20 files changed
+630 -49

No files matched your search

+54
View File
@@ -1253,6 +1253,60 @@ if [ -x "$BASE_DIR/scripts/test-gps-time-sync.py" ] && \
fail "host GPS-only time source 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'; 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 '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/}"
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
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"
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
if [ "$FAILURES" -ne 0 ]; then
echo "[check] $FAILURES check(s) failed."
exit 1