From 7900f079919c8e05441bcb2f382f825169aa0c1a Mon Sep 17 00:00:00 2001 From: W4HO <87742609+W4HO-ham@users.noreply.github.com> Date: Mon, 2 Nov 2026 18:49:00 -0647 Subject: [PATCH 01/17] omamobile-device-tegu 0.2.10: start the modem and phone service at boot, opt-in The 9a's modem only started by hand, from a bring-up script outside the package. omamobile-tegu-modem-up is now packaged: the kernel's own CP drivers when it has them, else the bring-up modules; the NV check, then a sleep inhibitor, then the drivers; a latch written before the drivers and cleared at CP ONLINE, so a start that never got there stops later boots until a human looks; the once-per-boot refusal; and with --phone the phone service and, when installed, the Phone and Messages bridge. omamobile-tegu-modem-boot.service runs it at boot, installed but never enabled by the package. A scratch-root test covers the driver choice, the order, the latch and the refusals. --- packages/omamobile-device-tegu/README.md | 20 +++ .../bin/omamobile-tegu-modem-up | 131 ++++++++++++++++++ packages/omamobile-device-tegu/test/all | 7 +- packages/omamobile-device-tegu/test/modem-up | 87 ++++++++++++ .../system/omamobile-tegu-modem-boot.service | 23 +++ 5 files changed, 267 insertions(+), 1 deletion(-) create mode 100644 packages/omamobile-device-tegu/bin/omamobile-tegu-modem-up create mode 100755 packages/omamobile-device-tegu/test/modem-up create mode 100644 packages/omamobile-device-tegu/vendor/systemd/system/omamobile-tegu-modem-boot.service diff --git a/packages/omamobile-device-tegu/README.md b/packages/omamobile-device-tegu/README.md index 604697628..2d59c9909 100644 --- a/packages/omamobile-device-tegu/README.md +++ b/packages/omamobile-device-tegu/README.md @@ -150,6 +150,26 @@ blacklists both and starts neither. Licence: MIT. +## The modem at boot (opt-in) + +`omamobile-tegu-modem-up` starts the CP once per boot: the kernel's own +drivers when it carries them (`cpif`, `pcie_gs201_cp` and the device tree's +`cpif` node), else the bring-up modules in `/var/lib/omamobile-tegu/modem`. +It runs the read-only NV check, takes a sleep inhibitor before any driver +loads (suspend with the CP up isn't qualified on the 9a, so nothing sleeps +until the reboot), writes a latch before the drivers load and clears it at +CP ONLINE, and with `--phone` starts `omamobile-sitd` and, when installed, +`omamobile-mmd` for Phone and Messages. It refuses a second start in a boot +that already loaded CPIF, and any start while the latch from a failed one is +there (`/var/lib/omamobile/modem-bringup-started`: read +`/var/log/omamobile/modem.log`, then remove it). Never stop the modem by +hand; the reboot's shutdown stops it. + +`omamobile-tegu-modem-boot.service` runs `omamobile-tegu-modem-up --phone` +at boot. The package installs it disabled; to have the palmtop come up as a +phone, `systemctl enable omamobile-tegu-modem-boot`. With it on the battery +drains as if awake, since the palmtop no longer suspends. + ## Optional Phone and Messages attachment `omamobile-telephony-tegu` is an opt-in companion package; it installs the diff --git a/packages/omamobile-device-tegu/bin/omamobile-tegu-modem-up b/packages/omamobile-device-tegu/bin/omamobile-tegu-modem-up new file mode 100644 index 000000000..e1af5e5d6 --- /dev/null +++ b/packages/omamobile-device-tegu/bin/omamobile-tegu-modem-up @@ -0,0 +1,131 @@ +#!/bin/bash +# SPDX-License-Identifier: MIT +# omamobile-tegu-modem-up: start the Pixel 9a's modem once per boot and, with +# --phone, the phone service on top (device/tegu MODEM-PLAN M5 and M-SIM, +# TELEPHONY-PLAN section 2). +# +# omamobile-tegu-modem-up [--gnss] [--phone] +# --gnss gnssd too (OMAMOBILE_MODEM_GNSS=1) +# --phone after CP ONLINE, start omamobile-sitd, and omamobile-mmd when +# it's installed (Phone and Messages); omamobile-tegu-modem.service +# runs it this way at boot when the owner has enabled it +# +# The CP drivers come from the running kernel when it carries them (cpif and +# pcie_gs201_cp, with the device tree's cpif node: the published kernel), else +# from the bring-up modules in /var/lib/omamobile-tegu/modem (the owner's +# integration kernel). The modem profile runs as the transient unit +# omamobile-tegu-modem, whose stop powers the CP off before rfsd goes. +# +# Rules this script keeps (AGENTS.md, "Suspend and modem"): +# - one CP start per boot: a second start in the same boot stalled in the +# ROM, so a boot that loaded CPIF refuses (reboot to start again); +# - never stop the modem by hand: the attended reboot's shutdown stops it; +# - a start that never reached ONLINE leaves a latch, and later boots refuse +# until a human removes it (/var/lib/omamobile/modem-bringup-started); +# - no system suspend once the CP is up: a sleep inhibitor, its own unit, is +# taken before any driver loads and lasts until the reboot. +set -euo pipefail +# The overrides are for test/modem-up's scratch root only. +B=${OMAMOBILE_MODEM_MODULES:-/var/lib/omamobile-tegu/modem} +LATCH=${OMAMOBILE_MODEM_LATCH:-/var/lib/omamobile/modem-bringup-started} +CP_STATE=${OMAMOBILE_MODEM_CP:-/usr/lib/omamobile-vendor/omamobile-modem-cp} +CHROOT=${OMAMOBILE_VENDOR_CHROOT:-/usr/lib/omamobile-vendor/omamobile-vendor-chroot} +SYS=${OMAMOBILE_SYS:-/sys} +DT=${OMAMOBILE_DT:-/proc/device-tree} +LOG=${OMAMOBILE_MODEM_LOG:-/var/log/omamobile} +say() { printf 'omamobile-tegu-modem-up: %s\n' "$*"; } +gnss=0 phone=0 +for a in "$@"; do + case $a in + --gnss) gnss=1 ;; + --phone) phone=1 ;; + *) say "usage: omamobile-tegu-modem-up [--gnss] [--phone]"; exit 2 ;; + esac +done +[[ $EUID -eq 0 || -n ${OMAMOBILE_MODEM_TEST:-} ]] || { say "run as root"; exit 1; } + +phone_up() { + ((phone)) || return 0 + systemctl start omamobile-sitd.service + say "phone service started" + if systemctl cat omamobile-mmd.service >/dev/null 2>&1; then + systemctl start omamobile-mmd.service && say "Phone and Messages bridge started" + fi +} + +if systemctl is-active -q omamobile-tegu-modem; then + say "already running: $($CP_STATE state 2>/dev/null || echo unknown)" + phone_up + exit 0 +fi +if [[ -d $SYS/module/cpif ]]; then + say "CPIF was loaded earlier this boot; reboot before starting the modem again"; exit 1 +fi +if [[ -e $LATCH ]]; then + say "an earlier start never reached ONLINE ($LATCH): look at /var/log/omamobile/modem.log, then remove it to try again" + exit 1 +fi +[[ -e $SYS/bus/platform/devices/154e0000.pinctrl ]] || { say "no FAR_ALIVE pinctrl (old device tree)"; exit 1; } + +# Which drivers: the kernel's own, or the bring-up modules +if [[ -e $DT/cpif ]] && modinfo -n cpif >/dev/null 2>&1 && modinfo -n pcie_gs201_cp >/dev/null 2>&1; then + in_tree=1 +else + in_tree=0 + for f in tegu-modem-cpif-activate.ko tegu-pcie0-cp.ko shm_ipc.ko cpif.ko cpif-keep-link.ko gnss_spi.ko gnssif.ko; do + [[ -f $B/$f ]] || { say "no in-kernel CP drivers and no $B/$f"; exit 1; } + done +fi + +# The NV checks (read-only) before anything touches the modem +$CHROOT modem check + +# No system suspend while the CP has been up this boot: a suspend with it +# ONLINE never woke (2026-10-27). Taken before the drivers load, kept until +# the reboot; systemctl suspend and logind's suspend then refuse. +systemctl is-active -q omamobile-tegu-modem-nosleep || + systemd-run -q --unit=omamobile-tegu-modem-nosleep \ + systemd-inhibit --what=sleep --who=omamobile-tegu-modem \ + --why="suspend with the modem up isn't qualified on the Pixel 9a" --mode=block sleep infinity + +mkdir -p "$(dirname "$LATCH")" "$LOG" +date -Is > "$LATCH"; sync "$LATCH" 2>/dev/null || sync + +if ((in_tree)); then + say "drivers: the running kernel's" + modprobe pcie_gs201_cp allow_hw=1 + modprobe shm_ipc + modprobe cpif + modprobe gnss_spi 2>/dev/null || true + modprobe gnssif 2>/dev/null || true +else + say "drivers: the bring-up modules in $B" + insmod $B/tegu-modem-cpif-activate.ko activate=1 + insmod $B/tegu-pcie0-cp.ko allow_hw=1 + insmod $B/shm_ipc.ko + # cpif with keep_link_up off at load, or the CP never reaches ONLINE + insmod $B/cpif-keep-link.ko keep_link_up=0 + # stock's GNSS SPI setup: mode 0, 32-bit words swapped in gnss_spi, 64-byte reads + insmod $B/gnss_spi.ko word32=2 piece=64 spi_mode=0 + insmod $B/gnssif.ko +fi +echo performance > $SYS/module/pcie_aspm/parameters/policy 2>/dev/null || true + +systemd-run -q --unit=omamobile-tegu-modem -p KillSignal=SIGINT -p TimeoutStopSec=60 \ + -p "ExecStop=$CHROOT modem stop" \ + --setenv=OMAMOBILE_MODEM_GNSS=$gnss \ + bash -c "exec $CHROOT modem start >> $LOG/modem.log 2>&1" +for _ in $(seq 1 60); do + s=$($CP_STATE state 2>/dev/null || true) + [[ $s == ONLINE ]] && break + systemctl is-active -q omamobile-tegu-modem || break + sleep ${OMAMOBILE_MODEM_POLL:-1} +done +s=$($CP_STATE state 2>/dev/null || echo unknown) +if [[ $s != ONLINE ]]; then + say "modem not ONLINE ($s); see /var/log/omamobile/modem.log. The latch stays: reboot, read the log, then remove $LATCH" + exit 1 +fi +rm -f "$LATCH"; sync +say "modem OK: CP ONLINE (log /var/log/omamobile/modem.log)" +phone_up diff --git a/packages/omamobile-device-tegu/test/all b/packages/omamobile-device-tegu/test/all index 121d36bc5..68f828257 100755 --- a/packages/omamobile-device-tegu/test/all +++ b/packages/omamobile-device-tegu/test/all @@ -104,6 +104,11 @@ for unit in omamobile-tegu-graphics omamobile-tegu-usb-rescue; do [[ $(readlink "$tmp/root/usr/lib/systemd/system/multi-user.target.wants/$unit.service") == ../$unit.service ]] \ || fail "$unit is enabled by a vendor wants link" done +# The modem's boot start is opt-in: installed, never enabled by the package +[[ -f $tmp/root/usr/lib/systemd/system/omamobile-tegu-modem-boot.service ]] || fail "install stages the modem's boot start" +[[ -e $tmp/root/usr/lib/systemd/system/multi-user.target.wants/omamobile-tegu-modem-boot.service ]] \ + && fail "the modem's boot start is enabled by the package (it must be opt-in)" +grep -q 'omamobile-tegu-modem-boot' omamobile-device-tegu.install && fail "the install scriptlet must not enable the modem's boot start" # The AoC start runs at every boot (its condition skips a DTB without the # node), and answers to omamobile-aoc.service for the sensor and fp units. [[ $(readlink "$tmp/root/usr/lib/systemd/system/multi-user.target.wants/omamobile-tegu-aoc.service") == ../omamobile-tegu-aoc.service ]] \ @@ -192,7 +197,7 @@ pass "the Bluetooth address is read at run time" grep -c '^for unit in omamobile-sensor-proxy.service omamobile-nfc-open.service; do$' bin/omamobile-setup-system >/dev/null || fail "setup-system enables the sensor proxy and the NFC opener" grep -qE 'omamobile-(fp|gnss-nmea|speaker-protection)' <(grep '^for unit' bin/omamobile-setup-system) && fail "setup-system must not enable fingerprint, GNSS or speaker protection on the 9a" -for t in test/graphics-start test/aoc-start test/usb-rescue test/sleep-hooks test/charge-limit; do +for t in test/graphics-start test/aoc-start test/usb-rescue test/sleep-hooks test/charge-limit test/modem-up; do "$t" || fail "$t" done pass "the scripts behave in a scratch root" diff --git a/packages/omamobile-device-tegu/test/modem-up b/packages/omamobile-device-tegu/test/modem-up new file mode 100755 index 000000000..7ab98d7cf --- /dev/null +++ b/packages/omamobile-device-tegu/test/modem-up @@ -0,0 +1,87 @@ +#!/bin/bash +# SPDX-License-Identifier: MIT +# omamobile-tegu-modem-up in a scratch root with fake commands: no phone, no +# modem. The refusals (CPIF already loaded, the failure latch), the choice of +# the kernel's drivers over the bring-up modules, the latch written before +# any driver and cleared at ONLINE, the sleep inhibitor taken before the +# drivers, and --phone starting sitd and the bridge. +set -euo pipefail +cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." +fail() { printf 'not ok - %s\n' "$1" >&2; exit 1; } +t=$(mktemp -d); trap 'rm -rf "$t"' EXIT +F=$t/bin; mkdir -p "$F" +fake() { printf '#!/bin/bash\n%s\n' "$2" > "$F/$1"; chmod +x "$F/$1"; } +# Every call goes to $t/calls in order; the CP turns ONLINE once the profile runs +fake systemctl 'echo "systemctl $*" >> "$T/calls" +case "$*" in + "is-active -q omamobile-tegu-modem") [[ -e $T/profile ]] ;; + "is-active -q omamobile-tegu-modem-nosleep") false ;; + "cat omamobile-mmd.service") [[ -n ${MMD:-} ]] ;; + *) true ;; +esac' +fake systemd-run 'echo "systemd-run $*" >> "$T/calls"; [[ "$*" == *"--unit=omamobile-tegu-modem "* ]] && touch "$T/profile"; true' +fake modinfo 'echo "modinfo $*" >> "$T/calls"; [[ -n ${IN_TREE:-} ]]' +fake modprobe 'echo "modprobe $*" >> "$T/calls"' +fake insmod 'echo "insmod $*" >> "$T/calls"' +fake sync 'true' +printf '#!/bin/bash\n[[ -e $T/profile && -z ${NEVER:-} ]] && echo ONLINE || echo OFFLINE\n' > "$t/cp"; chmod +x "$t/cp" +printf '#!/bin/bash\necho "chroot $*" >> "$T/calls"\n' > "$t/chroot"; chmod +x "$t/chroot" + +run() { # NAME [env...]: a fresh scratch root, then the script + local r=$t/$1; shift + rm -rf "$r"; mkdir -p "$r/sys/bus/platform/devices/154e0000.pinctrl" "$r/sys/module/pcie_aspm/parameters" "$r/dt" "$r/mods" "$r/log" + for m in tegu-modem-cpif-activate tegu-pcie0-cp shm_ipc cpif cpif-keep-link gnss_spi gnssif; do : > "$r/mods/$m.ko"; done + : > "$r/calls" + env -i PATH="$F:/usr/bin:/bin" T="$r" OMAMOBILE_MODEM_TEST=1 OMAMOBILE_SYS="$r/sys" OMAMOBILE_DT="$r/dt" \ + OMAMOBILE_MODEM_MODULES="$r/mods" OMAMOBILE_MODEM_LATCH="$r/latch" OMAMOBILE_MODEM_CP="$t/cp" \ + OMAMOBILE_VENDOR_CHROOT="$t/chroot" OMAMOBILE_MODEM_LOG="$r/log" OMAMOBILE_MODEM_POLL=0 "$@" \ + bash bin/omamobile-tegu-modem-up --phone > "$r/out" 2>&1 +} + +# The kernel's drivers when it has them and the DT names cpif +run_tree() { local r=$t/$1; shift; rm -rf "$r"; mkdir -p "$r/sys/bus/platform/devices/154e0000.pinctrl" "$r/sys/module/pcie_aspm/parameters" "$r/dt/cpif" "$r/mods" "$r/log"; : > "$r/calls" + env -i PATH="$F:/usr/bin:/bin" T="$r" OMAMOBILE_MODEM_TEST=1 OMAMOBILE_SYS="$r/sys" OMAMOBILE_DT="$r/dt" \ + OMAMOBILE_MODEM_MODULES="$r/mods" OMAMOBILE_MODEM_LATCH="$r/latch" OMAMOBILE_MODEM_CP="$t/cp" \ + OMAMOBILE_VENDOR_CHROOT="$t/chroot" OMAMOBILE_MODEM_LOG="$r/log" OMAMOBILE_MODEM_POLL=0 "$@" \ + bash bin/omamobile-tegu-modem-up --phone > "$r/out" 2>&1; } +run_tree k2 IN_TREE=1 MMD=1 || { cat "$t/k2/out"; fail "a start with the kernel's drivers succeeds"; } +c=$t/k2/calls +grep -qx 'modprobe pcie_gs201_cp allow_hw=1' "$c" || fail "the kernel's link driver is loaded with its hardware steps allowed" +grep -q '^insmod' "$c" && fail "no bring-up module is loaded when the kernel has the drivers" +grep -q 'drivers: the running kernel' "$t/k2/out" || fail "the start says which drivers it used" +n_inhibit=$(grep -n 'unit=omamobile-tegu-modem-nosleep' "$c" | cut -d: -f1) +n_driver=$(grep -n '^modprobe pcie_gs201_cp' "$c" | cut -d: -f1) +n_check=$(grep -n '^chroot modem check' "$c" | cut -d: -f1) +(( n_check < n_inhibit && n_inhibit < n_driver )) || fail "the NV check, then the sleep inhibitor, then the drivers" +[[ ! -e $t/k2/latch ]] || fail "the latch is cleared once the CP is ONLINE" +grep -qx 'systemctl start omamobile-sitd.service' "$c" || fail "--phone starts the phone service" +grep -qx 'systemctl start omamobile-mmd.service' "$c" || fail "--phone starts the bridge when it's installed" +printf 'ok - %s\n' "modem-up: the kernel's drivers, the order, the latch cleared, the phone service and the bridge" + +# The bring-up modules when the kernel lacks the drivers; no bridge without it +run b || { cat "$t/b/out"; fail "a start with the bring-up modules succeeds"; } +grep -q '^insmod .*/tegu-pcie0-cp.ko allow_hw=1$' "$t/b/calls" || fail "the bring-up link driver is loaded" +grep -q '^modprobe' "$t/b/calls" && fail "no kernel driver is modprobed without the kernel's drivers" +grep -qx 'systemctl start omamobile-mmd.service' "$t/b/calls" && fail "no bridge start when it isn't installed" +printf 'ok - %s\n' "modem-up: the bring-up modules otherwise, and no bridge when it isn't installed" + +# Refusals: CPIF already loaded this boot, and the latch of a start that never reached ONLINE +run_c() { local r=$t/c2; rm -rf "$r"; mkdir -p "$r/sys/module/cpif" "$r/sys/bus/platform/devices/154e0000.pinctrl" "$r/dt/cpif" "$r/log"; : > "$r/calls" + env -i PATH="$F:/usr/bin:/bin" T="$r" OMAMOBILE_MODEM_TEST=1 OMAMOBILE_SYS="$r/sys" OMAMOBILE_DT="$r/dt" \ + OMAMOBILE_MODEM_LATCH="$r/latch" OMAMOBILE_MODEM_CP="$t/cp" OMAMOBILE_VENDOR_CHROOT="$t/chroot" OMAMOBILE_MODEM_LOG="$r/log" \ + IN_TREE=1 bash bin/omamobile-tegu-modem-up --phone > "$r/out" 2>&1; } +run_c && fail "a second start in a boot that loaded CPIF is refused" +grep -q 'reboot before starting the modem again' "$t/c2/out" || fail "the refusal says to reboot" +grep -qE '^(modprobe|insmod)' "$t/c2/calls" && fail "nothing loads after the refusal" +run_tree n IN_TREE=1 NEVER=1 && fail "a start that never reaches ONLINE fails" +[[ -e $t/n/latch ]] || fail "the latch stays after a start that never reached ONLINE" +grep -q 'omamobile-sitd' "$t/n/calls" && fail "no phone service without ONLINE" +mkdir -p "$t/l"; date > "$t/l/latch" +run_l() { local r=$t/l; mkdir -p "$r/sys/bus/platform/devices/154e0000.pinctrl" "$r/dt/cpif" "$r/log"; : > "$r/calls" + env -i PATH="$F:/usr/bin:/bin" T="$r" OMAMOBILE_MODEM_TEST=1 OMAMOBILE_SYS="$r/sys" OMAMOBILE_DT="$r/dt" \ + OMAMOBILE_MODEM_LATCH="$r/latch" OMAMOBILE_MODEM_CP="$t/cp" OMAMOBILE_VENDOR_CHROOT="$t/chroot" OMAMOBILE_MODEM_LOG="$r/log" \ + IN_TREE=1 bash bin/omamobile-tegu-modem-up --phone > "$r/out" 2>&1; } +run_l && fail "a start with the latch set is refused" +grep -q 'never reached ONLINE' "$t/l/out" || fail "the refusal names the latch" +grep -qE '^(modprobe|insmod|systemd-run)' "$t/l/calls" && fail "nothing starts while the latch is set" +printf 'ok - %s\n' "modem-up: refuses a second start and a latched boot, and keeps the latch when ONLINE never comes" diff --git a/packages/omamobile-device-tegu/vendor/systemd/system/omamobile-tegu-modem-boot.service b/packages/omamobile-device-tegu/vendor/systemd/system/omamobile-tegu-modem-boot.service new file mode 100644 index 000000000..0d8feec5b --- /dev/null +++ b/packages/omamobile-device-tegu/vendor/systemd/system/omamobile-tegu-modem-boot.service @@ -0,0 +1,23 @@ +# SPDX-License-Identifier: MIT +# The Pixel 9a's modem at boot, opt-in: not enabled by the package. The owner +# turns it on with `systemctl enable omamobile-tegu-modem-boot`. It starts the +# CP once (omamobile-tegu-modem-up keeps the once-per-boot rule, the NV +# checks, the failure latch and the sleep inhibitor), then the phone service +# and, when installed, the Phone and Messages bridge. With it on the palmtop +# doesn't suspend (the modem blocks sleep until suspend with the CP up is +# qualified), so the battery drains as if awake. +[Unit] +Description=Start the Pixel 9a's modem and phone service (opt-in) +Documentation=file:///usr/share/doc/omamobile-device-tegu/README.md +After=omamobile-tegu-aoc.service omamobile-tegu-graphics.service network.target +Wants=network.target +ConditionPathExists=/usr/lib/omamobile-vendor/omamobile-vendor-chroot + +[Service] +Type=oneshot +RemainAfterExit=yes +ExecStart=/usr/bin/omamobile-tegu-modem-up --phone +TimeoutStartSec=300 + +[Install] +WantedBy=multi-user.target From 48e5d1810c91cf3a8d7839f50498c8741d077ce2 Mon Sep 17 00:00:00 2001 From: W4HO <87742609+W4HO-ham@users.noreply.github.com> Date: Mon, 2 Nov 2026 18:56:01 -0647 Subject: [PATCH 02/17] omamobile-device-tegu 0.2.11: run the modem profile's check after the CP drivers load The profile's check also wants CPIF's ports, so before the drivers it refused ("the CPIF port is not loaded") and the first boot start on the palmtop failed there. It runs after the drivers again, as the bring-up script had it; the inhibitor and the latch still come before any driver. --- packages/omamobile-device-tegu/README.md | 7 +++---- .../omamobile-device-tegu/bin/omamobile-tegu-modem-up | 8 +++++--- packages/omamobile-device-tegu/test/modem-up | 2 +- packages/omamobile-device-tegu/version | 2 +- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/packages/omamobile-device-tegu/README.md b/packages/omamobile-device-tegu/README.md index 2d59c9909..ddf671398 100644 --- a/packages/omamobile-device-tegu/README.md +++ b/packages/omamobile-device-tegu/README.md @@ -155,10 +155,9 @@ Licence: MIT. `omamobile-tegu-modem-up` starts the CP once per boot: the kernel's own drivers when it carries them (`cpif`, `pcie_gs201_cp` and the device tree's `cpif` node), else the bring-up modules in `/var/lib/omamobile-tegu/modem`. -It runs the read-only NV check, takes a sleep inhibitor before any driver -loads (suspend with the CP up isn't qualified on the 9a, so nothing sleeps -until the reboot), writes a latch before the drivers load and clears it at -CP ONLINE, and with `--phone` starts `omamobile-sitd` and, when installed, +It takes a sleep inhibitor before any driver loads (suspend with the CP up isn't qualified on the 9a, so nothing sleeps +until the reboot), writes a latch before the drivers load, runs the modem +profile's read-only NV check once CPIF is loaded, clears the latch at CP ONLINE, and with `--phone` starts `omamobile-sitd` and, when installed, `omamobile-mmd` for Phone and Messages. It refuses a second start in a boot that already loaded CPIF, and any start while the latch from a failed one is there (`/var/lib/omamobile/modem-bringup-started`: read diff --git a/packages/omamobile-device-tegu/bin/omamobile-tegu-modem-up b/packages/omamobile-device-tegu/bin/omamobile-tegu-modem-up index e1af5e5d6..c15188e0f 100644 --- a/packages/omamobile-device-tegu/bin/omamobile-tegu-modem-up +++ b/packages/omamobile-device-tegu/bin/omamobile-tegu-modem-up @@ -77,9 +77,6 @@ else done fi -# The NV checks (read-only) before anything touches the modem -$CHROOT modem check - # No system suspend while the CP has been up this boot: a suspend with it # ONLINE never woke (2026-10-27). Taken before the drivers load, kept until # the reboot; systemctl suspend and logind's suspend then refuse. @@ -111,6 +108,11 @@ else fi echo performance > $SYS/module/pcie_aspm/parameters/policy 2>/dev/null || true +# The profile's preconditions (read-only): the NV partitions read-only, +# unmounted and matching their checksums, and CPIF's ports present, so this +# comes after the drivers. A refusal keeps the latch: a human looks first. +$CHROOT modem check + systemd-run -q --unit=omamobile-tegu-modem -p KillSignal=SIGINT -p TimeoutStopSec=60 \ -p "ExecStop=$CHROOT modem stop" \ --setenv=OMAMOBILE_MODEM_GNSS=$gnss \ diff --git a/packages/omamobile-device-tegu/test/modem-up b/packages/omamobile-device-tegu/test/modem-up index 7ab98d7cf..71bf63f2d 100755 --- a/packages/omamobile-device-tegu/test/modem-up +++ b/packages/omamobile-device-tegu/test/modem-up @@ -52,7 +52,7 @@ grep -q 'drivers: the running kernel' "$t/k2/out" || fail "the start says which n_inhibit=$(grep -n 'unit=omamobile-tegu-modem-nosleep' "$c" | cut -d: -f1) n_driver=$(grep -n '^modprobe pcie_gs201_cp' "$c" | cut -d: -f1) n_check=$(grep -n '^chroot modem check' "$c" | cut -d: -f1) -(( n_check < n_inhibit && n_inhibit < n_driver )) || fail "the NV check, then the sleep inhibitor, then the drivers" +(( n_inhibit < n_driver && n_driver < n_check )) || fail "the sleep inhibitor, then the drivers, then the profile check (it needs CPIF loaded)" [[ ! -e $t/k2/latch ]] || fail "the latch is cleared once the CP is ONLINE" grep -qx 'systemctl start omamobile-sitd.service' "$c" || fail "--phone starts the phone service" grep -qx 'systemctl start omamobile-mmd.service' "$c" || fail "--phone starts the bridge when it's installed" diff --git a/packages/omamobile-device-tegu/version b/packages/omamobile-device-tegu/version index 13dead7eb..d3b5ba4bf 100644 --- a/packages/omamobile-device-tegu/version +++ b/packages/omamobile-device-tegu/version @@ -1 +1 @@ -0.2.10 +0.2.11 From 9917441a7b765a4d7afe31f42944ec91893a2e7f Mon Sep 17 00:00:00 2001 From: W4HO <87742609+W4HO-ham@users.noreply.github.com> Date: Mon, 2 Nov 2026 23:09:59 -0647 Subject: [PATCH 03/17] omamobile-device-tegu 0.2.12, omamobile-modem-sit 0.3.24: keep the modem latch until a clean shutdown, and the 9a's screen-on at start The latch was cleared as soon as the CP reached ONLINE, so a hang or reset after that would have started the modem again at every boot. It now stays until the modem profile's unit stops cleanly at shutdown (an ExecStopPost that runs only when the unit's result is success), and the next boot refuses while it's there, as TELEPHONY-PLAN 2.4 plans. The start also refuses a pcie_gs201_cp already loaded without allow_hw, as omamobile-modem-start does, and waits with wait-online instead of reading the state once a second. The screen-on that makes the 9a's modem send signal reports is now set only by tegu's sitd drop-in (OMAMOBILE_SIT_SCREEN_ON_AT_START), so the 7 Pro's start-up is unchanged; #381 already decodes the reports. The README and the boot unit give the order, the preconditions (slot B marked successful, a kernel with linux-omarchy-mobile#172, the charger for the first boots) and the rollback; the test checks the latch is on disk before any driver loads, that it stays past ONLINE, and the allow_hw refusal. --- device/tegu/MODEM-PLAN.md | 2 +- packages/omamobile-device-tegu/README.md | 52 +++++++++++++++---- .../bin/omamobile-tegu-modem-up | 31 ++++++----- packages/omamobile-device-tegu/test/all | 4 ++ packages/omamobile-device-tegu/test/modem-up | 34 ++++++++---- .../10-device-modem.conf | 3 ++ .../system/omamobile-tegu-modem-boot.service | 6 +++ packages/omamobile-device-tegu/version | 2 +- packages/omamobile-modem-sit/lib/service.py | 6 +++ 9 files changed, 105 insertions(+), 35 deletions(-) diff --git a/device/tegu/MODEM-PLAN.md b/device/tegu/MODEM-PLAN.md index 1d38749e4..b9a9af3f9 100644 --- a/device/tegu/MODEM-PLAN.md +++ b/device/tegu/MODEM-PLAN.md @@ -1782,7 +1782,7 @@ Preconditions, as SLEEP-PLAN's: | Piece | State | What it means here | | --- | --- | --- | -| Modem to ONLINE | `/usr/local/bin/omamobile-tegu-modem-up` (M5, once per boot; refuses a second start; arms the sleep inhibitor `omamobile-tegu-modem-nosleep`; its source is [bringup/omamobile-tegu-modem-up](bringup/omamobile-tegu-modem-up)) | the start is this script, not `omamobile-modem.service`, which is `masked-runtime` on the palmtop; the transient unit's ExecStop (the profile's stop, which powers the CP off) runs at shutdown, so the way to stop the modem is an attended reboot, never a stop by hand | +| Modem to ONLINE | `omamobile-tegu-modem-up` from `omamobile-device-tegu` (#372; before it, a bring-up copy in `/usr/local/bin`): once per boot, refuses a second start and a boot that finds the latch, arms the sleep inhibitor `omamobile-tegu-modem-nosleep`; `omamobile-tegu-modem-boot` runs it at boot when enabled (TELEPHONY-PLAN 2.7) | the start is this script, not `omamobile-modem.service`, which is `masked-runtime` on the palmtop; the transient unit's ExecStop (the profile's stop, which powers the CP off) runs at shutdown, so the way to stop the modem is an attended reboot, never a stop by hand | | NV safety | `pacman -Q` says `omamobile-modem` 0.1.4, but the profile files under `/usr/lib/omamobile-vendor` were copied by hand from newer trees (the 27th GNSS try ran 0.1.9's watcher; 0.1.4 predates the 9a's chroot support), so `pacman -Qkk omamobile-modem` is not clean; `/etc/omamobile/modem-nv.sha256` from the 2026-10-28 backup; the profile's `check` runs inside the start script | the NV checks live in that profile, so SIM-1 installs the package from main for real and records the version and the profile's sha256; a stock boot since 2026-10-28 would make `check` refuse; then a fresh read-only backup and a new checksum file come first (AGENTS.md ยง1) | | The RIL | `omamobile-modem-sit` 0.3.3 installed 2026-10-29 (SIM-1), both units disabled; 0.3.4 () reads the CP state on one open file | 0.3.3's watcher opens and closes the boot device about thirty times a minute, and that cycles the CP link on the 9a (the 10-29 hangs); the run uses 0.3.4 (SIM-1). Its unit `Requires=omamobile-modem.service`, which is masked here, so `systemctl start omamobile-sitd` would fail until SIM-2's unit copy removes that requirement (done 2026-10-29) | | The bridge for apps | `omamobile-mmd` not installed | not part of this test (T2 follows a passing run) | diff --git a/packages/omamobile-device-tegu/README.md b/packages/omamobile-device-tegu/README.md index ddf671398..250c784af 100644 --- a/packages/omamobile-device-tegu/README.md +++ b/packages/omamobile-device-tegu/README.md @@ -155,20 +155,52 @@ Licence: MIT. `omamobile-tegu-modem-up` starts the CP once per boot: the kernel's own drivers when it carries them (`cpif`, `pcie_gs201_cp` and the device tree's `cpif` node), else the bring-up modules in `/var/lib/omamobile-tegu/modem`. -It takes a sleep inhibitor before any driver loads (suspend with the CP up isn't qualified on the 9a, so nothing sleeps -until the reboot), writes a latch before the drivers load, runs the modem -profile's read-only NV check once CPIF is loaded, clears the latch at CP ONLINE, and with `--phone` starts `omamobile-sitd` and, when installed, -`omamobile-mmd` for Phone and Messages. It refuses a second start in a boot -that already loaded CPIF, and any start while the latch from a failed one is -there (`/var/lib/omamobile/modem-bringup-started`: read -`/var/log/omamobile/modem.log`, then remove it). Never stop the modem by -hand; the reboot's shutdown stops it. +In order, it: + +1. takes a sleep inhibitor (suspend with the CP up isn't qualified on the + 9a, so nothing sleeps until the reboot); +2. writes and syncs a latch, `/var/lib/omamobile/modem-bringup-started`; +3. loads the drivers (refusing a `pcie_gs201_cp` already loaded without + `allow_hw`); +4. runs the modem profile's read-only NV check, which needs CPIF loaded; +5. starts the profile and waits for CP ONLINE; +6. with `--phone`, starts `omamobile-sitd` and, when installed, + `omamobile-mmd` for Phone and Messages. + +The latch stays from step 2 until the profile's unit stops cleanly at +shutdown. A start that never reached ONLINE, or a boot that hung or reset +with the modem up, leaves it, and every later start refuses until you've +read `/var/log/omamobile/modem.log` and the last boot's journal and removed +it. It also refuses a second start in a boot that already loaded CPIF. +Never stop the modem by hand; the reboot's shutdown stops it. + +The in-tree driver branch (the kernel's `cpif` and `pcie_gs201_cp`) hasn't +run through this script yet; the in-tree drivers have run from the +bring-up runners. + +### Starting it at boot `omamobile-tegu-modem-boot.service` runs `omamobile-tegu-modem-up --phone` -at boot. The package installs it disabled; to have the palmtop come up as a -phone, `systemctl enable omamobile-tegu-modem-boot`. With it on the battery +at boot. The package installs it disabled. Before enabling it: + +- **Slot B marked successful.** Otherwise every reset spends one of ABL's + three tries, and at zero it boots stock on slot A, which has overwritten + `userdata`. +- **A kernel with linux-omarchy-mobile#172** (the PERIC0 GPIO bus clock + kept on). Without it the modem's GPIO writes hang the palmtop within + minutes. +- **The charger in** for the first boots. + +Then `systemctl enable omamobile-tegu-modem-boot`. With it on the battery drains as if awake, since the palmtop no longer suspends. +**Rollback:** `systemctl disable omamobile-tegu-modem-boot`, then reboot. +If the palmtop resets before you can log in, the latch does the work: the +boot after a reset with the modem up finds it and doesn't start the modem, +so log in then, disable the unit and remove the latch. If it still doesn't +come up, hold Volume Down + Power for fastboot and boot a known-good image +set. + ## Optional Phone and Messages attachment `omamobile-telephony-tegu` is an opt-in companion package; it installs the diff --git a/packages/omamobile-device-tegu/bin/omamobile-tegu-modem-up b/packages/omamobile-device-tegu/bin/omamobile-tegu-modem-up index c15188e0f..eea71db48 100644 --- a/packages/omamobile-device-tegu/bin/omamobile-tegu-modem-up +++ b/packages/omamobile-device-tegu/bin/omamobile-tegu-modem-up @@ -20,8 +20,11 @@ # - one CP start per boot: a second start in the same boot stalled in the # ROM, so a boot that loaded CPIF refuses (reboot to start again); # - never stop the modem by hand: the attended reboot's shutdown stops it; -# - a start that never reached ONLINE leaves a latch, and later boots refuse -# until a human removes it (/var/lib/omamobile/modem-bringup-started); +# - a latch (/var/lib/omamobile/modem-bringup-started) is written before any +# driver loads and removed only when the modem profile's unit stops +# cleanly at shutdown: a start that never reached ONLINE, or a boot that +# hung or reset with the modem up, leaves it, and later boots refuse until +# a human removes it (TELEPHONY-PLAN section 2.4); # - no system suspend once the CP is up: a sleep inhibitor, its own unit, is # taken before any driver loads and lasts until the reboot. set -euo pipefail @@ -62,7 +65,7 @@ if [[ -d $SYS/module/cpif ]]; then say "CPIF was loaded earlier this boot; reboot before starting the modem again"; exit 1 fi if [[ -e $LATCH ]]; then - say "an earlier start never reached ONLINE ($LATCH): look at /var/log/omamobile/modem.log, then remove it to try again" + say "an earlier start never reached ONLINE, or its boot didn't shut down cleanly ($LATCH, $(cat "$LATCH" 2>/dev/null)): look at /var/log/omamobile/modem.log and the last boot's journal, then remove it to try again" exit 1 fi [[ -e $SYS/bus/platform/devices/154e0000.pinctrl ]] || { say "no FAR_ALIVE pinctrl (old device tree)"; exit 1; } @@ -90,6 +93,12 @@ date -Is > "$LATCH"; sync "$LATCH" 2>/dev/null || sync if ((in_tree)); then say "drivers: the running kernel's" + # allow_hw is fixed at load time: a copy loaded without it refuses the + # CP's power-on, so it needs a reboot (as omamobile-modem-start checks). + if [[ -d $SYS/module/pcie_gs201_cp ]]; then + [[ $(cat "$SYS/module/pcie_gs201_cp/parameters/allow_hw" 2>/dev/null) == Y ]] || + { say "pcie_gs201_cp is loaded without allow_hw=1: reboot first"; exit 1; } + fi modprobe pcie_gs201_cp allow_hw=1 modprobe shm_ipc modprobe cpif @@ -113,21 +122,17 @@ echo performance > $SYS/module/pcie_aspm/parameters/policy 2>/dev/null || true # comes after the drivers. A refusal keeps the latch: a human looks first. $CHROOT modem check +# A clean stop of the profile's unit (the reboot's shutdown) is the only +# thing that removes the latch; a failed or killed profile leaves it. systemd-run -q --unit=omamobile-tegu-modem -p KillSignal=SIGINT -p TimeoutStopSec=60 \ -p "ExecStop=$CHROOT modem stop" \ + -p "ExecStopPost=/bin/sh -c '[ \"\$\$SERVICE_RESULT\" = success ] && rm -f $LATCH && sync'" \ --setenv=OMAMOBILE_MODEM_GNSS=$gnss \ bash -c "exec $CHROOT modem start >> $LOG/modem.log 2>&1" -for _ in $(seq 1 60); do - s=$($CP_STATE state 2>/dev/null || true) - [[ $s == ONLINE ]] && break - systemctl is-active -q omamobile-tegu-modem || break - sleep ${OMAMOBILE_MODEM_POLL:-1} -done -s=$($CP_STATE state 2>/dev/null || echo unknown) -if [[ $s != ONLINE ]]; then +if ! $CP_STATE wait-online 60 >/dev/null 2>&1; then + s=$($CP_STATE state 2>/dev/null || echo unknown) say "modem not ONLINE ($s); see /var/log/omamobile/modem.log. The latch stays: reboot, read the log, then remove $LATCH" exit 1 fi -rm -f "$LATCH"; sync -say "modem OK: CP ONLINE (log /var/log/omamobile/modem.log)" +say "modem OK: CP ONLINE (log /var/log/omamobile/modem.log); the latch stays until a clean shutdown" phone_up diff --git a/packages/omamobile-device-tegu/test/all b/packages/omamobile-device-tegu/test/all index 68f828257..172c71631 100755 --- a/packages/omamobile-device-tegu/test/all +++ b/packages/omamobile-device-tegu/test/all @@ -156,6 +156,10 @@ done [[ -f $tmp/root/usr/lib/systemd/system/omamobile-sitd.service.d/10-device-modem.conf ]] \ || fail "the device sitd policy is staged" grep -q 'omamobile-sitd-policy' PKGBUILD || fail "the package provides its sitd policy capability" +grep -qx 'Environment=OMAMOBILE_SIT_SCREEN_ON_AT_START=1' vendor/systemd/system/omamobile-sitd.service.d/10-device-modem.conf \ + || fail "the 9a's sitd tells its modem the screen is on at start-up (signal reports)" +! grep -rq OMAMOBILE_SIT_SCREEN_ON_AT_START ../omamobile-device-cheetah ../omamobile-device-raven \ + || fail "only the 9a sets the start-up screen-on" pass "install stages the package, enables only the guards, and nothing that marks a slot" for m in cpif shm_ipc pcie_gs201_cp; do diff --git a/packages/omamobile-device-tegu/test/modem-up b/packages/omamobile-device-tegu/test/modem-up index 71bf63f2d..ef19fb738 100755 --- a/packages/omamobile-device-tegu/test/modem-up +++ b/packages/omamobile-device-tegu/test/modem-up @@ -1,9 +1,10 @@ #!/bin/bash # SPDX-License-Identifier: MIT # omamobile-tegu-modem-up in a scratch root with fake commands: no phone, no -# modem. The refusals (CPIF already loaded, the failure latch), the choice of -# the kernel's drivers over the bring-up modules, the latch written before -# any driver and cleared at ONLINE, the sleep inhibitor taken before the +# modem. The refusals (CPIF already loaded, the latch, a link driver loaded +# without allow_hw), the choice of the kernel's drivers over the bring-up +# modules, the latch written before any driver and kept past ONLINE for the +# profile's clean stop to remove, the sleep inhibitor taken before the # drivers, and --phone starting sitd and the bridge. set -euo pipefail cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." @@ -21,10 +22,11 @@ case "$*" in esac' fake systemd-run 'echo "systemd-run $*" >> "$T/calls"; [[ "$*" == *"--unit=omamobile-tegu-modem "* ]] && touch "$T/profile"; true' fake modinfo 'echo "modinfo $*" >> "$T/calls"; [[ -n ${IN_TREE:-} ]]' -fake modprobe 'echo "modprobe $*" >> "$T/calls"' -fake insmod 'echo "insmod $*" >> "$T/calls"' +# The drivers record whether the latch was already on disk when they loaded +fake modprobe 'echo "modprobe $* latch=$([[ -e $OMAMOBILE_MODEM_LATCH ]] && echo yes || echo no)" >> "$T/calls"' +fake insmod 'echo "insmod $* latch=$([[ -e $OMAMOBILE_MODEM_LATCH ]] && echo yes || echo no)" >> "$T/calls"' fake sync 'true' -printf '#!/bin/bash\n[[ -e $T/profile && -z ${NEVER:-} ]] && echo ONLINE || echo OFFLINE\n' > "$t/cp"; chmod +x "$t/cp" +printf '#!/bin/bash\nif [[ -e $T/profile && -z ${NEVER:-} ]]; then echo ONLINE; else echo OFFLINE; [[ $1 == wait-online ]] && exit 1; fi; exit 0\n' > "$t/cp"; chmod +x "$t/cp" printf '#!/bin/bash\necho "chroot $*" >> "$T/calls"\n' > "$t/chroot"; chmod +x "$t/chroot" run() { # NAME [env...]: a fresh scratch root, then the script @@ -46,21 +48,23 @@ run_tree() { local r=$t/$1; shift; rm -rf "$r"; mkdir -p "$r/sys/bus/platform/de bash bin/omamobile-tegu-modem-up --phone > "$r/out" 2>&1; } run_tree k2 IN_TREE=1 MMD=1 || { cat "$t/k2/out"; fail "a start with the kernel's drivers succeeds"; } c=$t/k2/calls -grep -qx 'modprobe pcie_gs201_cp allow_hw=1' "$c" || fail "the kernel's link driver is loaded with its hardware steps allowed" +grep -qx 'modprobe pcie_gs201_cp allow_hw=1 latch=yes' "$c" || fail "the kernel's link driver is loaded with its hardware steps allowed, after the latch is on disk" +grep -q 'latch=no' "$c" && fail "no driver loads before the latch is written" grep -q '^insmod' "$c" && fail "no bring-up module is loaded when the kernel has the drivers" grep -q 'drivers: the running kernel' "$t/k2/out" || fail "the start says which drivers it used" n_inhibit=$(grep -n 'unit=omamobile-tegu-modem-nosleep' "$c" | cut -d: -f1) n_driver=$(grep -n '^modprobe pcie_gs201_cp' "$c" | cut -d: -f1) n_check=$(grep -n '^chroot modem check' "$c" | cut -d: -f1) (( n_inhibit < n_driver && n_driver < n_check )) || fail "the sleep inhibitor, then the drivers, then the profile check (it needs CPIF loaded)" -[[ ! -e $t/k2/latch ]] || fail "the latch is cleared once the CP is ONLINE" +[[ -e $t/k2/latch ]] || fail "the latch stays past ONLINE" +grep -q 'ExecStopPost=.*SERVICE_RESULT.*rm -f .*latch' "$c" || fail "the profile's clean stop removes the latch" grep -qx 'systemctl start omamobile-sitd.service' "$c" || fail "--phone starts the phone service" grep -qx 'systemctl start omamobile-mmd.service' "$c" || fail "--phone starts the bridge when it's installed" -printf 'ok - %s\n' "modem-up: the kernel's drivers, the order, the latch cleared, the phone service and the bridge" +printf 'ok - %s\n' "modem-up: the kernel's drivers, the order, the latch kept for a clean stop, the phone service and the bridge" # The bring-up modules when the kernel lacks the drivers; no bridge without it run b || { cat "$t/b/out"; fail "a start with the bring-up modules succeeds"; } -grep -q '^insmod .*/tegu-pcie0-cp.ko allow_hw=1$' "$t/b/calls" || fail "the bring-up link driver is loaded" +grep -q '^insmod .*/tegu-pcie0-cp.ko allow_hw=1 latch=yes$' "$t/b/calls" || fail "the bring-up link driver is loaded, after the latch" grep -q '^modprobe' "$t/b/calls" && fail "no kernel driver is modprobed without the kernel's drivers" grep -qx 'systemctl start omamobile-mmd.service' "$t/b/calls" && fail "no bridge start when it isn't installed" printf 'ok - %s\n' "modem-up: the bring-up modules otherwise, and no bridge when it isn't installed" @@ -85,3 +89,13 @@ run_l && fail "a start with the latch set is refused" grep -q 'never reached ONLINE' "$t/l/out" || fail "the refusal names the latch" grep -qE '^(modprobe|insmod|systemd-run)' "$t/l/calls" && fail "nothing starts while the latch is set" printf 'ok - %s\n' "modem-up: refuses a second start and a latched boot, and keeps the latch when ONLINE never comes" + +# A link driver already loaded without allow_hw: refuse before loading anything +r=$t/hw; mkdir -p "$r/sys/bus/platform/devices/154e0000.pinctrl" "$r/sys/module/pcie_gs201_cp/parameters" "$r/dt/cpif" "$r/log" +echo N > "$r/sys/module/pcie_gs201_cp/parameters/allow_hw"; : > "$r/calls" +env -i PATH="$F:/usr/bin:/bin" T="$r" OMAMOBILE_MODEM_TEST=1 OMAMOBILE_SYS="$r/sys" OMAMOBILE_DT="$r/dt" \ + OMAMOBILE_MODEM_LATCH="$r/latch" OMAMOBILE_MODEM_CP="$t/cp" OMAMOBILE_VENDOR_CHROOT="$t/chroot" OMAMOBILE_MODEM_LOG="$r/log" \ + IN_TREE=1 bash bin/omamobile-tegu-modem-up --phone > "$r/out" 2>&1 && fail "a link driver loaded without allow_hw is refused" +grep -q 'without allow_hw=1: reboot first' "$r/out" || fail "the refusal says to reboot" +grep -qE '^(modprobe|insmod)' "$r/calls" && fail "nothing loads after the allow_hw refusal" +printf 'ok - %s\n' "modem-up: refuses a link driver loaded without allow_hw" diff --git a/packages/omamobile-device-tegu/vendor/systemd/system/omamobile-sitd.service.d/10-device-modem.conf b/packages/omamobile-device-tegu/vendor/systemd/system/omamobile-sitd.service.d/10-device-modem.conf index 719317df9..6bfc2218e 100644 --- a/packages/omamobile-device-tegu/vendor/systemd/system/omamobile-sitd.service.d/10-device-modem.conf +++ b/packages/omamobile-device-tegu/vendor/systemd/system/omamobile-sitd.service.d/10-device-modem.conf @@ -8,3 +8,6 @@ After=omamobile-tegu-modem.service omamobile-tegu-aoc.service [Service] # Active alone is insufficient: the CP must already report ONLINE. ExecStartPre=/usr/lib/omamobile-vendor/omamobile-modem-cp state +# The 9a's modem sends signal reports only after it's told the screen is on, +# and nothing sends the screen state yet: sitd tells it once at start-up. +Environment=OMAMOBILE_SIT_SCREEN_ON_AT_START=1 diff --git a/packages/omamobile-device-tegu/vendor/systemd/system/omamobile-tegu-modem-boot.service b/packages/omamobile-device-tegu/vendor/systemd/system/omamobile-tegu-modem-boot.service index 0d8feec5b..3d6e113a6 100644 --- a/packages/omamobile-device-tegu/vendor/systemd/system/omamobile-tegu-modem-boot.service +++ b/packages/omamobile-device-tegu/vendor/systemd/system/omamobile-tegu-modem-boot.service @@ -6,6 +6,12 @@ # and, when installed, the Phone and Messages bridge. With it on the palmtop # doesn't suspend (the modem blocks sleep until suspend with the CP up is # qualified), so the battery drains as if awake. +# +# Before enabling it (README, "Starting it at boot"): slot B marked +# successful, a kernel with linux-omarchy-mobile#172, and the charger in for +# the first boots. Rollback: systemctl disable omamobile-tegu-modem-boot and +# reboot; after a reset with the modem up, the latch keeps the next boot +# from starting it. [Unit] Description=Start the Pixel 9a's modem and phone service (opt-in) Documentation=file:///usr/share/doc/omamobile-device-tegu/README.md diff --git a/packages/omamobile-device-tegu/version b/packages/omamobile-device-tegu/version index d3b5ba4bf..f2722b133 100644 --- a/packages/omamobile-device-tegu/version +++ b/packages/omamobile-device-tegu/version @@ -1 +1 @@ -0.2.11 +0.2.12 diff --git a/packages/omamobile-modem-sit/lib/service.py b/packages/omamobile-modem-sit/lib/service.py index a7967edd1..1ea9adb6c 100644 --- a/packages/omamobile-modem-sit/lib/service.py +++ b/packages/omamobile-modem-sit/lib/service.py @@ -924,6 +924,12 @@ def stop(*_): SOCKET.chmod(0o660) notify('READY=1\nSTATUS=registered') print('Calls and SMS service ready', flush=True) + # Set by a device whose modem sends signal reports only after it's + # told the screen is on (the Pixel 9a's drop-in), while nothing else + # sends the screen state yet. Never set on the 7 Pro. + if args.bringup and os.environ.get('OMAMOBILE_SIT_SCREEN_ON_AT_START') == '1' \ + and service.screen_on is None: + service.dispatch(dict(action='screen-state', on=True)) next_cp_check = 0 while not stopping: service.pump() From 23e0e0a4a8ea063c79ed7a96481825c4a04dfac9 Mon Sep 17 00:00:00 2001 From: W4HO <87742609+W4HO-ham@users.noreply.github.com> Date: Tue, 3 Nov 2026 07:09:45 -0647 Subject: [PATCH 04/17] omamobile-device-tegu: queue sitd and the bridge at boot, and DEVICES says the modem starts The boot unit's 300 s timeout could run out while the start waited for sitd to register, and the bridge would never start. The start now queues sitd and the bridge (ordered after sitd) without waiting. The 9a's DEVICES cell no longer says the package doesn't start the modem: its opt-in boot unit does. --- .../omamobile-device-tegu/bin/omamobile-tegu-modem-up | 9 ++++++--- packages/omamobile-device-tegu/test/modem-up | 6 +++--- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/packages/omamobile-device-tegu/bin/omamobile-tegu-modem-up b/packages/omamobile-device-tegu/bin/omamobile-tegu-modem-up index eea71db48..c9206ca13 100644 --- a/packages/omamobile-device-tegu/bin/omamobile-tegu-modem-up +++ b/packages/omamobile-device-tegu/bin/omamobile-tegu-modem-up @@ -49,10 +49,13 @@ done phone_up() { ((phone)) || return 0 - systemctl start omamobile-sitd.service - say "phone service started" + # Queued, not waited for: sitd is ready only once it has registered, which + # can take longer than the boot unit's timeout, and the bridge would never + # be started. The bridge is ordered after sitd. + systemctl start --no-block omamobile-sitd.service + say "phone service starting" if systemctl cat omamobile-mmd.service >/dev/null 2>&1; then - systemctl start omamobile-mmd.service && say "Phone and Messages bridge started" + systemctl start --no-block omamobile-mmd.service && say "Phone and Messages bridge starting after it" fi } diff --git a/packages/omamobile-device-tegu/test/modem-up b/packages/omamobile-device-tegu/test/modem-up index ef19fb738..ec7146bc9 100755 --- a/packages/omamobile-device-tegu/test/modem-up +++ b/packages/omamobile-device-tegu/test/modem-up @@ -58,15 +58,15 @@ n_check=$(grep -n '^chroot modem check' "$c" | cut -d: -f1) (( n_inhibit < n_driver && n_driver < n_check )) || fail "the sleep inhibitor, then the drivers, then the profile check (it needs CPIF loaded)" [[ -e $t/k2/latch ]] || fail "the latch stays past ONLINE" grep -q 'ExecStopPost=.*SERVICE_RESULT.*rm -f .*latch' "$c" || fail "the profile's clean stop removes the latch" -grep -qx 'systemctl start omamobile-sitd.service' "$c" || fail "--phone starts the phone service" -grep -qx 'systemctl start omamobile-mmd.service' "$c" || fail "--phone starts the bridge when it's installed" +grep -qx 'systemctl start --no-block omamobile-sitd.service' "$c" || fail "--phone starts the phone service" +grep -qx 'systemctl start --no-block omamobile-mmd.service' "$c" || fail "--phone starts the bridge when it's installed" printf 'ok - %s\n' "modem-up: the kernel's drivers, the order, the latch kept for a clean stop, the phone service and the bridge" # The bring-up modules when the kernel lacks the drivers; no bridge without it run b || { cat "$t/b/out"; fail "a start with the bring-up modules succeeds"; } grep -q '^insmod .*/tegu-pcie0-cp.ko allow_hw=1 latch=yes$' "$t/b/calls" || fail "the bring-up link driver is loaded, after the latch" grep -q '^modprobe' "$t/b/calls" && fail "no kernel driver is modprobed without the kernel's drivers" -grep -qx 'systemctl start omamobile-mmd.service' "$t/b/calls" && fail "no bridge start when it isn't installed" +grep -qx 'systemctl start --no-block omamobile-mmd.service' "$t/b/calls" && fail "no bridge start when it isn't installed" printf 'ok - %s\n' "modem-up: the bring-up modules otherwise, and no bridge when it isn't installed" # Refusals: CPIF already loaded this boot, and the latch of a start that never reached ONLINE From 60309eff1df060ab1aa16dfb678ac54d7b14fb82 Mon Sep 17 00:00:00 2001 From: W4HO <87742609+W4HO-ham@users.noreply.github.com> Date: Tue, 3 Nov 2026 08:32:03 -0647 Subject: [PATCH 05/17] omamobile-device-tegu: a deliberate restart after ONLINE doesn't cost the next boot its modem reboot-to (and so bin/omamobile push) skips the clean stop that removes the latch, so the next boot refused the modem as if the last one had hung (#390). The latch now names its boot and records ONLINE, and a latch from a boot that reached ONLINE and ended with reboot-to (its note, #403) is cleared with the note. A start that never reached ONLINE, or a note for another boot, still refuses. --- .../bin/omamobile-tegu-modem-up | 17 +++++++++++++- packages/omamobile-device-tegu/test/modem-up | 22 +++++++++++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a/packages/omamobile-device-tegu/bin/omamobile-tegu-modem-up b/packages/omamobile-device-tegu/bin/omamobile-tegu-modem-up index c9206ca13..773b92628 100644 --- a/packages/omamobile-device-tegu/bin/omamobile-tegu-modem-up +++ b/packages/omamobile-device-tegu/bin/omamobile-tegu-modem-up @@ -31,6 +31,9 @@ set -euo pipefail # The overrides are for test/modem-up's scratch root only. B=${OMAMOBILE_MODEM_MODULES:-/var/lib/omamobile-tegu/modem} LATCH=${OMAMOBILE_MODEM_LATCH:-/var/lib/omamobile/modem-bringup-started} +# reboot-to notes the boot it ends here (#403): it skips systemd's shutdown, +# and so the clean stop that removes the latch. +NOTE=${OMAMOBILE_DELIBERATE_RESTART:-/var/lib/omamobile/deliberate-restart} CP_STATE=${OMAMOBILE_MODEM_CP:-/usr/lib/omamobile-vendor/omamobile-modem-cp} CHROOT=${OMAMOBILE_VENDOR_CHROOT:-/usr/lib/omamobile-vendor/omamobile-vendor-chroot} SYS=${OMAMOBILE_SYS:-/sys} @@ -67,6 +70,17 @@ fi if [[ -d $SYS/module/cpif ]]; then say "CPIF was loaded earlier this boot; reboot before starting the modem again"; exit 1 fi +boot_id() { cat "${OMAMOBILE_BOOT_ID:-/proc/sys/kernel/random/boot_id}"; } +# A latch from a boot that reached ONLINE and then ended with reboot-to (a +# push, a reboot to the bootloader) ended on purpose, not in a hang or a +# reset: clear it with the note. A start that never reached ONLINE, or a +# note naming another boot, still refuses. +if [[ -e $LATCH && -s $NOTE ]] && grep -qx "online" "$LATCH" && + grep -q "boot $(head -c 64 "$NOTE" | tr -d '\n')\$" "$LATCH"; then + say "the last boot with the modem up ended with reboot-to: $LATCH removed" + rm -f "$LATCH" "$NOTE" + sync +fi if [[ -e $LATCH ]]; then say "an earlier start never reached ONLINE, or its boot didn't shut down cleanly ($LATCH, $(cat "$LATCH" 2>/dev/null)): look at /var/log/omamobile/modem.log and the last boot's journal, then remove it to try again" exit 1 @@ -92,7 +106,7 @@ systemctl is-active -q omamobile-tegu-modem-nosleep || --why="suspend with the modem up isn't qualified on the Pixel 9a" --mode=block sleep infinity mkdir -p "$(dirname "$LATCH")" "$LOG" -date -Is > "$LATCH"; sync "$LATCH" 2>/dev/null || sync +printf '%s boot %s\n' "$(date -Is)" "$(boot_id)" > "$LATCH"; sync "$LATCH" 2>/dev/null || sync if ((in_tree)); then say "drivers: the running kernel's" @@ -137,5 +151,6 @@ if ! $CP_STATE wait-online 60 >/dev/null 2>&1; then say "modem not ONLINE ($s); see /var/log/omamobile/modem.log. The latch stays: reboot, read the log, then remove $LATCH" exit 1 fi +echo online >> "$LATCH"; sync "$LATCH" 2>/dev/null || sync say "modem OK: CP ONLINE (log /var/log/omamobile/modem.log); the latch stays until a clean shutdown" phone_up diff --git a/packages/omamobile-device-tegu/test/modem-up b/packages/omamobile-device-tegu/test/modem-up index ec7146bc9..a91d5e599 100755 --- a/packages/omamobile-device-tegu/test/modem-up +++ b/packages/omamobile-device-tegu/test/modem-up @@ -99,3 +99,25 @@ env -i PATH="$F:/usr/bin:/bin" T="$r" OMAMOBILE_MODEM_TEST=1 OMAMOBILE_SYS="$r/s grep -q 'without allow_hw=1: reboot first' "$r/out" || fail "the refusal says to reboot" grep -qE '^(modprobe|insmod)' "$r/calls" && fail "nothing loads after the allow_hw refusal" printf 'ok - %s\n' "modem-up: refuses a link driver loaded without allow_hw" + +# reboot-to's note (#403): a latch from a boot that reached ONLINE and ended +# with reboot-to is cleared with the note, and the start goes on; one that +# never reached ONLINE, or a note naming another boot, still refuses. +note_case() { # NAME LATCH-LINES NOTE-ID -> runs with a fresh root, latch and note + local r=$t/$1; rm -rf "$r"; mkdir -p "$r/sys/bus/platform/devices/154e0000.pinctrl" "$r/sys/module/pcie_aspm/parameters" "$r/dt/cpif" "$r/log"; : > "$r/calls" + printf '%b' "$2" > "$r/latch"; printf '%s\n' "$3" > "$r/note"; echo 22222222-2222-2222-2222-222222222222 > "$r/boot_id" + env -i PATH="$F:/usr/bin:/bin" T="$r" OMAMOBILE_MODEM_TEST=1 OMAMOBILE_SYS="$r/sys" OMAMOBILE_DT="$r/dt" \ + OMAMOBILE_MODEM_LATCH="$r/latch" OMAMOBILE_DELIBERATE_RESTART="$r/note" OMAMOBILE_BOOT_ID="$r/boot_id" \ + OMAMOBILE_MODEM_CP="$t/cp" OMAMOBILE_VENDOR_CHROOT="$t/chroot" OMAMOBILE_MODEM_LOG="$r/log" OMAMOBILE_MODEM_POLL=0 \ + IN_TREE=1 MMD=1 bash bin/omamobile-tegu-modem-up --phone > "$r/out" 2>&1 +} +old=11111111-1111-1111-1111-111111111111 +note_case n1 "2026-11-03T00:00:00+00:00 boot $old\nonline\n" "$old" || { cat "$t/n1/out"; fail "a deliberate restart after ONLINE starts the modem"; } +grep -q 'ended with reboot-to' "$t/n1/out" || fail "the clear is logged" +[[ ! -e $t/n1/note ]] || fail "the note is removed with the latch" +grep -q "boot 22222222-2222-2222-2222-222222222222" "$t/n1/latch" && grep -qx online "$t/n1/latch" || fail "this boot's latch names its boot and ONLINE" +note_case n2 "2026-11-03T00:00:00+00:00 boot $old\n" "$old" && fail "a start that never reached ONLINE still refuses, note or not" +grep -q 'never reached ONLINE' "$t/n2/out" || fail "the refusal names the latch" +note_case n3 "2026-11-03T00:00:00+00:00 boot $old\nonline\n" 33333333-3333-3333-3333-333333333333 && fail "a note naming another boot clears nothing" +[[ -e $t/n3/latch && -e $t/n3/note ]] || fail "the latch and the note stay" +printf 'ok - %s\n' "modem-up: reboot-to's note clears an ONLINE latch of the boot it names, nothing else" From 1fc8e5f3592d9663a44519154eb5a6e598a4f345 Mon Sep 17 00:00:00 2001 From: W4HO <87742609+W4HO-ham@users.noreply.github.com> Date: Tue, 3 Nov 2026 08:51:56 -0647 Subject: [PATCH 06/17] omamobile-device-tegu: start gnssd with the modem at boot, for Omarchy's Location switch omamobile-gnss serves fixes only when the modem profile runs gnssd (OMAMOBILE_MODEM_GNSS=1), and the boot start didn't ask for it, so every Location request found no gnssd and the service hit its start limit. The boot unit now runs omamobile-tegu-modem-up --phone --gnss. The daily kernel keeps the PERIC0 GPIO bus clock critical, as linux-omarchy-mobile#172 does, so the modem's GNSS traffic can't hang the palmtop. --- packages/omamobile-device-tegu/test/all | 2 ++ .../vendor/systemd/system/omamobile-tegu-modem-boot.service | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/omamobile-device-tegu/test/all b/packages/omamobile-device-tegu/test/all index 172c71631..4fb3a6c3b 100755 --- a/packages/omamobile-device-tegu/test/all +++ b/packages/omamobile-device-tegu/test/all @@ -109,6 +109,8 @@ done [[ -e $tmp/root/usr/lib/systemd/system/multi-user.target.wants/omamobile-tegu-modem-boot.service ]] \ && fail "the modem's boot start is enabled by the package (it must be opt-in)" grep -q 'omamobile-tegu-modem-boot' omamobile-device-tegu.install && fail "the install scriptlet must not enable the modem's boot start" +grep -qx 'ExecStart=/usr/bin/omamobile-tegu-modem-up --phone --gnss' vendor/systemd/system/omamobile-tegu-modem-boot.service \ + || fail "the boot start brings gnssd up with the modem, for the Location switch" # The AoC start runs at every boot (its condition skips a DTB without the # node), and answers to omamobile-aoc.service for the sensor and fp units. [[ $(readlink "$tmp/root/usr/lib/systemd/system/multi-user.target.wants/omamobile-tegu-aoc.service") == ../omamobile-tegu-aoc.service ]] \ diff --git a/packages/omamobile-device-tegu/vendor/systemd/system/omamobile-tegu-modem-boot.service b/packages/omamobile-device-tegu/vendor/systemd/system/omamobile-tegu-modem-boot.service index 3d6e113a6..9a2e7e224 100644 --- a/packages/omamobile-device-tegu/vendor/systemd/system/omamobile-tegu-modem-boot.service +++ b/packages/omamobile-device-tegu/vendor/systemd/system/omamobile-tegu-modem-boot.service @@ -3,7 +3,8 @@ # turns it on with `systemctl enable omamobile-tegu-modem-boot`. It starts the # CP once (omamobile-tegu-modem-up keeps the once-per-boot rule, the NV # checks, the failure latch and the sleep inhibitor), then the phone service -# and, when installed, the Phone and Messages bridge. With it on the palmtop +# and, when installed, the Phone and Messages bridge, with gnssd in the +# modem profile so Omarchy's Location switch gets fixes (omamobile-gnss). With it on the palmtop # doesn't suspend (the modem blocks sleep until suspend with the CP up is # qualified), so the battery drains as if awake. # @@ -22,7 +23,7 @@ ConditionPathExists=/usr/lib/omamobile-vendor/omamobile-vendor-chroot [Service] Type=oneshot RemainAfterExit=yes -ExecStart=/usr/bin/omamobile-tegu-modem-up --phone +ExecStart=/usr/bin/omamobile-tegu-modem-up --phone --gnss TimeoutStartSec=300 [Install] From 487ba3f50d260c629bf4f8d649c53032e5b5435b Mon Sep 17 00:00:00 2001 From: W4HO <87742609+W4HO-ham@users.noreply.github.com> Date: Tue, 3 Nov 2026 09:04:13 -0647 Subject: [PATCH 07/17] device/tegu TELEPHONY-PLAN: the boot start's first record (2.7) Two reboots on the palmtop with the boot unit enabled, the NV check, the UFS count after a shutdown with the CP up and a phone-smoke report, as Derek asked before the README tells anyone to enable it. --- device/tegu/TELEPHONY-PLAN.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/device/tegu/TELEPHONY-PLAN.md b/device/tegu/TELEPHONY-PLAN.md index d19766400..ba6764571 100644 --- a/device/tegu/TELEPHONY-PLAN.md +++ b/device/tegu/TELEPHONY-PLAN.md @@ -132,6 +132,34 @@ successful, a kernel with linux-omarchy-mobile#172, an off-repo NV backup. Record each run here with the date, `uname -r`, the package versions, the phone-smoke report and the UFS count. +**2026-11-03, the palmtop** (the daily kernel +`7.3.0-rc6-omamobile-tegu-s2mpg15-m1-g991042e2eff3-dirty`; slot B marked +successful on 2026-10-31 with no fastboot write since; the kernel keeps the +PERIC0 GPIO bus clock critical, as #172 +does; on the charger; `omamobile-device-tegu` 0.2.12, `omamobile-modem-sit` +0.3.36, `omamobile-mmd` 0.1.4 and `omamobile-gnss` 0.2.7, all from this +stack): + +1. Read-only: `tools/nv-backup -d tegu --check` against the 2026-10-28 + backup (#407): every NV partition the same. Passed. +2. Enabled `omamobile-tegu-modem-boot`. Passed. +3. `systemctl reboot` with the unit enabled: "modem OK: CP ONLINE", the + phone service and the bridge queued, IMS registered with nothing started + by hand, gnssd running, the latch reading `boot ` and `online`, the + inhibitor held. A GNSS session through the Location socket had 133 of 135 + GGA sentences fixed (first fix 48 s). Passed. +4. A second `systemctl reboot` with the CP up: the profile's unit stopped + cleanly, the latch was removed and the next boot wrote its own; no + `ufshcd_err_handler` pass in the boot that shut down. Passed. + +`tools/phone-smoke` on the second boot: every required check ok (boot, the +storage guard, root, kernel health, USB, session), and display, GPU, lock, +touch, buttons, Wi-Fi, Bluetooth, battery, sound card, sensors, cameras and +thermal ok. It flagged a stale bring-up unit in `/etc/systemd/system` from +2026-10-28 (`omamobile-tegu-audio.service`, failing), now moved aside, and +new dmesg lines from NFC (an unknown notification opcode) and CPIF (packets +for a channel nobody has opened); neither came with a fault. + Qualification, attended and on the charger: boot to ONLINE, data and texts; the inhibitor; NV and UFS unchanged; then shutdown and reboot on their own. Suspend with the CP on needs its own tests, with NFC polling stopped, and From c0975038abba2616ab9ccd84604b28ed38ebde4e Mon Sep 17 00:00:00 2001 From: W4HO <87742609+W4HO-ham@users.noreply.github.com> Date: Tue, 3 Nov 2026 09:22:00 -0647 Subject: [PATCH 08/17] device/tegu TELEPHONY-PLAN: section 2's items 2 to 6 read as sentences again The status words added in #360 left each item's old sentence hanging after them. Each item now says what #372 does and what is still the target, in whole sentences. --- device/tegu/TELEPHONY-PLAN.md | 40 +++++++++++++++++------------------ 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/device/tegu/TELEPHONY-PLAN.md b/device/tegu/TELEPHONY-PLAN.md index ba6764571..cc4589cb9 100644 --- a/device/tegu/TELEPHONY-PLAN.md +++ b/device/tegu/TELEPHONY-PLAN.md @@ -82,39 +82,39 @@ Opt-in and attended at first, with sleep blocked for the boot. policy. `-dd` is never the install method. 2. **One modem service.** *Partly in #372:* `omamobile-tegu-modem-up` is packaged, with the explicit CP ONLINE check and an opt-in boot unit, and - #371 replaces the copied sitd unit with device drop-ins. *Target:* the - transient unit. Give it tegu's start (today the bring-up script - `/usr/local/bin/omamobile-tegu-modem-up` and its transient unit) with the - AoC's ordering, and drop the copied `/etc/systemd/system/omamobile-sitd.service` - and the transient-unit workaround. sitd starts only after an explicit + #371 replaces the copied sitd unit with device drop-ins. *Target:* tegu's + start as one modem service with the AoC's ordering, in place of the + transient unit `omamobile-tegu-modem-up` runs the profile in, and no + copied `/etc/systemd/system/omamobile-sitd.service` or transient-unit + workaround on any palmtop. sitd starts only after an explicit "CP ONLINE" check: a unit being active isn't enough. 3. **Preflight before any hardware access:** *Target.* #372 runs the profile's own check (NV read-only, unmounted, checksums of its RAM copies), after the drivers load because it needs CPIF's ports; the - up-front NV-only check and the gaps below are still to do. the kernel, DT, firmware, - private provisioning and board properties present; the six NV and - firmware partitions found by `PARTNAME`, read-only, unmounted and - matching the checksums. Today's profile hashes five RAM copies, doesn't + up-front NV-only check and the gaps below are still to do: the kernel, + DT, firmware, private provisioning and board properties present, and the + six NV and firmware partitions found by `PARTNAME`, read-only, unmounted + and matching the checksums. Today's profile hashes five RAM copies, doesn't hash `modem_b`, and exempts `persist` from its read-only check: the boot preflight closes those gaps. A mismatch stops the start; the baseline is never refreshed automatically. 4. **Two guards:** *Partly in #372:* a boot that has loaded CPIF refuses a - second start, and the latch is written and synced before any driver. *Target:* - keeping it from ONLINE until a clean shutdown. an atomic per-boot "attempted" marker, never cleared in - that boot, and a persistent failure latch written and synced before any - driver loads, kept through the whole phone-service start while this is - being qualified. No automatic CP or sitd restart, module unload, power + second start, and the latch is written and synced before any driver and + kept from ONLINE until a clean shutdown. *Target:* an atomic per-boot + "attempted" marker, never cleared in that boot, and the failure latch + kept through the whole phone-service start while this is being + qualified. No automatic CP or sitd restart, module unload, power cycle or latch clearing. -5. **Sleep:** *Done in #372*, before the drivers and until the reboot. take and confirm the sleep inhibitor before the modem drivers - load, and hold it past sitd and the profile, until shutdown. Keep the +5. **Sleep:** *Done in #372:* the sleep inhibitor is taken and confirmed + before the modem drivers load, and held past sitd and the profile until + the reboot. Keep the owner's auto-sleep setting as it is; the inhibitor blocks the sleep and says why. No suspend hook that stops and restarts the modem. Low-battery actions must not force an unqualified suspend. 6. **Failure stays visible:** *Partly in #372:* the stage is reported and - the latch stays after a failed start, with no retry. *Target:* the shutdown - order through one modem service. the failed stage reported, diagnostics left in - place, no retry. At shutdown, the established order: the phone service's - cleanup, the CP off, then rfsd. + the latch stays after a failed start, with no retry. *Target:* + diagnostics left in place, and the shutdown order through one modem + service: the phone service's cleanup, the CP off, then rfsd. ### 2.7 Enabling the boot start (gated runbook, #372) From 361377912eb03178aba37d7bbcb34cf461238661 Mon Sep 17 00:00:00 2001 From: W4HO <87742609+W4HO-ham@users.noreply.github.com> Date: Tue, 3 Nov 2026 10:54:38 -0647 Subject: [PATCH 09/17] omamobile-device-tegu: a reboot with the modem up clears its latch The profile unit's ExecStopPost removed the latch only when SERVICE_RESULT was success, and at a shutdown it never is: the CP's power-off in ExecStop ends rfsd or cbd before systemd's SIGINT, so the profile's supervisor exits 1. On the palmtop on 2026-11-03 a systemctl reboot with the modem up left the latch, and the next boot refused the modem. ExecStopPost now runs omamobile-tegu-modem-up --stopped, which removes this boot's latch once the start reached ONLINE, whatever the result, as omamobile-modem-start --stopped does on the Pixel 7 Pro. A hang or a reset never reaches it, so those still refuse the next boot. --- .../bin/omamobile-tegu-modem-up | 34 ++++++++++++++++--- packages/omamobile-device-tegu/test/modem-up | 26 +++++++++++++- 2 files changed, 54 insertions(+), 6 deletions(-) diff --git a/packages/omamobile-device-tegu/bin/omamobile-tegu-modem-up b/packages/omamobile-device-tegu/bin/omamobile-tegu-modem-up index 773b92628..cd12cab5b 100644 --- a/packages/omamobile-device-tegu/bin/omamobile-tegu-modem-up +++ b/packages/omamobile-device-tegu/bin/omamobile-tegu-modem-up @@ -9,6 +9,8 @@ # --phone after CP ONLINE, start omamobile-sitd, and omamobile-mmd when # it's installed (Phone and Messages); omamobile-tegu-modem.service # runs it this way at boot when the owner has enabled it +# omamobile-tegu-modem-up --stopped +# the profile unit's ExecStopPost: removes this boot's latch # # The CP drivers come from the running kernel when it carries them (cpif and # pcie_gs201_cp, with the device tree's cpif node: the published kernel), else @@ -40,16 +42,38 @@ SYS=${OMAMOBILE_SYS:-/sys} DT=${OMAMOBILE_DT:-/proc/device-tree} LOG=${OMAMOBILE_MODEM_LOG:-/var/log/omamobile} say() { printf 'omamobile-tegu-modem-up: %s\n' "$*"; } -gnss=0 phone=0 +gnss=0 phone=0 stopped=0 for a in "$@"; do case $a in --gnss) gnss=1 ;; --phone) phone=1 ;; - *) say "usage: omamobile-tegu-modem-up [--gnss] [--phone]"; exit 2 ;; + --stopped) stopped=1 ;; + *) say "usage: omamobile-tegu-modem-up [--gnss] [--phone] | --stopped"; exit 2 ;; esac done [[ $EUID -eq 0 || -n ${OMAMOBILE_MODEM_TEST:-} ]] || { say "run as root"; exit 1; } +# --stopped: the modem profile unit's ExecStopPost. Reaching it at all means +# the unit stopped (a hang or a reset never gets here), so this boot's latch +# goes once the start had reached ONLINE, whatever the unit's result: at a +# shutdown the CP's power-off ends rfsd or cbd before systemd's SIGINT, and +# the profile's supervisor then exits 1, so the result is never "success" +# (the omamobile-modem-start --stopped rule on the Pixel 7 Pro). A start that +# never reached ONLINE, or another boot's latch, is kept. +if ((stopped)); then + [[ -e $LATCH ]] || exit 0 + id=$(cat "${OMAMOBILE_BOOT_ID:-/proc/sys/kernel/random/boot_id}") + if ! grep -q "boot $id\$" "$LATCH"; then + say "$LATCH is another boot's ($(head -1 "$LATCH")): kept" + elif ! grep -qx online "$LATCH"; then + say "this boot's start never reached ONLINE: $LATCH kept" + else + rm -f "$LATCH"; sync + say "modem stopped (${SERVICE_RESULT:-result unknown}): $LATCH removed" + fi + exit 0 +fi + phone_up() { ((phone)) || return 0 # Queued, not waited for: sitd is ready only once it has registered, which @@ -139,11 +163,11 @@ echo performance > $SYS/module/pcie_aspm/parameters/policy 2>/dev/null || true # comes after the drivers. A refusal keeps the latch: a human looks first. $CHROOT modem check -# A clean stop of the profile's unit (the reboot's shutdown) is the only -# thing that removes the latch; a failed or killed profile leaves it. +# A stop of the profile's unit (the reboot's shutdown) is the only thing +# that removes the latch (--stopped above); a hang or a reset leaves it. systemd-run -q --unit=omamobile-tegu-modem -p KillSignal=SIGINT -p TimeoutStopSec=60 \ -p "ExecStop=$CHROOT modem stop" \ - -p "ExecStopPost=/bin/sh -c '[ \"\$\$SERVICE_RESULT\" = success ] && rm -f $LATCH && sync'" \ + -p "ExecStopPost=${OMAMOBILE_MODEM_UP_SELF:-/usr/bin/omamobile-tegu-modem-up} --stopped" \ --setenv=OMAMOBILE_MODEM_GNSS=$gnss \ bash -c "exec $CHROOT modem start >> $LOG/modem.log 2>&1" if ! $CP_STATE wait-online 60 >/dev/null 2>&1; then diff --git a/packages/omamobile-device-tegu/test/modem-up b/packages/omamobile-device-tegu/test/modem-up index a91d5e599..8b3843ad0 100755 --- a/packages/omamobile-device-tegu/test/modem-up +++ b/packages/omamobile-device-tegu/test/modem-up @@ -57,7 +57,7 @@ n_driver=$(grep -n '^modprobe pcie_gs201_cp' "$c" | cut -d: -f1) n_check=$(grep -n '^chroot modem check' "$c" | cut -d: -f1) (( n_inhibit < n_driver && n_driver < n_check )) || fail "the sleep inhibitor, then the drivers, then the profile check (it needs CPIF loaded)" [[ -e $t/k2/latch ]] || fail "the latch stays past ONLINE" -grep -q 'ExecStopPost=.*SERVICE_RESULT.*rm -f .*latch' "$c" || fail "the profile's clean stop removes the latch" +grep -q 'ExecStopPost=.*omamobile-tegu-modem-up --stopped' "$c" || fail "the profile's stop runs --stopped, which removes the latch" grep -qx 'systemctl start --no-block omamobile-sitd.service' "$c" || fail "--phone starts the phone service" grep -qx 'systemctl start --no-block omamobile-mmd.service' "$c" || fail "--phone starts the bridge when it's installed" printf 'ok - %s\n' "modem-up: the kernel's drivers, the order, the latch kept for a clean stop, the phone service and the bridge" @@ -121,3 +121,27 @@ grep -q 'never reached ONLINE' "$t/n2/out" || fail "the refusal names the latch" note_case n3 "2026-11-03T00:00:00+00:00 boot $old\nonline\n" 33333333-3333-3333-3333-333333333333 && fail "a note naming another boot clears nothing" [[ -e $t/n3/latch && -e $t/n3/note ]] || fail "the latch and the note stay" printf 'ok - %s\n' "modem-up: reboot-to's note clears an ONLINE latch of the boot it names, nothing else" + +# --stopped (the profile unit's ExecStopPost): this boot's latch goes once it +# reached ONLINE, whatever the unit's result (a shutdown's is exit-code: the +# CP's power-off ends a daemon before SIGINT); another boot's latch, or one +# that never reached ONLINE, stays. +stop_case() { # NAME LATCH-LINES RESULT + local r=$t/$1; rm -rf "$r"; mkdir -p "$r" + printf '%b' "$2" > "$r/latch"; echo 22222222-2222-2222-2222-222222222222 > "$r/boot_id" + env -i PATH="$F:/usr/bin:/bin" OMAMOBILE_MODEM_TEST=1 SERVICE_RESULT="$3" \ + OMAMOBILE_MODEM_LATCH="$r/latch" OMAMOBILE_BOOT_ID="$r/boot_id" \ + bash bin/omamobile-tegu-modem-up --stopped > "$r/out" 2>&1 +} +this=22222222-2222-2222-2222-222222222222 +stop_case s1 "2026-11-03T00:00:00+00:00 boot $this\nonline\n" exit-code || fail "--stopped succeeds" +[[ ! -e $t/s1/latch ]] || fail "a stop after ONLINE removes this boot's latch, even with the result exit-code" +grep -q 'modem stopped (exit-code)' "$t/s1/out" || fail "the removal is logged with the unit's result" +stop_case s2 "2026-11-03T00:00:00+00:00 boot $this\n" success +[[ -e $t/s2/latch ]] || fail "a start that never reached ONLINE keeps its latch" +stop_case s3 "2026-11-03T00:00:00+00:00 boot 11111111-1111-1111-1111-111111111111\nonline\n" success +[[ -e $t/s3/latch ]] || fail "another boot's latch is kept" +rm -rf "$t/s4"; mkdir -p "$t/s4" +env -i PATH="$F:/usr/bin:/bin" OMAMOBILE_MODEM_TEST=1 OMAMOBILE_MODEM_LATCH="$t/s4/latch" \ + bash bin/omamobile-tegu-modem-up --stopped > "$t/s4/out" 2>&1 || fail "--stopped with no latch succeeds" +printf 'ok - %s\n' "modem-up: --stopped removes this boot's ONLINE latch whatever the result, and keeps the others" From 3fb65a64421ca31b4e24f6994ef693aee741f4bc Mon Sep 17 00:00:00 2001 From: W4HO <87742609+W4HO-ham@users.noreply.github.com> Date: Tue, 3 Nov 2026 14:32:51 -0647 Subject: [PATCH 10/17] DEVICES, TELEPHONY-PLAN, omamobile-device-tegu: the 9a's modem and GNSS testing until the default, the latch's stop as it is now DEVICES reserves works for on by default, and the boot unit is opt-in, so Modem and GNSS read testing until the follow-up that turns it on after kernel #187. The latch is described as removed by the profile unit's stop at shutdown, the README gives the unit's --phone --gnss and says the reboot-to path is under test, and section 2.7 records the reboot that left the latch and the re-run on the fixed script. --- device/tegu/TELEPHONY-PLAN.md | 21 +++++++++++++++---- docs/DEVICES.md | 2 +- packages/omamobile-device-tegu/README.md | 16 ++++++++++---- .../bin/omamobile-tegu-modem-up | 11 +++++----- 4 files changed, 36 insertions(+), 14 deletions(-) diff --git a/device/tegu/TELEPHONY-PLAN.md b/device/tegu/TELEPHONY-PLAN.md index cc4589cb9..878d96ddc 100644 --- a/device/tegu/TELEPHONY-PLAN.md +++ b/device/tegu/TELEPHONY-PLAN.md @@ -100,7 +100,8 @@ Opt-in and attended at first, with sleep blocked for the boot. never refreshed automatically. 4. **Two guards:** *Partly in #372:* a boot that has loaded CPIF refuses a second start, and the latch is written and synced before any driver and - kept from ONLINE until a clean shutdown. *Target:* an atomic per-boot + kept from ONLINE until the profile's unit stops at a shutdown (its + ExecStopPost, whatever the stop's result). *Target:* an atomic per-boot "attempted" marker, never cleared in that boot, and the failure latch kept through the whole phone-service start while this is being qualified. No automatic CP or sitd restart, module unload, power @@ -125,7 +126,7 @@ successful, a kernel with linux-omarchy-mobile#172, an off-repo NV backup. | --- | --- | --- | --- | --- | | 1. Read-only / none | `uname -r`; `pacman -Q omamobile-device-tegu omamobile-modem omamobile-modem-sit omamobile-mmd`; `tools/nv-backup --check "$NV_BACKUP"` (laptop); `ls /var/lib/omamobile/modem-bringup-started` | The kernel and packages recorded, NV matches, no latch | NV mismatch, a latch present, B not marked | None | | 2. Enable / low | `systemctl enable omamobile-tegu-modem-boot` | A wants link, nothing started | Anything starts | `systemctl disable omamobile-tegu-modem-boot` | -| 3. Cold boot / medium (the CP starts at boot, sleep blocked) | Power off, then on; after login: `journalctl -b -u omamobile-tegu-modem-boot`; `omamobile-sit status`; `systemd-inhibit --list`; `tools/phone-smoke` (laptop) | "modem OK: CP ONLINE", sitd running and registered, the inhibitor held, the latch present (it stays until a clean shutdown), phone-smoke clean | No ONLINE, a reset, a UFS or NV error, no inhibitor | `systemctl disable omamobile-tegu-modem-boot`, reboot; after a reset the latch keeps the next boot from starting the modem | +| 3. Cold boot / medium (the CP starts at boot, sleep blocked) | Power off, then on; after login: `journalctl -b -u omamobile-tegu-modem-boot`; `omamobile-sit status`; `systemd-inhibit --list`; `tools/phone-smoke` (laptop) | "modem OK: CP ONLINE", sitd running and registered, the inhibitor held, the latch present (it stays until the profile's unit stops at shutdown), phone-smoke clean | No ONLINE, a reset, a UFS or NV error, no inhibitor | `systemctl disable omamobile-tegu-modem-boot`, reboot; after a reset the latch keeps the next boot from starting the modem | | 4. Clean shutdown / medium (one UFS handler pass expected on the 7 Pro's pattern) | `systemctl reboot`; after login: `journalctl -b -1 -k \| grep -c ufshcd_err_handler`; `ls /var/lib/omamobile/modem-bringup-started`; `tools/nv-backup --check` | The latch gone (clean stop), the CP up again at this boot, the UFS count recorded, NV matches | The latch still there after a clean reboot, I/O errors, NV mismatch | As step 3 | | 5. A day's use / low | Calls, texts and data as usual | No reset, no latch left over | A reset or hang | As step 3 | @@ -137,8 +138,8 @@ phone-smoke report and the UFS count. successful on 2026-10-31 with no fastboot write since; the kernel keeps the PERIC0 GPIO bus clock critical, as #172 does; on the charger; `omamobile-device-tegu` 0.2.12, `omamobile-modem-sit` -0.3.36, `omamobile-mmd` 0.1.4 and `omamobile-gnss` 0.2.7, all from this -stack): +0.3.36 and `omamobile-mmd` 0.1.4 from the pull requests above this one +(#376 to #380), `omamobile-gnss` 0.2.7 from main): 1. Read-only: `tools/nv-backup -d tegu --check` against the 2026-10-28 backup (#407): every NV partition the same. Passed. @@ -151,6 +152,18 @@ stack): 4. A second `systemctl reboot` with the CP up: the profile's unit stopped cleanly, the latch was removed and the next boot wrote its own; no `ufshcd_err_handler` pass in the boot that shut down. Passed. +5. Later the same day (10:03), a `systemctl reboot` with the CP up left the + latch: the CP's power-off in ExecStop ended rfsd before systemd's + SIGINT, the profile's supervisor exited 1 ("CP OFFLINE", then + `Control process exited, status=1`), and the old ExecStopPost removed + the latch only on `SERVICE_RESULT=success`. The next boot (10:33) + refused the modem. Failed; fixed in this pull request's last commit + (ExecStopPost runs `omamobile-tegu-modem-up --stopped`, which removes + this boot's latch after ONLINE whatever the result). Re-run with the + fixed script: modem started and ONLINE, `systemctl reboot` at 10:43 + ("modem stopped (success): โ€ฆ removed"), the next boot ONLINE on its own, + and a second reboot at 10:47 removed that boot's latch too. Passed. + `tools/nv-backup --check` after these reboots is still to come. `tools/phone-smoke` on the second boot: every required check ok (boot, the storage guard, root, kernel health, USB, session), and display, GPU, lock, diff --git a/docs/DEVICES.md b/docs/DEVICES.md index 35da976d8..303e2adb9 100644 --- a/docs/DEVICES.md +++ b/docs/DEVICES.md @@ -25,7 +25,7 @@ The status of each device, as verified on real hardware. Rows in the matrix have | Pixel 6 | oriole | gs101 (Tensor G1) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); native test image on one phone; slot B marked successful and `vbmeta_b` verification turned off, both without project approval; see notes) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); guarded `userdata` root on test image) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); connected output on test image) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); Panfrost render node present) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); touchscreen detected; input not checked by smoke) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); gpio-keys detected; input not checked by smoke) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); USB network and SSH on test image) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); link up; traffic not checked by smoke) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); controller powered; pairing not checked) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); charge and temperature reported) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); charging reported; control not checked) | no | no | no | no | no | no | no | no | no | no | no | | Pixel 4 | flame | SM8150 (Snapdragon 855) | testing (temporary RAM boot; [notes](../device/flame/BRINGUP-M1.md)) | testing (RAM probe; all UFS read-only) | testing (1080x2280 console; software desktop in separate Arch payload) | testing (separate Arch payload; FD640 contexts, llvmpipe desktop) | testing (separate Arch payload; events and PIN unlock verified) | no | testing (NCM + ACM + SSH; sustained transfers can disconnect) | testing (guarded RAM scan; association untested) | no | no | no | no | no | no | - | no | no | no | no | no | no | - | | Pixel 4 XL ([notes](../device/coral/NOTES.md)) | coral | SM8150 (Snapdragon 855) | WIP (direct ABL v2 boot on the test handset's slot A; slot-B install and ยง3.1 entry pending; [notes](../device/coral/BRINGUP-M1.md)) | testing (read-only `blockdev` guard + RAM `overlayfs`) | testing (1440x3040@60Hz S6E3HC2 DSC 1.1 KMS, DPMS, brightness) | testing (Adreno 640 / FD640 Mesa Freedreno, Hyprland) | testing (FTS SPI multitouch + read-only flash guard) | testing (power via `qcom-pon` + volume via `gpio-keys`) | testing (CDC ECM + ACM + SSH; stays up with host USB switched off) | testing (`WCN3990` `ath10k_snoc` + `rmtfs -r`, WPA2/DHCP/HTTPS; radio sessions ran before the modem baseline) | WIP (`WCN3990` `hci_qca` `hci0` up + BLE scan; audio/pairing open) | WIP (PM8150B ADC `VBAT_SNS` voltage + FG temp; aftermarket pack on test unit: no reply from `1-0036`) | testing (PM8150B SMB5 charger with `4.20 V` / `500 mA` kernel clamp) | testing (`CS40L25A` I2C click waveform) | testing (PM8150L flash LEDs + quick-settings tile) | no | - | testing (QDSP6 + dual `CS35L36` amps capped at `-26 dB` + `IA8508` SPI mic DSP) | testing (`SLPI` + `fastrpc` + RAM-backed `hexagonrpcd` + QMI SSC: 7 sensors + Soli radar) | WIP (`MPSS` boots with `rmtfs -r` + patched `tqftpserv`, SIM detected; no IPA/voice yet; radio sessions ran before the modem baseline) | no | testing (`CAMSS` + `IMX363`, `IMX481`, `IMX520`, dual `OV7251` NIR; `libcamera` softISP) | no | - | -| Pixel 9a ([notes](../device/tegu/NOTES.md)) | tegu | zumapro (Tensor G4) | works ([#28](https://github.com/derekross/omarchy-mobile/issues/28): native boot from slot B, the Arch root on `userdata`, `omamobile-device-tegu`; slot B was marked successful by hand on 2026-10-28 with the `devinfo` write approved on 2026-10-22, now on hold ([#125](https://github.com/derekross/omarchy-mobile/pull/125)), unmarked by the 10-31 fastboot recovery and marked again on 2026-10-31 during the hold ([record](../device/tegu/NOTES.md#2026-10-31-a-fastboot-flash-of-slot-b-cleared-its-successful-mark-and-b-was-marked-again)), and the package does not mark it; unpublished kernel: the SoC and board device tree is [kernel #81](https://github.com/derekross/linux-omarchy-mobile/pull/81), merged; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (UFS behind the read-only guard; unpublished kernel; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (120 Hz through gs-decon; the panel driver [kernel #89](https://github.com/derekross/linux-omarchy-mobile/pull/89), 120 Hz [kernel #88](https://github.com/derekross/linux-omarchy-mobile/pull/88), merged, the display DT, merged with [kernel #96](https://github.com/derekross/linux-omarchy-mobile/pull/96); brightness, DPMS off and on and the 60/120 Hz switch on the boot of [kernel #125](https://github.com/derekross/linux-omarchy-mobile/pull/125), merged, which also checks the panel's ID; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on), [brightness record](../device/tegu/NOTES.md#2026-11-01-afternoon-and-evening-wi-fi-from-the-package-the-wake-and-the-replug-storage-idle-the-panel-id)) | works (Panthor, the desktop renders, runtime suspend when idle; this boot runs at a fixed 160 MHz; the GPU's levels and its thermal zone are merged with [kernel #96](https://github.com/derekross/linux-omarchy-mobile/pull/96) ([kernel #85](https://github.com/derekross/linux-omarchy-mobile/pull/85) and [kernel #87](https://github.com/derekross/linux-omarchy-mobile/pull/87) landed through it), not yet run from it; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (Synaptics S3908 over SPI, [kernel #81](https://github.com/derekross/linux-omarchy-mobile/pull/81), merged; survives sleep, [kernel #82](https://github.com/derekross/linux-omarchy-mobile/pull/82), merged; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (gpio-keys: power and volume; the power key wakes from sleep; unpublished kernel; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (CDC NCM and SSH; reconnects after a replug, `omamobile-tegu-usb-rescue`, also after a replug the gadget didn't see ([#280](https://github.com/derekross/omarchy-mobile/pull/280); [the replug record](../device/tegu/NOTES.md#2026-10-28-what-the-device-tables-claims-rest-on)); [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (BCM4383 on PCIe channel 1 through the shared gs201 host and zuma PHY, [kernel #178](https://github.com/derekross/linux-omarchy-mobile/pull/178) on [kernel #156](https://github.com/derekross/linux-omarchy-mobile/pull/156), in review, and brcmfmac, [kernel #56](https://github.com/derekross/linux-omarchy-mobile/pull/56) in review; started at boot by `omamobile-device-tegu` 0.2.4 ([#238](https://github.com/derekross/omarchy-mobile/pull/238)) with the extractor's firmware; WPA2 with iwd, kept loaded across sleep by the package's sleep hook; [record](../device/tegu/NOTES.md#2026-11-01-afternoon-and-evening-wi-fi-from-the-package-the-wake-and-the-replug-storage-idle-the-panel-id)) | works (hci_uart on the bootloader's address, BlueZ, A2DP; [kernel #94](https://github.com/derekross/linux-omarchy-mobile/pull/94); unpublished kernel; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (MAX77779 gauge with temperature, current and time estimates through UPower; [kernel #66](https://github.com/derekross/linux-omarchy-mobile/pull/66); unpublished kernel; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (the MAX77779 charger binds from the device tree, [kernel #161](https://github.com/derekross/linux-omarchy-mobile/pull/161), merged, built by [#227](https://github.com/derekross/omarchy-mobile/pull/227); the charge limit in `omamobile-device-tegu` 0.2.3 holds charging off at the limit through `charge_behaviour` and lets it run again 5 below; [record](../device/tegu/NOTES.md#2026-10-31-and-11-01-every-testing-row-on-a-published-style-kernel)) | works (CS40L26A through feedbackd, with brownout prevention, [kernel #95](https://github.com/derekross/linux-omarchy-mobile/pull/95); its DT [kernel #96](https://github.com/derekross/linux-omarchy-mobile/pull/96), merged; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (LM3644, 25 steps to 75 mA, quick-settings tile; its DT [kernel #96](https://github.com/derekross/linux-omarchy-mobile/pull/96), merged; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | testing (Omarchy's Location switch serves fixes from GPS, Galileo, BeiDou and GLONASS once the modem is up, started by hand: a 30-minute session through the switch on 2026-11-01 (omamobile-gnss 0.2.5's start, the modem link left to cycle) ran clean, 1763 of 1765 GGA sentences fixed, first fix 37 s after a client connected; needs [kernel #150](https://github.com/derekross/linux-omarchy-mobile/pull/150), merged, the PERIC0 clock fix [kernel #172](https://github.com/derekross/linux-omarchy-mobile/pull/172), merged (without it the modem link hung the palmtop within minutes), and [#114](https://github.com/derekross/omarchy-mobile/pull/114), merged, from whose package build a session in a moving car fixed 145 of 153 times; the GNSS link driver is merged, [kernel #185](https://github.com/derekross/linux-omarchy-mobile/pull/185), loaded by hand with the modem off, and a session through it waits on the modem link; [plan](../device/tegu/MODEM-PLAN.md), record with [#202](https://github.com/derekross/omarchy-mobile/pull/202)) | works (audio and sensor DSP through the GSA and Trusty, 93 services, started at boot by `omamobile-device-tegu` 0.2.3 from the device tree, [kernel #162](https://github.com/derekross/linux-omarchy-mobile/pull/162) in review; [record](../device/tegu/NOTES.md#2026-10-31-and-11-01-every-testing-row-on-a-published-style-kernel)) | works (the TAS2572 amplifiers and the microphone through the AoC card and PipeWire, at boot with the AoC: a tone from the speaker, the microphone at -32 dBFS; speakers at a -10 dB ceiling; [record](../device/tegu/NOTES.md#2026-10-31-and-11-01-every-testing-row-on-a-published-style-kernel)) | works (accelerometer, light, proximity, compass and gyroscope through the AoC and the sensor proxy, at boot with the AoC; [record](../device/tegu/NOTES.md#2026-10-31-and-11-01-every-testing-row-on-a-published-style-kernel)) | WIP (registered on LTE, mobile data over `rmnet0`, texts both ways and speakerphone calls in and out with `omamobile-modem-sit` ([#356](https://github.com/derekross/omarchy-mobile/pull/356), [#367](https://github.com/derekross/omarchy-mobile/pull/367)), on the owner's kernel and on in-tree drivers from the open kernel PRs ([kernel #187](https://github.com/derekross/linux-omarchy-mobile/pull/187), [kernel #162](https://github.com/derekross/linux-omarchy-mobile/pull/162)); the package doesn't start the modem, the kernel PRs aren't merged, and calls have no echo cancellation or earpiece yet; [plan](../device/tegu/MODEM-PLAN.md), [record](../device/tegu/MODEM-PLAN.md#sim-test-results-2026-11-02-730-rc6-omamobile-tegu-s2mpg15-m1-g991042e2eff3-dirty)) | works (NXP ST54L through nxp-nci, its clock pad from the PMU ([kernel #104](https://github.com/derekross/linux-omarchy-mobile/pull/104) and [kernel #105](https://github.com/derekross/linux-omarchy-mobile/pull/105), merged, with [kernel #131](https://github.com/derekross/linux-omarchy-mobile/pull/131), merged), loaded at boot by `omamobile-device-tegu` 0.2.3 with neard and the link opener: polls with no I2C errors and read a payment card; polling stops before sleep; [record](../device/tegu/NOTES.md#2026-10-31-and-11-01-every-testing-row-on-a-published-style-kernel)) | works (main, ultrawide and front from the device tree, [kernel #164](https://github.com/derekross/linux-omarchy-mobile/pull/164) in review, with [kernel #63](https://github.com/derekross/linux-omarchy-mobile/pull/63) and [kernel #103](https://github.com/derekross/linux-omarchy-mobile/pull/103) in review: their drivers load at boot with nothing by hand, libcamera lists all three, and each streams, main at 19 fps and the others at 30 fps at 1280x960; basic picture quality through libcamera's software ISP; [record](../device/tegu/NOTES.md#2026-10-31-and-11-01-every-testing-row-on-a-published-style-kernel); the main camera's contrast autofocus through its LC898129 ([kernel #213](https://github.com/derekross/linux-omarchy-mobile/pull/213) in review, and a lens node on top of kernel #164, not yet in a pull request; libcamera 0.7.2-4.23), close subjects checked, the far end not yet ([notes](../device/tegu/NOTES.md#2026-11-07-the-main-cameras-autofocus-lc898129))) | testing (s2idle when asked for, or through the shell's auto-sleep with the `omamobile-sleep` toggle on, which ships off; the power key lights the lock screen on the first press ([#268](https://github.com/derekross/omarchy-mobile/pull/268), [#275](https://github.com/derekross/omarchy-mobile/pull/275)), and the RTC wakes it; on 2026-11-01 thirty attended 120 s sleeps ([plan](../device/tegu/SLEEP-PLAN.md) S1) and a day of real use with auto-sleep on ([record](../device/tegu/NOTES.md#2026-11-01-afternoon-and-evening-wi-fi-from-the-package-the-wake-and-the-replug-storage-idle-the-panel-id)) all woke, but six test sleeps since 10-28 did not (one in 21 on the clock-fix kernel on 11-01, and one in 127 in an overnight series of 120 s sleeps on 11-01 to 11-02), so sleep tests stay attended ([plan](../device/tegu/SLEEP-PLAN.md) S1); the drain is about 300 mA asleep, the same as awake with the screen off, because nothing below the CPUs sleeps yet; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (opt-in) (enrolls, matches, refuses other fingers and unlocks the lock screen through Trusty and `omamobile-fingerprint`, 2026-10-29; the sensor binds from the device tree, [kernel #165](https://github.com/derekross/linux-omarchy-mobile/pull/165) in review, with [kernel #126](https://github.com/derekross/linux-omarchy-mobile/pull/126), merged; opt-in as on the 7 Pro, because the service's first run writes Trusty's secure storage; [plan](../device/tegu/FINGERPRINT-PLAN.md), [record](../device/tegu/NOTES.md#2026-10-31-and-11-01-every-testing-row-on-a-published-style-kernel)) | +| Pixel 9a ([notes](../device/tegu/NOTES.md)) | tegu | zumapro (Tensor G4) | works ([#28](https://github.com/derekross/omarchy-mobile/issues/28): native boot from slot B, the Arch root on `userdata`, `omamobile-device-tegu`; slot B was marked successful by hand on 2026-10-28 with the `devinfo` write approved on 2026-10-22, now on hold ([#125](https://github.com/derekross/omarchy-mobile/pull/125)), unmarked by the 10-31 fastboot recovery and marked again on 2026-10-31 during the hold ([record](../device/tegu/NOTES.md#2026-10-31-a-fastboot-flash-of-slot-b-cleared-its-successful-mark-and-b-was-marked-again)), and the package does not mark it; unpublished kernel: the SoC and board device tree is [kernel #81](https://github.com/derekross/linux-omarchy-mobile/pull/81), merged; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (UFS behind the read-only guard; unpublished kernel; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (120 Hz through gs-decon; the panel driver [kernel #89](https://github.com/derekross/linux-omarchy-mobile/pull/89), 120 Hz [kernel #88](https://github.com/derekross/linux-omarchy-mobile/pull/88), merged, the display DT, merged with [kernel #96](https://github.com/derekross/linux-omarchy-mobile/pull/96); brightness, DPMS off and on and the 60/120 Hz switch on the boot of [kernel #125](https://github.com/derekross/linux-omarchy-mobile/pull/125), merged, which also checks the panel's ID; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on), [brightness record](../device/tegu/NOTES.md#2026-11-01-afternoon-and-evening-wi-fi-from-the-package-the-wake-and-the-replug-storage-idle-the-panel-id)) | works (Panthor, the desktop renders, runtime suspend when idle; this boot runs at a fixed 160 MHz; the GPU's levels and its thermal zone are merged with [kernel #96](https://github.com/derekross/linux-omarchy-mobile/pull/96) ([kernel #85](https://github.com/derekross/linux-omarchy-mobile/pull/85) and [kernel #87](https://github.com/derekross/linux-omarchy-mobile/pull/87) landed through it), not yet run from it; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (Synaptics S3908 over SPI, [kernel #81](https://github.com/derekross/linux-omarchy-mobile/pull/81), merged; survives sleep, [kernel #82](https://github.com/derekross/linux-omarchy-mobile/pull/82), merged; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (gpio-keys: power and volume; the power key wakes from sleep; unpublished kernel; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (CDC NCM and SSH; reconnects after a replug, `omamobile-tegu-usb-rescue`, also after a replug the gadget didn't see ([#280](https://github.com/derekross/omarchy-mobile/pull/280); [the replug record](../device/tegu/NOTES.md#2026-10-28-what-the-device-tables-claims-rest-on)); [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (BCM4383 on PCIe channel 1 through the shared gs201 host and zuma PHY, [kernel #178](https://github.com/derekross/linux-omarchy-mobile/pull/178) on [kernel #156](https://github.com/derekross/linux-omarchy-mobile/pull/156), in review, and brcmfmac, [kernel #56](https://github.com/derekross/linux-omarchy-mobile/pull/56) in review; started at boot by `omamobile-device-tegu` 0.2.4 ([#238](https://github.com/derekross/omarchy-mobile/pull/238)) with the extractor's firmware; WPA2 with iwd, kept loaded across sleep by the package's sleep hook; [record](../device/tegu/NOTES.md#2026-11-01-afternoon-and-evening-wi-fi-from-the-package-the-wake-and-the-replug-storage-idle-the-panel-id)) | works (hci_uart on the bootloader's address, BlueZ, A2DP; [kernel #94](https://github.com/derekross/linux-omarchy-mobile/pull/94); unpublished kernel; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (MAX77779 gauge with temperature, current and time estimates through UPower; [kernel #66](https://github.com/derekross/linux-omarchy-mobile/pull/66); unpublished kernel; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (the MAX77779 charger binds from the device tree, [kernel #161](https://github.com/derekross/linux-omarchy-mobile/pull/161), merged, built by [#227](https://github.com/derekross/omarchy-mobile/pull/227); the charge limit in `omamobile-device-tegu` 0.2.3 holds charging off at the limit through `charge_behaviour` and lets it run again 5 below; [record](../device/tegu/NOTES.md#2026-10-31-and-11-01-every-testing-row-on-a-published-style-kernel)) | works (CS40L26A through feedbackd, with brownout prevention, [kernel #95](https://github.com/derekross/linux-omarchy-mobile/pull/95); its DT [kernel #96](https://github.com/derekross/linux-omarchy-mobile/pull/96), merged; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (LM3644, 25 steps to 75 mA, quick-settings tile; its DT [kernel #96](https://github.com/derekross/linux-omarchy-mobile/pull/96), merged; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | testing (Omarchy's Location switch serves fixes from GPS, Galileo, BeiDou and GLONASS through the modem's Kepler, with gnssd started with the modem at boot by `omamobile-device-tegu`'s opt-in boot unit ([#372](https://github.com/derekross/omarchy-mobile/pull/372)): on 2026-11-03, after a reboot with nothing started by hand, a session through the switch's socket had 133 of 135 GGA sentences fixed, first fix 48 s after the client connected, 18 satellites; a 30-minute session on 2026-11-01 (omamobile-gnss 0.2.5's start, by hand, the modem link left to cycle) had 1763 of 1765, first fix 37 s, and a session in a moving car from [#114](https://github.com/derekross/omarchy-mobile/pull/114)'s package build fixed 145 of 153 times; needs [kernel #150](https://github.com/derekross/linux-omarchy-mobile/pull/150) and the PERIC0 clock fix [kernel #172](https://github.com/derekross/linux-omarchy-mobile/pull/172), both merged (without the latter the modem link hung the palmtop within minutes), and #114, merged; the GNSS link driver is merged, [kernel #185](https://github.com/derekross/linux-omarchy-mobile/pull/185), loaded by hand with the modem off, and a session through it waits on the modem link; [plan](../device/tegu/MODEM-PLAN.md), record with [#202](https://github.com/derekross/omarchy-mobile/pull/202)) | works (audio and sensor DSP through the GSA and Trusty, 93 services, started at boot by `omamobile-device-tegu` 0.2.3 from the device tree, [kernel #162](https://github.com/derekross/linux-omarchy-mobile/pull/162) in review; [record](../device/tegu/NOTES.md#2026-10-31-and-11-01-every-testing-row-on-a-published-style-kernel)) | works (the TAS2572 amplifiers and the microphone through the AoC card and PipeWire, at boot with the AoC: a tone from the speaker, the microphone at -32 dBFS; speakers at a -10 dB ceiling; [record](../device/tegu/NOTES.md#2026-10-31-and-11-01-every-testing-row-on-a-published-style-kernel)) | works (accelerometer, light, proximity, compass and gyroscope through the AoC and the sensor proxy, at boot with the AoC; [record](../device/tegu/NOTES.md#2026-10-31-and-11-01-every-testing-row-on-a-published-style-kernel)) | testing (calls in and out on the speakerphone, texts both ways, mobile data over the device `omamobile-sit-data` finds, with the Phone and Messages apps on the bridge ([#356](https://github.com/derekross/omarchy-mobile/pull/356), [#364](https://github.com/derekross/omarchy-mobile/pull/364), [#367](https://github.com/derekross/omarchy-mobile/pull/367), [#371](https://github.com/derekross/omarchy-mobile/pull/371)); `omamobile-device-tegu`'s opt-in boot unit starts the modem, the phone service and the bridge ([#372](https://github.com/derekross/omarchy-mobile/pull/372)); on the owner's kernel with the bring-up modules, and on in-tree drivers from [kernel #187](https://github.com/derekross/linux-omarchy-mobile/pull/187) and [kernel #162](https://github.com/derekross/linux-omarchy-mobile/pull/162), in review; the far end still hears an echo on the speakerphone ([#378](https://github.com/derekross/omarchy-mobile/pull/378)) and there's no earpiece route yet; [plan](../device/tegu/MODEM-PLAN.md), [record](../device/tegu/MODEM-PLAN.md#sim-test-results-2026-11-02-730-rc6-omamobile-tegu-s2mpg15-m1-g991042e2eff3-dirty)) | works (NXP ST54L through nxp-nci, its clock pad from the PMU ([kernel #104](https://github.com/derekross/linux-omarchy-mobile/pull/104) and [kernel #105](https://github.com/derekross/linux-omarchy-mobile/pull/105), merged, with [kernel #131](https://github.com/derekross/linux-omarchy-mobile/pull/131), merged), loaded at boot by `omamobile-device-tegu` 0.2.3 with neard and the link opener: polls with no I2C errors and read a payment card; polling stops before sleep; [record](../device/tegu/NOTES.md#2026-10-31-and-11-01-every-testing-row-on-a-published-style-kernel)) | works (main, ultrawide and front from the device tree, [kernel #164](https://github.com/derekross/linux-omarchy-mobile/pull/164) in review, with [kernel #63](https://github.com/derekross/linux-omarchy-mobile/pull/63) and [kernel #103](https://github.com/derekross/linux-omarchy-mobile/pull/103) in review: their drivers load at boot with nothing by hand, libcamera lists all three, and each streams, main at 19 fps and the others at 30 fps at 1280x960; basic picture quality through libcamera's software ISP; [record](../device/tegu/NOTES.md#2026-10-31-and-11-01-every-testing-row-on-a-published-style-kernel); the main camera's contrast autofocus through its LC898129 ([kernel #213](https://github.com/derekross/linux-omarchy-mobile/pull/213) in review, and a lens node on top of kernel #164, not yet in a pull request; libcamera 0.7.2-4.23), close subjects checked, the far end not yet ([notes](../device/tegu/NOTES.md#2026-11-07-the-main-cameras-autofocus-lc898129))) | testing (s2idle when asked for, or through the shell's auto-sleep with the `omamobile-sleep` toggle on, which ships off; the power key lights the lock screen on the first press ([#268](https://github.com/derekross/omarchy-mobile/pull/268), [#275](https://github.com/derekross/omarchy-mobile/pull/275)), and the RTC wakes it; on 2026-11-01 thirty attended 120 s sleeps ([plan](../device/tegu/SLEEP-PLAN.md) S1) and a day of real use with auto-sleep on ([record](../device/tegu/NOTES.md#2026-11-01-afternoon-and-evening-wi-fi-from-the-package-the-wake-and-the-replug-storage-idle-the-panel-id)) all woke, but six test sleeps since 10-28 did not (one in 21 on the clock-fix kernel on 11-01, and one in 127 in an overnight series of 120 s sleeps on 11-01 to 11-02), so sleep tests stay attended ([plan](../device/tegu/SLEEP-PLAN.md) S1); the drain is about 300 mA asleep, the same as awake with the screen off, because nothing below the CPUs sleeps yet; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (opt-in) (enrolls, matches, refuses other fingers and unlocks the lock screen through Trusty and `omamobile-fingerprint`, 2026-10-29; the sensor binds from the device tree, [kernel #165](https://github.com/derekross/linux-omarchy-mobile/pull/165) in review, with [kernel #126](https://github.com/derekross/linux-omarchy-mobile/pull/126), merged; opt-in as on the 7 Pro, because the service's first run writes Trusty's secure storage; [plan](../device/tegu/FINGERPRINT-PLAN.md), [record](../device/tegu/NOTES.md#2026-10-31-and-11-01-every-testing-row-on-a-published-style-kernel)) | | Pixel 8 Pro ([notes](../device/husky/NOTES.md)) | husky | zuma (Tensor G3) | WIP ([#1](https://github.com/derekross/omarchy-mobile/issues/1): slot B; from 2026-11-01 to 2026-11-07 a local unit marked slot B on Lef's phone; stopped pending [#252](https://github.com/derekross/omarchy-mobile/issues/252); Omarchy's image from the signed repository boots to the lock screen; the zuma device tree is merged ([kernel #13](https://github.com/derekross/linux-omarchy-mobile/pull/13), [#53](https://github.com/derekross/linux-omarchy-mobile/pull/53))) | testing (UFS at HS-G4 behind the read-only guard; Arch on `userdata`; [UFS-PLAN](../device/husky/UFS-PLAN.md)) | WIP (simple-framebuffer with the panel's size, [kernel #154](https://github.com/derekross/linux-omarchy-mobile/pull/154): console and Omarchy's lock screen; 120 Hz with brightness on a test kernel, [kernel #160](https://github.com/derekross/linux-omarchy-mobile/pull/160), started by the device package, [#228](https://github.com/derekross/omarchy-mobile/pull/228)) | testing (panthor on the Mali-G715 on a test kernel, [kernel #157](https://github.com/derekross/linux-omarchy-mobile/pull/157); [ROADMAP](../device/husky/ROADMAP.md)) | works (ST FTM5 over SPI, merged, [kernel #153](https://github.com/derekross/linux-omarchy-mobile/pull/153); verified on both phones, [notes](../device/husky/NOTES.md#2026-10-31-the-touchscreen)) | works (power and volume through `gpio-keys`, merged, [kernel #148](https://github.com/derekross/linux-omarchy-mobile/pull/148); verified on both phones, [notes](../device/husky/NOTES.md#2026-10-30-the-buttons)) | testing (USB and SSH) | testing (BCM4398 on a test kernel, [kernel #156](https://github.com/derekross/linux-omarchy-mobile/pull/156); firmware from the owner's image, [#214](https://github.com/derekross/omarchy-mobile/pull/214); [NOTES](../device/husky/NOTES.md)) | testing (BCM4398D0 on the APM UART, pairing and A2DP, on a test kernel, [kernel #199](https://github.com/derekross/linux-omarchy-mobile/pull/199); firmware from the owner's image; [ROADMAP](../device/husky/ROADMAP.md)) | testing (gauge with Google's ATL model through a bring-up overlay, temperature, MFD, pack EEPROM, [kernel #163](https://github.com/derekross/linux-omarchy-mobile/pull/163) and [#175](https://github.com/derekross/linux-omarchy-mobile/pull/175); the bus on by default waits for [kernel #205](https://github.com/derekross/linux-omarchy-mobile/pull/205); [notes](../device/husky/BATTERY-NOTES.md)) | testing (the charger driver and `tcpci_maxim` as a sink, by hand under a dead-man tool: sink at the Type-C 3 A level (input limit 0xc2 0x13 to 0x77); +1.5 A measured from a 30 W charger without the driver (1.485 A is the device-tree cap); no host mode, [#282](https://github.com/derekross/omarchy-mobile/pull/282); [notes](../device/husky/BATTERY-NOTES.md), [#1](https://github.com/derekross/omarchy-mobile/issues/1#issuecomment-6562547503)) | testing (CS40L26 on a test kernel, [kernel #200](https://github.com/derekross/linux-omarchy-mobile/pull/200)) | testing (LM3644, 50 mA cap, on a test kernel, [kernel #200](https://github.com/derekross/linux-omarchy-mobile/pull/200)) | no (first steps as drafts: [kernel #210](https://github.com/derekross/linux-omarchy-mobile/pull/210), [#211](https://github.com/derekross/linux-omarchy-mobile/pull/211)) | testing (loads and runs through the GSA and Trusty on a test kernel; plan and results [AOC-PLAN](../device/husky/AOC-PLAN.md)) | testing (stereo speakers and one microphone through UCM2 and PipeWire on a test kernel, [kernel #203](https://github.com/derekross/linux-omarchy-mobile/pull/203), [#204](https://github.com/derekross/linux-omarchy-mobile/pull/204), package [#453](https://github.com/derekross/omarchy-mobile/pull/453)) | no | no | testing (a test kernel reads tags; [kernel #208](https://github.com/derekross/linux-omarchy-mobile/pull/208), [#209](https://github.com/derekross/linux-omarchy-mobile/pull/209)) | no | no | no | | Pixel 8a ([notes](../device/akita/NOTES.md)) | akita | zuma (Tensor G3) | WIP ([#1](https://github.com/derekross/omarchy-mobile/issues/1): slot B into the initramfs with USB and SSH, no Arch root yet; `reboot-to bootloader` reaches fastboot; the first-light board file is merged, [kernel #192](https://github.com/derekross/linux-omarchy-mobile/pull/192); [BRINGUP-M1](../device/akita/BRINGUP-M1.md), [notes](../device/akita/NOTES.md#2026-11-03-first-light-m13-and-the-console-m14)) | WIP (UFS at HS-G4 behind the read-only guard, from the initramfs only, nothing run on `userdata`; merged, [kernel #206](https://github.com/derekross/linux-omarchy-mobile/pull/206); the device package and storage plan are in review, [#456](https://github.com/derekross/omarchy-mobile/pull/456)) | WIP (simple-framebuffer: the boot console over Omarchy's splash; merged with [kernel #192](https://github.com/derekross/linux-omarchy-mobile/pull/192); [notes](../device/akita/NOTES.md#2026-11-03-first-light-m13-and-the-console-m14)) | no | no | no | testing (USB and SSH from the initramfs; merged with [kernel #192](https://github.com/derekross/linux-omarchy-mobile/pull/192)) | no | no | no | no | no | no | no | no | no | no | no | no | no | no | no | | Pixel 7 ([notes](../device/panther/NOTES.md)) | panther | gs201 (Tensor G2) | WIP (slot B, not marked successful; Arch and Hyprland boot; `boot` and `init_boot` carry AVB footers, which a phone whose `vbmeta_b` is stock's needs to start slot B (device-panther 0.1.6, [#396](https://github.com/derekross/omarchy-mobile/pull/396), [notes](../device/panther/NOTES.md#2026-11-02-avb-footers-on-boot-and-init_boot)); `reboot-to bootloader` reaches fastboot with `reboot=warm`, merged, [kernel #198](https://github.com/derekross/linux-omarchy-mobile/pull/198); [BRINGUP-M1](../device/panther/BRINGUP-M1.md); board file merged, [kernel #108](https://github.com/derekross/linux-omarchy-mobile/pull/108)) | testing (UFS behind the read-only guard; Arch on `userdata`; merged, [kernel #108](https://github.com/derekross/linux-omarchy-mobile/pull/108)) | WIP (simple-framebuffer: console and the Hyprland desktop; brightness and display off/on over DCS through the S6E3FC3 panel driver and device-panther 0.1.4, merged, [kernel #177](https://github.com/derekross/linux-omarchy-mobile/pull/177); [DISPLAY-PLAN](../device/panther/DISPLAY-PLAN.md)) | testing (Panthor on the Mali-G710; Hyprland renders on it; merged through [kernel #134](https://github.com/derekross/linux-omarchy-mobile/pull/134), with the always-on rule in device-panther 0.1.1, [#145](https://github.com/derekross/omarchy-mobile/pull/145); [notes](../device/panther/NOTES.md#2026-10-28-the-gpu-and-the-haptics-power-off-and-usb-after-a-replug)) | WIP (FocalTech FT3658: touches drive Hyprland and unlock the PIN screen on a test kernel; the driver, [kernel #109](https://github.com/derekross/linux-omarchy-mobile/pull/109), and the touch node, [kernel #134](https://github.com/derekross/linux-omarchy-mobile/pull/134), are merged; stock's interrupt pull-up and CS delay, [kernel #166](https://github.com/derekross/linux-omarchy-mobile/pull/166), the driver's review fixes, [kernel #133](https://github.com/derekross/linux-omarchy-mobile/pull/133), and the kernel option with the touch notes, [#149](https://github.com/derekross/omarchy-mobile/pull/149), are merged) | testing (gpio-keys: power, volume; merged, [kernel #108](https://github.com/derekross/linux-omarchy-mobile/pull/108)) | testing (USB and SSH; merged, [kernel #108](https://github.com/derekross/linux-omarchy-mobile/pull/108); a replug comes back through `omamobile-usb-rescue` in device-panther 0.1.3, on the MAX77759's I2C bus, merged, [kernel #167](https://github.com/derekross/linux-omarchy-mobile/pull/167); [notes](../device/panther/NOTES.md#2026-10-29-usb-comes-back-after-a-replug-u1)) | no | testing (BCM4389 on the APM UART through hci_bcm with the phone's own patch, merged, [kernel #196](https://github.com/derekross/linux-omarchy-mobile/pull/196): a BLE mouse drives the shell, and headphones play over A2DP with their AVRCP buttons, on its author's Pixel 7; the Bluetooth address and the rest of the package side aren't merged yet; headset calls, suspend and power not tested) | WIP (MAX77759 fuel gauge with stock's battery model on a test kernel: percentage, capacity and temperature in upower and the bar; merged, [kernel #171](https://github.com/derekross/linux-omarchy-mobile/pull/171) and the driver fix [#170](https://github.com/derekross/linux-omarchy-mobile/pull/170); a second unit's Lishen pack isn't matched by that model yet, [notes](../device/panther/NOTES.md#2026-11-03-a-second-unit-angelrenefm); [BATTERY-PLAN](../device/panther/BATTERY-PLAN.md)) | no | testing (CS40L26 with the phone's own firmware, `tools/extract-vendor-firmware -d panther`; merged through [kernel #134](https://github.com/derekross/linux-omarchy-mobile/pull/134), with the feedbackd rule in device-panther 0.1.1, [#145](https://github.com/derekross/omarchy-mobile/pull/145); [notes](../device/panther/NOTES.md#2026-10-28-the-gpu-and-the-haptics-power-off-and-usb-after-a-replug)) | testing (LM3644 rear flash, 36 steps, from the node merged in [kernel #197](https://github.com/derekross/linux-omarchy-mobile/pull/197) and the bring-up overlay `torch.dtso`, [#426](https://github.com/derekross/omarchy-mobile/pull/426): lit on a second Pixel 7; the quick-settings tile not checked) | no | no | no | no | no | no | no (the package's camera start and DMA heap rule are merged, device-panther 0.1.9, [#443](https://github.com/derekross/omarchy-mobile/pull/443), inert until the camera device tree is proposed) | no (s2idle by default since [kernel #134](https://github.com/derekross/linux-omarchy-mobile/pull/134) and device-panther 0.1.1; not run yet) | WIP (the sensor's node, disabled, is merged, [kernel #207](https://github.com/derekross/linux-omarchy-mobile/pull/207); with a bring-up overlay and the package side, which is in review ([#458](https://github.com/derekross/omarchy-mobile/pull/458)), a finger enrolled and unlocked its author's Pixel 7, also after a reboot) | diff --git a/packages/omamobile-device-tegu/README.md b/packages/omamobile-device-tegu/README.md index 250c784af..1f36b8d61 100644 --- a/packages/omamobile-device-tegu/README.md +++ b/packages/omamobile-device-tegu/README.md @@ -167,21 +167,29 @@ In order, it: 6. with `--phone`, starts `omamobile-sitd` and, when installed, `omamobile-mmd` for Phone and Messages. -The latch stays from step 2 until the profile's unit stops cleanly at -shutdown. A start that never reached ONLINE, or a boot that hung or reset +The latch stays from step 2 until the profile's unit stops at shutdown: +its ExecStopPost (`omamobile-tegu-modem-up --stopped`) removes this boot's +latch once the start had reached ONLINE, whatever the stop's result (the +CP's power-off can end rfsd before systemd's SIGINT, so the result is often +not "success"). A start that never reached ONLINE, or a boot that hung or reset with the modem up, leaves it, and every later start refuses until you've read `/var/log/omamobile/modem.log` and the last boot's journal and removed it. It also refuses a second start in a boot that already loaded CPIF. Never stop the modem by hand; the reboot's shutdown stops it. +With #403, a `reboot-to` (and so `bin/omamobile push`) with the CP ONLINE +notes the boot it ends, and the next boot clears that boot's latch and +starts the modem on its own, after a reboot that didn't power the CP off +through the profile. That path is still under test on the 9a. + The in-tree driver branch (the kernel's `cpif` and `pcie_gs201_cp`) hasn't run through this script yet; the in-tree drivers have run from the bring-up runners. ### Starting it at boot -`omamobile-tegu-modem-boot.service` runs `omamobile-tegu-modem-up --phone` -at boot. The package installs it disabled. Before enabling it: +`omamobile-tegu-modem-boot.service` runs `omamobile-tegu-modem-up --phone +--gnss` at boot. The package installs it disabled. Before enabling it: - **Slot B marked successful.** Otherwise every reset spends one of ABL's three tries, and at zero it boots stock on slot A, which has overwritten diff --git a/packages/omamobile-device-tegu/bin/omamobile-tegu-modem-up b/packages/omamobile-device-tegu/bin/omamobile-tegu-modem-up index cd12cab5b..3bab00adf 100644 --- a/packages/omamobile-device-tegu/bin/omamobile-tegu-modem-up +++ b/packages/omamobile-device-tegu/bin/omamobile-tegu-modem-up @@ -23,10 +23,11 @@ # ROM, so a boot that loaded CPIF refuses (reboot to start again); # - never stop the modem by hand: the attended reboot's shutdown stops it; # - a latch (/var/lib/omamobile/modem-bringup-started) is written before any -# driver loads and removed only when the modem profile's unit stops -# cleanly at shutdown: a start that never reached ONLINE, or a boot that -# hung or reset with the modem up, leaves it, and later boots refuse until -# a human removes it (TELEPHONY-PLAN section 2.4); +# driver loads and removed when the modem profile's unit stops (its +# ExecStopPost runs --stopped, at a shutdown) after the start had reached +# ONLINE, whatever the stop's result: a start that never reached ONLINE, +# or a boot that hung or reset with the modem up, leaves it, and later +# boots refuse until a human removes it (TELEPHONY-PLAN section 2.4); # - no system suspend once the CP is up: a sleep inhibitor, its own unit, is # taken before any driver loads and lasts until the reboot. set -euo pipefail @@ -176,5 +177,5 @@ if ! $CP_STATE wait-online 60 >/dev/null 2>&1; then exit 1 fi echo online >> "$LATCH"; sync "$LATCH" 2>/dev/null || sync -say "modem OK: CP ONLINE (log /var/log/omamobile/modem.log); the latch stays until a clean shutdown" +say "modem OK: CP ONLINE (log /var/log/omamobile/modem.log); the latch stays until the profile unit stops at shutdown" phone_up From 1320bcf914c098a7af739abda29c3e2e74e3d4e7 Mon Sep 17 00:00:00 2001 From: W4HO <87742609+W4HO-ham@users.noreply.github.com> Date: Wed, 4 Nov 2026 02:49:12 -0647 Subject: [PATCH 11/17] device/tegu TELEPHONY-PLAN, omamobile-device-tegu README: the NV check and the reboot-to path passed (2.7) The radio backup check after the day's reboots read every NV partition the same, and a reboot-to with the CP ONLINE cleared its latch and brought the modem back on its own at the next boot. --- device/tegu/TELEPHONY-PLAN.md | 12 +++++++++++- packages/omamobile-device-tegu/README.md | 3 ++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/device/tegu/TELEPHONY-PLAN.md b/device/tegu/TELEPHONY-PLAN.md index 878d96ddc..b0ef219af 100644 --- a/device/tegu/TELEPHONY-PLAN.md +++ b/device/tegu/TELEPHONY-PLAN.md @@ -163,7 +163,17 @@ does; on the charger; `omamobile-device-tegu` 0.2.12, `omamobile-modem-sit` fixed script: modem started and ONLINE, `systemctl reboot` at 10:43 ("modem stopped (success): โ€ฆ removed"), the next boot ONLINE on its own, and a second reboot at 10:47 removed that boot's latch too. Passed. - `tools/nv-backup --check` after these reboots is still to come. + `tools/nv-backup -d tegu --check` against the same backup after the + day's reboots (these, two kernel pushes and two sysrq reboots after + sleep tests): every NV partition and `metadata` the same, `devinfo` + different, as after any boot-success mark (tegu NOTES, 2026-11-03). + Passed. +6. The `reboot-to` path (#403's `reboot-to` installed): in the evening, + with the CP ONLINE, `reboot-to omamobile`. The next boot logged "the + last boot with the modem up ended with reboot-to: + /var/lib/omamobile/modem-bringup-started removed", started the modem on + its own to "modem OK: CP ONLINE", and left no + `/var/lib/omamobile/deliberate-restart` behind. Passed. `tools/phone-smoke` on the second boot: every required check ok (boot, the storage guard, root, kernel health, USB, session), and display, GPU, lock, diff --git a/packages/omamobile-device-tegu/README.md b/packages/omamobile-device-tegu/README.md index 1f36b8d61..47cd0e2bf 100644 --- a/packages/omamobile-device-tegu/README.md +++ b/packages/omamobile-device-tegu/README.md @@ -180,7 +180,8 @@ Never stop the modem by hand; the reboot's shutdown stops it. With #403, a `reboot-to` (and so `bin/omamobile push`) with the CP ONLINE notes the boot it ends, and the next boot clears that boot's latch and starts the modem on its own, after a reboot that didn't power the CP off -through the profile. That path is still under test on the 9a. +through the profile. On the 9a that path passed once, on 2026-11-03 +(TELEPHONY-PLAN 2.7). The in-tree driver branch (the kernel's `cpif` and `pcie_gs201_cp`) hasn't run through this script yet; the in-tree drivers have run from the From 926fec54715582d29bd8ce8fd7922edd1aa9d454 Mon Sep 17 00:00:00 2001 From: W4HO <87742609+W4HO-ham@users.noreply.github.com> Date: Fri, 6 Nov 2026 08:33:19 -0643 Subject: [PATCH 12/17] omamobile-device-tegu, device/tegu TELEPHONY-PLAN: a reboot-to clears the latch too The script's header, the comment above systemd-run, the last "modem OK" message and 2.7 step 3's Expect still said only the profile's stop at shutdown removes the latch; since the note commit, the next boot after a reboot-to clears it as well. Step 6 now records that the UFS and CP shutdown are not observable after a reboot-to, and that its reboot-to was #403's, built by hand. --- device/tegu/TELEPHONY-PLAN.md | 10 ++++++++-- .../bin/omamobile-tegu-modem-up | 15 +++++++++------ 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/device/tegu/TELEPHONY-PLAN.md b/device/tegu/TELEPHONY-PLAN.md index b0ef219af..22983bb8b 100644 --- a/device/tegu/TELEPHONY-PLAN.md +++ b/device/tegu/TELEPHONY-PLAN.md @@ -126,7 +126,7 @@ successful, a kernel with linux-omarchy-mobile#172, an off-repo NV backup. | --- | --- | --- | --- | --- | | 1. Read-only / none | `uname -r`; `pacman -Q omamobile-device-tegu omamobile-modem omamobile-modem-sit omamobile-mmd`; `tools/nv-backup --check "$NV_BACKUP"` (laptop); `ls /var/lib/omamobile/modem-bringup-started` | The kernel and packages recorded, NV matches, no latch | NV mismatch, a latch present, B not marked | None | | 2. Enable / low | `systemctl enable omamobile-tegu-modem-boot` | A wants link, nothing started | Anything starts | `systemctl disable omamobile-tegu-modem-boot` | -| 3. Cold boot / medium (the CP starts at boot, sleep blocked) | Power off, then on; after login: `journalctl -b -u omamobile-tegu-modem-boot`; `omamobile-sit status`; `systemd-inhibit --list`; `tools/phone-smoke` (laptop) | "modem OK: CP ONLINE", sitd running and registered, the inhibitor held, the latch present (it stays until the profile's unit stops at shutdown), phone-smoke clean | No ONLINE, a reset, a UFS or NV error, no inhibitor | `systemctl disable omamobile-tegu-modem-boot`, reboot; after a reset the latch keeps the next boot from starting the modem | +| 3. Cold boot / medium (the CP starts at boot, sleep blocked) | Power off, then on; after login: `journalctl -b -u omamobile-tegu-modem-boot`; `omamobile-sit status`; `systemd-inhibit --list`; `tools/phone-smoke` (laptop) | "modem OK: CP ONLINE", sitd running and registered, the inhibitor held, the latch present (it stays until the profile's unit stops at shutdown, or until the next boot after a `reboot-to`, which clears it from its note), phone-smoke clean | No ONLINE, a reset, a UFS or NV error, no inhibitor | `systemctl disable omamobile-tegu-modem-boot`, reboot; after a reset the latch keeps the next boot from starting the modem | | 4. Clean shutdown / medium (one UFS handler pass expected on the 7 Pro's pattern) | `systemctl reboot`; after login: `journalctl -b -1 -k \| grep -c ufshcd_err_handler`; `ls /var/lib/omamobile/modem-bringup-started`; `tools/nv-backup --check` | The latch gone (clean stop), the CP up again at this boot, the UFS count recorded, NV matches | The latch still there after a clean reboot, I/O errors, NV mismatch | As step 3 | | 5. A day's use / low | Calls, texts and data as usual | No reset, no latch left over | A reset or hang | As step 3 | @@ -173,7 +173,13 @@ does; on the charger; `omamobile-device-tegu` 0.2.12, `omamobile-modem-sit` last boot with the modem up ended with reboot-to: /var/lib/omamobile/modem-bringup-started removed", started the modem on its own to "modem OK: CP ONLINE", and left no - `/var/lib/omamobile/deliberate-restart` behind. Passed. + `/var/lib/omamobile/deliberate-restart` behind. Passed. Whether the + CP's power-off or UFS logged anything is not observable after a + `reboot-to`: it skips systemd's shutdown, so the kernel's final + shutdown runs after the journal's last write, and the next boot's + `journalctl -b -1` ends before it. The `reboot-to` here was #403's, + built by hand on the palmtop; pacman puts the packaged one back when + #403's `omamobile-device-tegu` lands. `tools/phone-smoke` on the second boot: every required check ok (boot, the storage guard, root, kernel health, USB, session), and display, GPU, lock, diff --git a/packages/omamobile-device-tegu/bin/omamobile-tegu-modem-up b/packages/omamobile-device-tegu/bin/omamobile-tegu-modem-up index 3bab00adf..f761cc0c4 100644 --- a/packages/omamobile-device-tegu/bin/omamobile-tegu-modem-up +++ b/packages/omamobile-device-tegu/bin/omamobile-tegu-modem-up @@ -25,9 +25,11 @@ # - a latch (/var/lib/omamobile/modem-bringup-started) is written before any # driver loads and removed when the modem profile's unit stops (its # ExecStopPost runs --stopped, at a shutdown) after the start had reached -# ONLINE, whatever the stop's result: a start that never reached ONLINE, -# or a boot that hung or reset with the modem up, leaves it, and later -# boots refuse until a human removes it (TELEPHONY-PLAN section 2.4); +# ONLINE, whatever the stop's result, or at the next boot when this one +# ended with reboot-to (its deliberate-restart note): a start that never +# reached ONLINE, or a boot that hung or reset with the modem up, leaves +# it, and later boots refuse until a human removes it (TELEPHONY-PLAN +# section 2.4); # - no system suspend once the CP is up: a sleep inhibitor, its own unit, is # taken before any driver loads and lasts until the reboot. set -euo pipefail @@ -164,8 +166,9 @@ echo performance > $SYS/module/pcie_aspm/parameters/policy 2>/dev/null || true # comes after the drivers. A refusal keeps the latch: a human looks first. $CHROOT modem check -# A stop of the profile's unit (the reboot's shutdown) is the only thing -# that removes the latch (--stopped above); a hang or a reset leaves it. +# A stop of the profile's unit (the reboot's shutdown, --stopped above) +# removes the latch, and so does the next boot after a reboot-to (its note, +# above); a hang or a reset leaves it. systemd-run -q --unit=omamobile-tegu-modem -p KillSignal=SIGINT -p TimeoutStopSec=60 \ -p "ExecStop=$CHROOT modem stop" \ -p "ExecStopPost=${OMAMOBILE_MODEM_UP_SELF:-/usr/bin/omamobile-tegu-modem-up} --stopped" \ @@ -177,5 +180,5 @@ if ! $CP_STATE wait-online 60 >/dev/null 2>&1; then exit 1 fi echo online >> "$LATCH"; sync "$LATCH" 2>/dev/null || sync -say "modem OK: CP ONLINE (log /var/log/omamobile/modem.log); the latch stays until the profile unit stops at shutdown" +say "modem OK: CP ONLINE (log /var/log/omamobile/modem.log); the latch stays until the profile unit stops at shutdown, or until the next boot after a reboot-to" phone_up From 66fbbf63f1807c8e661ebd7774921cea860a2455 Mon Sep 17 00:00:00 2001 From: cbm Date: Sun, 8 Nov 2026 18:35:08 +0100 Subject: [PATCH 13/17] omamobile-device-tegu: one unclean end with the modem up doesn't cost the next boot its modem The starter kept any leftover latch and refused every later start until a human removed it. That is right for a bring-up that never reached ONLINE (a hang in the bring-up itself must not repeat on its own), but a boot that ended with the modem up and no clean stop had a working bring-up: on 2026-11-08 a held power key ended such a boot on the 9a ("Long Press Power Key Reboot (PMIC COLD)" in the bootloader's console record), and the three boots after it came up without the modem, two of them clean reboots, until the latch was removed by hand. Now a latch from another boot that reads ONLINE is moved aside as modem-bringup-started.unclean-