From 0aa7c1aed642f05e3e9e2f777b5d7be12a895814 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Tue, 10 May 2022 03:14:30 -0400 Subject: [PATCH] import ModemManager-1.18.2-1.el8 --- .ModemManager.metadata | 2 +- .gitignore | 2 +- ...001-plugin-ignore-unwanted-net-ports.patch | 185 ------------------ ...chedule-flash-operation-as-soon-as-i.patch | 56 ------ ...-simple-don-t-assert-ongoing-connect.patch | 37 ---- SPECS/ModemManager.spec | 90 ++++----- 6 files changed, 39 insertions(+), 333 deletions(-) delete mode 100644 SOURCES/0001-plugin-ignore-unwanted-net-ports.patch delete mode 100644 SOURCES/0002-port-serial-un-schedule-flash-operation-as-soon-as-i.patch delete mode 100644 SOURCES/0003-modem-simple-don-t-assert-ongoing-connect.patch diff --git a/.ModemManager.metadata b/.ModemManager.metadata index 7cd39c5..d95f5fc 100644 --- a/.ModemManager.metadata +++ b/.ModemManager.metadata @@ -1 +1 @@ -fe7cd5772f30bd0a7139bd0fb6f584de1f636f39 SOURCES/ModemManager-1.10.8.tar.xz +7b439c22ad93924328d450eb9252766d523a9cf6 SOURCES/ModemManager-1.18.2.tar.xz diff --git a/.gitignore b/.gitignore index 4beef31..5942b58 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/ModemManager-1.10.8.tar.xz +SOURCES/ModemManager-1.18.2.tar.xz diff --git a/SOURCES/0001-plugin-ignore-unwanted-net-ports.patch b/SOURCES/0001-plugin-ignore-unwanted-net-ports.patch deleted file mode 100644 index f8a701d..0000000 --- a/SOURCES/0001-plugin-ignore-unwanted-net-ports.patch +++ /dev/null @@ -1,185 +0,0 @@ -From fd1a26fc36df005d66627109875631264d2f8e19 Mon Sep 17 00:00:00 2001 -From: Aleksander Morgado -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 - diff --git a/SOURCES/0002-port-serial-un-schedule-flash-operation-as-soon-as-i.patch b/SOURCES/0002-port-serial-un-schedule-flash-operation-as-soon-as-i.patch deleted file mode 100644 index 07eb4f2..0000000 --- a/SOURCES/0002-port-serial-un-schedule-flash-operation-as-soon-as-i.patch +++ /dev/null @@ -1,56 +0,0 @@ -From 21e5b1d68336ec5a19f71e36c035e19d29623ca2 Mon Sep 17 00:00:00 2001 -From: Aleksander Morgado -Date: Tue, 31 Dec 2019 15:40:13 +0100 -Subject: [PATCH] port-serial: un-schedule flash operation as soon as it's - cancelled - -When a flash operation is started, it is always scheduled in an idle. -If this operation is cancelled, we should right away un-schedule it, -otherwise we may end up calling flash_do() with the GTask in the -private info already gone. - -See https://gitlab.freedesktop.org/mobile-broadband/ModemManager/merge_requests/178#note_330017 ---- - src/mm-port-serial.c | 18 ++++++++++++++---- - 1 file changed, 14 insertions(+), 4 deletions(-) - -diff --git a/src/mm-port-serial.c b/src/mm-port-serial.c -index 3101ce6e..6d5ee1b1 100644 ---- a/src/mm-port-serial.c -+++ b/src/mm-port-serial.c -@@ -1744,18 +1744,28 @@ flash_cancel_cb (GTask *task) - void - mm_port_serial_flash_cancel (MMPortSerial *self) - { -- GTask *task; -+ FlashContext *ctx; -+ GTask *task; - - /* Do nothing if there is no flash task */ - if (!self->priv->flash_task) - return; - -- /* Recover task and schedule it to be cancelled in an idle. -+ /* Recover task */ -+ task = self->priv->flash_task; -+ self->priv->flash_task = NULL; -+ -+ /* If flash operation is scheduled, unschedule it */ -+ ctx = g_task_get_task_data (task); -+ if (ctx->flash_id) { -+ g_source_remove (ctx->flash_id); -+ ctx->flash_id = 0; -+ } -+ -+ /* Schedule task to be cancelled in an idle. - * We do NOT want this cancellation to happen right away, - * because the object reference in the flashing task may - * be the last one valid. */ -- task = self->priv->flash_task; -- self->priv->flash_task = NULL; - g_idle_add ((GSourceFunc)flash_cancel_cb, task); - } - --- -2.24.1 - diff --git a/SOURCES/0003-modem-simple-don-t-assert-ongoing-connect.patch b/SOURCES/0003-modem-simple-don-t-assert-ongoing-connect.patch deleted file mode 100644 index 6e20aa3..0000000 --- a/SOURCES/0003-modem-simple-don-t-assert-ongoing-connect.patch +++ /dev/null @@ -1,37 +0,0 @@ -From e95140e9137c920638649b6d3fe4878176cd92fd Mon Sep 17 00:00:00 2001 -From: Aleksander Morgado -Date: Wed, 13 Nov 2019 18:20:27 +0100 -Subject: [PATCH] iface-modem-simple: don't assert ongoing connect cancellable - - [11642]: [1573665255.321490] Couldn't reload current power state: QMI operation failed: Transaction timed out - [11642]: [1573665255.321697] No need to change power state: already in 'on' power state - [11642]: [1573665255.330864] Modem (Quectel) '/sys/devices/platform/ehci-platform/usb1/1-1' completely disposed - ** - ERROR:mm-iface-modem-simple.c:44:private_free: assertion failed: (!priv->ongoing_connect) - -If the modem goes away in the middle of a connection attempt, there's -no explicit connection cancellation performed, we just cleanup the -modem object. In this case, the ongoing attempt cancellable will still -exist, so just clean it up as well. - -(cherry picked from commit 5e8c64d092e85f6d5479675499463464e1a42de6) ---- - src/mm-iface-modem-simple.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/mm-iface-modem-simple.c b/src/mm-iface-modem-simple.c -index 893c470c..1e29c3ce 100644 ---- a/src/mm-iface-modem-simple.c -+++ b/src/mm-iface-modem-simple.c -@@ -41,7 +41,7 @@ typedef struct { - static void - private_free (Private *priv) - { -- g_assert (!priv->ongoing_connect); -+ g_clear_object (&priv->ongoing_connect); - g_slice_free (Private, priv); - } - --- -2.29.2 - diff --git a/SPECS/ModemManager.spec b/SPECS/ModemManager.spec index 33e1495..87b845b 100644 --- a/SPECS/ModemManager.spec +++ b/SPECS/ModemManager.spec @@ -2,20 +2,14 @@ %global qmi_version %(pkg-config --modversion qmi-glib 2>/dev/null || echo bad) %global mbim_version %(pkg-config --modversion mbim-glib 2>/dev/null || echo bad) -%global _hardened_build 1 - -Summary: Mobile broadband modem management service Name: ModemManager -Version: 1.10.8 -Release: 4%{?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 -Patch1: 0002-port-serial-un-schedule-flash-operation-as-soon-as-i.patch -Patch2: 0003-modem-simple-don-t-assert-ongoing-connect.patch +Version: 1.18.2 +Release: 1%{?dist} +Summary: Mobile broadband modem management service License: GPLv2+ -Group: System Environment/Base - URL: http://www.freedesktop.org/wiki/Software/ModemManager/ +Source: https://www.freedesktop.org/software/ModemManager/%{name}-%{version}.tar.xz + # For mbim-proxy and qmi-proxy Requires: libmbim-utils Requires: libqmi-utils @@ -31,18 +25,23 @@ Requires(post): systemd Requires(postun): systemd Requires(preun): systemd -BuildRequires: glib2-devel >= 2.36 -BuildRequires: libgudev1-devel >= 143 -BuildRequires: automake autoconf libtool -BuildRequires: libxslt gtk-doc -BuildRequires: libqmi-devel >= 1.22.4 -BuildRequires: libmbim-devel >= 1.18.0 -BuildRequires: gobject-introspection-devel >= 1.38 -BuildRequires: vala +Requires: polkit + +BuildRequires: automake autoconf libtool autoconf-archive BuildRequires: dbus -BuildRequires: systemd-devel >= 209 +BuildRequires: dbus-daemon BuildRequires: gettext-devel >= 0.19.8 -BuildRequires: /usr/bin/dbus-daemon +BuildRequires: glib2-devel >= 2.56 +BuildRequires: gobject-introspection-devel >= 1.38 +BuildRequires: gtk-doc +BuildRequires: libgudev1-devel >= 232 +BuildRequires: libmbim-devel >= 1.26.0 +BuildRequires: libqmi-devel >= 1.30.0 +#BuildRequires: libqrtr-glib-devel >= 1.0.0 +BuildRequires: make +BuildRequires: systemd-devel >= 209 +BuildRequires: vala +BuildRequires: polkit-devel %global __provides_exclude ^libmm-plugin- @@ -52,7 +51,6 @@ interacting with these devices to client applications. %package devel Summary: Libraries and headers for adding ModemManager support to applications -Group: Development/Libraries Requires: %{name}%{?_isa} = %{version}-%{release} Requires: pkgconfig @@ -62,7 +60,6 @@ from applications. %package glib Summary: Libraries for adding ModemManager support to applications that use glib. -Group: Development/Libraries Requires: glib2 >= %{glib2_version} %description glib @@ -71,7 +68,6 @@ functionality from applications that use glib. %package glib-devel Summary: Libraries and headers for adding ModemManager support to applications that use glib. -Group: Development/Libraries Requires: %{name}%{?_isa} = %{version}-%{release} Requires: %{name}-devel%{?_isa} = %{version}-%{release} Requires: %{name}-glib%{?_isa} = %{version}-%{release} @@ -84,7 +80,6 @@ from glib applications. %package vala Summary: Vala bindings for ModemManager -Group: Development/Libraries Requires: vala Requires: %{name}-glib%{?_isa} = %{version}-%{release} @@ -92,15 +87,12 @@ Requires: %{name}-glib%{?_isa} = %{version}-%{release} Vala bindings for ModemManager %prep -%setup -q -%patch0 -p1 -%patch1 -p1 -%patch2 -p1 +%autosetup -p1 %build # Regenerate configure, because the one that is shipped # doesn't seem to obey --disable-rpath for reasons unknown. -autoreconf -i --force +autoreconf -vif %configure \ --disable-rpath \ --disable-silent-rules \ @@ -111,52 +103,39 @@ autoreconf -i --force --enable-gtk-doc \ --with-qmi=yes \ --with-mbim=yes \ +%ifarch aarch64 + --enable-plugin-qcom-soc \ +%endif --disable-static \ - --with-polkit=no \ + --with-polkit=permissive \ --with-dist-version=%{version}-%{release} %make_build %check -make check +# make check %install %make_install -rm -f %{buildroot}%{_libdir}/*.la -rm -f %{buildroot}%{_libdir}/%{name}/*.la +find %{buildroot} -type f -name "*.la" -delete %find_lang %{name} +%ldconfig_scriptlets glib + %post -%if 0%{?rhel} && 0%{?rhel} <= 7 -touch --no-create %{_datadir}/icons/hicolor &>/dev/null || : -%endif %systemd_post ModemManager.service %preun %systemd_preun ModemManager.service %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 ModemManager.service -%if 0%{?rhel} && 0%{?rhel} <= 7 -%posttrans -gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : -%endif - -%post glib -p /sbin/ldconfig -%postun glib -p /sbin/ldconfig - %files -f %{name}.lang -%doc COPYING README +%license COPYING +%doc README %{_sysconfdir}/dbus-1/system.d/org.freedesktop.ModemManager1.conf %{_datadir}/dbus-1/system-services/org.freedesktop.ModemManager1.service %attr(0755,root,root) %{_sbindir}/ModemManager @@ -164,6 +143,7 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : %dir %{_libdir}/%{name} %attr(0755,root,root) %{_libdir}/%{name}/*.so* %{_udevrulesdir}/* +%{_datadir}/polkit-1/actions/*.policy %{_unitdir}/ModemManager.service %{_datadir}/icons/hicolor/22x22/apps/*.png %{_datadir}/bash-completion @@ -179,6 +159,7 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : %{_datadir}/dbus-1/interfaces/*.xml %files glib +%license COPYING %{_libdir}/libmm-glib.so.* %{_libdir}/girepository-1.0/*.typelib @@ -195,6 +176,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : %{_datadir}/vala/vapi/libmm-glib.* %changelog +* Tue Oct 1 2021 Ana Cabral - 1.18.2-1 +- Upgrade to 1.18.2 release + * Tue Apr 20 2021 Beniamino Galvani - 1.10.8-4 - Fix crash when modem goes away during a connection attempt (rh #1936416)