diff options
| author | Michael Biebl <biebl@debian.org> | 2018-04-23 18:55:26 +0200 |
|---|---|---|
| committer | Michael Biebl <biebl@debian.org> | 2018-04-23 19:48:55 +0200 |
| commit | 28153a7e4791cb68375e359cefb97ae6924f7c5e (patch) | |
| tree | 1768f191489e61c82e4b739b5529e38446193ba1 | |
| parent | 27b1d2cfa3352a59a87a0b4060021a1cb06de369 (diff) | |
Rebase patches
5 files changed, 26 insertions, 344 deletions
diff --git a/debian/patches/Don-t-make-NetworkManager-D-Bus-activatable.patch b/debian/patches/Don-t-make-NetworkManager-D-Bus-activatable.patch index 694b05b5..70f702d1 100644 --- a/debian/patches/Don-t-make-NetworkManager-D-Bus-activatable.patch +++ b/debian/patches/Don-t-make-NetworkManager-D-Bus-activatable.patch @@ -10,10 +10,10 @@ to be autostarted by a client request. 2 files changed, 6 deletions(-) diff --git a/Makefile.am b/Makefile.am -index 639921d..2ddc7bc 100644 +index b575616..6728fbd 100644 --- a/Makefile.am +++ b/Makefile.am -@@ -3689,11 +3689,6 @@ endif +@@ -3794,11 +3794,6 @@ endif data/NetworkManager-dispatcher.service: $(srcdir)/data/NetworkManager-dispatcher.service.in $(AM_V_GEN) $(data_edit) $< >$@ @@ -26,13 +26,14 @@ index 639921d..2ddc7bc 100644 examples_DATA += data/server.conf diff --git a/data/NetworkManager.service.in b/data/NetworkManager.service.in -index 95d58f9..1502b89 100644 +index 2692935..ff90456 100644 --- a/data/NetworkManager.service.in +++ b/data/NetworkManager.service.in -@@ -24,6 +24,5 @@ ProtectHome=read-only +@@ -24,7 +24,6 @@ ProtectHome=read-only [Install] WantedBy=multi-user.target -Alias=dbus-org.freedesktop.NetworkManager.service Also=NetworkManager-dispatcher.service + # We want to enable NetworkManager-wait-online.service whenever this service diff --git a/debian/patches/Fix-arping-path.patch b/debian/patches/Fix-arping-path.patch deleted file mode 100644 index f56e3d8f..00000000 --- a/debian/patches/Fix-arping-path.patch +++ /dev/null @@ -1,38 +0,0 @@ -From: Laurent Bigonville <bigon@bigon.be> -Date: Mon, 27 Oct 2014 11:08:02 +0100 -Subject: Fix arping path - -Debian provides two arping implementations: -/usr/sbin/arping, shipped by the arping package, -/usr/bin/arping, shipped by the iputils-arping package. - -They aren't completely command line compatible, so we choose the one -which upstream (Fedora) is using, i.e. iputils-arping. - -Closes: #755039 ---- - src/devices/nm-arping-manager.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/src/devices/nm-arping-manager.c b/src/devices/nm-arping-manager.c -index 51f80e0..3564acc 100644 ---- a/src/devices/nm-arping-manager.c -+++ b/src/devices/nm-arping-manager.c -@@ -223,7 +223,7 @@ nm_arping_manager_start_probe (NMArpingManager *self, guint timeout, GError **er - - priv->completed = 0; - -- argv[0] = nm_utils_find_helper ("arping", NULL, NULL); -+ argv[0] = nm_utils_find_helper ("arping", "/usr/bin/arping", NULL); - if (!argv[0]) { - g_set_error_literal (error, NM_DEVICE_ERROR, NM_DEVICE_ERROR_FAILED, - "arping could not be found"); -@@ -343,7 +343,7 @@ send_announcements (NMArpingManager *self, const char *mode_arg) - return; - } - -- argv[0] = nm_utils_find_helper ("arping", NULL, NULL); -+ argv[0] = nm_utils_find_helper ("arping", "/usr/bin/arping", NULL); - if (!argv[0]) { - _LOGW ("arping could not be found; no ARPs will be sent"); - return; diff --git a/debian/patches/Force-online-state-with-unmanaged-devices.patch b/debian/patches/Force-online-state-with-unmanaged-devices.patch index 508afede..b9aced11 100644 --- a/debian/patches/Force-online-state-with-unmanaged-devices.patch +++ b/debian/patches/Force-online-state-with-unmanaged-devices.patch @@ -8,23 +8,23 @@ online state to CONNECTED. Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=512286 --- - src/nm-manager.c | 117 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ - 1 file changed, 117 insertions(+) + src/nm-manager.c | 115 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 115 insertions(+) diff --git a/src/nm-manager.c b/src/nm-manager.c -index 8391dbf..e60b6c6 100644 +index 1ccfad8..1e99a4e 100644 --- a/src/nm-manager.c +++ b/src/nm-manager.c -@@ -62,6 +62,8 @@ - #include "introspection/org.freedesktop.NetworkManager.h" - #include "introspection/org.freedesktop.NetworkManager.Device.h" +@@ -60,6 +60,8 @@ + #include "nm-dispatcher.h" + #include "NetworkManagerUtils.h" +#define IFUPDOWN_STATE_FILE "/run/network/ifstate" + /*****************************************************************************/ typedef struct { -@@ -169,6 +171,10 @@ typedef struct { +@@ -164,6 +166,10 @@ typedef struct { GFileMonitor *fw_monitor; guint fw_changed_id; @@ -35,24 +35,22 @@ index 8391dbf..e60b6c6 100644 guint timestamp_update_id; guint devices_inited_id; -@@ -1124,6 +1130,29 @@ find_best_device_state (NMManager *manager) +@@ -1206,6 +1212,27 @@ find_best_device_state (NMManager *manager) return best_state; } +static NMState -+find_unmanaged_state (NMManager *manager, NMState current_state) ++find_unmanaged_state (NMManager *self, NMState current_state) +{ -+ NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (manager); ++ NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self); + NMState new_state = current_state; -+ GSList *iter; -+ -+ for (iter = priv->devices; iter; iter = iter->next) { -+ NMDevice *dev = NM_DEVICE (iter->data); -+ NMDeviceState state = nm_device_get_state (dev); ++ NMDevice *device; + ++ c_list_for_each_entry (device, &priv->devices_lst_head, devices_lst) { ++ NMDeviceState state = nm_device_get_state (device); + + if (state == NM_DEVICE_STATE_UNMANAGED) { -+ const char *iface = nm_device_get_ip_iface (dev); ++ const char *iface = nm_device_get_ip_iface (device); + if (priv->ifstate_force_online) { + new_state = NM_STATE_CONNECTED_GLOBAL; + nm_log_dbg (LOGD_CORE, "Unmanaged device found: %s; state CONNECTED forced.", iface); @@ -65,17 +63,17 @@ index 8391dbf..e60b6c6 100644 static void nm_manager_update_metered (NMManager *self) { -@@ -1162,6 +1191,9 @@ nm_manager_update_state (NMManager *manager) +@@ -1244,6 +1271,9 @@ nm_manager_update_state (NMManager *self) else - new_state = find_best_device_state (manager); + new_state = find_best_device_state (self); + if (new_state != NM_STATE_CONNECTED_GLOBAL) -+ new_state = find_unmanaged_state (manager, new_state); ++ new_state = find_unmanaged_state (self, new_state); + if ( new_state >= NM_STATE_CONNECTED_LOCAL && priv->connectivity_state == NM_CONNECTIVITY_FULL) { new_state = NM_STATE_CONNECTED_GLOBAL; -@@ -5421,6 +5453,62 @@ impl_manager_check_connectivity (NMManager *self, +@@ -5640,6 +5670,62 @@ impl_manager_check_connectivity (NMDBusObject *obj, nm_auth_chain_add_call (chain, NM_AUTH_PERMISSION_NETWORK_CONTROL, TRUE); } @@ -138,7 +136,7 @@ index 8391dbf..e60b6c6 100644 static void start_factory (NMDeviceFactory *factory, gpointer user_data) { -@@ -5572,6 +5660,9 @@ nm_manager_start (NMManager *self, GError **error) +@@ -5790,6 +5876,9 @@ nm_manager_start (NMManager *self, GError **error) nm_clear_g_source (&priv->devices_inited_id); priv->devices_inited_id = g_idle_add_full (G_PRIORITY_LOW + 10, devices_inited_cb, self, NULL); @@ -148,7 +146,7 @@ index 8391dbf..e60b6c6 100644 return TRUE; } -@@ -6567,6 +6658,22 @@ nm_manager_init (NMManager *self) +@@ -6637,6 +6726,22 @@ nm_manager_init (NMManager *self) KERNEL_FIRMWARE_DIR); } @@ -171,7 +169,7 @@ index 8391dbf..e60b6c6 100644 /* Update timestamps in active connections */ priv->timestamp_update_id = g_timeout_add_seconds (300, (GSourceFunc) periodic_update_active_connection_timestamps, self); -@@ -6849,6 +6956,16 @@ dispose (GObject *object) +@@ -6910,6 +7015,16 @@ dispose (GObject *object) g_clear_object (&priv->fw_monitor); } diff --git a/debian/patches/libnm-register-empty-NMClient-and-NetworkManager-when-loa.patch b/debian/patches/libnm-register-empty-NMClient-and-NetworkManager-when-loa.patch deleted file mode 100644 index 7e520d91..00000000 --- a/debian/patches/libnm-register-empty-NMClient-and-NetworkManager-when-loa.patch +++ /dev/null @@ -1,277 +0,0 @@ -From: Lubomir Rintel <lkundrak@v3.sk> -Date: Sat, 4 Nov 2017 20:41:45 +0100 -Subject: libnm: register empty NMClient and NetworkManager when loading libnm - with GIR - -Register empty "NMClient" and "NetworkManager" GIR modules as soon as libnm is -loaded witch gnome-introspection. This prevents the real modules from being -loaded because they would in turn load libnm-glib and abort() and crash. - -In particular this prevents the GNOME shell from crashing with -libnm-glib abort and allows gracefully disabling the extensions which -use the obsolete library. - -Test: - - $ cat test.js - const NM = imports.gi.NM; - print (NM.SecretAgentGetSecretsFlags.ALLOW_INTERACTION); - - const NMClient = imports.gi.NMClient; - print (NMClient.SecretAgentGetSecretsFlags.ALLOW_INTERACTION); - -Before: - - $ gjs test.js - 1 - - (gjs:16253): libnm-util-ERROR **: libnm symbols detected; Mixing libnm with libnm-util/libnm-glib is not supported - Trace/breakpoint trap (core dumped) - $ - -After: - - $ gjs test.js - 1 - Gjs-Message: JS WARNING: [test.js 5]: reference to undefined property "SecretAgentGetSecretsFlags" - - (gjs:16228): Gjs-WARNING **: JS ERROR: TypeError: NMClient.SecretAgentGetSecretsFlags is undefined - @test.js:5:1 - - JS_EvaluateScript() failed - -(cherry picked from commit 4d1f090aedf05c0e2955d431638e311d1e18a52f) ---- - Makefile.am | 18 +++++++ - configure.ac | 20 ++++++-- - libnm/fake-typelib/NMClient.gir | 9 ++++ - libnm/fake-typelib/NetworkManager.gir | 10 ++++ - libnm/fake-typelib/typelibs.gresource.xml | 7 +++ - libnm/nm-libnm-utils.c | 82 +++++++++++++++++++++++++++++++ - 6 files changed, 143 insertions(+), 3 deletions(-) - create mode 100644 libnm/fake-typelib/NMClient.gir - create mode 100644 libnm/fake-typelib/NetworkManager.gir - create mode 100644 libnm/fake-typelib/typelibs.gresource.xml - -diff --git a/Makefile.am b/Makefile.am -index 2ddc7bc..a741c6e 100644 ---- a/Makefile.am -+++ b/Makefile.am -@@ -858,6 +858,7 @@ nodist_libnminclude_HEADERS += \ - noinst_LTLIBRARIES += libnm/libnm-utils.la - - libnm_libnm_utils_la_CPPFLAGS = \ -+ $(INTROSPECTION_CFLAGS) \ - $(libnm_lib_cppflags) - - libnm_libnm_utils_la_SOURCES = \ -@@ -956,6 +957,23 @@ libnm/libnm.typelib: libnm/libnm.gir - $(INTROSPECTION_COMPILER) --includedir=$(srcdir)/libnm-core --includedir=$(builddir)/libnm-core --includedir=$(srcdir)/libnm --includedir=$(builddir)/libnm $< -o $@ - - INTROSPECTION_GIRS += libnm/NM-1.0.gir -+ -+if WITH_FAKE_TYPELIBS -+ -+libnm/fake-typelib/NetworkManager.typelib: libnm/fake-typelib/NetworkManager.gir -+ $(AM_V_GEN) $(INTROSPECTION_COMPILER) $< -o $@ -+ -+libnm/fake-typelib/NMClient.typelib: libnm/fake-typelib/NMClient.gir -+ $(AM_V_GEN) $(INTROSPECTION_COMPILER) $< -o $@ -+ -+libnm/fake-typelib/typelibs.c: libnm/fake-typelib/typelibs.gresource.xml libnm/fake-typelib/NetworkManager.typelib libnm/fake-typelib/NMClient.typelib -+ $(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) $< --target=$@ --sourcedir=$(srcdir)/libnm/fake-typelib --generate-source --manual-register --internal -+ -+libnm_libnm_utils_la_SOURCES += \ -+ libnm/fake-typelib/typelibs.c -+ -+endif -+ - endif - - if HAVE_INTROSPECTION -diff --git a/configure.ac b/configure.ac -index 8a066ad..6f561e2 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -322,9 +322,12 @@ GLIB_CFLAGS="$GLIB_CFLAGS -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_32 -DGLIB_V - AC_SUBST(GLIB_CFLAGS) - AC_SUBST(GLIB_LIBS) - -+GOBJECT_INTROSPECTION_CHECK([0.9.6]) -+ - AC_ARG_WITH(libnm-glib, - AS_HELP_STRING([--without-libnm-glib], -- [don't build legacy libraries])) -+ [don"'"t build legacy libraries])) -+fake_typelibs=no - if test "$with_libnm_glib" != "no"; then - PKG_CHECK_MODULES(DBUS, dbus-1 >= 1.1 dbus-glib-1 >= 0.94, :, - [AC_MSG_FAILURE([$DBUS_PKG_ERRORS -@@ -333,13 +336,24 @@ Configure with --without-libnm-glib if you do not need the legacy libraries]) - ]) - - with_libnm_glib=yes -+ -+ if test "${found_introspection}" = "yes"; then -+ AC_PATH_PROG(GLIB_COMPILE_RESOURCES, glib-compile-resources) -+ if ! test x"$GLIB_COMPILE_RESOURCES" = x""; then -+ fake_typelibs=yes -+ fi -+ fi - fi - AM_CONDITIONAL(WITH_LEGACY_LIBRARIES, test "$with_libnm_glib" != "no") -+if test "$fake_typelibs" = "yes"; then -+ AC_DEFINE(WITH_FAKE_TYPELIBS, 1, [Define for libnm to prevent GIR from loading libnm-glib]) -+else -+ AC_DEFINE(WITH_FAKE_TYPELIBS, 0, [Define for libnm to prevent GIR from loading libnm-glib]) -+fi -+AM_CONDITIONAL(WITH_FAKE_TYPELIBS, test "${fake_typelibs}" = "yes") - - PKG_CHECK_MODULES([LIBUDEV], [libudev >= 175]) - --GOBJECT_INTROSPECTION_CHECK([0.9.6]) -- - # Qt4 - PKG_CHECK_MODULES(QT, [QtCore >= 4 QtDBus QtNetwork], [have_qt=yes],[have_qt=no]) - AC_ARG_ENABLE(qt, -diff --git a/libnm/fake-typelib/NMClient.gir b/libnm/fake-typelib/NMClient.gir -new file mode 100644 -index 0000000..3002f8d ---- /dev/null -+++ b/libnm/fake-typelib/NMClient.gir -@@ -0,0 +1,9 @@ -+<?xml version="1.0"?> -+<!-- A lame duck typelib which prevents GIR from loading the -+ real one (which would crash due to conflict with libnm) --> -+<repository version="1.2" -+ xmlns="http://www.gtk.org/introspection/core/1.0" -+ xmlns:c="http://www.gtk.org/introspection/c/1.0" -+ xmlns:glib="http://www.gtk.org/introspection/glib/1.0"> -+ <namespace name="NMClient" version="0.0" /> -+</repository> -diff --git a/libnm/fake-typelib/NetworkManager.gir b/libnm/fake-typelib/NetworkManager.gir -new file mode 100644 -index 0000000..d15d29a ---- /dev/null -+++ b/libnm/fake-typelib/NetworkManager.gir -@@ -0,0 +1,10 @@ -+<?xml version="1.0"?> -+<!-- A lame duck typelib which prevents GIR from loading the -+ real one (which would crash due to conflict with libnm) --> -+<repository version="1.2" -+ xmlns="http://www.gtk.org/introspection/core/1.0" -+ xmlns:c="http://www.gtk.org/introspection/c/1.0" -+ xmlns:glib="http://www.gtk.org/introspection/glib/1.0"> -+ <namespace name="NetworkManager" version="0.0"> -+ </namespace> -+</repository> -diff --git a/libnm/fake-typelib/typelibs.gresource.xml b/libnm/fake-typelib/typelibs.gresource.xml -new file mode 100644 -index 0000000..9a71d97 ---- /dev/null -+++ b/libnm/fake-typelib/typelibs.gresource.xml -@@ -0,0 +1,7 @@ -+<?xml version="1.0" encoding="UTF-8"?> -+<gresources> -+ <gresource prefix="/org/freedesktop/libnm/fake-typelib"> -+ <file>NetworkManager.typelib</file> -+ <file>NMClient.typelib</file> -+ </gresource> -+</gresources> -diff --git a/libnm/nm-libnm-utils.c b/libnm/nm-libnm-utils.c -index fbbfe2c..a01228d 100644 ---- a/libnm/nm-libnm-utils.c -+++ b/libnm/nm-libnm-utils.c -@@ -23,6 +23,8 @@ - - #include "nm-libnm-utils.h" - -+#include <girepository.h> -+ - /*****************************************************************************/ - - char * -@@ -160,3 +162,83 @@ next: - nm_assert (g_utf8_validate (desc_full, -1, NULL)); - return desc_full; - } -+ -+#if WITH_FAKE_TYPELIBS -+ -+/* -+ * Here we register empty "NMClient" and "NetworkManager" GIR modules as soon -+ * as we are loaded (if gnome-introspection is being used). This prevents the -+ * real modules from being loaded because they would in turn load libnm-glib -+ * and abort() and crash. -+ * -+ * For the high level languages that utilize GIR the crash is highly inconvenient -+ * while the inability to resolve any methods and attributes is potentially -+ * recoverable. -+ */ -+ -+GResource *typelibs_get_resource (void); -+void typelibs_register_resource (void); -+ -+static void __attribute__((constructor)) -+_nm_libnm_utils_init (void) -+{ -+ GITypelib *typelib; -+ GBytes *data; -+ const char *namespace; -+ GModule *self; -+ GITypelib *(*_g_typelib_new_from_const_memory) (const guint8 *memory, -+ gsize len, -+ GError **error) = NULL; -+ const char *(*_g_irepository_load_typelib) (GIRepository *repository, -+ GITypelib *typelib, -+ GIRepositoryLoadFlags flags, -+ GError **error) = NULL; -+ const char *names[] = { "/org/freedesktop/libnm/fake-typelib/NetworkManager.typelib", -+ "/org/freedesktop/libnm/fake-typelib/NMClient.typelib" }; -+ int i; -+ -+ self = g_module_open (NULL, 0); -+ if (!self) -+ return; -+ g_module_symbol (self, "g_typelib_new_from_const_memory", -+ (gpointer *) &_g_typelib_new_from_const_memory); -+ if (_g_typelib_new_from_const_memory) { -+ g_module_symbol (self, "g_irepository_load_typelib", -+ (gpointer *) &_g_irepository_load_typelib); -+ } -+ g_module_close (self); -+ -+ if (!_g_typelib_new_from_const_memory || !_g_irepository_load_typelib) -+ return; -+ -+ typelibs_register_resource (); -+ -+ for (i = 0; i < 2; i++) { -+ gs_free_error GError *error = NULL; -+ -+ data = g_resource_lookup_data (typelibs_get_resource (), -+ names[i], -+ G_RESOURCE_LOOKUP_FLAGS_NONE, -+ &error); -+ if (!data) { -+ g_warning ("Fake typelib %s could not be loaded: %s", names[i], error->message); -+ return; -+ } -+ -+ typelib = _g_typelib_new_from_const_memory (g_bytes_get_data (data, NULL), -+ g_bytes_get_size (data), -+ &error); -+ if (!typelib) { -+ g_warning ("Could not create fake typelib instance %s: %s", names[i], error->message); -+ return; -+ } -+ -+ namespace = _g_irepository_load_typelib (NULL, typelib, 0, &error); -+ if (!namespace) { -+ g_warning ("Could not load fake typelib %s: %s", names[i], error->message); -+ return; -+ } -+ } -+} -+ -+#endif /* WITH_FAKE_TYPELIBS */ diff --git a/debian/patches/series b/debian/patches/series index e44814db..0adf0cf1 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,6 +1,4 @@ Force-online-state-with-unmanaged-devices.patch Don-t-setup-Sleep-Monitor-if-not-booted-with-systemd.patch -Fix-arping-path.patch Don-t-make-NetworkManager-D-Bus-activatable.patch Fix-iscsiadm-path.patch -libnm-register-empty-NMClient-and-NetworkManager-when-loa.patch |