mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-03-09 15:40:03 +00:00
parent
c3887fdd67
commit
bf39aca9c6
13 changed files with 145 additions and 262 deletions
|
@ -8,27 +8,28 @@
|
|||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libmbim
|
||||
PKG_SOURCE_VERSION:=1.26.4
|
||||
PKG_VERSION:=1.26.2
|
||||
PKG_RELEASE:=$(AUTORELEASE)
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://gitlab.freedesktop.org/mobile-broadband/libmbim.git
|
||||
PKG_MIRROR_HASH:=4963f9135f8ad26165d969d0b2028b00d68243201113c94a2ebe22c4227058a4
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
|
||||
PKG_SOURCE_URL:=https://www.freedesktop.org/software/libmbim
|
||||
PKG_HASH:=10c77bf5b5eb8c92ba80e9b519923ad9b898362bc8e1928e2bc9a17eeba649af
|
||||
|
||||
PKG_MAINTAINER:=Nicholas Smith <nicholas@nbembedded.com>
|
||||
|
||||
PKG_INSTALL:=1
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/nls.mk
|
||||
include $(INCLUDE_DIR)/meson.mk
|
||||
|
||||
TARGET_CFLAGS += -ffunction-sections -fdata-sections -fno-merge-all-constants -fmerge-constants
|
||||
TARGET_LDFLAGS += -Wl,--gc-sections
|
||||
|
||||
MESON_ARGS += \
|
||||
-Dintrospection=false \
|
||||
-Dman=false \
|
||||
-Dbash_completion=false \
|
||||
-Db_lto=true
|
||||
CONFIGURE_ARGS += \
|
||||
--disable-static \
|
||||
--disable-gtk-doc \
|
||||
--disable-gtk-doc-html \
|
||||
--disable-gtk-doc-pdf \
|
||||
--disable-silent-rules \
|
||||
--enable-more-warnings=yes
|
||||
|
||||
define Package/libmbim
|
||||
SECTION:=libs
|
||||
|
@ -55,6 +56,10 @@ define Package/mbim-utils
|
|||
LICENSE_FILES:=COPYING
|
||||
endef
|
||||
|
||||
CONFIGURE_ARGS += \
|
||||
--without-udev \
|
||||
--without-udev-base-dir
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(1)/usr/include
|
||||
$(CP) \
|
||||
|
@ -73,15 +78,11 @@ define Build/InstallDev
|
|||
endef
|
||||
|
||||
define Package/libmbim/install
|
||||
$(INSTALL_DIR) \
|
||||
$(1)/usr/lib \
|
||||
$(1)/usr/libexec
|
||||
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) \
|
||||
$(PKG_INSTALL_DIR)/usr/lib/libmbim*.so.* \
|
||||
$(1)/usr/lib/
|
||||
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/libexec/mbim-proxy $(1)/usr/libexec/
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/mbim-proxy $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
define Package/mbim-utils/install
|
||||
|
|
|
@ -13,19 +13,4 @@ config LIBQMI_WITH_QRTR_GLIB
|
|||
help
|
||||
Compile libqmi with QRTR support
|
||||
|
||||
choice
|
||||
prompt "Select QMI message collection to build"
|
||||
default LIBQMI_COLLECTION_BASIC
|
||||
|
||||
config LIBQMI_COLLECTION_MINIMAL
|
||||
depends on !MODEMMANAGER_WITH_QMI
|
||||
bool "minimal"
|
||||
|
||||
config LIBQMI_COLLECTION_BASIC
|
||||
bool "basic (default)"
|
||||
|
||||
config LIBQMI_COLLECTION_FULL
|
||||
bool "full"
|
||||
endchoice
|
||||
|
||||
endmenu
|
||||
|
|
|
@ -8,21 +8,20 @@
|
|||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libqmi
|
||||
PKG_SOURCE_VERSION:=1.30.8
|
||||
PKG_VERSION:=1.30.4
|
||||
PKG_RELEASE:=$(AUTORELEASE)
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://gitlab.freedesktop.org/mobile-broadband/libqmi.git
|
||||
PKG_MIRROR_HASH:=a0fa33a89011bdb593f66fd0b674f2a7c31f87e43ffd7f3e9a515b00864c4a91
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
|
||||
PKG_SOURCE_URL:=https://www.freedesktop.org/software/libqmi
|
||||
PKG_HASH:=00d7da30a4f8d1185f37cba289cfaf1dfcd04a58f2f76d6acfdf5b85312d6ed6
|
||||
|
||||
PKG_MAINTAINER:=Nicholas Smith <nicholas@nbembedded.com>
|
||||
|
||||
PKG_INSTALL:=1
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/nls.mk
|
||||
include $(INCLUDE_DIR)/meson.mk
|
||||
|
||||
TARGET_CFLAGS += -ffunction-sections -fdata-sections -fno-merge-all-constants -fmerge-constants
|
||||
TARGET_LDFLAGS += -Wl,--gc-sections
|
||||
|
||||
define Package/libqmi/config
|
||||
source "$(SOURCE)/Config.in"
|
||||
|
@ -60,16 +59,28 @@ define Package/libqmi-utils/description
|
|||
Utils to talk to QMI enabled modems
|
||||
endef
|
||||
|
||||
MESON_ARGS += \
|
||||
-Dudev=false \
|
||||
-Dintrospection=false \
|
||||
-Dman=false \
|
||||
-Dbash_completion=false \
|
||||
-Db_lto=true \
|
||||
-Dmbim_qmux=$(if $(CONFIG_LIBQMI_WITH_MBIM_QMUX),true,false) \
|
||||
-Dqrtr=$(if $(CONFIG_LIBQMI_WITH_QRTR_GLIB),true,false) \
|
||||
-Dcollection=$(if $(CONFIG_LIBQMI_COLLECTION_MINIMAL),minimal\
|
||||
,$(if $(CONFIG_LIBQMI_COLLECTION_BASIC),basic,full))
|
||||
CONFIGURE_ARGS += \
|
||||
--disable-static \
|
||||
--disable-gtk-doc \
|
||||
--disable-gtk-doc-html \
|
||||
--disable-gtk-doc-pdf \
|
||||
--disable-silent-rules \
|
||||
--enable-firmware-update \
|
||||
--enable-more-warnings=yes \
|
||||
--without-udev \
|
||||
--without-udev-base-dir
|
||||
|
||||
ifeq ($(CONFIG_LIBQMI_WITH_MBIM_QMUX),y)
|
||||
CONFIGURE_ARGS += --enable-mbim-qmux
|
||||
else
|
||||
CONFIGURE_ARGS += --disable-mbim-qmux
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_LIBQMI_WITH_QRTR_GLIB),y)
|
||||
CONFIGURE_ARGS += --enable-qrtr
|
||||
else
|
||||
CONFIGURE_ARGS += --disable-qrtr
|
||||
endif
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(1)/usr/include
|
||||
|
@ -89,15 +100,12 @@ define Build/InstallDev
|
|||
endef
|
||||
|
||||
define Package/libqmi/install
|
||||
$(INSTALL_DIR) \
|
||||
$(1)/usr/lib \
|
||||
$(1)/usr/libexec
|
||||
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) \
|
||||
$(PKG_INSTALL_DIR)/usr/lib/libqmi*.so.* \
|
||||
$(1)/usr/lib/
|
||||
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/libexec/qmi-proxy $(1)/usr/libexec/
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/qmi-proxy $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
define Package/qmi-utils/install
|
||||
|
|
|
@ -1,71 +0,0 @@
|
|||
#
|
||||
# Copyright (C) 2016 Velocloud Inc.
|
||||
# Copyright (C) 2016 Aleksander Morgado <aleksander@aleksander.es>
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libqrtr-glib
|
||||
PKG_VERSION:=1.2.2
|
||||
PKG_RELEASE:=$(AUTORELEASE)
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://gitlab.freedesktop.org/mobile-broadband/libqrtr-glib.git
|
||||
PKG_SOURCE_VERSION:=$(PKG_VERSION)
|
||||
PKG_MIRROR_HASH:=ffb918edf96581d4ba310bd1e975297e9a7006a7e26f37934afde462585125f2
|
||||
|
||||
PKG_MAINTAINER:=Nicholas Smith <nicholas.smith@telcoantennas.com.au>
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/nls.mk
|
||||
include $(INCLUDE_DIR)/meson.mk
|
||||
|
||||
TARGET_CFLAGS += -ffunction-sections -fdata-sections -fno-merge-all-constants -fmerge-constants
|
||||
TARGET_LDFLAGS += -Wl,--gc-sections
|
||||
|
||||
define Package/libqrtr-glib
|
||||
SECTION:=libs
|
||||
CATEGORY:=Libraries
|
||||
DEPENDS:=+glib2
|
||||
TITLE:=Helper library to talk to QRTR enabled modems
|
||||
URL:=https://gitlab.freedesktop.org/mobile-broadband/libqrtr-glib
|
||||
LICENSE:=LGPL-2.1-or-later
|
||||
LICENSE_FILES:=COPYING.LIB
|
||||
endef
|
||||
|
||||
define Package/libqrtr-glib/description
|
||||
Helper library talk to QRTR enabled modems.
|
||||
endef
|
||||
|
||||
MESON_ARGS += \
|
||||
-Dintrospection=false \
|
||||
-Dgtk_doc=false \
|
||||
-Db_lto=true
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(1)/usr/include
|
||||
$(CP) \
|
||||
$(PKG_INSTALL_DIR)/usr/include/libqrtr-glib \
|
||||
$(1)/usr/include/
|
||||
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) \
|
||||
$(PKG_INSTALL_DIR)/usr/lib/libqrtr-glib*.so* \
|
||||
$(1)/usr/lib/
|
||||
|
||||
$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
|
||||
$(CP) \
|
||||
$(PKG_INSTALL_DIR)/usr/lib/pkgconfig/qrtr-glib.pc \
|
||||
$(1)/usr/lib/pkgconfig
|
||||
endef
|
||||
|
||||
define Package/libqrtr-glib/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) \
|
||||
$(PKG_INSTALL_DIR)/usr/lib/libqrtr-glib*.so.* \
|
||||
$(1)/usr/lib/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,libqrtr-glib))
|
|
@ -1,30 +1,21 @@
|
|||
menu "Configuration"
|
||||
depends on PACKAGE_modemmanager
|
||||
depends on PACKAGE_modemmanager
|
||||
|
||||
config MODEMMANAGER_WITH_MBIM
|
||||
bool "Include MBIM support"
|
||||
default y
|
||||
help
|
||||
Compile ModemManager with MBIM support
|
||||
config MODEMMANAGER_WITH_MBIM
|
||||
bool "Include MBIM support"
|
||||
default y
|
||||
help
|
||||
Compile ModemManager with MBIM support
|
||||
|
||||
config MODEMMANAGER_WITH_QMI
|
||||
bool "Include QMI support"
|
||||
default y
|
||||
help
|
||||
Compile ModemManager with QMI support
|
||||
|
||||
config MODEMMANAGER_WITH_QRTR
|
||||
bool "Include QRTR support"
|
||||
default y
|
||||
depends on MODEMMANAGER_WITH_QMI
|
||||
select LIBQMI_WITH_QRTR_GLIB
|
||||
help
|
||||
Compile ModemManager with QRTR support
|
||||
|
||||
config MODEMMANAGER_WITH_AT_COMMAND_VIA_DBUS
|
||||
bool "Allow AT commands via DBus"
|
||||
default n
|
||||
help
|
||||
Compile ModemManager allowing AT commands without debug flag
|
||||
config MODEMMANAGER_WITH_QMI
|
||||
bool "Include QMI support"
|
||||
default y
|
||||
help
|
||||
Compile ModemManager with QMI support
|
||||
|
||||
config MODEMMANAGER_WITH_AT_COMMAND_VIA_DBUS
|
||||
bool "Allow AT commands via DBus"
|
||||
default n
|
||||
help
|
||||
Compile ModemManager allowing AT commands without debug flag
|
||||
endmenu
|
||||
|
|
|
@ -8,25 +8,23 @@
|
|||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=modemmanager
|
||||
PKG_SOURCE_VERSION:=1.18.12
|
||||
PKG_RELEASE:=$(AUTORELEASE)
|
||||
PKG_VERSION:=1.18.6
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://gitlab.freedesktop.org/mobile-broadband/ModemManager.git
|
||||
PKG_MIRROR_HASH:=5a32f90fc58345e2136f4196166a7a2b95a804a6b92adf1bfb5b7a1173a5b1a0
|
||||
PKG_SOURCE:=ModemManager-$(PKG_VERSION).tar.xz
|
||||
PKG_SOURCE_URL:=https://www.freedesktop.org/software/ModemManager
|
||||
PKG_HASH:=d4f804b31cf504239c5f1d4973c62095c00cba1ee9abb503718dac6d146a470a
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/ModemManager-$(PKG_VERSION)
|
||||
|
||||
PKG_MAINTAINER:=Nicholas Smith <nicholas@nbembedded.com>
|
||||
PKG_MAINTAINER:=Nicholas Smith <nicholas.smith@telcoantennas.com.au>
|
||||
PKG_LICENSE:=GPL-2.0-or-later
|
||||
PKG_LICENSE_FILES:=COPYING
|
||||
|
||||
PKG_BUILD_DEPENDS:=glib2/host libxslt/host
|
||||
PKG_INSTALL:=1
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/nls.mk
|
||||
include $(INCLUDE_DIR)/meson.mk
|
||||
|
||||
TARGET_CFLAGS += -ffunction-sections -fdata-sections -fno-merge-all-constants -fmerge-constants
|
||||
TARGET_LDFLAGS += -Wl,--gc-sections
|
||||
|
||||
define Package/modemmanager/config
|
||||
source "$(SOURCE)/Config.in"
|
||||
|
@ -43,8 +41,7 @@ define Package/modemmanager
|
|||
+dbus \
|
||||
+ppp \
|
||||
+MODEMMANAGER_WITH_MBIM:libmbim \
|
||||
+MODEMMANAGER_WITH_QMI:libqmi \
|
||||
+MODEMMANAGER_WITH_QRTR:libqrtr-glib
|
||||
+MODEMMANAGER_WITH_QMI:libqmi
|
||||
endef
|
||||
|
||||
define Package/modemmanager/description
|
||||
|
@ -53,21 +50,35 @@ define Package/modemmanager/description
|
|||
Select Utilities/usb-modeswitch if needed.
|
||||
endef
|
||||
|
||||
MESON_ARGS += \
|
||||
-Dudev=false \
|
||||
-Dudevdir=/lib/udev \
|
||||
-Dsystemdsystemunitdir=no \
|
||||
-Dsystemd_suspend_resume=false \
|
||||
-Dsystemd_journal=false \
|
||||
-Dpolkit=no \
|
||||
-Dintrospection=false \
|
||||
-Dman=false \
|
||||
-Dbash_completion=false \
|
||||
-Db_lto=true \
|
||||
-Dmbim=$(if $(CONFIG_MODEMMANAGER_WITH_MBIM),true,false) \
|
||||
-Dqmi=$(if $(CONFIG_MODEMMANAGER_WITH_QMI),true,false) \
|
||||
-Dqrtr=$(if $(CONFIG_MODEMMANAGER_WITH_QRTR),true,false) \
|
||||
-Dat_command_via_dbus=$(if $(CONFIG_MODEMMANAGER_WITH_AT_COMMAND_VIA_DBUS),true,false)
|
||||
CONFIGURE_ARGS += \
|
||||
--without-polkit \
|
||||
--without-udev \
|
||||
--without-systemdsystemunitdir \
|
||||
--disable-rpath \
|
||||
--disable-gtk-doc
|
||||
|
||||
ifeq ($(CONFIG_MODEMMANAGER_WITH_AT_COMMAND_VIA_DBUS),y)
|
||||
CONFIGURE_ARGS += --with-at-command-via-dbus
|
||||
endif
|
||||
|
||||
ifdef CONFIG_MODEMMANAGER_WITH_MBIM
|
||||
CONFIGURE_ARGS += --with-mbim
|
||||
else
|
||||
CONFIGURE_ARGS += --without-mbim
|
||||
endif
|
||||
|
||||
ifdef CONFIG_MODEMMANAGER_WITH_QMI
|
||||
CONFIGURE_ARGS += --with-qmi
|
||||
else
|
||||
CONFIGURE_ARGS += --without-qmi
|
||||
endif
|
||||
|
||||
define Build/Prepare
|
||||
$(call Build/Prepare/Default)
|
||||
( cd "$(PKG_BUILD_DIR)"; \
|
||||
printf "all:\ninstall:\n" >po/Makefile.in.in; \
|
||||
)
|
||||
endef
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(1)/usr/include/ModemManager
|
||||
|
@ -99,9 +110,6 @@ define Package/modemmanager/install
|
|||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/ModemManager/libmm-shared-*.so* $(1)/usr/lib/ModemManager
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/ModemManager/libmm-plugin-*.so* $(1)/usr/lib/ModemManager
|
||||
|
||||
$(INSTALL_DIR) $(1)/usr/lib/ModemManager/connection.d
|
||||
$(INSTALL_BIN) ./files/10-report-down $(1)/usr/lib/ModemManager/connection.d
|
||||
|
||||
$(INSTALL_DIR) $(1)/etc/dbus-1/system.d
|
||||
$(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/dbus-1/system.d/org.freedesktop.ModemManager1.conf $(1)/etc/dbus-1/system.d
|
||||
|
||||
|
@ -112,9 +120,6 @@ define Package/modemmanager/install
|
|||
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/ModemManager/*.conf $(1)/usr/share/ModemManager
|
||||
$(INSTALL_DATA) ./files/modemmanager.common $(1)/usr/share/ModemManager
|
||||
|
||||
$(INSTALL_DIR) $(1)/usr/share/ModemManager/fcc-unlock.available.d
|
||||
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/ModemManager/fcc-unlock.available.d/* $(1)/usr/share/ModemManager/fcc-unlock.available.d
|
||||
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_BIN) ./files/modemmanager.init $(1)/etc/init.d/modemmanager
|
||||
|
||||
|
|
|
@ -1,35 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
# SPDX-License-Identifier: CC0-1.0
|
||||
# 2022 Aleksander Morgado <aleksander@aleksander.es>
|
||||
#
|
||||
# Automatically report to netifd that the underlying modem
|
||||
# is really disconnected
|
||||
#
|
||||
# require program name and at least 4 arguments
|
||||
[ $# -lt 4 ] && exit 1
|
||||
|
||||
MODEM_PATH="$1"
|
||||
BEARER_PATH="$2"
|
||||
INTERFACE="$3"
|
||||
STATE="$4"
|
||||
|
||||
[ "${STATE}" = "disconnected" ] || exit 0
|
||||
|
||||
. /usr/share/ModemManager/modemmanager.common
|
||||
. /lib/netifd/netifd-proto.sh
|
||||
INCLUDE_ONLY=1 . /lib/netifd/proto/modemmanager.sh
|
||||
|
||||
MODEM_STATUS=$(mmcli --modem="${MODEM_PATH}" --output-keyvalue)
|
||||
[ -n "${MODEM_STATUS}" ] || exit 1
|
||||
|
||||
MODEM_DEVICE=$(modemmanager_get_field "${MODEM_STATUS}" "modem.generic.device")
|
||||
[ -n "${MODEM_DEVICE}" ] || exit 2
|
||||
|
||||
CFG=$(mm_get_modem_config "${MODEM_DEVICE}")
|
||||
[ -n "${CFG}" ] || exit 3
|
||||
|
||||
logger -t "modemmanager" "interface ${CFG} (network device ${INTERFACE}) ${STATE}"
|
||||
proto_init_update $INTERFACE 0
|
||||
proto_send_update $CFG
|
||||
exit 0
|
|
@ -12,7 +12,7 @@
|
|||
mkdir -m 0755 -p "${MODEMMANAGER_RUNDIR}"
|
||||
|
||||
# Report network interface
|
||||
mm_log "info" "${ACTION} network interface ${INTERFACE}: event processed"
|
||||
mm_log "${ACTION} network interface ${INTERFACE}: event processed"
|
||||
mm_report_event "${ACTION}" "${INTERFACE}" "net" "/sys${DEVPATH}"
|
||||
|
||||
# Look for an associated cdc-wdm interface
|
||||
|
@ -26,6 +26,6 @@ esac
|
|||
|
||||
# Report cdc-wdm device, if any
|
||||
[ -n "${cdcwdm}" ] && {
|
||||
mm_log "info" "${ACTION} cdc interface ${cdcwdm}: custom event processed"
|
||||
mm_log "${ACTION} cdc interface ${cdcwdm}: custom event processed"
|
||||
mm_report_event "${ACTION}" "${cdcwdm}" "usbmisc" "/sys${DEVPATH}"
|
||||
}
|
||||
|
|
|
@ -12,5 +12,5 @@
|
|||
mkdir -m 0755 -p "${MODEMMANAGER_RUNDIR}"
|
||||
|
||||
# Report TTY
|
||||
mm_log "info" "${ACTION} serial interface ${DEVNAME}: event processed"
|
||||
mm_log "${ACTION} serial interface ${DEVNAME}: event processed"
|
||||
mm_report_event "${ACTION}" "${DEVNAME}" "tty" "/sys${DEVPATH}"
|
||||
|
|
|
@ -11,5 +11,5 @@
|
|||
mkdir -m 0755 -p "${MODEMMANAGER_RUNDIR}"
|
||||
|
||||
# Report wwan
|
||||
mm_log "info" "${ACTION} wwan control port ${DEVNAME}: event processed"
|
||||
mm_log "${ACTION} wwan control port ${DEVNAME}: event processed"
|
||||
mm_report_event "${ACTION}" "${DEVNAME}" "wwan" "/sys${DEVPATH}"
|
||||
|
|
|
@ -20,8 +20,7 @@ MODEMMANAGER_EVENTS_CACHE="${MODEMMANAGER_RUNDIR}/events.cache"
|
|||
# Common logging
|
||||
|
||||
mm_log() {
|
||||
local level="$1"; shift
|
||||
logger -p "daemon.${level}" -t "ModemManager[$$]" "hotplug: $*"
|
||||
[ "$(uci -q get openmptcprouter.settings.debug)" = "true" ] && logger -t "ModemManager" "hotplug: $*"
|
||||
}
|
||||
|
||||
################################################################################
|
||||
|
@ -40,14 +39,14 @@ mm_find_physdev_sysfs_path() {
|
|||
# avoid infinite loops iterating
|
||||
[ -z "${tmp_path}" ] || [ "${tmp_path}" = "/" ] && return
|
||||
|
||||
# For USB devices, the physical device will be that with a idVendor
|
||||
# and idProduct pair of files
|
||||
# for USB devices, the physical device will be that with a idVendor
|
||||
# and idProduct pair of files
|
||||
[ -f "${tmp_path}"/idVendor ] && [ -f "${tmp_path}"/idProduct ] && {
|
||||
tmp_path=$(readlink -f "$tmp_path")
|
||||
echo "${tmp_path}"
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
# For PCI devices, the physical device will be that with a vendor
|
||||
# and device pair of files
|
||||
[ -f "${tmp_path}"/vendor ] && [ -f "${tmp_path}"/device ] && {
|
||||
|
@ -170,7 +169,7 @@ mm_wait_for_modem() {
|
|||
|
||||
while [ $n -ge 0 ]; do
|
||||
[ -d "${sysfspath}" ] || {
|
||||
mm_log "error" "ignoring modem detection request: no device at ${sysfspath}"
|
||||
mm_log "error: ignoring modem detection request: no device at ${sysfspath}"
|
||||
proto_set_available "${cfg}" 0
|
||||
return 1
|
||||
}
|
||||
|
@ -178,10 +177,10 @@ mm_wait_for_modem() {
|
|||
# Check if the modem exists at the given sysfs path
|
||||
if ! mmcli -m "${sysfspath}" > /dev/null 2>&1
|
||||
then
|
||||
mm_log "error" "modem not detected at sysfs path"
|
||||
mm_log "error: modem not detected at sysfs path"
|
||||
else
|
||||
mm_log "info" "modem exported successfully at ${sysfspath}"
|
||||
mm_log "info" "setting interface '${cfg}' as available"
|
||||
mm_log "modem exported successfully at ${sysfspath}"
|
||||
mm_log "setting interface '${cfg}' as available"
|
||||
proto_set_available "${cfg}" 1
|
||||
return 0
|
||||
fi
|
||||
|
@ -190,7 +189,7 @@ mm_wait_for_modem() {
|
|||
n=$((n-step))
|
||||
done
|
||||
|
||||
mm_log "error" "timed out waiting for the modem to get exported at ${sysfspath}"
|
||||
mm_log "error: timed out waiting for the modem to get exported at ${sysfspath}"
|
||||
proto_set_available "${cfg}" 0
|
||||
return 2
|
||||
}
|
||||
|
@ -202,7 +201,7 @@ mm_report_modem_wait() {
|
|||
|
||||
parent_sysfspath=$(mm_find_physdev_sysfs_path "$sysfspath")
|
||||
[ -n "${parent_sysfspath}" ] || {
|
||||
mm_log "error" "parent device sysfspath not found"
|
||||
mm_log "error: parent device sysfspath not found"
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -213,23 +212,23 @@ mm_report_modem_wait() {
|
|||
|
||||
cfg=$(mm_get_modem_config "${parent_sysfspath}")
|
||||
if [ -n "${cfg}" ]; then
|
||||
mm_log "info" "interface '${cfg}' is set to configure device '${parent_sysfspath}'"
|
||||
mm_log "info" "now waiting for modem at sysfs path ${parent_sysfspath}"
|
||||
mm_log "interface '${cfg}' is set to configure device '${parent_sysfspath}'"
|
||||
mm_log "now waiting for modem at sysfs path ${parent_sysfspath}"
|
||||
mm_set_modem_wait_status "${parent_sysfspath}" "processed"
|
||||
# Launch subshell for the explicit wait
|
||||
( mm_wait_for_modem "${cfg}" "${parent_sysfspath}" ) > /dev/null 2>&1 &
|
||||
else
|
||||
mm_log "info" "no need to wait for modem at sysfs path ${parent_sysfspath}"
|
||||
mm_log "no need to wait for modem at sysfs path ${parent_sysfspath}"
|
||||
mm_set_modem_wait_status "${parent_sysfspath}" "ignored"
|
||||
fi
|
||||
;;
|
||||
"processed")
|
||||
mm_log "info" "already waiting for modem at sysfs path ${parent_sysfspath}"
|
||||
mm_log "already waiting for modem at sysfs path ${parent_sysfspath}"
|
||||
;;
|
||||
"ignored")
|
||||
;;
|
||||
*)
|
||||
mm_log "error" "unknown status read for device at sysfs path ${parent_sysfspath}"
|
||||
mm_log "error: unknown status read for device at sysfs path ${parent_sysfspath}"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
@ -259,7 +258,7 @@ mm_cleanup_interface_by_sysfspath() {
|
|||
cfg=$(mm_get_modem_config "$dev")
|
||||
[ -n "${cfg}" ] || return
|
||||
|
||||
mm_log "info" "setting interface '$cfg' as unavailable"
|
||||
mm_log "setting interface '$cfg' as unavailable"
|
||||
proto_set_available "${cfg}" 0
|
||||
}
|
||||
|
||||
|
@ -287,7 +286,7 @@ mm_report_event() {
|
|||
esac
|
||||
|
||||
# Report the event
|
||||
mm_log "debug" "event reported: action=${action}, name=${name}, subsystem=${subsystem}"
|
||||
mm_log "event reported: action=${action}, name=${name}, subsystem=${subsystem}"
|
||||
mmcli --report-kernel-event="action=${action},name=${name},subsystem=${subsystem}" 1>/dev/null 2>&1 &
|
||||
|
||||
# Wait for added modem if a sysfspath is given
|
||||
|
@ -303,7 +302,7 @@ mm_report_event_from_cache_line() {
|
|||
subsystem=$(echo "${event_line}" | awk -F ',' '{ print $3 }')
|
||||
sysfspath=$(echo "${event_line}" | awk -F ',' '{ print $4 }')
|
||||
|
||||
mm_log "debug" "cached event found: action=${action}, name=${name}, subsystem=${subsystem}, sysfspath=${sysfspath}"
|
||||
mm_log "cached event found: action=${action}, name=${name}, subsystem=${subsystem}, sysfspath=${sysfspath}"
|
||||
mm_report_event "${action}" "${name}" "${subsystem}" "${sysfspath}"
|
||||
}
|
||||
|
||||
|
@ -318,11 +317,11 @@ mm_report_events_from_cache() {
|
|||
# Wait for ModemManager to be available in the bus
|
||||
while [ $n -ge 0 ]; do
|
||||
sleep $step
|
||||
mm_log "info" "checking if ModemManager is available..."
|
||||
mm_log "checking if ModemManager is available..."
|
||||
|
||||
if ! mmcli -L >/dev/null 2>&1
|
||||
then
|
||||
mm_log "info" "ModemManager not yet available"
|
||||
mm_log "ModemManager not yet available"
|
||||
else
|
||||
mmrunning=1
|
||||
break
|
||||
|
@ -331,7 +330,7 @@ mm_report_events_from_cache() {
|
|||
done
|
||||
|
||||
[ ${mmrunning} -eq 1 ] || {
|
||||
mm_log "error" "couldn't report initial kernel events: ModemManager not running"
|
||||
mm_log "error: couldn't report initial kernel events: ModemManager not running"
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
@ -4,8 +4,6 @@
|
|||
USE_PROCD=1
|
||||
START=70
|
||||
|
||||
LOG_LEVEL="INFO"
|
||||
|
||||
stop_service() {
|
||||
# Load common utils
|
||||
. /usr/share/ModemManager/modemmanager.common
|
||||
|
@ -30,8 +28,6 @@ start_service() {
|
|||
. /usr/share/ModemManager/modemmanager.common
|
||||
procd_open_instance
|
||||
procd_set_param command /usr/sbin/ModemManager-wrapper
|
||||
procd_append_param command --log-level="$LOG_LEVEL"
|
||||
[ "$LOG_LEVEL" = "DEBUG" ] && procd_append_param command --debug
|
||||
procd_set_param respawn "${respawn_threshold:-3600}" "${respawn_timeout:-5}" "${respawn_retry:-5}"
|
||||
procd_set_param pidfile "${MODEMMANAGER_PID_FILE}"
|
||||
procd_close_instance
|
||||
|
|
|
@ -197,6 +197,7 @@ modemmanager_connected_method_dhcp_ipv4() {
|
|||
local interface="$1"
|
||||
local wwan="$2"
|
||||
local metric="$3"
|
||||
local defaultroute="$4"
|
||||
|
||||
proto_init_update "${wwan}" 1
|
||||
proto_set_keep 1
|
||||
|
@ -222,6 +223,7 @@ modemmanager_connected_method_static_ipv4() {
|
|||
local dns1="$7"
|
||||
local dns2="$8"
|
||||
local metric="$9"
|
||||
local defaultroute="$10"
|
||||
|
||||
local mask=""
|
||||
|
||||
|
@ -242,8 +244,9 @@ modemmanager_connected_method_static_ipv4() {
|
|||
proto_set_keep 1
|
||||
echo "adding IPv4 address ${address}, netmask ${mask}"
|
||||
proto_add_ipv4_address "${address}" "${mask}"
|
||||
[ -n "${gateway}" ] && {
|
||||
[ -n "${gateway}" ] && [ "${defaultroute}" != 0 ] && {
|
||||
echo "adding default IPv4 route via ${gateway}"
|
||||
logger -t "modemmanager.proto" "adding default IPv4 route via ${gateway} ${address}"
|
||||
proto_add_ipv4_route "0.0.0.0" "0" "${gateway}" "${address}"
|
||||
}
|
||||
[ -n "${dns1}" ] && {
|
||||
|
@ -262,6 +265,7 @@ modemmanager_connected_method_dhcp_ipv6() {
|
|||
local interface="$1"
|
||||
local wwan="$2"
|
||||
local metric="$3"
|
||||
local defaultroute="$4"
|
||||
|
||||
proto_init_update "${wwan}" 1
|
||||
proto_set_keep 1
|
||||
|
@ -288,6 +292,7 @@ modemmanager_connected_method_static_ipv6() {
|
|||
local dns1="$7"
|
||||
local dns2="$8"
|
||||
local metric="$9"
|
||||
local defaultroute="$10"
|
||||
|
||||
[ -n "${address}" ] || {
|
||||
proto_notify_error "${interface}" ADDRESS_MISSING
|
||||
|
@ -306,7 +311,7 @@ modemmanager_connected_method_static_ipv6() {
|
|||
echo "adding IPv6 address ${address}, prefix ${prefix}"
|
||||
proto_add_ipv6_address "${address}" "128"
|
||||
proto_add_ipv6_prefix "${address}/${prefix}"
|
||||
[ -n "${gateway}" ] && {
|
||||
[ -n "${gateway}" ] && [ "$defaultroute" != 0 ] && {
|
||||
echo "adding default IPv6 route via ${gateway}"
|
||||
proto_add_ipv6_route "${gateway}" "128"
|
||||
proto_add_ipv6_route "::0" "0" "${gateway}" "" "" "${address}/${prefix}"
|
||||
|
@ -357,9 +362,9 @@ proto_modemmanager_setup() {
|
|||
|
||||
local device apn allowedauth username password pincode iptype metric signalrate
|
||||
|
||||
local address prefix gateway mtu dns1 dns2
|
||||
local address prefix gateway mtu dns1 dns2 defaultroute
|
||||
|
||||
json_get_vars device apn allowedauth username password pincode iptype metric signalrate
|
||||
json_get_vars device apn allowedauth username password pincode iptype metric signalrate defaultroute
|
||||
|
||||
# validate sysfs path given in config
|
||||
[ -n "${device}" ] || {
|
||||
|
@ -447,7 +452,7 @@ proto_modemmanager_setup() {
|
|||
echo "IPv4 connection setup required in interface ${interface}: ${bearermethod_ipv4}"
|
||||
case "${bearermethod_ipv4}" in
|
||||
"dhcp")
|
||||
modemmanager_connected_method_dhcp_ipv4 "${interface}" "${beareriface}" "${metric}"
|
||||
modemmanager_connected_method_dhcp_ipv4 "${interface}" "${beareriface}" "${metric}" "${defaultroute}"
|
||||
;;
|
||||
"static")
|
||||
address=$(modemmanager_get_field "${bearerstatus}" "bearer.ipv4-config.address")
|
||||
|
@ -456,7 +461,7 @@ proto_modemmanager_setup() {
|
|||
mtu=$(modemmanager_get_field "${bearerstatus}" "bearer.ipv4-config.mtu")
|
||||
dns1=$(modemmanager_get_field "${bearerstatus}" "bearer.ipv4-config.dns.value\[1\]")
|
||||
dns2=$(modemmanager_get_field "${bearerstatus}" "bearer.ipv4-config.dns.value\[2\]")
|
||||
modemmanager_connected_method_static_ipv4 "${interface}" "${beareriface}" "${address}" "${prefix}" "${gateway}" "${mtu}" "${dns1}" "${dns2}" "${metric}"
|
||||
modemmanager_connected_method_static_ipv4 "${interface}" "${beareriface}" "${address}" "${prefix}" "${gateway}" "${mtu}" "${dns1}" "${dns2}" "${metric}" "${defaultroute}"
|
||||
;;
|
||||
"ppp")
|
||||
modemmanager_connected_method_ppp_ipv4 "${interface}" "${beareriface}" "${username}" "${password}" "${allowedauth}"
|
||||
|
@ -474,7 +479,7 @@ proto_modemmanager_setup() {
|
|||
echo "IPv6 connection setup required in interface ${interface}: ${bearermethod_ipv6}"
|
||||
case "${bearermethod_ipv6}" in
|
||||
"dhcp")
|
||||
modemmanager_connected_method_dhcp_ipv6 "${interface}" "${beareriface}" "${metric}"
|
||||
modemmanager_connected_method_dhcp_ipv6 "${interface}" "${beareriface}" "${metric}" "${defaultroute}"
|
||||
;;
|
||||
"static")
|
||||
address=$(modemmanager_get_field "${bearerstatus}" "bearer.ipv6-config.address")
|
||||
|
@ -483,7 +488,7 @@ proto_modemmanager_setup() {
|
|||
mtu=$(modemmanager_get_field "${bearerstatus}" "bearer.ipv6-config.mtu")
|
||||
dns1=$(modemmanager_get_field "${bearerstatus}" "bearer.ipv6-config.dns.value\[1\]")
|
||||
dns2=$(modemmanager_get_field "${bearerstatus}" "bearer.ipv6-config.dns.value\[2\]")
|
||||
modemmanager_connected_method_static_ipv6 "${interface}" "${beareriface}" "${address}" "${prefix}" "${gateway}" "${mtu}" "${dns1}" "${dns2}" "${metric}"
|
||||
modemmanager_connected_method_static_ipv6 "${interface}" "${beareriface}" "${address}" "${prefix}" "${gateway}" "${mtu}" "${dns1}" "${dns2}" "${metric}" "${defaultroute}"
|
||||
;;
|
||||
"ppp")
|
||||
proto_notify_error "${interface}" "unsupported method"
|
||||
|
@ -515,8 +520,7 @@ proto_modemmanager_teardown() {
|
|||
modemstatus=$(mmcli --modem="${device}" --output-keyvalue)
|
||||
bearerpath=$(modemmanager_get_field "${modemstatus}" "modem.generic.bearers.value\[1\]")
|
||||
[ -n "${bearerpath}" ] || {
|
||||
echo "couldn't load bearer path: disconnecting anyway"
|
||||
mmcli --modem="${device}" --simple-disconnect >/dev/null 2>&1
|
||||
echo "couldn't load bearer path"
|
||||
return
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue