1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-03-09 15:40:03 +00:00

Revert "fix modemmanager"

This reverts commit 1f5e6c61d9.
This commit is contained in:
suyuan168 2022-04-28 16:14:01 +08:00
parent 4794097e42
commit 2b84a869fb
10 changed files with 116 additions and 335 deletions

View file

@ -8,29 +8,28 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=libmbim PKG_NAME:=libmbim
PKG_SOURCE_VERSION:=1.26.2 PKG_VERSION:=1.26.0
PKG_RELEASE:=$(AUTORELEASE) PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=https://gitlab.freedesktop.org/mobile-broadband/libmbim.git PKG_SOURCE_URL:=https://www.freedesktop.org/software/libmbim
PKG_MIRROR_HASH:=47eb6511818271be66336fb67ec97de7925119b09ddbd0ffd06b3f76893a461e PKG_HASH:=1e1f0926b22c77210442129eca689722ecf324ab9c9abf421a5c989f46e813cf
PKG_MAINTAINER:=Nicholas Smith <nicholas@nbembedded.com> PKG_MAINTAINER:=Nicholas Smith <nicholas@nbembedded.com>
PKG_INSTALL:=1 PKG_INSTALL:=1
PKG_BUILD_PARALLEL:=1
include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/nls.mk include $(INCLUDE_DIR)/nls.mk
include $(INCLUDE_DIR)/meson.mk
TARGET_CFLAGS += -ffunction-sections -fdata-sections -fno-merge-all-constants -fmerge-constants CONFIGURE_ARGS += \
TARGET_LDFLAGS += -Wl,--gc-sections --disable-static \
--disable-gtk-doc \
MESON_ARGS += \ --disable-gtk-doc-html \
-Dintrospection=false \ --disable-gtk-doc-pdf \
-Dman=false \ --disable-silent-rules \
-Dbash_completion=false \ --enable-more-warnings=yes
-Db_lto=true
define Package/libmbim define Package/libmbim
SECTION:=libs SECTION:=libs
@ -57,6 +56,10 @@ define Package/mbim-utils
LICENSE_FILES:=COPYING LICENSE_FILES:=COPYING
endef endef
CONFIGURE_ARGS += \
--without-udev \
--without-udev-base-dir
define Build/InstallDev define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include $(INSTALL_DIR) $(1)/usr/include
$(CP) \ $(CP) \
@ -75,15 +78,11 @@ define Build/InstallDev
endef endef
define Package/libmbim/install define Package/libmbim/install
$(INSTALL_DIR) \ $(INSTALL_DIR) $(1)/usr/lib
$(1)/usr/lib \
$(1)/usr/libexec
$(CP) \ $(CP) \
$(PKG_INSTALL_DIR)/usr/lib/libmbim*.so.* \ $(PKG_INSTALL_DIR)/usr/lib/libmbim*.so.* \
$(1)/usr/lib/ $(1)/usr/lib/
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/mbim-proxy $(1)/usr/lib/
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/libexec/mbim-proxy $(1)/usr/libexec/
endef endef
define Package/mbim-utils/install define Package/mbim-utils/install

View file

@ -13,19 +13,4 @@ config LIBQMI_WITH_QRTR_GLIB
help help
Compile libqmi with QRTR support 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 endmenu

View file

