From 83e2356264c814eb2a8acea95a5866e5d9656757 Mon Sep 17 00:00:00 2001 From: John Klug Date: Tue, 21 Dec 2021 11:17:53 -0600 Subject: AT&T Data-Only Requirements --- recipes-connectivity/ppp/files/init.patch | 10 +++--- recipes-connectivity/ppp/files/wait_for_reset | 45 --------------------------- recipes-connectivity/ppp/ppp_%.bbappend | 13 ++------ 3 files changed, 8 insertions(+), 60 deletions(-) delete mode 100755 recipes-connectivity/ppp/files/wait_for_reset (limited to 'recipes-connectivity/ppp') diff --git a/recipes-connectivity/ppp/files/init.patch b/recipes-connectivity/ppp/files/init.patch index 00ae09a..333c428 100644 --- a/recipes-connectivity/ppp/files/init.patch +++ b/recipes-connectivity/ppp/files/init.patch @@ -7,9 +7,9 @@ diff -Naru orig/init new/init . /etc/init.d/functions +. /etc/default/ppp +if [[ $RADIORESETWAIT == yes ]] ; then -+ . /usr/libexec/ppp/wait_for_reset ++ WAITFORRESET=/usr/bin/mts-wait-for-cell-reset +else -+ function wait_for_reset { :; } ++ WAITFORRESET=":" +fi + +mkdir -p /run/ppp || true @@ -21,7 +21,7 @@ diff -Naru orig/init new/init case "$1" in start) echo -n "Starting up PPP link: pppd" -+ wait_for_reset ++ ${WAITFORRESET} if [ "$RUNFILE" = "1" ]; then + logger "ppp_on_boot" /etc/ppp/ppp_on_boot @@ -35,13 +35,13 @@ diff -Naru orig/init new/init + if [ "$RUNFILE" = "1" ]; then poff sleep 5 -+ wait_for_reset ++ ${WAITFORRESET} /etc/ppp/ppp_on_boot - else + else poff provider sleep 5 -+ wait_for_reset ++ ${WAITFORRESET} pppd call provider fi echo "." 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 -} diff --git a/recipes-connectivity/ppp/ppp_%.bbappend b/recipes-connectivity/ppp/ppp_%.bbappend index fafe176..0a7e818 100644 --- a/recipes-connectivity/ppp/ppp_%.bbappend +++ b/recipes-connectivity/ppp/ppp_%.bbappend @@ -10,16 +10,11 @@ SRC_URI_append = "\ file://init.patch;patchdir=.. \ file://default.patch;patchdir=.. \ file://poff.patch;patchdir=.. \ - file://wait_for_reset \ file://default" PR = "r12" -PACKAGES =+ "${PN}-radioresetwait ${PN}-waitforresetfunc" -FILES_${PN}-waitforresetfunc = "${libexecdir}/ppp/wait_for_reset" - -RDEPENDS_${PN}-radioresetwait += "${PN}-waitforresetfunc" -RDEPENDS_${PN}-waitforresetfunc += "bash" +PACKAGES =+ "${PN}-radioresetwait" ALLOW_EMPTY_${PN}-radioresetwait = "1" @@ -29,10 +24,8 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/files:" CONFFILES_${PN} += "${sysconfdir}/init.d/ppp" do_install_append() { - install -d -m 755 ${D}/${sysconfdir}/default/ - install -m 644 ${WORKDIR}/default ${D}/${sysconfdir}/default/ppp - install -d -m 755 ${D}/${libexecdir}/ppp - install -m 755 ${WORKDIR}/wait_for_reset ${D}/${libexecdir}/ppp/wait_for_reset + install -d -m 755 ${D}/${sysconfdir}/default/ + install -m 644 ${WORKDIR}/default ${D}/${sysconfdir}/default/ppp } pkg_postinst_${PN}-radioresetwait() { -- cgit v1.2.3