Skip to content

omamobile-modem 0.1.27: give gnssd the SIT RIL GPS stub on the Pixel 9a - #863

Merged
derekross merged 1 commit into
derekross:mainfrom
den-kloot:modem-gnss-sitril-stub
Nov 18, 2026
Merged

derekross merged 1 commit into
derekross:mainfrom
den-kloot:modem-gnss-sitril-stub

Conversation

@den-kloot

Copy link
Copy Markdown
Contributor

What and why

Part 1 of #862. On the Pixel 9a, gnssd aborts 20 s after the modem reaches ONLINE: libcustomgnss dlopen()s /vendor/lib64/libsitril-gps.so, whose libsitril-client needs binder, and the modem profile has none (F libbinder.ProcessState: Binder driver '/dev/binder' could not be opened ... Terminating., SIGABRT). So @GNSSND never appears and Location has no receiver.

libcustomgnss takes only GpsOpen, GpsClose, RegisterCallback and RequestAGPS from that library (by dlsym), the same four that omamobile-gnss's libomamobile-sitril-gps.so already stubs for the 7 Pro's gpsd. The modem profile now bind-mounts that stub read-only over the library inside its own namespace when the GNSS devices go in. The extracted image is unchanged. Without the library or without the stub, it does nothing (with a note in the second case). It doesn't use bind(), which truncates a file target before mounting.

Device and build

Checks (no phone needed)

  • tools/pr-check passes (against c4623572, on the laptop)
  • tests/all: passes except tests/install-phone's "an interrupt on the other slot's screen", a signal-timing case in a file this PR doesn't touch. It failed on some runs and passed on others (including on main) on a heavily loaded laptop.
  • tests/packages for the package touched: packages/omamobile-modem/test/all passes
  • Each changed package has its version bumped, and the new version is in the commit subject
  • Commits have area prefixes and bodies that say why; the AI help is a Co-Authored-By: trailer, no Signed-off-by:

On the phone

  • I ran this on my own phone: with the stub over libsitril-gps.so, gnssd went CODELOAD -> OPERATIONAL, listened on @GNSSND, and a Location session had its first fix after about 55 s (cold, indoors), 18 satellites seen, up to 5 used, no Kepler fault, no reset.
  • The new modem_gnss_sitril itself ran inside the live modem namespace: the stub was mounted ro over the library, and the host's image file was untouched and not mounted.
  • Not tested: a full modem start from this package version (the fix ran on this boot as a stub swapped into the image by hand, plus the function above; the 9a starts the modem once per boot). The 7 Pro is unaffected (no gnssd there).
  • Nothing in this change writes outside slot B and userdata, weakens the storage guard, or reads registers from userspace
tools/phone-smoke report

phone-smoke: unknown

Kernel 7.3.0-rc6-omamobile-push1-gbd32edee1132, tools at unknown, 2026-11-17T11:25Z.

Check Result Detail
boot (required) ok kernel 7.3.0-rc6-omamobile-push1-gbd32edee1132, slot b, up 4341s
storage guard (required) ok 62 partitions; only userdata and slot b's boot images writable
root (required) ok ext4 on userdata, 71G free
kernel health (required) ok no oops or BUG; 0 WARN, 0 error lines in dmesg (0 known, 0 new)
systemd units not ok failed: omamobile-bt-addr@hci0.service
USB gadget (required) ok bound to 11210000.usb
display ok card1-DSI-1 connected, 1080x2424
GPU ok render node on panthor
session (required) ok Hyprland and the Omarchy shell running
lock ok PAM file present, the shell can lock (passwordPam true, locked false)
touch ok Synaptics TouchComm Touchscreen
buttons ok gpio-keys
Wi-Fi ok wlp1s0 on brcmfmac, link down
Bluetooth ok hci0, powered false
battery ok 58% Charging, 39 °C
sound cards ok googleteguaocsn
sensors ok Accelerometer AmbientLight Proximity
cameras skip no libcamera tools
thermal ok hottest zone 55 °C

