This removes PPP entirely from consideration in ModemManager. This has 2 patches - one for the OpenWrt build (against the 21.02 release(ish)) and MM itself (against 1.18.4).

This is definitely incomplete. In particular, the MM scripts still reference pppd. And ppp (pppoe in particular) is somewhat sewn into luci. My goal
here would be to completely remove ppp(d) from the OpenWrt build if possible.

Also, I think some of the plugins rely on PPP, turning it off for some will
definitely break.  However, this suffices for my immediate needs. Obviously
the plugin selection needs to be expanded in Config.in.

Regards.

diff --git a/feeds-awc/packages/net/modemmanager/Makefile b/feeds-awc/packages/net/modemmanager/Makefile
index 498e0fec4c..bed8133501 100644
--- a/feeds-awc/packages/net/modemmanager/Makefile
+++ b/feeds-awc/packages/net/modemmanager/Makefile
@@ -42,7 +42,7 @@ define Package/modemmanager
 	$(INTL_DEPENDS) \
 	+glib2 \
 	+dbus \
-	+ppp \
+	+CONFIG_MODEMMANAGER_WITH_PPP:ppp \
 	+MODEMMANAGER_WITH_MBIM:libmbim \
 	+MODEMMANAGER_WITH_QMI:libqmi
 endef
@@ -58,9 +58,7 @@ CONFIGURE_ARGS += \
 	--without-udev \
 	--without-systemdsystemunitdir \
 	--disable-rpath \
-	--disable-gtk-doc \
-	--enable-all-plugins=no \
-	--enable-plugin-quectel
+	--disable-gtk-doc
 
 ifeq ($(CONFIG_MODEMMANAGER_WITH_AT_COMMAND_VIA_DBUS),y)
   CONFIGURE_ARGS += --with-at-command-via-dbus
@@ -78,6 +76,21 @@ else
   CONFIGURE_ARGS += --without-qmi
 endif
 
+ifndef CONFIG_MODEMMANAGER_WITH_PPP
+  CONFIGURE_ARGS += --disable-ppp
+endif
+
+ifdef CONFIG_MODEMMANAGER_WITH_PLUGIN_ALL
+  CONFIGURE_ARGS += --enable-all-plugins=yes
+else
+  CONFIGURE_ARGS += --enable-all-plugins=no
+endif
+
+ifdef CONFIG_MODEMMANAGER_WITH_PLUGIN_QUECTEL
+  CONFIGURE_ARGS += --enable-plugin-quectel
+endif
+
+
 define Build/Prepare
 	$(call Build/Prepare/Default)
 	(cd $(PKG_BUILD_DIR) && NOCONFIGURE=1 ./autogen.sh) 
diff --git a/feeds-awc/packages/net/modemmanager/Config.in b/feeds-awc/packages/net/modemmanager/Config.in
index a5d34cd717..9602833d70 100644
--- a/feeds-awc/packages/net/modemmanager/Config.in
+++ b/feeds-awc/packages/net/modemmanager/Config.in
@@ -19,11 +19,23 @@ depends on PACKAGE_modemmanager
 		help
 			Compile ModemManager allowing AT commands without debug flag
 
-	config MODEMMANAGER_WITH_NO_PPP
-		bool "Exclude PPP support"
-		default n
+	config MODEMMANAGER_WITH_PPP
+		bool "Include PPP support"
+		default y
 		help
-		  Compile ModemManager without PPP support       
+		  Compile ModemManager with PPP support       
             
+   	config MODEMMANAGER_WITH_PLUGIN_ALL
+		bool "Include all plugins"
+		default y
+		help
+		  Compile all plugins       
             
+        menu "ModemManager Plugins"
+            config MODEMMANAGER_WITH_PLUGIN_QUECTEL
+            bool "Quectel Modem Support"
+            default y
+            depends on !MODEMMANAGER_WITH_PLUGIN_ALL
+        endmenu
+             
 endmenu
--- a/configure.ac	2022-01-17 09:25:41.729736671 -0500
+++ b/configure.ac	2022-01-17 09:28:49.502051780 -0500
@@ -424,6 +424,19 @@
         ;;
 esac
 
+AC_ARG_WITH(ppp, AS_HELP_STRING([--without-ppp], [Build without PPP support]), [], [with_ppp=yes])
+AM_CONDITIONAL(WITH_PPP, test "x$with_ppp" = "xyes")
+case $with_ppp in
+    yes)
+	AC_DEFINE(WITH_QMI, 1, [Define if you want PPP support])
+	;;
+    *)
+        with_ppp=no
+        ;;
+esac
+
+
+
 dnl-----------------------------------------------------------------------------
 dnl QRTR support (both as libqrtr-glib and libqmi-glib apis)
 dnl
