From 8cce77bc7d52048eae54572e8167eddd6713f6b3 Mon Sep 17 00:00:00 2001 From: Jorijn van der Graaf Date: Sun, 20 Sep 2026 16:58:43 +0200 Subject: [PATCH] ims-pdn-up: an empty profile list is the modem coming up, not a modem without ims On a cold boot the profile-list query can succeed while ModemManager is still enabling the modem and return no profiles at all; the lookup then read "no ims profile" and fell back to the APN-string request, the one a walled carrier refuses (Fairphone 6, index 2 present a minute later). Treat a list without any profile entry like a failed lookup and retry it after the registration wait; a list with entries but no ims APN still falls back to the APN string. --- packaging/ims-pdn-up.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packaging/ims-pdn-up.sh b/packaging/ims-pdn-up.sh index 3ba1603..9cf899f 100644 --- a/packaging/ims-pdn-up.sh +++ b/packaging/ims-pdn-up.sh @@ -72,6 +72,13 @@ fi lookup_profile() { # $1 = log suffix; sets PROFILE_ID, LOOKUP=done on a usable list [ "$LOOKUP" = done ] && return 0 if OUT=$(qmicli -d qrtr://0 --wds-get-profile-list=3gpp 2>&1); then + # a list with no profiles at all is the modem still coming up, not + # a modem without an ims profile (dev phone cold boot 2026-09-20 + # 16:47: exit 0, no entries, index 2 present a minute later) + if ! printf '%s\n' "$OUT" | grep -q -E '^[[:space:]]*\[[0-9]+\] 3gpp'; then + log "ims profile lookup returned no profiles$1" + return 0 + fi PROFILE_ID=$(printf '%s\n' "$OUT" | awk -v apn="$IMS_APN" ' /^[ \t]*\[[0-9]+\] 3gpp/ { idx = $1; gsub(/[^0-9]/, "", idx) } /APN:/ { a = $0; sub(/.*APN: '"'"'/, "", a); sub(/'"'"'.*/, "", a);