diff options
author | Jeff Hatch <jhatch@multitech.com> | 2022-01-14 08:42:29 -0600 |
---|---|---|
committer | Jeff Hatch <jhatch@multitech.com> | 2022-01-14 08:42:29 -0600 |
commit | c0dc46667e659b02bab06e30beeaeefdad05a061 (patch) | |
tree | b65914afd05eb7fb1228dedf13e62c7b4c4d307d /recipes-connectivity/ppp/files/wait_for_reset | |
parent | be0069adf8794e129cd5b01d4b1052677136d82c (diff) | |
parent | a5c5dcc3eeaa771ce4b3e58a52c45f98095d3aac (diff) | |
download | meta-mlinux-c0dc46667e659b02bab06e30beeaeefdad05a061.tar.gz meta-mlinux-c0dc46667e659b02bab06e30beeaeefdad05a061.tar.bz2 meta-mlinux-c0dc46667e659b02bab06e30beeaeefdad05a061.zip |
Merge branch 'vs/mtx-4338' into 6
Diffstat (limited to 'recipes-connectivity/ppp/files/wait_for_reset')
-rwxr-xr-x | recipes-connectivity/ppp/files/wait_for_reset | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/recipes-connectivity/ppp/files/wait_for_reset b/recipes-connectivity/ppp/files/wait_for_reset deleted file mode 100755 index e77df77..0000000 --- a/recipes-connectivity/ppp/files/wait_for_reset +++ /dev/null @@ -1,45 +0,0 @@ -#!/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 "exit 0" $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 - echo "$$" "0" >/sys/devices/platform/mts-io/radio-reset-monitor - trap "" $USR2 -} |