From bf9ea21547ab89761fc00a5a84a8f9a9af92b2cc Mon Sep 17 00:00:00 2001 From: saiththerobo Date: Tue, 3 Nov 2026 09:55:13 +0000 Subject: [PATCH 1/2] device-raven 0.1.30: leave omamobile-sleepd to omamobile-shell omamobile-shell ships the shared sleep watcher (omamobile-sleepd, its user service and the graphical-session wants link), and device-raven still carried its own copy of all three. The two packages couldn't be installed together: pacstrap of a raven root image stopped with "conflicting files" on /usr/bin/omamobile-sleepd. Raven now uses the shell's watcher; its sleep hook (omamobile-sleep) and s2idle policy stay here. Raven's copy also treated bl_power as panel-off and held off sleep while an SSH session over usb0 was up; auto-sleep ships off, so that difference only matters once someone turns the toggle on. Co-Authored-By: Claude Opus 5.5 --- packages/omamobile-device-raven/README.md | 2 +- .../bin/omamobile-sleepd | 111 ------------------ packages/omamobile-device-raven/test/all | 8 +- .../omamobile-sleepd.service | 1 - .../systemd/user/omamobile-sleepd.service | 15 --- packages/omamobile-device-raven/version | 2 +- 6 files changed, 5 insertions(+), 134 deletions(-) delete mode 100755 packages/omamobile-device-raven/bin/omamobile-sleepd delete mode 120000 packages/omamobile-device-raven/vendor/systemd/user/graphical-session.target.wants/omamobile-sleepd.service delete mode 100644 packages/omamobile-device-raven/vendor/systemd/user/omamobile-sleepd.service diff --git a/packages/omamobile-device-raven/README.md b/packages/omamobile-device-raven/README.md index c6065b4ed..1bfbfa964 100644 --- a/packages/omamobile-device-raven/README.md +++ b/packages/omamobile-device-raven/README.md @@ -14,7 +14,7 @@ the counterpart of `omamobile-device-cheetah`. Bring-up and results: | On-demand CPU frequency (safe once the thermal zones throttle) | `tmpfiles.d/omamobile-raven-cpufreq.conf` | | The user may switch the panel off (`bl_power`) and inhibit the touchscreen, for Omarchy's display off | `udev/rules.d/20-omamobile-display.rules` | | Wi-Fi power save on | `NetworkManager/conf.d/omamobile-raven-wifi-powersave.conf` | -| Sleep (s2idle) once locked with the panel off, behind `omarchy-toggle omamobile-sleep on`; Wi-Fi stays connected across sleep (unloaded instead after a D3 failure, or with `/etc/omamobile/wifi-unload-for-sleep`) | `omamobile-sleepd` (+ user `.service`, enabled), `omamobile-sleep` (`system-sleep/omamobile`), `sleep.conf.d/10-omamobile.conf` | +| Sleep (s2idle) once locked with the panel off, behind `omarchy-toggle omamobile-sleep on` (the watcher, `omamobile-sleepd`, is omamobile-shell's); Wi-Fi stays connected across sleep (unloaded instead after a D3 failure, or with `/etc/omamobile/wifi-unload-for-sleep`) | `omamobile-sleep` (`system-sleep/omamobile`), `sleep.conf.d/10-omamobile.conf` | | Modem bring-up only: its PCIe driver and CPIF never load at boot, and the modem's units aren't enabled (as on main; `systemctl enable --now omamobile-modem omamobile-sitd` to use it, MODEM-PLAN) | `modprobe.d/omamobile-raven-modem.conf` | | Bluetooth on at boot; the session waits (at most 15 s) for the adapter | `bluetooth.service` (enabled), `sddm.service.d/`, `omamobile-wait-bluetooth` | diff --git a/packages/omamobile-device-raven/bin/omamobile-sleepd b/packages/omamobile-device-raven/bin/omamobile-sleepd deleted file mode 100755 index a6b739386..000000000 --- a/packages/omamobile-device-raven/bin/omamobile-sleepd +++ /dev/null @@ -1,111 +0,0 @@ -#!/bin/bash -# SPDX-License-Identifier: MIT -# Puts the phone to sleep (s2idle) once it is locked with the panel off, as -# Android does (device/raven/SUSPEND-PLAN.md). A user service; it only acts -# while the Omarchy toggle "omamobile-sleep" is on: -# omarchy-toggle omamobile-sleep on -# -# Every 2 s it checks: panel off (bl_power != 0), session locked, no USB -# host, no SSH connection over a live link, no inhibitor blocking sleep. After -# OMAMOBILE_SLEEP_AFTER_OFF seconds of that (default 10), or -# OMAMOBILE_SLEEP_GRACE seconds after a dark wake (default 5), it runs -# "systemctl suspend". Waking with Power -# lights the PIN pad through omamobile-keys; the sleep hook reloads Wi-Fi -# once the panel is lit. -# omamobile-sleepd now ask a running watcher to sleep without the delay -set -u - -after=${OMAMOBILE_SLEEP_AFTER_OFF:-10} -grace=${OMAMOBILE_SLEEP_GRACE:-5} -request=${XDG_RUNTIME_DIR:-/run/user/$UID}/omamobile-sleepd-now -stats=/sys/power/suspend_stats - -if [[ ${1:-} == now ]]; then - touch "$request" - exit 0 -fi - -log() { echo "omamobile-sleepd: $*"; } - -panel_off() { - local p found= - for p in /sys/class/backlight/*/bl_power; do - [[ -r $p ]] || continue - found=1 - [[ $(<"$p") == 0 ]] && return 1 - done - [[ -n $found ]] -} - -locked() { [[ $(omarchy-shell lock isLocked 2>/dev/null) == true ]]; } - -# An SSH connection counts only while the link it runs over is up: pulling -# the USB cable leaves its socket established for a long time, and usb0 -# even keeps its carrier, so over usb0 that means the laptop is there. -ssh_connected() { - local addr dev - while read -r _ _ addr _; do - dev=$(ip -o addr show to "${addr%:*}" 2>/dev/null | awk '{ print $2; exit }') - [[ -n $dev ]] || continue - if [[ $dev == usb0 ]]; then usb_host && return 0 - elif [[ $(cat "/sys/class/net/$dev/carrier" 2>/dev/null) == 1 ]]; then return 0 - fi - done < <(ss -Htn state established '( sport = :22 )' 2>/dev/null) - return 1 -} - -# A laptop on the USB cable: omamobile-usb-rescue keeps this marker while -# VBUS is present with the data switch connected (a wall charger holds the -# switch elsewhere). The gadget's own state can't tell: the switch just -# opens on unplug, and the controller stays "configured". -usb_host() { [[ -e /run/omamobile/usb-host ]]; } - -sleep_blocked() { - # (what, who, why, mode, uid, pid) for each inhibitor - busctl --json=short call org.freedesktop.login1 /org/freedesktop/login1 \ - org.freedesktop.login1.Manager ListInhibitors 2>/dev/null | - jq -e 'any(.data[0][]; (.[0] | split(":") | index("sleep")) and .[3] == "block")' >/dev/null -} - -why_not() { - omarchy-toggle-enabled omamobile-sleep || { echo "toggle off"; return; } - panel_off || { echo "panel lit"; return; } - locked || { echo "unlocked"; return; } - usb_host && { echo "USB host connected"; return; } - ssh_connected && { echo "SSH connected"; return; } - sleep_blocked && { echo "inhibited"; return; } -} - -dark_since= -reason= -while :; do - now=$(date +%s) - why=$(why_not) - if [[ -n $why ]]; then - [[ $why != "$reason" ]] && log "not sleeping: $why" - reason=$why - dark_since= - rm -f "$request" - else - reason= - [[ -n $dark_since ]] || dark_since=$now - if [[ -e $request ]] || ((now - dark_since >= after)); then - rm -f "$request" - ok=$(<"$stats/success") fail=$(<"$stats/fail") - log "suspending (dark and locked for $((now - dark_since)) s)" - systemctl suspend || log "systemctl suspend failed" - # Wait for the resume: one of the counters moves (60 s at most). - for _ in $(seq 120); do - [[ $(<"$stats/success") != "$ok" || $(<"$stats/fail") != "$fail" ]] && break - sleep 0.5 - done - if [[ $(<"$stats/fail") != "$fail" ]]; then - log "suspend failed (last failed device: $(cat "$stats/last_failed_dev" 2>/dev/null)); backing off 60 s" - sleep 60 - fi - # Still dark after a wake: sleep again after the grace period. - dark_since=$(($(date +%s) - after + grace)) - fi - fi - sleep 2 -done diff --git a/packages/omamobile-device-raven/test/all b/packages/omamobile-device-raven/test/all index 83c5fdc01..0203a74ee 100755 --- a/packages/omamobile-device-raven/test/all +++ b/packages/omamobile-device-raven/test/all @@ -57,7 +57,7 @@ for f in usr/bin/omamobile-bootctl usr/bin/reboot-to usr/bin/omamobile-boot-succ usr/lib/udev/rules.d/72-omamobile-feedbackd.rules usr/lib/systemd/system/omamobile-feedbackd-rescan.service \ usr/lib/udev/rules.d/20-omamobile-display.rules \ usr/lib/NetworkManager/conf.d/omamobile-raven-wifi-powersave.conf \ - usr/bin/omamobile-sleep usr/bin/omamobile-sleepd usr/lib/systemd/user/omamobile-sleepd.service \ + usr/bin/omamobile-sleep \ usr/lib/systemd/sleep.conf.d/10-omamobile.conf \ usr/share/licenses/omamobile-device-raven/LICENSE.Apache-2.0 usr/share/omamobile/device-raven/version; do [[ -e $tmp/root/$f ]] || fail "install stages $f" @@ -68,8 +68,7 @@ done || fail "the USB rescue unit is enabled by a vendor wants link" [[ $(readlink "$tmp/root/usr/lib/systemd/system-sleep/omamobile") == /usr/bin/omamobile-sleep ]] \ || fail "the sleep hook is linked into system-sleep" -[[ $(readlink "$tmp/root/usr/lib/systemd/user/graphical-session.target.wants/omamobile-sleepd.service") == ../omamobile-sleepd.service ]] \ - || fail "the sleep watcher is enabled by a vendor wants link" +[ ! -e "$tmp/root/usr/bin/omamobile-sleepd" ] || fail "the sleep watcher is omamobile-shell's, not this package's" pass "install stages the package" # omamobile-wlan-mac only ever sets a unicast, globally administered address @@ -84,7 +83,7 @@ out=$(sed "s|/proc/device-tree/chosen/config/wlan_mac1|$tmp/dt/wlan_mac1|; s|^ip pass "wlan-mac: only a real address from the bootloader" # Sleep: s2idle only (deep doesn't wake), the hook powers the Wi-Fi chip off -# (pcie_gs201 too), and the watcher does nothing without its toggle +# (pcie_gs201 too) # The modem doesn't start at boot from this package: as on main, the modem # packages are installed but not enabled (enabling it is its own change) for u in omamobile-modem omamobile-sitd omamobile-sitd-2 omamobile-sit-data-restore; do @@ -94,7 +93,6 @@ done grep -qx 'MemorySleepMode=s2idle' vendor/systemd/sleep.conf.d/10-omamobile.conf || fail "sleep is s2idle" grep -q 'modprobe -r brcmfmac_wcc brcmfmac pcie_gs201' bin/omamobile-sleep || fail "unload mode unloads the PCIe host" grep -q 'wifi_pci=0000:01:00.0' bin/omamobile-sleep || fail "a Wi-Fi D3 failure falls back to unload mode" -grep -q 'omarchy-toggle-enabled omamobile-sleep ||' bin/omamobile-sleepd || fail "the watcher is gated by its toggle" pass "sleep policy" # Policy that keeps the phone safe at boot diff --git a/packages/omamobile-device-raven/vendor/systemd/user/graphical-session.target.wants/omamobile-sleepd.service b/packages/omamobile-device-raven/vendor/systemd/user/graphical-session.target.wants/omamobile-sleepd.service deleted file mode 120000 index 0898f94eb..000000000 --- a/packages/omamobile-device-raven/vendor/systemd/user/graphical-session.target.wants/omamobile-sleepd.service +++ /dev/null @@ -1 +0,0 @@ -../omamobile-sleepd.service \ No newline at end of file diff --git a/packages/omamobile-device-raven/vendor/systemd/user/omamobile-sleepd.service b/packages/omamobile-device-raven/vendor/systemd/user/omamobile-sleepd.service deleted file mode 100644 index c77fe37e0..000000000 --- a/packages/omamobile-device-raven/vendor/systemd/user/omamobile-sleepd.service +++ /dev/null @@ -1,15 +0,0 @@ -# SPDX-License-Identifier: MIT -# Sleep (s2idle) once the phone is locked with the panel off. Runs in every -# session but does nothing until "omarchy-toggle omamobile-sleep on". -[Unit] -Description=Sleep when locked and dark -After=graphical-session.target -PartOf=graphical-session.target - -[Service] -ExecStart=/usr/bin/omamobile-sleepd -Restart=on-failure -RestartSec=5 - -[Install] -WantedBy=graphical-session.target diff --git a/packages/omamobile-device-raven/version b/packages/omamobile-device-raven/version index 5ef49d2f0..013adb716 100644 --- a/packages/omamobile-device-raven/version +++ b/packages/omamobile-device-raven/version @@ -1 +1 @@ -0.1.29 +0.1.30 From 51072407294a6c73d932a384e95cfa51f2b06e8b Mon Sep 17 00:00:00 2001 From: saiththerobo Date: Tue, 3 Nov 2026 11:04:43 +0000 Subject: [PATCH 2/2] device/raven: put the sensors and GNSS packages in the root image raven's descriptor had no ROOTFS_PACKAGES, so a raven image got the device package but not omamobile-sensors: on a fresh install the AoC came up and nothing read its sensors (accelerometer, light, proximity and compass missing in the boot check). With omamobile-sensors installed the proxy starts at boot and all four come up with the phone's factory calibration. omamobile-gnss comes along as on cheetah; it stays off until `omamobile-gnss on`. Audio and the modem stay out until their own work lands. Co-Authored-By: Claude Opus 5.5 --- device/raven/device.conf | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/device/raven/device.conf b/device/raven/device.conf index e615c072a..648a756b9 100644 --- a/device/raven/device.conf +++ b/device/raven/device.conf @@ -14,6 +14,11 @@ SOC=gs101 # [V] upstream arch/arm64/boot/dts/exynos/google/gs101-raven.dts COMPATIBLE="google,gs101-raven" PACKAGE=omamobile-device-raven +# This phone's other packages in the root image, on top of the shared +# rootfs/packages.omamobile: the sensors through the AoC, and GNSS (off +# until `omamobile-gnss on`). Audio waits on the amplifiers' limits, the +# modem on its kernel. +ROOTFS_PACKAGES="omamobile-sensors omamobile-gnss" # --- Kernel and device tree --- DTB=exynos/google/gs101-raven.dtb