import ModemManager-1.10.8-1.el8

This commit is contained in:
CentOS Sources 2020-01-21 18:21:25 -05:00 committed by Stepan Oksanichenko
parent 34d6e43371
commit 857845d95b
4 changed files with 218 additions and 12 deletions

View File

@ -1 +1 @@
99939eee46f207491b8543021e218e23cff48409 SOURCES/ModemManager-1.10.0.tar.xz
fe7cd5772f30bd0a7139bd0fb6f584de1f636f39 SOURCES/ModemManager-1.10.8.tar.xz

2
.gitignore vendored
View File

@ -1 +1 @@
SOURCES/ModemManager-1.10.0.tar.xz
SOURCES/ModemManager-1.10.8.tar.xz

View File

@ -0,0 +1,185 @@
From fd1a26fc36df005d66627109875631264d2f8e19 Mon Sep 17 00:00:00 2001
From: Aleksander Morgado <aleksander@aleksander.es>
Date: Wed, 22 May 2019 23:20:30 +0200
Subject: [PATCH] plugin: ignore unwanted net ports
* For QMI modems, make sure we only grab QMI data ports (flag the
rest as ignored).
* For MBIM modems, make sure we only grab MBIM data ports (flag the
rest as ignored).
* For other plugins that use NET ports in their logic, make sure we
only grab non-QMI and non-MBIM data ports.
---
src/mm-plugin.c | 120 +++++++++++++++++++++++++++++++++++-------------
1 file changed, 89 insertions(+), 31 deletions(-)
diff --git a/src/mm-plugin.c b/src/mm-plugin.c
index 08fe2cd0..a19111ff 100644
--- a/src/mm-plugin.c
+++ b/src/mm-plugin.c
@@ -37,6 +37,13 @@
#include "mm-log.h"
#include "mm-daemon-enums-types.h"
+#if defined WITH_QMI
+# include "mm-broadband-modem-qmi.h"
+#endif
+#if defined WITH_MBIM
+# include "mm-broadband-modem-mbim.h"
+#endif
+
G_DEFINE_TYPE (MMPlugin, mm_plugin, G_TYPE_OBJECT)
/* Virtual port corresponding to the embedded modem */
@@ -920,9 +927,22 @@ mm_plugin_create_modem (MMPlugin *self,
/* Grab each port */
for (l = port_probes; l; l = g_list_next (l)) {
- GError *inner_error = NULL;
- MMPortProbe *probe = MM_PORT_PROBE (l->data);
- gboolean grabbed;
+ GError *inner_error = NULL;
+ MMPortProbe *probe;
+ gboolean grabbed = FALSE;
+ gboolean force_ignored = FALSE;
+ const gchar *subsys;
+ const gchar *name;
+ const gchar *driver;
+ MMPortType port_type;
+
+ probe = MM_PORT_PROBE (l->data);
+
+ subsys = mm_port_probe_get_port_subsys (probe);
+ name = mm_port_probe_get_port_name (probe);
+ port_type = mm_port_probe_get_port_type (probe);
+
+ driver = mm_kernel_device_get_driver (mm_port_probe_peek_port (probe));
/* If grabbing a port fails, just warn. We'll decide if the modem is
* valid or not when all ports get organized */
@@ -931,45 +951,82 @@ mm_plugin_create_modem (MMPlugin *self,
* probed and accepted by the generic plugin, which is overwritten
* by the specific one when needed. */
if (apply_subsystem_filter (self, mm_port_probe_peek_port (probe))) {
- grabbed = FALSE;
inner_error = g_error_new (MM_CORE_ERROR,
MM_CORE_ERROR_UNSUPPORTED,
"unsupported subsystem: '%s'",
- mm_port_probe_get_port_subsys (probe));
+ subsys);
+ goto next;
}
+
/* Ports that are explicitly blacklisted will be grabbed as ignored */
- else if (mm_port_probe_is_ignored (probe)) {
- mm_dbg ("(%s/%s): port is blacklisted",
- mm_port_probe_get_port_subsys (probe),
- mm_port_probe_get_port_name (probe));
- grabbed = mm_base_modem_grab_port (modem,
- mm_port_probe_peek_port (probe),
- MM_PORT_TYPE_IGNORED,
- MM_PORT_SERIAL_AT_FLAG_NONE,
- &inner_error);
+ if (mm_port_probe_is_ignored (probe)) {
+ mm_dbg ("(%s/%s): port is blacklisted", subsys, name);
+ force_ignored = TRUE;
+ goto grab_port;
}
-#if !defined WITH_QMI
- else if (mm_port_probe_get_port_type (probe) == MM_PORT_TYPE_NET &&
- !g_strcmp0 (mm_kernel_device_get_driver (mm_port_probe_peek_port (probe)), "qmi_wwan")) {
- /* Try to generically grab the port, but flagged as ignored */
- grabbed = mm_base_modem_grab_port (modem,
- mm_port_probe_peek_port (probe),
- MM_PORT_TYPE_IGNORED,
- MM_PORT_SERIAL_AT_FLAG_NONE,
- &inner_error);
+
+#if defined WITH_QMI
+ if (MM_IS_BROADBAND_MODEM_QMI (modem) &&
+ port_type == MM_PORT_TYPE_NET &&
+ g_strcmp0 (driver, "qmi_wwan") != 0) {
+ /* Non-QMI net ports are ignored in QMI modems */
+ mm_dbg ("(%s/%s): ignoring non-QMI net port in QMI modem", subsys, name);
+ force_ignored = TRUE;
+ goto grab_port;
+ }
+
+ if (!MM_IS_BROADBAND_MODEM_QMI (modem) &&
+ port_type == MM_PORT_TYPE_NET &&
+ g_strcmp0 (driver, "qmi_wwan") == 0) {
+ /* QMI net ports are ignored in non-QMI modems */
+ mm_dbg ("(%s/%s): ignoring QMI net port in non-QMI modem", subsys, name);
+ force_ignored = TRUE;
+ goto grab_port;
+ }
+#else
+ if (port_type == MM_PORT_TYPE_NET &&
+ g_strcmp0 (driver, "qmi_wwan") != 0) {
+ /* QMI net ports are ignored if QMI support not built */
+ mm_dbg ("(%s/%s): ignoring QMI net port as QMI support isn't available", subsys, name);
+ force_ignored = TRUE;
+ goto grab_port;
+ }
+#endif
+
+#if defined WITH_MBIM
+ if (MM_IS_BROADBAND_MODEM_MBIM (modem) &&
+ port_type == MM_PORT_TYPE_NET &&
+ g_strcmp0 (driver, "cdc_mbim") != 0) {
+ /* Non-MBIM net ports are ignored in MBIM modems */
+ mm_dbg ("(%s/%s): ignoring non-MBIM net port in MBIM modem", subsys, name);
+ force_ignored = TRUE;
+ goto grab_port;
+ }
+
+ if (!MM_IS_BROADBAND_MODEM_MBIM (modem) &&
+ port_type == MM_PORT_TYPE_NET &&
+ g_strcmp0 (driver, "cdc_mbim") == 0) {
+ /* MBIM net ports are ignored in non-MBIM modems */
+ mm_dbg ("(%s/%s): ignoring MBIM net port in non-MBIM modem", subsys, name);
+ force_ignored = TRUE;
+ goto grab_port;
+ }
+#else
+ if (port_type == MM_PORT_TYPE_NET &&
+ g_strcmp0 (driver, "cdc_mbim") == 0) {
+ mm_dbg ("(%s/%s): ignoring MBIM net port as MBIM support isn't available", subsys, name);
+ force_ignored = TRUE;
+ goto grab_port;
}
#endif
-#if !defined WITH_MBIM
- else if (mm_port_probe_get_port_type (probe) == MM_PORT_TYPE_NET &&
- !g_strcmp0 (mm_kernel_device_get_driver (mm_port_probe_peek_port (probe)), "cdc_mbim")) {
- /* Try to generically grab the port, but flagged as ignored */
+
+ grab_port:
+ if (force_ignored)
grabbed = mm_base_modem_grab_port (modem,
mm_port_probe_peek_port (probe),
MM_PORT_TYPE_IGNORED,
MM_PORT_SERIAL_AT_FLAG_NONE,
&inner_error);
- }
-#endif
else if (MM_PLUGIN_GET_CLASS (self)->grab_port)
grabbed = MM_PLUGIN_GET_CLASS (self)->grab_port (MM_PLUGIN (self),
modem,
@@ -981,10 +1038,11 @@ mm_plugin_create_modem (MMPlugin *self,
mm_port_probe_get_port_type (probe),
MM_PORT_SERIAL_AT_FLAG_NONE,
&inner_error);
+
+ next:
if (!grabbed) {
mm_warn ("Could not grab port (%s/%s): '%s'",
- mm_port_probe_get_port_subsys (MM_PORT_PROBE (l->data)),
- mm_port_probe_get_port_name (MM_PORT_PROBE (l->data)),
+ subsys, name,
inner_error ? inner_error->message : "unknown error");
g_clear_error (&inner_error);
}
--
2.21.0

View File

@ -6,21 +6,25 @@
Summary: Mobile broadband modem management service
Name: ModemManager
Version: 1.10.0
Version: 1.10.8
Release: 1%{?dist}
Source: https://www.freedesktop.org/software/ModemManager/%{name}-%{version}.tar.xz
Patch0: https://gitlab.freedesktop.org/mobile-broadband/ModemManager/commit/fd1a26fc36df.patch#/0001-plugin-ignore-unwanted-net-ports.patch
License: GPLv2+
Group: System Environment/Base
URL: http://www.freedesktop.org/wiki/Software/ModemManager/
Requires: glib2 >= %{glib2_version}
Requires: libqmi >= %{qmi_version}
Requires: libmbim >= %{mbim_version}
# For mbim-proxy and qmi-proxy
Requires: libmbim-utils
Requires: libqmi-utils
Requires: %{name}-glib%{?_isa} = %{version}-%{release}
# Don't allow older versions of these than what we built against,
# because they add new API w/o versioning it or bumping the SONAME
Conflicts: glib2%{?_isa} < %{glib2_version}
Conflicts: libqmi%{?_isa} < %{qmi_version}
Conflicts: libmbim%{?_isa} < %{mbim_version}
Requires(post): systemd
Requires(postun): systemd
Requires(preun): systemd
@ -29,14 +33,14 @@ BuildRequires: glib2-devel >= 2.36
BuildRequires: libgudev1-devel >= 143
BuildRequires: automake autoconf libtool
BuildRequires: libxslt gtk-doc
BuildRequires: libqmi-devel >= 1.22.0
BuildRequires: libqmi-devel >= 1.22.4
BuildRequires: libmbim-devel >= 1.18.0
BuildRequires: gobject-introspection-devel >= 1.38
BuildRequires: vala
BuildRequires: dbus
BuildRequires: systemd-devel >= 209
BuildRequires: gettext-devel >= 0.19.8
BuildRequires: dbus-daemon
BuildRequires: /usr/bin/dbus-daemon
%global __provides_exclude ^libmm-plugin-
@ -87,6 +91,7 @@ Vala bindings for ModemManager
%prep
%setup -q
%patch0 -p1
%build
# Regenerate configure, because the one that is shipped
@ -106,13 +111,13 @@ autoreconf -i --force
--with-polkit=no \
--with-dist-version=%{version}-%{release}
make %{?_smp_mflags}
%make_build
%check
make check
%install
make install DESTDIR=%{buildroot}
%make_install
rm -f %{buildroot}%{_libdir}/*.la
rm -f %{buildroot}%{_libdir}/%{name}/*.la
@ -130,19 +135,21 @@ touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
%postun
%if 0%{?rhel} && 0%{?rhel} <= 7
/sbin/ldconfig
if [ $1 -eq 0 ] ; then
touch --no-create %{_datadir}/icons/hicolor &>/dev/null
gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
fi
%endif
%systemd_postun
%systemd_postun ModemManager.service
%if 0%{?rhel} && 0%{?rhel} <= 7
%posttrans
gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
%endif
%ldconfig_scriptlets glib
%post glib -p /sbin/ldconfig
%postun glib -p /sbin/ldconfig
%files -f %{name}.lang
%doc COPYING README
@ -156,6 +163,7 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
%{_unitdir}/ModemManager.service
%{_datadir}/icons/hicolor/22x22/apps/*.png
%{_datadir}/bash-completion
%{_datadir}/ModemManager
%{_mandir}/man1/*
%{_mandir}/man8/*
@ -183,6 +191,19 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
%{_datadir}/vala/vapi/libmm-glib.*
%changelog
* Fri Nov 29 2019 Lubomir Rintel <lrintel@redhat.com> - 1.10.8-1
- Update to 1.10.8 release
* Wed Oct 16 2019 Lubomir Rintel <lkundrak@v3.sk> - 1.10.6-1
- Update to 1.10.6 release
* Wed Jul 10 2019 Lubomir Rintel <lkundrak@v3.sk> - 1.10.4-1
- Update to 1.10.2 release (rh #1543498)
* Fri Jun 14 2019 Lubomir Rintel <lkundrak@v3.sk> - 1.10.2-1
- Update to 1.10.2 release (rh #1543498)
- Don't grab cdc_ether devices on Sierra QMI modems (rh #1712031)
* Mon May 06 2019 Lubomir Rintel <lkundrak@v3.sk> - 1.10.0-1
- Update to 1.10.0 release