diff options
author | Florian Eckert <fe@dev.tdt.de> | 2018-04-10 15:56:24 +0200 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2018-12-18 17:22:06 +0100 |
commit | 5a3810b386040a6424ba2f16c7805eb492002fb8 (patch) | |
tree | 57bb3b7c56b8b113e456e844b8b6a920467eb55b /package/network/utils/uqmi/files/lib/netifd | |
parent | 1e012fd697d87a2ace9e0c2e046a206b377dc18c (diff) | |
download | upstream-5a3810b386040a6424ba2f16c7805eb492002fb8.tar.gz upstream-5a3810b386040a6424ba2f16c7805eb492002fb8.tar.bz2 upstream-5a3810b386040a6424ba2f16c7805eb492002fb8.zip |
uqmi: do not block proto handler if SIM is uninitialized
QMI proto setup-handler will wait forever if SIM does not get initialized.
To fix this stop polling pin status and notify netifd. Netifd will generate
then a "ifup-failed" ACTION.
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
(backported from f171a86d064ac3fcfff05d286becae87c2e26b5f)
Diffstat (limited to 'package/network/utils/uqmi/files/lib/netifd')
-rwxr-xr-x | package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh b/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh index f1a939763a..759be62a42 100755 --- a/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh +++ b/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh @@ -72,7 +72,15 @@ proto_qmi_setup() { local uninitialized_timeout=0 while uqmi -s -d "$device" --get-pin-status | grep '"UIM uninitialized"' > /dev/null; do [ -e "$device" ] || return 1 - sleep 1; + if [ "$uninitialized_timeout" -lt "$timeout" ]; then + let uninitialized_timeout++ + sleep 1; + else + echo "SIM not initialized" + proto_notify_error "$interface" SIM_NOT_INITIALIZED + proto_block_restart "$interface" + return 1 + fi done [ -n "$pincode" ] && { |