Packages: hyprland 0.57.0-3.4, libcamera 0.7.2-4.25, mesa 1:26.2.4-1.4, omacam 0.3.3-1, omamessages 0.2.2-1, omamobile-apps 0.2.3-1, omamobile-audio 0.5.18-1, omamobile-device-tegu 0.2.18-1, omamobile-firstboot 0.1.5-1, omamobile-gnss 0.2.9-1, omamobile-keyring 20261026-1, omamobile-mirror 0.1.1-1, omamobile-mmd 0.1.4-1, omamobile-modem 0.1.21-1, omamobile-modem-sit 0.3.35-1, omamobile-omarchy 0.1.44-1, omamobile-owl-widgets 0.1.2-1, omamobile-sensors 0.2.1-1, omamobile-settings 0.1.2-1, omamobile-shell 0.2.127-1, omamobile-voice 0.1.0-1, omaphone 0.2.3-1, omarchy 4.5.0-3, omatel-agent 0.2.4-2, quickshell 0.3.2.r7.g2b4501a-1

(omamobile-bt-addr@hci0 failed on the previous boot with the old kernel too: unrelated.)

🤖 Generated with Claude Code

gnssd's libcustomgnss (gps.cfg GlueLayer_IsUseCustomGnssLib=1) dlopen()s
/vendor/lib64/libsitril-gps.so and takes GpsOpen, GpsClose,
RegisterCallback and RequestAGPS from it. The real library reaches the
RIL's GPS channel through libsitril-client over binder, and the modem
profile has no binder. With a modem chroot extracted from
CP3A.261005.005, libbinder ends gnssd at its first call, 20 s after
ONLINE:

  F libbinder.ProcessState: Binder driver '/dev/binder' could not be
    opened. Error: 2 (No such file or directory) ... Terminating.
  libc: Fatal signal 6 (SIGABRT) ... (gnssd)

so @GNSSND never appears and Location has no receiver. The profile now
bind-mounts omamobile-gnss's stub (libomamobile-sitril-gps.so, the same
four calls succeeding as no-ops, which the 7 Pro's gpsd already preloads)
read-only over that file, inside the profile's namespace only: the image
stays as extracted. Without the image's library or without the stub it
does nothing (with a note for the missing stub). bind() is not used for
it, because it truncates a file target before mounting.

On the Pixel 9a (7.3.0-rc6-omamobile-push1-gbd32edee1132, modem up with
--gnss, no SIM needed): with the stub in place gnssd goes
CODELOAD -> OPERATIONAL, listens on @GNSSND, and a Location session gave
its first fix after about 55 s (cold, indoors), 18 satellites seen, up to
5 used, no Kepler fault.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@derekross

Copy link
Copy Markdown
Owner

Thank you, this is a clean fix, and the write-up in #862 made it easy to follow. I checked the mechanism here in a scratch namespace: the stub mounts read-only over a file inside the read-only image bind, the chroot reads the stub, and the image's own file is untouched. I also deleted the read-only remount to see your test fail, and it does. The Pixel 7 Pro can't reach the new function, since only the 9a's modem image carries gnssd.

Two things before I merge it:

  1. omamobile-modem 0.1.28: the modem keeps modem_a; SLOT=a in boot-update.conf holds it to a boot from slot A (ACTIVE-SLOT-PLAN §7 step 5) #850 also takes omamobile-modem 0.1.27, and the two conflict in profiles/modem.conf. Both add a function right after modem_gnss(). omamobile-modem 0.1.28: the modem keeps modem_a; SLOT=a in boot-update.conf holds it to a boot from slot A (ACTIVE-SLOT-PLAN §7 step 5) #850 is my own draft and still needs a run on my phone, so I won't make you wait on it: whichever of the two is ready first takes 0.1.27, and the other rebases, keeps both functions and takes 0.1.28. Keep 0.1.27 for now; I'll say here if omamobile-modem 0.1.28: the modem keeps modem_a; SLOT=a in boot-update.conf holds it to a boot from slot A (ACTIVE-SLOT-PLAN §7 step 5) #850 lands first.
  2. One full modem start from the package. Your note says the fix ran with the stub copied into the image by hand, plus the new function inside the live namespace. The function runs in profile_setup under set -e, before cbd, so a mount that fails there would stop the modem start and leave the 9a's bring-up latch for the next boot. After the rebase, could you boot once with the package installed (and omamobile-gnss 0.2.10 or later), with the image's own libsitril-gps.so back in place, and post: the modem ONLINE, findmnt in the namespace showing the stub over the library, gnssd OPERATIONAL and a fix, with uname -r and the package versions?

Two smaller points:

@W4HO-ham

