modem: fix missing call log entries and rejected calls still ringing

On a freshly flashed image the root-run dual-SIM daemon created
~/.local/share/sxmo/modem as root. sxmo_modemcall.sh runs under set -e,
so its failed modemlog.tsv write aborted hangup() before the call was
ended on the network (the caller kept ringing), and no call was ever
logged for xcalllog.

- dsds-daemon: create the log and call state directories owned by user,
  append to modemlog.tsv through a helper that keeps it user-owned, and
  repair root-owned leftovers on start; never create /run/user/10000.
- sxmo_modemcall.sh: make log_event non-fatal and hang up on the network
  before logging and running the hangup/discard hooks.
- sxmo_modemmonitor.sh: only fall back to an unprivileged dsds-daemon
  when doas is unavailable, not whenever the root instance exits.
- apply-bananarchy-overlay.sh: pre-create the modem and block log
  directories in the image.
This commit is contained in:
Luxferre committed 2026-10-28 20:07:42 +02:00
1 parent 99e2280590
commit a4dbf71af9
5 files changed
+119 -33

No files matched your search

+8 -1
View File
@@ -67,8 +67,15 @@ mainloop() {
while : ; do
uim_st="$(doas -n /usr/libexec/msm-modem-uim-selection status 2>/dev/null || /usr/libexec/msm-modem-uim-selection status 2>/dev/null || true)"
if printf "%s\n" "$uim_st" | grep -q "^DUAL_SIM_ACTIVE=1$"; then
doas -n /usr/libexec/msm-modem-uim-selection dsds-daemon 2>/dev/null || \
# Run the daemon as root whenever doas permits it. Only fall back to
# an unprivileged instance when doas is unavailable, not when the root
# daemon merely exited or was restarted (an unprivileged instance
# cannot keep the user's call log and call state files writable).
if doas -n /usr/libexec/msm-modem-uim-selection status >/dev/null 2>&1; then
doas -n /usr/libexec/msm-modem-uim-selection dsds-daemon 2>/dev/null || true
else
/usr/libexec/msm-modem-uim-selection dsds-daemon 2>/dev/null || true
fi
fi
sleep 5
done