--- a/config.h.in	2022-01-14 11:43:57.475591025 -0500
+++ b/config.h.in	2022-01-17 09:38:11.560442550 -0500
@@ -240,6 +240,9 @@
 /* Define if you want QMI support */
 #undef WITH_QMI
 
+/* Define if you want PPP support */
+#undef WITH_PPP
+
 /* Define if you want QRTR support */
 #undef WITH_QRTR
 
--- a/src/mm-base-modem.c	2021-11-26 03:38:54.000000000 -0500
+++ b/src/mm-base-modem.c	2022-01-17 09:47:59.022589306 -0500
@@ -387,9 +387,11 @@
             } else if (mm_kernel_device_get_property_as_boolean (kernel_device, ID_MM_PORT_TYPE_AT_SECONDARY)) {
                 mm_obj_dbg (port, "AT port flagged as secondary");
                 at_pflags = MM_PORT_SERIAL_AT_FLAG_SECONDARY;
+#ifdef WITH_PPP
             } else if (mm_kernel_device_get_property_as_boolean (kernel_device, ID_MM_PORT_TYPE_AT_PPP)) {
                 mm_obj_dbg (port, "AT port flagged as PPP");
                 at_pflags = MM_PORT_SERIAL_AT_FLAG_PPP;
+#endif
             }
         }
         /* The plugin may specify NONE_NO_GENERIC to avoid the generic
@@ -1316,12 +1318,14 @@
                 }
             }
 
+#ifdef WITH_PPP
             if (flags & MM_PORT_SERIAL_AT_FLAG_PPP) {
                 if (!data_at_primary)
                     data_at_primary = MM_PORT_SERIAL_AT (candidate);
                 else
                     data_at = g_list_append (data_at, candidate);
             }
+#endif
 
             /* Explicitly flagged secondary ports trump NONE ports for secondary */
             if (flags & MM_PORT_SERIAL_AT_FLAG_SECONDARY) {
@@ -1468,7 +1473,11 @@
         mm_port_serial_at_set_flags (secondary, MM_PORT_SERIAL_AT_FLAG_SECONDARY);
     if (data_at_primary) {
         flags = mm_port_serial_at_get_flags (data_at_primary);
-        mm_port_serial_at_set_flags (data_at_primary, flags | MM_PORT_SERIAL_AT_FLAG_PPP);
+        mm_port_serial_at_set_flags (data_at_primary, flags
+#ifdef WITH_PPP
+        | MM_PORT_SERIAL_AT_FLAG_PPP
+#endif
+        );
     }
 
     /* sort ports by name */
--- a/src/mm-port-serial-at.c	2021-09-17 09:11:50.000000000 -0400
+++ b/src/mm-port-serial-at.c	2022-01-17 09:47:42.214537693 -0500
@@ -477,7 +477,9 @@
     /* MM_PORT_SERIAL_AT_FLAG_NONE_NO_GENERIC is not expected */
     g_return_if_fail (flags <= (MM_PORT_SERIAL_AT_FLAG_PRIMARY |
                                 MM_PORT_SERIAL_AT_FLAG_SECONDARY |
+#ifdef WITH_PPP
                                 MM_PORT_SERIAL_AT_FLAG_PPP |
+#endif
                                 MM_PORT_SERIAL_AT_FLAG_GPS_CONTROL));
 
     self->priv->flags = flags;
--- a/src/mm-broadband-bearer.c	2022-01-17 11:08:06.117783177 -0500
+++ b/src/mm-broadband-bearer.c	2022-01-17 11:09:32.294015077 -0500
@@ -219,10 +219,12 @@
     /* Keep port open during connection */
     ctx->close_data_on_exit = FALSE;
 
+#ifdef WITH_PPP
     /* Generic CDMA connections are done over PPP always */
     g_assert (MM_IS_PORT_SERIAL_AT (ctx->data));
     config = mm_bearer_ip_config_new ();
     mm_bearer_ip_config_set_method (config, MM_BEARER_IP_METHOD_PPP);
+#endif
 
     /* Assume only IPv4 is given */
     g_task_return_pointer (
--- a/src/mm-base-bearer.c	2022-01-17 11:07:54.961753033 -0500
+++ b/src/mm-base-bearer.c	2022-01-17 11:08:45.977890644 -0500
@@ -541,6 +541,7 @@
         MM_GDBUS_BEARER (self),
         mm_bearer_ip_config_get_dictionary (ipv6_config));
 
+#ifdef WITH_PPP
     /* If PPP is involved in the requested IP config, we must ignore
      * all disconnection reports found via CGACT? polling or CGEV URCs.
      * In this case, upper layers should always explicitly disconnect
@@ -550,6 +551,7 @@
         mm_obj_dbg (self, "PPP is required for connection, will ignore disconnection reports");
         self->priv->ignore_disconnection_reports = TRUE;
     }
+#endif
 
     /* Update the property value */
     self->priv->status = MM_BEARER_STATUS_CONNECTED;

Reply via email to