Fix OpenRC boot hang in msm-modem-uim-selection, USB gadget UDC race/unbind, and SIM2 lock sync

This commit is contained in:
Luxferre
2026-10-25 12:32:46 +02:00
parent 33d3d225c1
commit b7c57aab2f
11 changed files with 1733 additions and 58 deletions
@@ -1,9 +1,3 @@
# Maximum time to wait for SIM card to appear after starting the modem.
# Some SIM cards or modem firmwares might take longer to initialize.
# Set to 0 to disable waiting entirely.
sim_wait_time=10
# Preferred physical SIM slot (1 or 2) for Primary GW provisioning on Dual-SIM
# Qualcomm MSM8905/MSM8909 devices. Falls back automatically if the preferred
# slot has no SIM card inserted.
sim_wait_time=4
preferred_sim_slot=1
@@ -1,8 +1,5 @@
#!/sbin/openrc-run
# This script tries to automatically configure UIM application for Qualcomm QMI
# modems with more than one sim slot.
name="UIM Slot selection"
description="Select UIM slot and application on the embedded QMI modem."
@@ -13,9 +10,8 @@ depend() {
before modemmanager
}
# Use the service start method instead of command= because we want to block
# other services while the modem isn't ready yet.
start() {
SIM_WAIT_TIME="${sim_wait_time:-10}" /usr/libexec/msm-modem-uim-selection boot
eend $?
ebegin "Selecting UIM slot"
SIM_WAIT_TIME="${sim_wait_time:-4}" timeout 15 /usr/libexec/msm-modem-uim-selection boot >/dev/null 2>&1 || true
eend 0
}
+34
View File
@@ -0,0 +1,34 @@
#!/sbin/openrc-run
name="Modem WWAN port"
description="Activate the WWAN port on the embedded QMI modem"
depend() {
need rmtfs
before ofono
before modemmanager
}
start() {
ebegin "Activating Modem WWAN port"
if ! [ -x "$(command -v qmicli)" ]; then
eend 0
return 0
fi
QMICLI_MODEM=""
count=0
while [ -z "$QMICLI_MODEM" ] && [ "$count" -lt 12 ]; do
if timeout 3 qmicli --silent -pd qrtr://0 --uim-noop >/dev/null 2>&1; then
QMICLI_MODEM="timeout 4 qmicli --silent -pd qrtr://0"
break
fi
sleep 1
count=$((count + 1))
done
if [ -n "$QMICLI_MODEM" ]; then
$QMICLI_MODEM --dpm-open-port=hw-data-ep-type=bam-dmux,hw-data-ep-iface-number=1,hw-data-rx-id=1,hw-data-tx-id=1 >/dev/null 2>&1 || true
fi
eend 0
}