From c1499747271dfbd08dde315ce90047772f564a23 Mon Sep 17 00:00:00 2001 From: W4HO <87742609+W4HO-ham@users.noreply.github.com> Date: Wed, 28 Oct 2026 02:09:23 -0647 Subject: [PATCH 1/6] omamobile-gnss 0.2.4: build without the Pixel 9a's HAL client 0.2.3 made bionic/prebuilt/omamobile-gnss-client mandatory in install and in the package test, but the bionic prebuilts are built by hand and never committed, so a build machine whose prebuilts predate 0.2.3 can no longer package omamobile-gnss. The client is now optional in both: the package builds without it (and says so), and the gnss-slsi profile's check already names it when it's missing. --- packages/omamobile-gnss/install | 8 +++++++- packages/omamobile-gnss/test/all | 4 +++- packages/omamobile-gnss/version | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/packages/omamobile-gnss/install b/packages/omamobile-gnss/install index 0b1c51db4..43c63cf65 100755 --- a/packages/omamobile-gnss/install +++ b/packages/omamobile-gnss/install @@ -17,7 +17,13 @@ install -Dm644 profiles/gnss.conf "$v/profiles/gnss.conf" install -Dm644 profiles/gnss-slsi.conf "$v/profiles/gnss-slsi.conf" install -Dm644 gnss/props.conf "$v/gnss/props.conf" install -Dm644 bionic/prebuilt/omamobile-fp-shim.so "$v/omamobile-fp-shim.so" -install -Dm755 bionic/prebuilt/omamobile-gnss-client "$v/omamobile-gnss-client" +# The 9a's HAL client is optional: a build without it (bionic/ not rebuilt +# since 0.2.3) still packages, and the gnss-slsi profile's check names it. +if [[ -f bionic/prebuilt/omamobile-gnss-client ]]; then + install -Dm755 bionic/prebuilt/omamobile-gnss-client "$v/omamobile-gnss-client" +else + echo "omamobile-gnss: no bionic/prebuilt/omamobile-gnss-client, packaged without it (Pixel 9a only)" >&2 +fi for f in bionic/prebuilt/stubs/*.so; do install -Dm644 "$f" "$v/stubs/${f##*/}"; done for f in vendor/systemd/system/*; do install -Dm644 "$f" "$d/usr/lib/systemd/system/${f##*/}"; done install -Dm644 vendor/systemd/user/omamobile-geoclue-agent.service "$d/usr/lib/systemd/user/omamobile-geoclue-agent.service" diff --git a/packages/omamobile-gnss/test/all b/packages/omamobile-gnss/test/all index 94b8827e9..481773be0 100755 --- a/packages/omamobile-gnss/test/all +++ b/packages/omamobile-gnss/test/all @@ -19,7 +19,9 @@ if [[ ! -f bionic/prebuilt/omamobile-fp-shim.so ]]; then echo "ok - the rest # SKIP no bionic prebuilts in this checkout (built on the computer)" exit 0 fi -for f in bionic/prebuilt/omamobile-fp-shim.so bionic/prebuilt/omamobile-gnss-client \ +# the 9a's HAL client is optional (built since 0.2.3): checked when present +c=bionic/prebuilt/omamobile-gnss-client; [[ -f $c ]] || c= +for f in bionic/prebuilt/omamobile-fp-shim.so $c \ bionic/prebuilt/stubs/libomamobile-sitril-gps.so \ bionic/prebuilt/stubs/libcom.android.tethering.connectivity_native.so; do [[ -f $f ]] || fail "$f missing: build it on the computer first (make -C bionic, see bionic/Makefile)" diff --git a/packages/omamobile-gnss/version b/packages/omamobile-gnss/version index 717903969..abd410582 100644 --- a/packages/omamobile-gnss/version +++ b/packages/omamobile-gnss/version @@ -1 +1 @@ -0.2.3 +0.2.4 From 64549525ce990967bbb65d6ff094def3ea564322 Mon Sep 17 00:00:00 2001 From: W4HO <87742609+W4HO-ham@users.noreply.github.com> Date: Wed, 28 Oct 2026 03:45:58 -0647 Subject: [PATCH 2/6] omamobile-gnss 0.2.5: Location on the Pixel 9a The Location switch ran only the Pixel 7 Pro's path: omamobile-gnss-start loads the Broadcom driver and starts the gnss profile, the NMEA bridge reads that profile's FIFO, and the service needs its image. On the 9a, GNSS is the modem's Kepler core behind the gnss-slsi profile, so nothing reached GeoClue. The start script now runs gnss-slsi on the 9a (once gnssd listens) with its NMEA to the FIFO, stop picks the profile before the hang marker is looked at, the bridge reads whichever profile's FIFO exists, the units accept either image, and the CLI reports the 9a's image and leaves the Broadcom orbit-prediction timer off there. --- packages/omamobile-gnss/bin/omamobile-gnss | 7 +++++-- .../omamobile-gnss/lib/omamobile-gnss-nmea | 7 +++++-- .../omamobile-gnss/lib/omamobile-gnss-start | 18 ++++++++++++++++++ packages/omamobile-gnss/test/all | 9 +++++++++ .../systemd/system/omamobile-gnss-nmea.service | 4 ++-- .../systemd/system/omamobile-gnss.service | 7 ++++--- packages/omamobile-gnss/version | 2 +- 7 files changed, 44 insertions(+), 10 deletions(-) diff --git a/packages/omamobile-gnss/bin/omamobile-gnss b/packages/omamobile-gnss/bin/omamobile-gnss index 38ee547e6..d94304c23 100755 --- a/packages/omamobile-gnss/bin/omamobile-gnss +++ b/packages/omamobile-gnss/bin/omamobile-gnss @@ -30,6 +30,8 @@ AGENT=omamobile-geoclue-agent.service LTO_TIMER=omamobile-gnss-lto.timer LTO_FILE=/var/lib/omamobile-vendor/gnss/data/vendor/gps/lto2.dat ROOT=/usr/lib/omamobile-vendor/gnss/root +# the Pixel 9a's image (gnss-slsi): no Broadcom orbit predictions there +[[ ! -d $ROOT && -d /usr/lib/omamobile-vendor/gnss-slsi/root ]] && ROOT=/usr/lib/omamobile-vendor/gnss-slsi/root usage() { sed -n '3,17s/^# \{0,1\}//p' "$0" >&2 @@ -95,14 +97,15 @@ status() { none|unknown) echo "orbit predictions (LTO): $lto" ;; *) echo "orbit predictions (LTO): ${lto} h old" ;; esac - [[ -d $ROOT ]] || echo "vendor files: missing ($ROOT; tools/extract-vendor-chroot -p gnss)" + [[ -d $ROOT ]] || echo "vendor files: missing ($ROOT; tools/extract-vendor-chroot -p gnss, or -p gnss-slsi -d tegu)" fi } case ${1:-} in on) as_root on - systemctl enable --now "$SOCKET" "$LTO_TIMER" + systemctl enable --now "$SOCKET" + [[ $ROOT == */gnss/root ]] && systemctl enable --now "$LTO_TIMER" systemctl --global enable "$AGENT" ;; off) diff --git a/packages/omamobile-gnss/lib/omamobile-gnss-nmea b/packages/omamobile-gnss/lib/omamobile-gnss-nmea index a638edd23..3c135d2f2 100755 --- a/packages/omamobile-gnss/lib/omamobile-gnss-nmea +++ b/packages/omamobile-gnss/lib/omamobile-gnss-nmea @@ -31,7 +31,10 @@ import sys import time import tty -FIFO = "/var/lib/omamobile-vendor/gnss/data/vendor/gps/nmea_out" +# the Pixel 7 Pro's gnss profile, then the Pixel 9a's gnss-slsi +FIFOS = ("/var/lib/omamobile-vendor/gnss/data/vendor/gps/nmea_out", + "/var/lib/omamobile-vendor/gnss-slsi/data/vendor/gps/nmea_out") +FIFO = FIFOS[0] RUN = "/run/omamobile-gnss" MAX_LINE = 1024 SD_LISTEN_FDS_START = 3 @@ -175,7 +178,7 @@ class Bridge: def main(): ap = argparse.ArgumentParser(description=__doc__.splitlines()[0]) - ap.add_argument("--fifo", default=FIFO) + ap.add_argument("--fifo", default=next((f for f in FIFOS if os.path.exists(f)), FIFO)) ap.add_argument("--run", default=RUN) ap.add_argument("--idle-exit", type=int, default=0, metavar="SECONDS", help="exit after SECONDS without a client (0: never)") diff --git a/packages/omamobile-gnss/lib/omamobile-gnss-start b/packages/omamobile-gnss/lib/omamobile-gnss-start index e7939e82a..6e60a72a4 100755 --- a/packages/omamobile-gnss/lib/omamobile-gnss-start +++ b/packages/omamobile-gnss/lib/omamobile-gnss-start @@ -12,6 +12,13 @@ set -euo pipefail MARK=/var/lib/omamobile/gnss-bringup-started say() { printf 'omamobile-gnss: %s\n' "$*" >&2; } +# the Pixel 9a (zumapro-tegu) runs the gnss-slsi profile, the Pixel 7 Pro gnss +tegu() { tr -d '\0' < /proc/device-tree/compatible 2>/dev/null | grep -c 'google,zumapro-tegu' >/dev/null; } +if [[ ${1:-} == --stop ]]; then + if tegu; then profile=gnss-slsi; else profile=gnss; fi + exec /usr/lib/omamobile-vendor/omamobile-vendor-chroot "$profile" stop +fi + if [[ ${1:-} == --retry ]]; then rm -f "$MARK" elif [[ -e $MARK ]]; then @@ -19,6 +26,17 @@ elif [[ -e $MARK ]]; then exit 0 fi +# The Pixel 9a's GNSS is the modem's Kepler core: Samsung's gnssd runs in +# the modem profile, and the gnss-slsi profile runs the HAL and our client, +# which writes NMEA to the FIFO the bridge reads. Nothing to load here. +if tegu; then + if ! grep -c '@GNSSND' /proc/net/unix >/dev/null; then + say "gnssd isn't running (the modem profile with OMAMOBILE_MODEM_GNSS=1); nothing to do" + exit 0 + fi + say "starting the 9a's GNSS HAL and client" + OMAMOBILE_GNSS_NMEA_OUT=fifo exec /usr/lib/omamobile-vendor/omamobile-vendor-chroot gnss-slsi start +fi # The DT must have the GNSS node enabled (gnss overlay); otherwise nothing to do. if ! grep -qs okay /sys/firmware/devicetree/base/soc@0/usi@109400c0/spi@10940000/status; then say "SPI5 is not enabled in this device tree; nothing to do" diff --git a/packages/omamobile-gnss/test/all b/packages/omamobile-gnss/test/all index 481773be0..b85942711 100755 --- a/packages/omamobile-gnss/test/all +++ b/packages/omamobile-gnss/test/all @@ -10,6 +10,15 @@ for f in bin/omamobile-gnss lib/omamobile-vendor-chroot lib/omamobile-gnss-start bash -n "$f" || fail "syntax: $f" done python3 -c 'import ast, sys; ast.parse(open(sys.argv[1]).read())' lib/omamobile-gnss-nmea || fail "python: omamobile-gnss-nmea" +# The Pixel 9a's path: gnss-slsi from the start script, its FIFO in the bridge and the units. +grep -c 'gnss-slsi start' lib/omamobile-gnss-start >/dev/null || fail "the 9a starts gnss-slsi" +grep -c 'OMAMOBILE_GNSS_NMEA_OUT=fifo' lib/omamobile-gnss-start >/dev/null || fail "the 9a's NMEA goes to the FIFO" +grep -c 'gnss-slsi/data/vendor/gps/nmea_out' lib/omamobile-gnss-nmea >/dev/null || fail "the bridge reads the 9a's FIFO" +grep -c '^ConditionPathExists=|/usr/lib/omamobile-vendor/gnss-slsi/root$' vendor/systemd/system/omamobile-gnss.service >/dev/null || fail "the service runs with the 9a's image" +grep -c '^ExecStop=/usr/lib/omamobile-vendor/omamobile-gnss-start --stop$' vendor/systemd/system/omamobile-gnss.service >/dev/null || fail "stop picks the profile" +grep -c 'gnss-slsi/data/vendor/gps' vendor/systemd/system/omamobile-gnss-nmea.service >/dev/null || fail "the bridge may open the 9a's FIFO" +# --stop comes before the hang marker, so a leftover marker never skips a stop +[[ $(grep -n -- '--stop' lib/omamobile-gnss-start | head -1 | cut -d: -f1) -lt $(grep -n 'elif \[\[ -e \$MARK' lib/omamobile-gnss-start | cut -d: -f1) ]] || fail "--stop before the marker" # A running stack keeps the phone awake (SUSPEND-PLAN 6.1). grep -qx 'ExecStart=/usr/bin/systemd-inhibit --what=sleep --mode=block "--who=Omarchy Mobile GNSS" "--why=A location session is running" /usr/lib/omamobile-vendor/omamobile-gnss-start' \ vendor/systemd/system/omamobile-gnss.service || fail "the stack holds a sleep inhibitor while it runs" diff --git a/packages/omamobile-gnss/vendor/systemd/system/omamobile-gnss-nmea.service b/packages/omamobile-gnss/vendor/systemd/system/omamobile-gnss-nmea.service index 0f7eabacc..2ef2514dd 100644 --- a/packages/omamobile-gnss/vendor/systemd/system/omamobile-gnss-nmea.service +++ b/packages/omamobile-gnss/vendor/systemd/system/omamobile-gnss-nmea.service @@ -11,7 +11,7 @@ Requires=omamobile-gnss-nmea.socket After=omamobile-gnss-nmea.socket [Service] -ExecStartPre=/bin/sh -c 'for i in $(seq 1 150); do [ -p /var/lib/omamobile-vendor/gnss/data/vendor/gps/nmea_out ] && exit 0; sleep 0.2; done; exit 1' +ExecStartPre=/bin/sh -c 'for i in $(seq 1 150); do for f in /var/lib/omamobile-vendor/gnss/data/vendor/gps/nmea_out /var/lib/omamobile-vendor/gnss-slsi/data/vendor/gps/nmea_out; do [ -p $f ] && exit 0; done; sleep 0.2; done; exit 1' ExecStart=/usr/lib/omamobile-vendor/omamobile-gnss-nmea --idle-exit 60 ProtectSystem=strict -ReadWritePaths=-/var/lib/omamobile-vendor/gnss/data/vendor/gps -/run/omamobile-gnss +ReadWritePaths=-/var/lib/omamobile-vendor/gnss/data/vendor/gps -/var/lib/omamobile-vendor/gnss-slsi/data/vendor/gps -/run/omamobile-gnss diff --git a/packages/omamobile-gnss/vendor/systemd/system/omamobile-gnss.service b/packages/omamobile-gnss/vendor/systemd/system/omamobile-gnss.service index f3d96fcd7..db62762d2 100644 --- a/packages/omamobile-gnss/vendor/systemd/system/omamobile-gnss.service +++ b/packages/omamobile-gnss/vendor/systemd/system/omamobile-gnss.service @@ -5,10 +5,11 @@ # bridge does (StopWhenUnneeded), which closes /dev/ttyBCM and powers the # chip off. [Unit] -Description=Omarchy Mobile GNSS (BCM4775x, stock lhd and gpsd) +Description=Omarchy Mobile GNSS (Pixel 7 Pro: BCM4775x, stock lhd and gpsd; Pixel 9a: the modem's Kepler through the stock HAL) After=network-online.target StopWhenUnneeded=yes -ConditionPathExists=/usr/lib/omamobile-vendor/gnss/root +ConditionPathExists=|/usr/lib/omamobile-vendor/gnss/root +ConditionPathExists=|/usr/lib/omamobile-vendor/gnss-slsi/root [Service] # A location session keeps the phone awake: while the stack runs it holds a @@ -17,5 +18,5 @@ ConditionPathExists=/usr/lib/omamobile-vendor/gnss/root ExecStart=/usr/bin/systemd-inhibit --what=sleep --mode=block "--who=Omarchy Mobile GNSS" "--why=A location session is running" /usr/lib/omamobile-vendor/omamobile-gnss-start # Before the stop signal: ask gpsd to end its request, so it saves its # state (gldata.sto) for the next start. Bounded at ~4 s. -ExecStop=/usr/lib/omamobile-vendor/omamobile-vendor-chroot gnss stop +ExecStop=/usr/lib/omamobile-vendor/omamobile-gnss-start --stop TimeoutStopSec=15 diff --git a/packages/omamobile-gnss/version b/packages/omamobile-gnss/version index abd410582..3a4036fb4 100644 --- a/packages/omamobile-gnss/version +++ b/packages/omamobile-gnss/version @@ -1 +1 @@ -0.2.4 +0.2.5 From ec6d08dcbd5c1c75eb816ef6326b98c941ef8ce5 Mon Sep 17 00:00:00 2001 From: W4HO <87742609+W4HO-ham@users.noreply.github.com> Date: Sat, 31 Oct 2026 09:17:58 -0643 Subject: [PATCH 3/6] omamobile-gnss 0.2.5: the 9a writes the hang marker before its session and clears it only on stop A GNSS session on the 9a can still hang the SoC with the modem up, and socket activation lets any GeoClue client start one, so without a marker a hang could repeat at every boot. The marker now goes down before gnss-slsi starts and is cleared only by --stop; the board is read through OMAMOBILE_DT as the shell's setup does, and the test runs both branches with a fake device tree and a stub chroot. --- .../omamobile-gnss/lib/omamobile-gnss-start | 17 ++++++++- packages/omamobile-gnss/test/all | 37 +++++++++++++++++++ 2 files changed, 53 insertions(+), 1 deletion(-) diff --git a/packages/omamobile-gnss/lib/omamobile-gnss-start b/packages/omamobile-gnss/lib/omamobile-gnss-start index 6e60a72a4..dc1b9b84e 100755 --- a/packages/omamobile-gnss/lib/omamobile-gnss-start +++ b/packages/omamobile-gnss/lib/omamobile-gnss-start @@ -13,8 +13,15 @@ MARK=/var/lib/omamobile/gnss-bringup-started say() { printf 'omamobile-gnss: %s\n' "$*" >&2; } # the Pixel 9a (zumapro-tegu) runs the gnss-slsi profile, the Pixel 7 Pro gnss -tegu() { tr -d '\0' < /proc/device-tree/compatible 2>/dev/null | grep -c 'google,zumapro-tegu' >/dev/null; } +# OMAMOBILE_DT lets the tests run both branches on any machine (as +# omamobile-setup-user does). +tegu() { tr -d '\0' < "${OMAMOBILE_DT:-/proc/device-tree}/compatible" 2>/dev/null | grep -c 'google,zumapro-tegu' >/dev/null; } if [[ ${1:-} == --stop ]]; then + # A clean stop is the only place the 9a's marker is cleared: its session + # runs in the foreground until then, so a reset in between leaves the + # marker and the next boot skips GNSS until --retry. + rm -f "$MARK" + sync if tegu; then profile=gnss-slsi; else profile=gnss; fi exec /usr/lib/omamobile-vendor/omamobile-vendor-chroot "$profile" stop fi @@ -34,6 +41,14 @@ if tegu; then say "gnssd isn't running (the modem profile with OMAMOBILE_MODEM_GNSS=1); nothing to do" exit 0 fi + # The hang marker goes down before the session, as on the 7 Pro, because + # a session on the 9a can still hang the SoC with the modem up + # (MODEM-PLAN G3-L1), and socket activation lets any GeoClue client start + # one: without the marker a hang could repeat at every boot. It is + # cleared by --stop, not here, since this exec never returns. + mkdir -p "$(dirname "$MARK")" + date -Is > "$MARK" + sync say "starting the 9a's GNSS HAL and client" OMAMOBILE_GNSS_NMEA_OUT=fifo exec /usr/lib/omamobile-vendor/omamobile-vendor-chroot gnss-slsi start fi diff --git a/packages/omamobile-gnss/test/all b/packages/omamobile-gnss/test/all index b85942711..c789fcfb2 100755 --- a/packages/omamobile-gnss/test/all +++ b/packages/omamobile-gnss/test/all @@ -12,6 +12,43 @@ done python3 -c 'import ast, sys; ast.parse(open(sys.argv[1]).read())' lib/omamobile-gnss-nmea || fail "python: omamobile-gnss-nmea" # The Pixel 9a's path: gnss-slsi from the start script, its FIFO in the bridge and the units. grep -c 'gnss-slsi start' lib/omamobile-gnss-start >/dev/null || fail "the 9a starts gnss-slsi" +# the 9a writes the hang marker before its session and clears it only in --stop +s=lib/omamobile-gnss-start +[[ $(grep -n 'date -Is > "\$MARK"' $s | head -1 | cut -d: -f1) -lt $(grep -n 'gnss-slsi start' $s | head -1 | cut -d: -f1) ]] || fail "the 9a's marker goes down before gnss-slsi start" +[[ $(grep -n 'rm -f "\$MARK"' $s | head -1 | cut -d: -f1) -lt $(grep -n 'profile.*stop' $s | head -1 | cut -d: -f1) ]] || fail "--stop clears the marker" +grep -c 'OMAMOBILE_DT:-/proc/device-tree' $s >/dev/null || fail "the compatible is read through an overridable path" +# both branches, with a fake device tree and a stub chroot: the 9a path writes +# the marker and runs gnss-slsi, the 7 Pro path neither (no SPI5 node here) +tmp=$(mktemp -d); mkdir -p "$tmp/dt" "$tmp/bin" "$tmp/lib/omamobile-vendor" "$tmp/var/lib/omamobile" +printf 'google,zumapro-tegu\0google,zumapro\0' > "$tmp/dt/compatible" +cat > "$tmp/stub" <<'EOF' +#!/bin/sh +echo "chroot $*" >> "${STUB_LOG}" +EOF +chmod +x "$tmp/stub" +run_start() { # $1 dt dir, $2 fake unix table + STUB_LOG="$tmp/log" OMAMOBILE_DT="$1" bash -c ' + MARKDIR='"$tmp"'/var/lib/omamobile + sed -e "s|/var/lib/omamobile/gnss-bringup-started|'"$tmp"'/var/lib/omamobile/gnss-bringup-started|" \ + -e "s|/proc/net/unix|'"$2"'|" \ + -e "s|/usr/lib/omamobile-vendor/omamobile-vendor-chroot|'"$tmp"'/stub|" lib/omamobile-gnss-start > '"$tmp"'/start + bash '"$tmp"'/start "$@"' _ "${3:-}" 2>/dev/null +} +: > "$tmp/log"; printf '@GNSSND\n' > "$tmp/unix" +run_start "$tmp/dt" "$tmp/unix" +grep -c 'chroot gnss-slsi start' "$tmp/log" >/dev/null || fail "9a branch: gnss-slsi start ran" +[[ -e "$tmp/var/lib/omamobile/gnss-bringup-started" ]] || fail "9a branch: the marker was written before the session" +run_start "$tmp/dt" "$tmp/unix" +grep -c 'never finished; skipping' <(STUB_LOG="$tmp/log" OMAMOBILE_DT="$tmp/dt" bash "$tmp/start" 2>&1) >/dev/null || fail "9a branch: a leftover marker skips the next start" +run_start "$tmp/dt" "$tmp/unix" --stop +[[ ! -e "$tmp/var/lib/omamobile/gnss-bringup-started" ]] || fail "--stop clears the marker" +grep -c 'chroot gnss-slsi stop' "$tmp/log" >/dev/null || fail "9a branch: --stop stops gnss-slsi" +: > "$tmp/log"; printf 'google,gs201-cheetah\0google,gs201\0' > "$tmp/dt/compatible" +run_start "$tmp/dt" "$tmp/unix" +grep -c 'gnss-slsi' "$tmp/log" >/dev/null && fail "7 Pro branch: must not touch gnss-slsi" +[[ ! -e "$tmp/var/lib/omamobile/gnss-bringup-started" ]] || fail "7 Pro branch: no SPI5 node here, so no marker" +rm -rf "$tmp" +echo "ok - the 9a's start writes the marker, --stop clears it, both branches behave" grep -c 'OMAMOBILE_GNSS_NMEA_OUT=fifo' lib/omamobile-gnss-start >/dev/null || fail "the 9a's NMEA goes to the FIFO" grep -c 'gnss-slsi/data/vendor/gps/nmea_out' lib/omamobile-gnss-nmea >/dev/null || fail "the bridge reads the 9a's FIFO" grep -c '^ConditionPathExists=|/usr/lib/omamobile-vendor/gnss-slsi/root$' vendor/systemd/system/omamobile-gnss.service >/dev/null || fail "the service runs with the 9a's image" From b808a00b797182a038c4e11c7cab7d2fc007fa08 Mon Sep 17 00:00:00 2001 From: W4HO <87742609+W4HO-ham@users.noreply.github.com> Date: Sat, 31 Oct 2026 09:37:36 -0643 Subject: [PATCH 4/6] omamobile-gnss: the stop assertion follows ExecStop to the start script 0.2.5 moved ExecStop to omamobile-gnss-start --stop, which picks the profile, but the older assertion still demanded the 7 Pro's chroot stop line, so check() failed on the palmtop. It now checks that ExecStop runs the start script and that --stop ends in the profile's own stop. --- packages/omamobile-gnss/test/all | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/omamobile-gnss/test/all b/packages/omamobile-gnss/test/all index c789fcfb2..27dd39347 100755 --- a/packages/omamobile-gnss/test/all +++ b/packages/omamobile-gnss/test/all @@ -101,8 +101,13 @@ grep -q '^\[geoclue-where-am-i\]' etc/geoclue/conf.d/90-omamobile-gnss.conf || f # status must not print "nono" (forced suffix only when forced) grep -q 'forced/yes' bin/omamobile-gnss && fail "status forced suffix" grep -q 'blacklist bcm4775x_gnss' vendor/modprobe.d/omamobile-gnss.conf || fail "driver must stay blacklisted from autoload" -grep -q '^ExecStop=.*omamobile-vendor-chroot gnss stop$' vendor/systemd/system/omamobile-gnss.service || - fail "the stack must stop gpsd's request before the stop signal" +# ExecStop runs before the stop signal, and the start script's --stop ends in +# the profile's own stop (gnss on the 7 Pro, gnss-slsi on the 9a), so gpsd's +# request is withdrawn before the chroot is killed. +grep -c '^ExecStop=/usr/lib/omamobile-vendor/omamobile-gnss-start --stop$' vendor/systemd/system/omamobile-gnss.service >/dev/null || + fail "the stack must stop the profile before the stop signal" +grep -c 'exec /usr/lib/omamobile-vendor/omamobile-vendor-chroot "\$profile" stop' lib/omamobile-gnss-start >/dev/null || + fail "--stop must end in the profile's stop" grep -q 'omamobile-gnss-lto.timer\|LTO_TIMER' bin/omamobile-gnss || fail "the Location switch must handle the LTO timer" grep -q 'etc/omamobile/gnss.conf' PKGBUILD || fail "gnss.conf must be a backup file" From ee248d463182233c2ec0ec0db563a3106295cbf3 Mon Sep 17 00:00:00 2001 From: W4HO <87742609+W4HO-ham@users.noreply.github.com> Date: Sun, 1 Nov 2026 14:00:01 -0647 Subject: [PATCH 5/6] omamobile-gnss: a stop clears the 9a's hang marker only after a session of this boot systemd runs ExecStop after a start that skipped on a leftover marker too, so --stop deleted the marker and the next GeoClue client started a full session again. The 9a's start now writes /run/omamobile-gnss/session with the marker, and --stop clears both only when that file exists. --- .../omamobile-gnss/lib/omamobile-gnss-start | 17 +++++++++++++---- packages/omamobile-gnss/test/all | 13 +++++++++++-- 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/packages/omamobile-gnss/lib/omamobile-gnss-start b/packages/omamobile-gnss/lib/omamobile-gnss-start index dc1b9b84e..e94a31516 100755 --- a/packages/omamobile-gnss/lib/omamobile-gnss-start +++ b/packages/omamobile-gnss/lib/omamobile-gnss-start @@ -10,6 +10,9 @@ set -euo pipefail MARK=/var/lib/omamobile/gnss-bringup-started +# The 9a's session of this boot: written with the marker, in /run so that a +# reset empties it. +SESSION=/run/omamobile-gnss/session say() { printf 'omamobile-gnss: %s\n' "$*" >&2; } # the Pixel 9a (zumapro-tegu) runs the gnss-slsi profile, the Pixel 7 Pro gnss @@ -19,9 +22,14 @@ tegu() { tr -d '\0' < "${OMAMOBILE_DT:-/proc/device-tree}/compatible" 2>/dev/nul if [[ ${1:-} == --stop ]]; then # A clean stop is the only place the 9a's marker is cleared: its session # runs in the foreground until then, so a reset in between leaves the - # marker and the next boot skips GNSS until --retry. - rm -f "$MARK" - sync + # marker and the next boot skips GNSS until --retry. Only a session of + # this boot clears it: systemd runs ExecStop after a start that skipped + # on a leftover marker too, and that stop must leave the marker alone. + # The 7 Pro's start clears its own marker once the driver is up. + if [[ -e $SESSION ]]; then + rm -f "$MARK" "$SESSION" + sync + fi if tegu; then profile=gnss-slsi; else profile=gnss; fi exec /usr/lib/omamobile-vendor/omamobile-vendor-chroot "$profile" stop fi @@ -46,8 +54,9 @@ if tegu; then # (MODEM-PLAN G3-L1), and socket activation lets any GeoClue client start # one: without the marker a hang could repeat at every boot. It is # cleared by --stop, not here, since this exec never returns. - mkdir -p "$(dirname "$MARK")" + mkdir -p "$(dirname "$MARK")" "$(dirname "$SESSION")" date -Is > "$MARK" + : > "$SESSION" sync say "starting the 9a's GNSS HAL and client" OMAMOBILE_GNSS_NMEA_OUT=fifo exec /usr/lib/omamobile-vendor/omamobile-vendor-chroot gnss-slsi start diff --git a/packages/omamobile-gnss/test/all b/packages/omamobile-gnss/test/all index 27dd39347..7435d4c70 100755 --- a/packages/omamobile-gnss/test/all +++ b/packages/omamobile-gnss/test/all @@ -15,7 +15,7 @@ grep -c 'gnss-slsi start' lib/omamobile-gnss-start >/dev/null || fail "the 9a st # the 9a writes the hang marker before its session and clears it only in --stop s=lib/omamobile-gnss-start [[ $(grep -n 'date -Is > "\$MARK"' $s | head -1 | cut -d: -f1) -lt $(grep -n 'gnss-slsi start' $s | head -1 | cut -d: -f1) ]] || fail "the 9a's marker goes down before gnss-slsi start" -[[ $(grep -n 'rm -f "\$MARK"' $s | head -1 | cut -d: -f1) -lt $(grep -n 'profile.*stop' $s | head -1 | cut -d: -f1) ]] || fail "--stop clears the marker" +[[ $(grep -n 'rm -f "\$MARK" "\$SESSION"' $s | head -1 | cut -d: -f1) -lt $(grep -n 'profile.*stop' $s | head -1 | cut -d: -f1) ]] || fail "--stop clears the marker" grep -c 'OMAMOBILE_DT:-/proc/device-tree' $s >/dev/null || fail "the compatible is read through an overridable path" # both branches, with a fake device tree and a stub chroot: the 9a path writes # the marker and runs gnss-slsi, the 7 Pro path neither (no SPI5 node here) @@ -31,6 +31,7 @@ run_start() { # $1 dt dir, $2 fake unix table MARKDIR='"$tmp"'/var/lib/omamobile sed -e "s|/var/lib/omamobile/gnss-bringup-started|'"$tmp"'/var/lib/omamobile/gnss-bringup-started|" \ -e "s|/proc/net/unix|'"$2"'|" \ + -e "s|/run/omamobile-gnss/session|'"$tmp"'/run/omamobile-gnss/session|" \ -e "s|/usr/lib/omamobile-vendor/omamobile-vendor-chroot|'"$tmp"'/stub|" lib/omamobile-gnss-start > '"$tmp"'/start bash '"$tmp"'/start "$@"' _ "${3:-}" 2>/dev/null } @@ -40,9 +41,17 @@ grep -c 'chroot gnss-slsi start' "$tmp/log" >/dev/null || fail "9a branch: gnss- [[ -e "$tmp/var/lib/omamobile/gnss-bringup-started" ]] || fail "9a branch: the marker was written before the session" run_start "$tmp/dt" "$tmp/unix" grep -c 'never finished; skipping' <(STUB_LOG="$tmp/log" OMAMOBILE_DT="$tmp/dt" bash "$tmp/start" 2>&1) >/dev/null || fail "9a branch: a leftover marker skips the next start" +# after a reset: the marker is left over and /run is empty. The start skips, +# systemd runs ExecStop anyway, and the marker must still be there afterwards +rm -rf "$tmp/run" run_start "$tmp/dt" "$tmp/unix" --stop -[[ ! -e "$tmp/var/lib/omamobile/gnss-bringup-started" ]] || fail "--stop clears the marker" +[[ -e "$tmp/var/lib/omamobile/gnss-bringup-started" ]] || fail "a stop after a skipped start cleared the leftover marker" grep -c 'chroot gnss-slsi stop' "$tmp/log" >/dev/null || fail "9a branch: --stop stops gnss-slsi" +# a session of this boot: --stop clears the marker and the session file +run_start "$tmp/dt" "$tmp/unix" --retry +[[ -e "$tmp/run/omamobile-gnss/session" ]] || fail "9a branch: the session file is written with the marker" +run_start "$tmp/dt" "$tmp/unix" --stop +[[ ! -e "$tmp/var/lib/omamobile/gnss-bringup-started" && ! -e "$tmp/run/omamobile-gnss/session" ]] || fail "--stop after a session clears the marker" : > "$tmp/log"; printf 'google,gs201-cheetah\0google,gs201\0' > "$tmp/dt/compatible" run_start "$tmp/dt" "$tmp/unix" grep -c 'gnss-slsi' "$tmp/log" >/dev/null && fail "7 Pro branch: must not touch gnss-slsi" From efe7fd5e9b8c3643ce8430ce0a218d8d49f720da Mon Sep 17 00:00:00 2001 From: W4HO <87742609+W4HO-ham@users.noreply.github.com> Date: Sun, 1 Nov 2026 15:14:10 -0647 Subject: [PATCH 6/6] omamobile-gnss test: the 7 Pro case reads a scratch SPI5 status, not the phone's On a Pixel 7 Pro with the GNSS overlay, the test read the real SPI5 status, found it okay and went on to load the real modules. The SPI5 path now points into the test's temporary directory like the others. --- packages/omamobile-gnss/test/all | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/omamobile-gnss/test/all b/packages/omamobile-gnss/test/all index 7435d4c70..fb85ac46e 100755 --- a/packages/omamobile-gnss/test/all +++ b/packages/omamobile-gnss/test/all @@ -32,6 +32,7 @@ run_start() { # $1 dt dir, $2 fake unix table sed -e "s|/var/lib/omamobile/gnss-bringup-started|'"$tmp"'/var/lib/omamobile/gnss-bringup-started|" \ -e "s|/proc/net/unix|'"$2"'|" \ -e "s|/run/omamobile-gnss/session|'"$tmp"'/run/omamobile-gnss/session|" \ + -e "s|/sys/firmware/devicetree/base/soc@0/usi@109400c0/spi@10940000/status|'"$tmp"'/no-spi5|" \ -e "s|/usr/lib/omamobile-vendor/omamobile-vendor-chroot|'"$tmp"'/stub|" lib/omamobile-gnss-start > '"$tmp"'/start bash '"$tmp"'/start "$@"' _ "${3:-}" 2>/dev/null }