summaryrefslogtreecommitdiff
path: root/recipes-core
diff options
context:
space:
mode:
authorJohn Klug <john.klug@multitech.com>2017-08-31 18:28:00 -0500
committerJohn Klug <john.klug@multitech.com>2017-09-14 17:35:11 -0500
commita87cfd8e5f81d9062d6bad4b3264542e9e026edb (patch)
treed31a279981f138c5accc49ddcce648c088b3706d /recipes-core
parent40b970420674bc7ce9d347f258b93c59f9f0272d (diff)
downloadmeta-mlinux-a87cfd8e5f81d9062d6bad4b3264542e9e026edb.tar.gz
meta-mlinux-a87cfd8e5f81d9062d6bad4b3264542e9e026edb.tar.bz2
meta-mlinux-a87cfd8e5f81d9062d6bad4b3264542e9e026edb.zip
Add the carrierswitch stuff during boot for mtcap
Diffstat (limited to 'recipes-core')
-rw-r--r--recipes-core/multitech/cell-radio-carrierswitch/cell-radio-carrierswitch.default6
-rw-r--r--recipes-core/multitech/cell-radio-carrierswitch/cell-radio-carrierswitch.init26
-rw-r--r--recipes-core/multitech/cell-radio-carrierswitch_1.0.bb33
3 files changed, 65 insertions, 0 deletions
diff --git a/recipes-core/multitech/cell-radio-carrierswitch/cell-radio-carrierswitch.default b/recipes-core/multitech/cell-radio-carrierswitch/cell-radio-carrierswitch.default
new file mode 100644
index 0000000..42bc1b0
--- /dev/null
+++ b/recipes-core/multitech/cell-radio-carrierswitch/cell-radio-carrierswitch.default
@@ -0,0 +1,6 @@
+# set to "yes" to enable cell-radio-fwswitch on boot
+ENABLED="no"
+
+# The default timeout is 60 seconds.
+# It depends on how long your radio takes to get ready.
+# export TIMEOUT 60
diff --git a/recipes-core/multitech/cell-radio-carrierswitch/cell-radio-carrierswitch.init b/recipes-core/multitech/cell-radio-carrierswitch/cell-radio-carrierswitch.init
new file mode 100644
index 0000000..32b8d0d
--- /dev/null
+++ b/recipes-core/multitech/cell-radio-carrierswitch/cell-radio-carrierswitch.init
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+# no firmware switch by default
+ENABLED="no"
+
+[ -r /etc/default/cell-radio-fwswitch ] && source /etc/default/cell-radio-fwswitch
+[ "$ENABLED" == "yes" ] || exit 0
+
+# It may take a couple of boots to get the APN straightened out.
+# mlinux-switch-apn is only effective for LNA3. It will only
+# take action if it detects a different SIM from the one
+# that is configured. It requires a RADIO that is active.
+# The script is executed in the background to prevent holding up the
+# boot.
+
+case $1 in
+ start)
+ (/usr/sbin/mlinux-switch-apn 2>&1 | logger -p daemon.notice) &
+ ;;
+
+ *)
+ echo "Usage: $0 {start}"
+ exit 2
+ ;;
+esac
+
diff --git a/recipes-core/multitech/cell-radio-carrierswitch_1.0.bb b/recipes-core/multitech/cell-radio-carrierswitch_1.0.bb
new file mode 100644
index 0000000..6302779
--- /dev/null
+++ b/recipes-core/multitech/cell-radio-carrierswitch_1.0.bb
@@ -0,0 +1,33 @@
+DESCRIPTION = "Radio firmware switching functionality for dual image units (only LNA3 radios for now)"
+SECTION = "base"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
+PR = "r1"
+
+RDEPENDS_${PN} = "radio-query radio-cmd mlinux-scripts"
+
+inherit update-rc.d
+INITSCRIPT_NAME = "cell-radio-carrierswitch"
+INITSCRIPT_PARAMS = "start 63 5 ."
+
+SRC_URI = "\
+ file://cell-radio-carrierswitch.default \
+ file://cell-radio-carrierswitch.init \
+"
+
+do_install_mtcap() {
+ install -d ${D}${sysconfdir}/init.d
+ install -m 0755 ${WORKDIR}/cell-radio-carrierswitch.init ${D}${sysconfdir}/init.d/cell-radio-carrierswitch
+
+ install -d ${D}${sysconfdir}/default
+ install -m 0644 ${WORKDIR}/cell-radio-carrierswitch.default ${D}${sysconfdir}/default/cell-radio-carrierswitch
+ sed -i 's/ENABLED="no"/ENABLED="yes"/g' ${D}${sysconfdir}/default/cell-radio-carrierswitch
+}
+
+do_install_mtcdt() {
+ install -d ${D}${sysconfdir}/init.d
+ install -m 0755 ${WORKDIR}/cell-radio-carrierswitch.init ${D}${sysconfdir}/init.d/cell-radio-carrierswitch
+
+ install -d ${D}${sysconfdir}/default
+ install -m 0644 ${WORKDIR}/cell-radio-carrierswitch.default ${D}${sysconfdir}/default/cell-radio-carrierswitch
+}