@ -8,23 +8,20 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=libqmi PKG_NAME:=libqmi
PKG_SOURCE_VERSION:=1.30.4 PKG_VERSION:=1.28.8
PKG_RELEASE:=$(AUTORELEASE) PKG_RELEASE:=$(AUTORELEASE)
PKG_SOURCE_PROTO:=git PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=https://gitlab.freedesktop.org/mobile-broadband/libqmi.git PKG_SOURCE_URL:=https://www.freedesktop.org/software/libqmi
PKG_MIRROR_HASH:=537eae29c36aba9757afd86e48b91c37c3fe3232037ad11fdd426297f6040a6b PKG_HASH:=6e3bbbd200bc1b64b23f6254fef9212f2699ec77cfb32075d2ba5079c73a9f78
PKG_MAINTAINER:=Nicholas Smith <nicholas@nbembedded.com> PKG_MAINTAINER:=Nicholas Smith <nicholas@nbembedded.com>
PKG_INSTALL:=1 PKG_INSTALL:=1
PKG_BUILD_PARALLEL:=1
include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/nls.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 define Package/libqmi/config
source "$(SOURCE)/Config.in" source "$(SOURCE)/Config.in"
@ -62,16 +59,18 @@ define Package/libqmi-utils/description
Utils to talk to QMI enabled modems Utils to talk to QMI enabled modems
endef endef
MESON_ARGS += \ CONFIGURE_ARGS += \
-Dudev=false \ --disable-static \
-Dintrospection=false \ --disable-gtk-doc \
-Dman=false \ --disable-gtk-doc-html \
-Dbash_completion=false \ --disable-gtk-doc-pdf \
-Db_lto=true \ --disable-silent-rules \
-Dmbim_qmux=$(if $(CONFIG_LIBQMI_WITH_MBIM_QMUX),true,false) \ --enable-firmware-update \
-Dqrtr=$(if $(CONFIG_LIBQMI_WITH_QRTR_GLIB),true,false) \ --$(if $(LIBQMI_WITH_MBIM_QMUX),en,dis)able-mbim-qmux \
-Dcollection=$(if $(CONFIG_LIBQMI_COLLECTION_MINIMAL),minimal\ --$(if $(LIBQMI_WITH_QRTR_GLIB),en,dis)able-qrtr \
,$(if $(CONFIG_LIBQMI_COLLECTION_BASIC),basic,full)) --enable-more-warnings=yes \
--without-udev \
--without-udev-base-dir
define Build/InstallDev define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include $(INSTALL_DIR) $(1)/usr/include
@ -91,15 +90,12 @@ define Build/InstallDev
endef endef
define Package/libqmi/install define Package/libqmi/install
$(INSTALL_DIR) \ $(INSTALL_DIR) $(1)/usr/lib
$(1)/usr/lib \
$(1)/usr/libexec
$(CP) \ $(CP) \
$(PKG_INSTALL_DIR)/usr/lib/libqmi*.so.* \ $(PKG_INSTALL_DIR)/usr/lib/libqmi*.so.* \
$(1)/usr/lib/ $(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 endef
define Package/qmi-utils/install define Package/qmi-utils/install

View file

@ -1,30 +1,21 @@
menu "Configuration" menu "Configuration"
depends on PACKAGE_modemmanager depends on PACKAGE_modemmanager
config MODEMMANAGER_WITH_MBIM config MODEMMANAGER_WITH_MBIM
bool "Include MBIM support" bool "Include MBIM support"
default y default y
help help
Compile ModemManager with MBIM support Compile ModemManager with MBIM support
config MODEMMANAGER_WITH_QMI config MODEMMANAGER_WITH_QMI
bool "Include QMI support" bool "Include QMI support"
default y default y
help help
Compile ModemManager with QMI support Compile ModemManager with QMI support
config MODEMMANAGER_WITH_QRTR config MODEMMANAGER_WITH_AT_COMMAND_VIA_DBUS
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" bool "Allow AT commands via DBus"
default n default n
help help
Compile ModemManager allowing AT commands without debug flag Compile ModemManager allowing AT commands without debug flag
endmenu endmenu

View file

@ -8,26 +8,23 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=modemmanager PKG_NAME:=modemmanager
PKG_SOURCE_VERSION:=1.18.6 PKG_VERSION:=1.16.10
PKG_RELEASE:=$(AUTORELEASE) PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git PKG_SOURCE:=ModemManager-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=https://gitlab.freedesktop.org/mobile-broadband/ModemManager.git PKG_SOURCE_URL:=https://www.freedesktop.org/software/ModemManager
PKG_MIRROR_HASH:=72f1a865153745d05c482ed3a77f2045d24387f1f9a37177fe7bc35ab7663765 PKG_HASH:=2ccf1f716c2d121e8e6709bcf8af29ee86971a90adacca2e8d6288b30278862e
PKG_BUILD_DIR:=$(BUILD_DIR)/ModemManager-$(PKG_VERSION)
PKG_MAINTAINER:=Nicholas Smith <nicholas@nbembedded.com> PKG_MAINTAINER:=Nicholas Smith <nicholas@nbembedded.com>
PKG_LICENSE:=GPL-2.0-or-later PKG_LICENSE:=GPL-2.0-or-later
PKG_LICENSE_FILES:=COPYING PKG_LICENSE_FILES:=COPYING
PKG_INSTALL:=1 PKG_INSTALL:=1
PKG_BUILD_DEPENDS:=glib2/host libxslt/host PKG_BUILD_PARALLEL:=1
include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/nls.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 define Package/modemmanager/config
source "$(SOURCE)/Config.in" source "$(SOURCE)/Config.in"
@ -44,8 +41,7 @@ define Package/modemmanager
+dbus \ +dbus \
+ppp \ +ppp \
+MODEMMANAGER_WITH_MBIM:libmbim \ +MODEMMANAGER_WITH_MBIM:libmbim \
+MODEMMANAGER_WITH_QMI:libqmi \ +MODEMMANAGER_WITH_QMI:libqmi
+MODEMMANAGER_WITH_QRTR:libqrtr-glib
endef endef
define Package/modemmanager/description define Package/modemmanager/description
@ -54,21 +50,35 @@ define Package/modemmanager/description
Select Utilities/usb-modeswitch if needed. Select Utilities/usb-modeswitch if needed.
endef endef
MESON_ARGS += \ CONFIGURE_ARGS += \
-Dudev=false \ --without-polkit \
-Dudevdir=/lib/udev \ --without-udev \
-Dsystemdsystemunitdir=no \ --without-systemdsystemunitdir \
-Dsystemd_suspend_resume=false \ --disable-rpath \
-Dsystemd_journal=false \ --disable-gtk-doc
-Dpolkit=no \
-Dintrospection=false \ ifeq ($(CONFIG_MODEMMANAGER_WITH_AT_COMMAND_VIA_DBUS),y)
-Dman=false \ CONFIGURE_ARGS += --with-at-command-via-dbus
-Dbash_completion=false \ endif
-Db_lto=true \
-Dmbim=$(if $(CONFIG_MODEMMANAGER_WITH_MBIM),true,false) \ ifdef CONFIG_MODEMMANAGER_WITH_MBIM
-Dqmi=$(if $(CONFIG_MODEMMANAGER_WITH_QMI),true,false) \ CONFIGURE_ARGS += --with-mbim
-Dqrtr=$(if $(CONFIG_MODEMMANAGER_WITH_QRTR),true,false) \ else
-Dat_command_via_dbus=$(if $(CONFIG_MODEMMANAGER_WITH_AT_COMMAND_VIA_DBUS),true,false) 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 define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include/ModemManager $(INSTALL_DIR) $(1)/usr/include/ModemManager
@ -88,7 +98,6 @@ define Package/modemmanager/install
$(INSTALL_DIR) $(1)/usr/sbin $(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ModemManager $(1)/usr/sbin $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ModemManager $(1)/usr/sbin
$(INSTALL_BIN) ./files/usr/sbin/ModemManager-wrapper $(1)/usr/sbin
$(INSTALL_DIR) $(1)/usr/bin $(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mmcli $(1)/usr/bin $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mmcli $(1)/usr/bin
@ -122,9 +131,6 @@ define Package/modemmanager/install
$(INSTALL_DIR) $(1)/etc/hotplug.d/tty $(INSTALL_DIR) $(1)/etc/hotplug.d/tty
$(INSTALL_DATA) ./files/25-modemmanager-tty $(1)/etc/hotplug.d/tty $(INSTALL_DATA) ./files/25-modemmanager-tty $(1)/etc/hotplug.d/tty
$(INSTALL_DIR) $(1)/etc/hotplug.d/wwan
$(INSTALL_DATA) ./files/25-modemmanager-wwan $(1)/etc/hotplug.d/wwan
$(INSTALL_DIR) $(1)/lib/netifd/proto $(INSTALL_DIR) $(1)/lib/netifd/proto
$(INSTALL_BIN) ./files/modemmanager.proto $(1)/lib/netifd/proto/modemmanager.sh $(INSTALL_BIN) ./files/modemmanager.proto $(1)/lib/netifd/proto/modemmanager.sh
endef endef

View file

@ -20,8 +20,7 @@ MODEMMANAGER_EVENTS_CACHE="${MODEMMANAGER_RUNDIR}/events.cache"
# Common logging # Common logging
mm_log() { mm_log() {
local level="$1"; shift logger -t "ModemManager" "hotplug: $*"
logger -p "daemon.${level}" -t "ModemManager[$$]" "hotplug: $*"
} }
################################################################################ ################################################################################
@ -40,21 +39,12 @@ mm_find_physdev_sysfs_path() {
# avoid infinite loops iterating # avoid infinite loops iterating
[ -z "${tmp_path}" ] || [ "${tmp_path}" = "/" ] && return [ -z "${tmp_path}" ] || [ "${tmp_path}" = "/" ] && return
# For USB devices, the physical device will be that with a idVendor # the physical device will be that with a idVendor and idProduct pair of files
# and idProduct pair of files
[ -f "${tmp_path}"/idVendor ] && [ -f "${tmp_path}"/idProduct ] && { [ -f "${tmp_path}"/idVendor ] && [ -f "${tmp_path}"/idProduct ] && {
tmp_path=$(readlink -f "$tmp_path") tmp_path=$(readlink -f "$tmp_path")
echo "${tmp_path}" echo "${tmp_path}"
return 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 ] && {
tmp_path=$(readlink -f "$tmp_path")
echo "${tmp_path}"
return
}
done done
} }
@ -170,7 +160,7 @@ mm_wait_for_modem() {
while [ $n -ge 0 ]; do while [ $n -ge 0 ]; do
[ -d "${sysfspath}" ] || { [ -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 proto_set_available "${cfg}" 0
return 1 return 1
} }
@ -178,10 +168,10 @@ mm_wait_for_modem() {
# Check if the modem exists at the given sysfs path # Check if the modem exists at the given sysfs path
if ! mmcli -m "${sysfspath}" > /dev/null 2>&1 if ! mmcli -m "${sysfspath}" > /dev/null 2>&1
then then
mm_log "error" "modem not detected at sysfs path" mm_log "error: modem not detected at sysfs path"
else else
mm_log "info" "modem exported successfully at ${sysfspath}" mm_log "modem exported successfully at ${sysfspath}"
mm_log "info" "setting interface '${cfg}' as available" mm_log "setting interface '${cfg}' as available"
proto_set_available "${cfg}" 1 proto_set_available "${cfg}" 1
return 0 return 0
fi fi
@ -190,7 +180,7 @@ mm_wait_for_modem() {
n=$((n-step)) n=$((n-step))
done 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 proto_set_available "${cfg}" 0
return 2 return 2
} }
@ -202,7 +192,7 @@ mm_report_modem_wait() {
parent_sysfspath=$(mm_find_physdev_sysfs_path "$sysfspath") parent_sysfspath=$(mm_find_physdev_sysfs_path "$sysfspath")
[ -n "${parent_sysfspath}" ] || { [ -n "${parent_sysfspath}" ] || {
mm_log "error" "parent device sysfspath not found" mm_log "error: parent device sysfspath not found"
return return
} }
@ -213,23 +203,23 @@ mm_report_modem_wait() {
cfg=$(mm_get_modem_config "${parent_sysfspath}") cfg=$(mm_get_modem_config "${parent_sysfspath}")
if [ -n "${cfg}" ]; then if [ -n "${cfg}" ]; then
mm_log "info" "interface '${cfg}' is set to configure device '${parent_sysfspath}'" mm_log "interface '${cfg}' is set to configure device '${parent_sysfspath}'"
mm_log "info" "now waiting for modem at sysfs path ${parent_sysfspath}" mm_log "now waiting for modem at sysfs path ${parent_sysfspath}"
mm_set_modem_wait_status "${parent_sysfspath}" "processed" mm_set_modem_wait_status "${parent_sysfspath}" "processed"
# Launch subshell for the explicit wait # Launch subshell for the explicit wait
( mm_wait_for_modem "${cfg}" "${parent_sysfspath}" ) > /dev/null 2>&1 & ( mm_wait_for_modem "${cfg}" "${parent_sysfspath}" ) > /dev/null 2>&1 &
else 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" mm_set_modem_wait_status "${parent_sysfspath}" "ignored"
fi fi
;; ;;
"processed") "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") "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 esac
} }
@ -259,7 +249,7 @@ mm_cleanup_interface_by_sysfspath() {
cfg=$(mm_get_modem_config "$dev") cfg=$(mm_get_modem_config "$dev")
[ -n "${cfg}" ] || return [ -n "${cfg}" ] || return
mm_log "info" "setting interface '$cfg' as unavailable" mm_log "setting interface '$cfg' as unavailable"
proto_set_available "${cfg}" 0 proto_set_available "${cfg}" 0
} }
@ -287,7 +277,7 @@ mm_report_event() {
esac esac
# Report the event # 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 & mmcli --report-kernel-event="action=${action},name=${name},subsystem=${subsystem}" 1>/dev/null 2>&1 &
# Wait for added modem if a sysfspath is given # Wait for added modem if a sysfspath is given
@ -303,7 +293,7 @@ mm_report_event_from_cache_line() {
subsystem=$(echo "${event_line}" | awk -F ',' '{ print $3 }') subsystem=$(echo "${event_line}" | awk -F ',' '{ print $3 }')
sysfspath=$(echo "${event_line}" | awk -F ',' '{ print $4 }') 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}" mm_report_event "${action}" "${name}" "${subsystem}" "${sysfspath}"
} }
@ -318,11 +308,11 @@ mm_report_events_from_cache() {
# Wait for ModemManager to be available in the bus # Wait for ModemManager to be available in the bus
while [ $n -ge 0 ]; do while [ $n -ge 0 ]; do
sleep $step sleep $step
mm_log "info" "checking if ModemManager is available..." mm_log "checking if ModemManager is available..."
if ! mmcli -L >/dev/null 2>&1 if ! mmcli -L >/dev/null 2>&1
then then
mm_log "info" "ModemManager not yet available" mm_log "ModemManager not yet available"
else else
mmrunning=1 mmrunning=1
break break
@ -331,7 +321,7 @@ mm_report_events_from_cache() {
done done
[ ${mmrunning} -eq 1 ] || { [ ${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 return
} }

View file

@ -4,8 +4,6 @@
USE_PROCD=1 USE_PROCD=1
START=70 START=70
LOG_LEVEL="INFO"
stop_service() { stop_service() {
# Load common utils # Load common utils
. /usr/share/ModemManager/modemmanager.common . /usr/share/ModemManager/modemmanager.common
@ -24,14 +22,14 @@ start_service() {
# it starts. # it starts.
# #
# All these commands need to be executed on every MM start, even after # All these commands need to be executed on every MM start, even after
# procd-triggered respawns, which is why this is wrapped in a startup # procd-triggered respawns, which is why they're all included as instance command
# wrapper script called '/usr/sbin/ModemManager-wrapper'.
# #
. /usr/share/ModemManager/modemmanager.common
procd_open_instance procd_open_instance
procd_set_param command /usr/sbin/ModemManager-wrapper procd_set_param command sh -c ". /usr/share/ModemManager/modemmanager.common; \
procd_append_param command --log-level="$LOG_LEVEL" mkdir -m 0755 -p ${MODEMMANAGER_RUNDIR}; \
[ "$LOG_LEVEL" = "DEBUG" ] && procd_append_param command --debug mm_cleanup_interfaces; \
( mm_report_events_from_cache ) >/dev/null 2>&1 & \
/usr/sbin/ModemManager"
procd_set_param respawn "${respawn_threshold:-3600}" "${respawn_timeout:-5}" "${respawn_retry:-5}" procd_set_param respawn "${respawn_threshold:-3600}" "${respawn_timeout:-5}" "${respawn_retry:-5}"
procd_set_param pidfile "${MODEMMANAGER_PID_FILE}" procd_set_param pidfile "${MODEMMANAGER_PID_FILE}"
procd_close_instance procd_close_instance

0
modemmanager/files/usr/sbin/ModemManager-wrapper Normal file → Executable file
View file

View file

@ -1,88 +0,0 @@
--- a/plugins/broadmobi/mm-plugin-broadmobi.c
+++ b/plugins/broadmobi/mm-plugin-broadmobi.c
@@ -19,7 +19,6 @@
#define _LIBMM_INSIDE_MM
#include <libmm-glib.h>
-#include "mm-port-enums-types.h"
#include "mm-log-object.h"
#include "mm-plugin-broadmobi.h"
#include "mm-broadband-modem.h"
--- a/plugins/dlink/mm-plugin-dlink.c
+++ b/plugins/dlink/mm-plugin-dlink.c
@@ -19,7 +19,6 @@
#define _LIBMM_INSIDE_MM
#include <libmm-glib.h>
-#include "mm-port-enums-types.h"
#include "mm-log-object.h"
#include "mm-plugin-dlink.h"
#include "mm-broadband-modem.h"
--- a/plugins/meson.build
+++ b/plugins/meson.build
@@ -461,7 +461,7 @@ if plugins_options['huawei']
plugins += {'plugin-huawei': {
'plugin': true,
'helper': {'sources': files('huawei/mm-modem-helpers-huawei.c'), 'include_directories': plugins_incs + [huawei_inc], 'c_args': common_c_args + ['-DMM_MODULE_NAME="huawei"']},
- 'module': {'sources': sources + enums_sources, 'include_directories': plugins_incs + [huawei_inc], 'c_args': common_c_args + ['-DMM_MODULE_NAME="huawei"']},
+ 'module': {'sources': sources + enums_sources + port_enums_sources, 'include_directories': plugins_incs + [huawei_inc], 'c_args': common_c_args + ['-DMM_MODULE_NAME="huawei"']},
'test': {'sources': files('huawei/tests/test-modem-helpers-huawei.c') + enums_sources, 'include_directories': huawei_inc, 'dependencies': libhelpers_dep},
}}
--- a/plugins/telit/mm-plugin-telit.c
+++ b/plugins/telit/mm-plugin-telit.c
@@ -21,7 +21,6 @@
#define _LIBMM_INSIDE_MM
#include <libmm-glib.h>
-#include "mm-port-enums-types.h"
#include "mm-log-object.h"
#include "mm-modem-helpers.h"
#include "mm-plugin-telit.h"
--- a/plugins/tplink/mm-plugin-tplink.c
+++ b/plugins/tplink/mm-plugin-tplink.c
@@ -19,7 +19,6 @@
#define _LIBMM_INSIDE_MM
#include <libmm-glib.h>
-#include "mm-port-enums-types.h"
#include "mm-log-object.h"
#include "mm-plugin-tplink.h"
#include "mm-broadband-modem.h"
--- a/src/meson.build
+++ b/src/meson.build
@@ -147,15 +147,15 @@ endif
enums_types = 'mm-port-enums-types'
-enums_sources = []
-enums_sources += gnome.mkenums(
+port_enums_sources = []
+port_enums_sources += gnome.mkenums(
enums_types + '.c',
sources: headers,
c_template: build_aux_dir / enums_types + '.c.template',
fhead: '#include "mm-port-enums-types.h"',
)
-enums_sources += gnome.mkenums(
+port_enums_sources += gnome.mkenums(
enums_types + '.h',
sources: headers,
h_template: build_aux_dir / enums_types + '.h.template',
@@ -165,13 +165,13 @@ enums_sources += gnome.mkenums(
libport = static_library(
'port',
- sources: sources + enums_sources,
+ sources: sources + port_enums_sources,
include_directories: top_inc,
dependencies: deps + private_deps,
)
libport_dep = declare_dependency(
- sources: enums_sources[1],
+ sources: port_enums_sources[1],
include_directories: '.',
dependencies: deps,
link_with: libport,

View file

@ -1,96 +0,0 @@
--- a/plugins/meson.build
+++ b/plugins/meson.build
@@ -88,7 +88,7 @@ if plugins_shared['icera']
plugins += {'shared-icera': {
'plugin': false,
'helper': {'sources': files('icera/mm-modem-helpers-icera.c'), 'include_directories': plugins_incs, 'c_args': common_c_args},
- 'module': {'sources': sources, 'include_directories': plugins_incs, 'c_args': common_c_args},
+ 'module': {'sources': sources + daemon_enums_sources, 'include_directories': plugins_incs, 'c_args': common_c_args},
'test': {'sources': files('icera/tests/test-modem-helpers-icera.c'), 'include_directories': plugins_incs + [icera_inc], 'dependencies': libhelpers_dep},
}}
endif
@@ -185,7 +185,7 @@ if plugins_shared['telit']
plugins += {'shared-telit': {
'plugin': false,
'helper': {'sources': files('telit/mm-modem-helpers-telit.c'), 'include_directories': plugins_incs, 'c_args': common_c_args},
- 'module': {'sources': sources, 'include_directories': plugins_incs + [telit_inc], 'c_args': common_c_args},
+ 'module': {'sources': sources + daemon_enums_sources, 'include_directories': plugins_incs + [telit_inc], 'c_args': common_c_args},
'test': {'sources': files('telit/tests/test-mm-modem-helpers-telit.c'), 'include_directories': telit_inc, 'dependencies': libmm_test_common_dep},
}}
endif
@@ -285,7 +285,7 @@ if plugins_options['cinterion']
plugins += {'plugin-cinterion': {
'plugin': true,
'helper': {'sources': files('cinterion/mm-modem-helpers-cinterion.c'), 'include_directories': plugins_incs, 'c_args': common_c_args},
- 'module': {'sources': sources, 'include_directories': plugins_incs, 'c_args': common_c_args},
+ 'module': {'sources': sources + daemon_enums_sources, 'include_directories': plugins_incs, 'c_args': common_c_args},
'test': {'sources': files('cinterion/tests/test-modem-helpers-cinterion.c'), 'include_directories': plugins_incs + [include_directories('cinterion')], 'dependencies': libport_dep},
}}
@@ -460,8 +460,8 @@ if plugins_options['huawei']
plugins += {'plugin-huawei': {
'plugin': true,
- 'helper': {'sources': files('huawei/mm-modem-helpers-huawei.c'), 'include_directories': plugins_incs + [huawei_inc], 'c_args': common_c_args + ['-DMM_MODULE_NAME="huawei"']},
- 'module': {'sources': sources + enums_sources + port_enums_sources, 'include_directories': plugins_incs + [huawei_inc], 'c_args': common_c_args + ['-DMM_MODULE_NAME="huawei"']},
+ 'helper': {'sources': files('huawei/mm-modem-helpers-huawei.c') + daemon_enums_sources, 'include_directories': plugins_incs + [huawei_inc], 'c_args': common_c_args + ['-DMM_MODULE_NAME="huawei"']},
+ 'module': {'sources': sources + enums_sources + port_enums_sources + daemon_enums_sources, 'include_directories': plugins_incs + [huawei_inc], 'c_args': common_c_args + ['-DMM_MODULE_NAME="huawei"']},
'test': {'sources': files('huawei/tests/test-modem-helpers-huawei.c') + enums_sources, 'include_directories': huawei_inc, 'dependencies': libhelpers_dep},
}}
@@ -534,7 +534,7 @@ if plugins_options['mbm']
plugins += {'plugin-ericsson-mbm': {
'plugin': true,
'helper': {'sources': files('mbm/mm-modem-helpers-mbm.c'), 'include_directories': plugins_incs, 'c_args': common_c_args + ['-DMM_MODULE_NAME="ericsson-mbm"']},
- 'module': {'sources': sources, 'include_directories': plugins_incs, 'c_args': common_c_args + ['-DMM_MODULE_NAME="ericsson-mbm"']},
+ 'module': {'sources': sources + daemon_enums_sources, 'include_directories': plugins_incs, 'c_args': common_c_args + ['-DMM_MODULE_NAME="ericsson-mbm"']},
'test': {'sources': files('mbm/tests/test-modem-helpers-mbm.c'), 'include_directories': plugins_incs + [include_directories('mbm')], 'dependencies': libhelpers_dep},
}}
@@ -644,7 +644,7 @@ if plugins_options['option-hso']
plugins += {'plugin-option-hso': {
'plugin': true,
- 'module': {'sources': sources, 'include_directories': plugins_incs, 'c_args': '-DMM_MODULE_NAME="option-hso"'},
+ 'module': {'sources': sources + daemon_enums_sources, 'include_directories': plugins_incs, 'c_args': '-DMM_MODULE_NAME="option-hso"'},
}}
endif
@@ -852,7 +852,7 @@ if plugins_options['ublox']
plugins += {'plugin-ublox': {
'plugin': true,
'helper': {'sources': files('ublox/mm-modem-helpers-ublox.c'), 'include_directories': plugins_incs, 'c_args': common_c_args},
- 'module': {'sources': sources, 'include_directories': plugins_incs + [ublox_inc], 'c_args': common_c_args},
+ 'module': {'sources': sources + daemon_enums_sources, 'include_directories': plugins_incs + [ublox_inc], 'c_args': common_c_args},
'test': {'sources': files('ublox/tests/test-modem-helpers-ublox.c'), 'include_directories': ublox_inc, 'dependencies': libmm_test_common_dep},
}}
--- a/src/meson.build
+++ b/src/meson.build
@@ -225,14 +225,15 @@ sources = files(
enums_types = 'mm-daemon-enums-types'
-sources += gnome.mkenums(
+daemon_enums_sources = []
+daemon_enums_sources += gnome.mkenums(
enums_types + '.c',
sources: headers,
c_template: build_aux_dir / enums_types + '.c.template',
fhead: '#include "mm-daemon-enums-types.h"',
)
-sources += gnome.mkenums(
+daemon_enums_sources += gnome.mkenums(
enums_types + '.h',
sources: headers,
h_template: build_aux_dir / enums_types + '.h.template',
@@ -296,7 +297,7 @@ endif
executable(
'ModemManager',
- sources: sources,
+ sources: sources + daemon_enums_sources,
include_directories: top_inc,
dependencies: deps,
c_args: c_args,