summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Klug <john.klug@multitech.com>2021-08-19 13:49:48 -0500
committerJohn Klug <john.klug@multitech.com>2021-12-29 06:55:36 -0600
commit94f7934265495f14017cf7b6c1064e215f7552a5 (patch)
treec53637bc27d7877bddfc0d1cd23e1bab60725bd5
parenta24b127c684aef6ffb2f862098582cf770b567a5 (diff)
downloadmeta-mlinux-94f7934265495f14017cf7b6c1064e215f7552a5.tar.gz
meta-mlinux-94f7934265495f14017cf7b6c1064e215f7552a5.tar.bz2
meta-mlinux-94f7934265495f14017cf7b6c1064e215f7552a5.zip
Have eudev notify mts-io when cellular modem is ready to use after reset
-rw-r--r--recipes-core/udev/eudev/cellular_radios.rules1
-rw-r--r--recipes-core/udev/eudev/cellular_radios.sh7
-rw-r--r--recipes-core/udev/eudev_%.bbappend10
3 files changed, 15 insertions, 3 deletions
diff --git a/recipes-core/udev/eudev/cellular_radios.rules b/recipes-core/udev/eudev/cellular_radios.rules
index d7c0521..a74ddf1 100644
--- a/recipes-core/udev/eudev/cellular_radios.rules
+++ b/recipes-core/udev/eudev/cellular_radios.rules
@@ -1,4 +1,5 @@
ACTION=="remove", GOTO="mlinux_end"
+ACTION=="add", RUN+="/etc/udev/scripts/cellular_radios.sh"
SUBSYSTEM!="tty", GOTO="mlinux_end"
KERNEL!="ttyUSB[0-9]*|ttyACM[0-9]*", GOTO="mlinux_end"
diff --git a/recipes-core/udev/eudev/cellular_radios.sh b/recipes-core/udev/eudev/cellular_radios.sh
new file mode 100644
index 0000000..695831f
--- /dev/null
+++ b/recipes-core/udev/eudev/cellular_radios.sh
@@ -0,0 +1,7 @@
+#!/bin/bash
+# Let mts-io know when the radio is ready
+READYFILE=/sys/devices/platform/mts-io/radio-udev-discovery
+if [[ -f $READYFILE ]] ; then
+ echo 1 >$READYFILE
+fi
+
diff --git a/recipes-core/udev/eudev_%.bbappend b/recipes-core/udev/eudev_%.bbappend
index 26bcceb..364288e 100644
--- a/recipes-core/udev/eudev_%.bbappend
+++ b/recipes-core/udev/eudev_%.bbappend
@@ -1,14 +1,18 @@
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+RDEPENDS_${PN} += "bash"
-PR .= ".mlinux6"
+PR .= ".mlinux7"
# add custom rules for persistent modem device names
SRC_URI += "file://cellular_radios.rules \
+ file://cellular_radios.sh \
file://${MACHINE}.rules"
do_install_append() {
- install -m 644 ${WORKDIR}/cellular_radios.rules ${D}${sysconfdir}/udev/rules.d/
- install -m 644 ${WORKDIR}/${MACHINE}.rules ${D}${sysconfdir}/udev/rules.d/
+ install -m 644 ${WORKDIR}/cellular_radios.rules ${D}${sysconfdir}/udev/rules.d/
+ install -m 644 ${WORKDIR}/${MACHINE}.rules ${D}${sysconfdir}/udev/rules.d/
+ install -d ${D}${sysconfdir}/udev/scripts
+ install -m 755 ${WORKDIR}/cellular_radios.sh ${D}${sysconfdir}/udev/scripts/
}