Copy link
Copy Markdown
Contributor

I'll run this on my palmtop (the BP3A chroot, where GpsOpen() fails today without ending gnssd): omamobile-modem from this branch and omamobile-gnss from #864, a modem start from the packages, findmnt in the namespace, gnssd's state and a Location session through the switch. The palmtop is in a sleep series tonight, so it will be tomorrow; I'll post the result here and on #864.

@W4HO-ham

Copy link
Copy Markdown
Contributor

Ran on my palmtop this morning (2026-11-18), with the BP3A chroot.

  • What ran: kernel 7.3.0-rc6-omamobile-tegu-s2mpg15-m1-g991042e2eff3-dirty (my daily one, with the bring-up link modules), omamobile-modem 0.1.27-1 from this branch (681fa4f) and omamobile-gnss 0.2.11-1 from omamobile-gnss 0.2.11: apps get positions after Location is turned on, and the runner records its own namespace PID #864 (a7e223c), both built with makepkg in the project's build image and installed with the modem off; omamobile-modem-sit 0.3.44, omamobile-device-tegu 0.2.21. The palmtop came from omamobile-modem 0.1.20.
  • A modem start from the packages (a clean reboot with the boot unit enabled, which runs omamobile-tegu-modem-up --phone --gnss): CP ONLINE, IMS voice and SMS registered, the data bearer up, no failed unit.
  • The stub, in the namespace, through the runner (omamobile-vendor-chroot modem ns findmnt): /run/omamobile-vendor/modem/root/vendor/lib64/libsitril-gps.so ro,relatime, its source /usr/lib/omamobile-vendor/stubs/libomamobile-sitril-gps.so.
  • gnssd: libcustomgnss: dlopen /vendor/lib64/libsitril-gps.so, then UNUSABLE->CODELOAD and CODELOAD->OPERATIONAL.
  • A 120 s session through the switch's socket: 59 GGA sentences, 54 with a fix, up to 14 satellites. The same session a few minutes earlier on 0.1.20 and 0.2.10, at the same spot: 81 GGA, 76 with a fix, up to 13 satellites. Both times the service started on the client and stopped on its idle lease, gnssd stayed, and the CP stayed ONLINE.

So on the BP3A chroot the stub changes nothing I can see: GpsOpen() now succeeds as a no-op where it used to fail, and fixes come as before. I've left both packages on the palmtop.

derekross added a commit that referenced this pull request Nov 18, 2026
… the same way twice

SLOT=b in boot-update.conf moved the modem to modem_b, but
omamobile-boot-update treats SLOT=b as its default, the same as no line,
so adding the documented default to a slot-B phone would have paired the
firmware with an older radio image and set the NV overlay aside. SLOT=b
now reads nothing else and gives modem_a, like no line. SLOT=a (a
format-2 install on slot A) still gives modem_a only on a boot from
slot A. Nothing selects modem_b until a slot-B install has a signal of
its own (ACTIVE-SLOT-PLAN §4, which now describes what was built).

The rule is in the profile (shell) and the NV overlay (Python), and the
two differed on a CRLF line, a CR in bootconfig and non-UTF-8 bytes, where
the Python side also raised an uncaught error. Both now read bytes and
split on \n only, a boot-update.conf that is there but can't be read is
unknown in both, and test/all feeds one table of 31 inputs to both
readers.

The version moves to 0.1.28: #863 keeps 0.1.27.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@derekross
derekross merged commit da6ccb8 into derekross:main Nov 18, 2026
2 checks passed
@derekross

Copy link
Copy Markdown
Owner

Merged as omamobile-modem 0.1.27, thank you @den-kloot, and thank you @W4HO-ham for the start from the package on the BP3A chroot: that was the run I was waiting for.

Two things I'd still like, as a follow-up PR whenever it suits:

  • A failed stub mount shouldn't cost the modem start: if the bind fails, a note and carry on (gnssd then aborts as before); if the read-only remount fails, unmount and carry on.
  • A few lines in device/tegu/MODEM-PLAN.md's GNSS section (the CP3A abort, the stub, the date and kernel), and when you next boot your own CP3A chroot from the package, the findmnt line and gnssd reaching OPERATIONAL, so the record has that image too.

derekross added a commit that referenced this pull request Nov 18, 2026
…h new profile functions kept, version 0.1.28

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants