summaryrefslogtreecommitdiff
path: root/recipes-connectivity
diff options
context:
space:
mode:
authorJohn Klug <john.klug@multitech.com>2021-09-03 14:11:08 -0500
committerJohn Klug <john.klug@multitech.com>2021-09-07 10:09:19 -0500
commit63b1b9239e8988b8d189db9a8f68541d55557a2d (patch)
tree541d0f7be5b6c428c31140485ab9b28f72ee3668 /recipes-connectivity
parent894a5bb4c9885d1d8c7faeaeb582370a3099df3f (diff)
downloadmeta-mlinux-63b1b9239e8988b8d189db9a8f68541d55557a2d.tar.gz
meta-mlinux-63b1b9239e8988b8d189db9a8f68541d55557a2d.tar.bz2
meta-mlinux-63b1b9239e8988b8d189db9a8f68541d55557a2d.zip
Add wait for reset capability to ppp init script
Diffstat (limited to 'recipes-connectivity')
-rw-r--r--recipes-connectivity/ppp/files/init.patch35
-rw-r--r--recipes-connectivity/ppp/ppp_%.bbappend32
2 files changed, 61 insertions, 6 deletions
diff --git a/recipes-connectivity/ppp/files/init.patch b/recipes-connectivity/ppp/files/init.patch
index 2d68474..2170711 100644
--- a/recipes-connectivity/ppp/files/init.patch
+++ b/recipes-connectivity/ppp/files/init.patch
@@ -1,11 +1,38 @@
-diff -Naru orig/init new/init
---- orig/init 2020-08-07 10:07:53.921964585 -0500
-+++ new/init 2020-08-11 09:01:48.118064508 -0500
-@@ -16,6 +16,7 @@
+diff -Ndru orig/init new/init
+--- orig/init 2021-09-01 04:13:34.868409735 -0500
++++ new/init 2021-09-01 10:19:44.940852572 -0500
+@@ -8,6 +8,11 @@
+
+ # Source function library.
+ . /etc/init.d/functions
++if [[ $RADIORESETWAIT == yes ]] ; then
++ . /usr/libexec/ppp/wait_for_reset
++else
++ function wait_for_reset { :; }
++fi
+
+ test -x /usr/sbin/pppd -a -f /etc/ppp/ppp_on_boot || exit 0
+ if [ -x /etc/ppp/ppp_on_boot ]; then RUNFILE=1; fi
+@@ -15,7 +20,9 @@
+ case "$1" in
start)
echo -n "Starting up PPP link: pppd"
++ wait_for_reset
if [ "$RUNFILE" = "1" ]; then
+ logger "ppp_on_boot"
/etc/ppp/ppp_on_boot
else
pppd call provider
+@@ -40,10 +47,12 @@
+ if [ "$RUNFILE" = "1" ]; then
+ poff
+ sleep 5
++ wait_for_reset
+ /etc/ppp/ppp_on_boot
+ else
+ poff provider
+ sleep 5
++ wait_for_reset
+ pppd call provider
+ fi
+ echo "."
diff --git a/recipes-connectivity/ppp/ppp_%.bbappend b/recipes-connectivity/ppp/ppp_%.bbappend
index 072fcd3..510765b 100644
--- a/recipes-connectivity/ppp/ppp_%.bbappend
+++ b/recipes-connectivity/ppp/ppp_%.bbappend
@@ -1,9 +1,27 @@
+#
+# ${PN}-radioresetwait depends on ${PN}-waitforresetfunc
+# With these installed, ppp will wait for radio-reset to
+# finish before proceeding with starting the pppd daemon.
+#
+# These functions require corresponding features in
+# mts-io and udev to monitor the radio-reset
+#
SRC_URI_append = "\
file://init.patch;patchdir=.. \
+ file://default.patch;patchdir=.. \
file://poff.patch;patchdir=.. \
+ file://wait_for_reset \
file://default"
-PR = "r10"
+PR = "r11"
+
+PACKAGES =+ "${PN}-radioresetwait ${PN}-waitforresetfunc"
+FILES_${PN}-waitforresetfunc = "${libexecdir}/ppp/wait_for_reset"
+
+RDEPENDS_${PN}-radioresetwait += "${PN}-waitforresetfunc"
+RDEPENDS_${PN}-waitforresetfunc += "bash"
+
+ALLOW_EMPTY_${PN}-radioresetwait = "1"
FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
@@ -11,6 +29,16 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
CONFFILES_${PN} += "${sysconfdir}/init.d/ppp"
do_install_append() {
- install -d -m 0755 ${D}/${sysconfdir}/default/
+ 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
}
+
+pkg_postinst_${PN}-radioresetwait() {
+ sed -i 's/^RADIORESETWAIT="no"/RADIORESETWAIT="yes"/' $D${sysconfdir}/default/ppp
+}
+pkg_prerm_${PN}-radioresetwait() {
+ sed -i 's/^RADIORESETWAIT="yes"/RADIORESETWAIT="no"/' $D${sysconfdir}/default/ppp
+}
+