summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Klug <john.klug@multitech.com>2021-09-03 09:54:16 -0500
committerJohn Klug <john.klug@multitech.com>2021-12-29 06:58:41 -0600
commit0b242ac2d3ff273e40738b76157e0db11ffa9de3 (patch)
tree405bd7496fdefb53467d3d673befbb4056c680ff
parentebdb0f57ea127c9e5725ef364c353f9c456eb3c5 (diff)
downloadmeta-mlinux-0b242ac2d3ff273e40738b76157e0db11ffa9de3.tar.gz
meta-mlinux-0b242ac2d3ff273e40738b76157e0db11ffa9de3.tar.bz2
meta-mlinux-0b242ac2d3ff273e40738b76157e0db11ffa9de3.zip
Missing files from ppp change
-rw-r--r--recipes-connectivity/ppp/files/default.patch13
-rwxr-xr-xrecipes-connectivity/ppp/files/wait_for_reset45
2 files changed, 58 insertions, 0 deletions
diff --git a/recipes-connectivity/ppp/files/default.patch b/recipes-connectivity/ppp/files/default.patch
new file mode 100644
index 0000000..b2b4b51
--- /dev/null
+++ b/recipes-connectivity/ppp/files/default.patch
@@ -0,0 +1,13 @@
+ New RADIORESETWAIT config
+===========================================================
+diff -Ndru orig/default new/default
+--- orig/default 2021-09-01 10:07:10.392837363 -0500
++++ new/default 2021-09-01 10:07:25.912837676 -0500
+@@ -6,3 +6,7 @@
+ # maximum wait time for the SIM to register
+ # for cellular PPP.
+ PPPTIMEOUT=60
++#
++#
++# Wait for radio-reset to finish.
++RADIORESETWAIT="no"
diff --git a/recipes-connectivity/ppp/files/wait_for_reset b/recipes-connectivity/ppp/files/wait_for_reset
new file mode 100755
index 0000000..7e9da95
--- /dev/null
+++ b/recipes-connectivity/ppp/files/wait_for_reset
@@ -0,0 +1,45 @@
+#!/bin/bash
+
+# For ppp to work, stty must work on file descriptor 0.
+# If stty fails, so will ppp.
+
+NAME=wait_for_reset
+
+: ${LOG:="/usr/bin/logger -t ${NAME} -p daemon.notice"}
+
+USR2=12
+TERM=15
+# Child used to set our PID in the radio-reset-monitor
+function sleep_reset
+{
+ # Wait for parent to enter wait.
+ trap "kill $!;kill $BASHPID" $TERM
+ while [[ $(ps -h -o wchan -p $PPID) != do_wait ]] ; do usleep 100 ; done
+ ${LOG} Register for SIGUSR2 when radio-reset complete
+ echo "$$" "$USR2" >/sys/devices/platform/mts-io/radio-reset-monitor
+ discovered=$(cat /sys/devices/platform/mts-io/radio-udev-discovery)
+ if ((discovered == 1)) ; then
+ # reset is not in progress.
+ exit 0
+ fi
+ sleep 4294967295 # Hopefully forever
+ exit 0
+}
+
+# Wait for radio-reset to complete
+function wait_for_reset
+{
+ # Wait for radio reset/modem discovery
+ trap ":" $USR2
+ in_reset=$(cat /sys/devices/platform/mts-io/radio-udev-discovery)
+ if ((in_reset == 0)) ; then
+ sleep_reset &
+ wait $!
+ # pgrep is needed to find the sleep process
+ echo "pgrep -P: $(pgrep -P $!)"
+ pgrep -P $! | xargs kill
+ ${LOG} "radio-reset is complete"
+
+ fi
+ trap "" $USR2
+}