From 092305e8f6a868a751b646ab63c5c057c2456467 Mon Sep 17 00:00:00 2001 From: Javier Viguera Date: Wed, 5 Jul 2017 12:39:17 +0200 Subject: [PATCH] modemmanager: remove cellularifupdown script The cellular interface is now managed by NetworkManager, so there is no need for this custom script. Signed-off-by: Javier Viguera --- .../modemmanager/cellularifupdown | 65 ------------------- .../modemmanager/modemmanager_%.bbappend | 6 -- 2 files changed, 71 deletions(-) delete mode 100644 meta-digi-dey/recipes-connectivity/modemmanager/modemmanager/cellularifupdown diff --git a/meta-digi-dey/recipes-connectivity/modemmanager/modemmanager/cellularifupdown b/meta-digi-dey/recipes-connectivity/modemmanager/modemmanager/cellularifupdown deleted file mode 100644 index 15e993c8d..000000000 --- a/meta-digi-dey/recipes-connectivity/modemmanager/modemmanager/cellularifupdown +++ /dev/null @@ -1,65 +0,0 @@ -#!/bin/sh - -RETRIES=12 -POLLING_WAIT=5 - -# Run only for cellular network interfaces -[ -z "${IF_APN}" ] && exit 0 - -background_connect() { - # The XBee Cellular needs more time to settle down before MM is able - # to detect it. As the XBee is connected to a 'ttymxc' serial port, - # we check those ports to conditionally delay the launch of MM. - if echo "${IF_PORT}" | grep -qs ttymxc; then - sleep 25 - fi - - # Ensure ModemManager is running - killall -0 ModemManager 2>/dev/null || ModemManager --log-file=/var/log/modemmanager.log & - - # Wait for modem detection - while [ "${RETRIES}" -gt "0" ]; do - mmcli -m 0 > /dev/null 2>&1 && break - sleep ${POLLING_WAIT} - RETRIES="$((RETRIES - 1))" - done - - # Abort if no modem detected - if [ "$RETRIES" -eq "0" ]; then - logger -s -p error -t modemmanager "No modem detected"; - exit - fi - - ARGS="apn=${IF_APN}" - [ -n "${IF_PIN}" ] && ARGS="${ARGS},pin=${IF_PIN}" - - [ -n "${IF_USER}" ] && ARGS="${ARGS},user=${IF_USER}" - [ -n "${IF_PASSWORD}" ] && ARGS="${ARGS},password=${IF_PASSWORD}" - [ -n "${IF_PORT}" ] && ARGS="${ARGS},number=*99#" - - # Enable the modem and connect to provider - mmcli -m 0 --simple-connect=${ARGS} > /dev/null 2>&1 - - # For serial modems, pppd creates the network interface - # Otherwise, get an IP with udhcpc - if [ -n "${IF_PORT}" ]; then - pppd ${IF_PORT} call mm_cellular > /dev/null 2>&1 - else - udhcpc -q -i ${IFACE} >/dev/null - fi - - ifconfig ${IFACE} up -} - - -if [ "$MODE" = "start" ]; then - background_connect & -elif [ "$MODE" = "stop" ]; then - # If a call number was used, destroy the network interface - [ -n "${IF_PORT}" ] && poff mm_cellular - - ifconfig ${IFACE} down - - # Disconnect and disable the modem - mmcli -m 0 -d > /dev/null 2>&1 -fi diff --git a/meta-digi-dey/recipes-connectivity/modemmanager/modemmanager_%.bbappend b/meta-digi-dey/recipes-connectivity/modemmanager/modemmanager_%.bbappend index 1a67116d7..b1d763aea 100644 --- a/meta-digi-dey/recipes-connectivity/modemmanager/modemmanager_%.bbappend +++ b/meta-digi-dey/recipes-connectivity/modemmanager/modemmanager_%.bbappend @@ -3,7 +3,6 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}:" SRC_URI += " \ - file://cellularifupdown \ file://78-mm-digi-xbee-cellular.rules \ " @@ -13,11 +12,6 @@ SRC_URI += " \ PACKAGECONFIG_remove = " polkit" do_install_append() { - # Install ifupdown script for cellular interfaces - install -d ${D}${sysconfdir}/network/if-pre-up.d/ ${D}${sysconfdir}/network/if-post-down.d/ - install -m 0755 ${WORKDIR}/cellularifupdown ${D}${sysconfdir}/network/if-pre-up.d/ - ln -sf ../if-pre-up.d/cellularifupdown ${D}${sysconfdir}/network/if-post-down.d/cellularifupdown - # Install udev rules for XBee cellular install -d ${D}${nonarch_base_libdir}/udev/rules.d install -m 0644 ${WORKDIR}/78-mm-digi-xbee-cellular.rules ${D}${nonarch_base_libdir}/udev/rules.d/