From 7f23bde94f07005d22dfb577635efd096603607c Mon Sep 17 00:00:00 2001 From: Michael Biebl Date: Wed, 6 May 2015 16:52:18 +0200 Subject: Rebase patches. --- debian/changelog | 1 + ...ific-tweaks-for-NetworkManager-systemd-se.patch | 33 ---- ...Force-online-state-with-unmanaged-devices.patch | 194 -------------------- ...-Sleep-Monitor-if-not-booted-with-systemd.patch | 77 -------- debian/patches/0004-Use-symlinks-for-nmtui.patch | 36 ---- ...-virtual-ethernet-interfaces-as-unmanaged.patch | 69 -------- ...rect-path-when-calling-dnssec-trigger-scr.patch | 23 --- debian/patches/0007-fix-arping-path.patch | 29 --- .../0008-Fix-dependencies-in-libnm.pc.patch | 23 --- ...-at-runtime-whether-to-start-ModemManager.patch | 70 -------- ...ll-nm-settings-ifcfg-rh.5-man-page-condit.patch | 32 ---- ...n-t-make-NetworkManager-D-Bus-activatable.patch | 40 ----- ...-network.target-on-NetworkManager-wait-on.patch | 57 ------ ...-at-runtime-whether-to-start-ModemManager.patch | 70 ++++++++ ...ific-tweaks-for-NetworkManager-systemd-se.patch | 33 ++++ ...-network.target-on-NetworkManager-wait-on.patch | 57 ++++++ ...n-t-make-NetworkManager-D-Bus-activatable.patch | 40 +++++ ...-Sleep-Monitor-if-not-booted-with-systemd.patch | 77 ++++++++ ...Force-online-state-with-unmanaged-devices.patch | 195 +++++++++++++++++++++ ...-virtual-ethernet-interfaces-as-unmanaged.patch | 69 ++++++++ debian/patches/Use-symlinks-for-nmtui.patch | 36 ++++ ...rect-path-when-calling-dnssec-trigger-scr.patch | 23 +++ ...ll-nm-settings-ifcfg-rh.5-man-page-condit.patch | 32 ++++ debian/patches/fix-arping-path.patch | 29 +++ debian/patches/series | 23 ++- 25 files changed, 673 insertions(+), 695 deletions(-) delete mode 100644 debian/patches/0001-Debian-specific-tweaks-for-NetworkManager-systemd-se.patch delete mode 100644 debian/patches/0002-Force-online-state-with-unmanaged-devices.patch delete mode 100644 debian/patches/0003-Don-t-setup-Sleep-Monitor-if-not-booted-with-systemd.patch delete mode 100644 debian/patches/0004-Use-symlinks-for-nmtui.patch delete mode 100644 debian/patches/0005-Mark-virtual-ethernet-interfaces-as-unmanaged.patch delete mode 100644 debian/patches/0006-Use-the-correct-path-when-calling-dnssec-trigger-scr.patch delete mode 100644 debian/patches/0007-fix-arping-path.patch delete mode 100644 debian/patches/0008-Fix-dependencies-in-libnm.pc.patch delete mode 100644 debian/patches/0009-Check-at-runtime-whether-to-start-ModemManager.patch delete mode 100644 debian/patches/0010-build-install-nm-settings-ifcfg-rh.5-man-page-condit.patch delete mode 100644 debian/patches/0011-Don-t-make-NetworkManager-D-Bus-activatable.patch delete mode 100644 debian/patches/0012-Don-t-block-network.target-on-NetworkManager-wait-on.patch create mode 100644 debian/patches/Check-at-runtime-whether-to-start-ModemManager.patch create mode 100644 debian/patches/Debian-specific-tweaks-for-NetworkManager-systemd-se.patch create mode 100644 debian/patches/Don-t-block-network.target-on-NetworkManager-wait-on.patch create mode 100644 debian/patches/Don-t-make-NetworkManager-D-Bus-activatable.patch create mode 100644 debian/patches/Don-t-setup-Sleep-Monitor-if-not-booted-with-systemd.patch create mode 100644 debian/patches/Force-online-state-with-unmanaged-devices.patch create mode 100644 debian/patches/Mark-virtual-ethernet-interfaces-as-unmanaged.patch create mode 100644 debian/patches/Use-symlinks-for-nmtui.patch create mode 100644 debian/patches/Use-the-correct-path-when-calling-dnssec-trigger-scr.patch create mode 100644 debian/patches/build-install-nm-settings-ifcfg-rh.5-man-page-condit.patch create mode 100644 debian/patches/fix-arping-path.patch (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 98343cd0..1dcfa3f5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,7 @@ network-manager (1.0.2-1) UNRELEASED; urgency=medium * New upstream release. * Make no-patch-numbers the default for gbp pq to avoid unnecessary noise. + * Rebase patches. -- Michael Biebl Tue, 05 May 2015 17:49:16 +0200 diff --git a/debian/patches/0001-Debian-specific-tweaks-for-NetworkManager-systemd-se.patch b/debian/patches/0001-Debian-specific-tweaks-for-NetworkManager-systemd-se.patch deleted file mode 100644 index 546d20e1..00000000 --- a/debian/patches/0001-Debian-specific-tweaks-for-NetworkManager-systemd-se.patch +++ /dev/null @@ -1,33 +0,0 @@ -From: Michael Biebl -Date: Wed, 2 Apr 2014 03:15:53 +0200 -Subject: Debian specific tweaks for NetworkManager systemd service file - -This patch is needed to avoid a dependency loop which is generated -by early boot (rcS) SysV init scripts depending on the $network LSB -system facility (either directly or indirectly via $remote_fs). - -The $network LSB system facility is mapped to network.target. - -Those rcS SysV init scripts are started in sysinit.target, -NetworkManager.service is started via multi-user.target, which depends -on sysinit.target. - -As long as we have rcS SysV init scripts which such a dependency on -$remote_fs or $network we can not make NetworkManager.service a provider -for network.target. ---- - data/NetworkManager.service.in | 2 -- - 1 file changed, 2 deletions(-) - -diff --git a/data/NetworkManager.service.in b/data/NetworkManager.service.in -index b2e61ff..1883b40 100644 ---- a/data/NetworkManager.service.in -+++ b/data/NetworkManager.service.in -@@ -1,7 +1,5 @@ - [Unit] - Description=Network Manager --Wants=network.target --Before=network.target @DISTRO_NETWORK_SERVICE@ - - [Service] - Type=dbus diff --git a/debian/patches/0002-Force-online-state-with-unmanaged-devices.patch b/debian/patches/0002-Force-online-state-with-unmanaged-devices.patch deleted file mode 100644 index 23fdaf9c..00000000 --- a/debian/patches/0002-Force-online-state-with-unmanaged-devices.patch +++ /dev/null @@ -1,194 +0,0 @@ -From: Michael Biebl -Date: Wed, 2 Apr 2014 03:15:53 +0200 -Subject: Force online state with unmanaged devices - -If we have unmanaged devices in /e/n/i, monitor the ifupdown state file -and in case we find active interfaces besides lo, forcefully set the -online state to CONNECTED. - -Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=512286 ---- - src/nm-manager.c | 121 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ - 1 file changed, 121 insertions(+) - -diff --git a/src/nm-manager.c b/src/nm-manager.c -index 7e81afa..1fac0d7 100644 ---- a/src/nm-manager.c -+++ b/src/nm-manager.c -@@ -64,6 +64,8 @@ - #define NM_AUTOIP_DBUS_SERVICE "org.freedesktop.nm_avahi_autoipd" - #define NM_AUTOIP_DBUS_IFACE "org.freedesktop.nm_avahi_autoipd" - -+#define IFUPDOWN_STATE_FILE "/run/network/ifstate" -+ - static gboolean impl_manager_get_devices (NMManager *manager, - GPtrArray **devices, - GError **err); -@@ -198,6 +200,11 @@ typedef struct { - GFileMonitor *fw_monitor; - guint fw_changed_id; - -+ /* ifupdown state file monitor */ -+ GFileMonitor *ifstate_monitor; -+ guint ifstate_monitor_id; -+ gboolean ifstate_force_online; -+ - guint timestamp_update_id; - - gboolean startup; -@@ -625,6 +632,29 @@ find_best_device_state (NMManager *manager, gboolean *want_connectivity_check) - return best_state; - } - -+static NMState -+find_unmanaged_state (NMManager *manager, NMState current_state) -+{ -+ NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (manager); -+ 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); -+ -+ -+ if (state == NM_DEVICE_STATE_UNMANAGED) { -+ const char *iface = nm_device_get_ip_iface (dev); -+ if (priv->ifstate_force_online) { -+ new_state = NM_STATE_CONNECTED_GLOBAL; -+ nm_log_dbg (LOGD_CORE, "Unmanaged device found: %s; state CONNECTED forced.", iface); -+ } -+ } -+ } -+ return new_state; -+} -+ - static void - nm_manager_update_state (NMManager *manager) - { -@@ -640,6 +670,8 @@ nm_manager_update_state (NMManager *manager) - new_state = NM_STATE_ASLEEP; - else - new_state = find_best_device_state (manager, &want_connectivity_check); -+ if (new_state != NM_STATE_CONNECTED_GLOBAL) -+ new_state = find_unmanaged_state (manager, new_state); - - if (new_state == NM_STATE_CONNECTING && want_connectivity_check) { - nm_connectivity_check_async (priv->connectivity, -@@ -4131,6 +4163,65 @@ impl_manager_check_connectivity (NMManager *manager, - nm_auth_chain_add_call (chain, NM_AUTH_PERMISSION_NETWORK_CONTROL, TRUE); - } - -+static void -+check_ifstate_file (gpointer user_data) -+{ -+ NMManager *self = NM_MANAGER (user_data); -+ NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self); -+ GIOChannel *channel; -+ gchar *line; -+ gboolean online = FALSE; -+ -+ channel = g_io_channel_new_file (IFUPDOWN_STATE_FILE, "r", NULL); -+ if (!channel) { -+ nm_log_warn (LOGD_CORE, "Error: failed to open %s", IFUPDOWN_STATE_FILE); -+ return; -+ } -+ -+ while (g_io_channel_read_line (channel, &line, NULL, NULL, NULL) -+ != G_IO_STATUS_EOF && !online) { -+ g_strstrip (line); -+ if (strlen (line) > 0 && g_strcmp0 (line, "lo=lo") != 0) { -+ online = TRUE; -+ } -+ g_free (line); -+ } -+ -+ g_io_channel_shutdown (channel, FALSE, NULL); -+ g_io_channel_unref (channel); -+ -+ if (priv->ifstate_force_online != online) { -+ priv->ifstate_force_online = online; -+ nm_manager_update_state (self); -+ } -+} -+ -+static void -+ifstate_file_changed (GFileMonitor *monitor, -+ GFile *file, -+ GFile *other_file, -+ GFileMonitorEvent event_type, -+ gpointer user_data) -+{ -+ NMManager *self = NM_MANAGER (user_data); -+ NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self); -+ -+ switch (event_type) { -+// case G_FILE_MONITOR_EVENT_CREATED: -+//#if GLIB_CHECK_VERSION(2,23,4) -+// case G_FILE_MONITOR_EVENT_MOVED: -+//#endif -+// case G_FILE_MONITOR_EVENT_ATTRIBUTE_CHANGED: -+ case G_FILE_MONITOR_EVENT_CHANGED: -+ case G_FILE_MONITOR_EVENT_CHANGES_DONE_HINT: -+ nm_log_dbg (LOGD_CORE, "ifupdown state file %s was changed", IFUPDOWN_STATE_FILE); -+ check_ifstate_file (user_data); -+ break; -+ default: -+ break; -+ } -+} -+ - void - nm_manager_start (NMManager *self) - { -@@ -4179,6 +4270,9 @@ nm_manager_start (NMManager *self) - system_create_virtual_devices (self); - - check_if_startup_complete (self); -+ -+ /* Trigger ifupdown state file check */ -+ check_ifstate_file (self); - } - - void -@@ -4873,6 +4967,22 @@ nm_manager_init (NMManager *manager) - KERNEL_FIRMWARE_DIR); - } - -+ /* Monitor the ifupdown state file */ -+ file = g_file_new_for_path (IFUPDOWN_STATE_FILE); -+ priv->ifstate_monitor = g_file_monitor_file (file, G_FILE_MONITOR_NONE, NULL, NULL); -+ g_object_unref (file); -+ -+ if (priv->ifstate_monitor) { -+ priv->ifstate_monitor_id = g_signal_connect (priv->ifstate_monitor, "changed", -+ G_CALLBACK (ifstate_file_changed), -+ manager); -+ nm_log_info (LOGD_CORE, "monitoring ifupdown state file '%s'.", -+ IFUPDOWN_STATE_FILE); -+ } else { -+ nm_log_warn (LOGD_CORE, "failed to monitor ifupdown state file '%s'.", -+ IFUPDOWN_STATE_FILE); -+ } -+ - /* Update timestamps in active connections */ - priv->timestamp_update_id = g_timeout_add_seconds (300, (GSourceFunc) periodic_update_active_connection_timestamps, manager); - } -@@ -5069,6 +5179,17 @@ dispose (GObject *object) - g_clear_object (&priv->fw_monitor); - } - -+ if (priv->ifstate_monitor) { -+ if (priv->ifstate_monitor_id) -+ g_signal_handler_disconnect (priv->ifstate_monitor, priv->ifstate_monitor_id); -+ -+ if (priv->ifstate_force_online) -+ g_source_remove (priv->ifstate_force_online); -+ -+ g_file_monitor_cancel (priv->ifstate_monitor); -+ g_object_unref (priv->ifstate_monitor); -+ } -+ - for (iter = priv->factories; iter; iter = iter->next) { - NMDeviceFactory *factory = iter->data; - diff --git a/debian/patches/0003-Don-t-setup-Sleep-Monitor-if-not-booted-with-systemd.patch b/debian/patches/0003-Don-t-setup-Sleep-Monitor-if-not-booted-with-systemd.patch deleted file mode 100644 index f8bc42f6..00000000 --- a/debian/patches/0003-Don-t-setup-Sleep-Monitor-if-not-booted-with-systemd.patch +++ /dev/null @@ -1,77 +0,0 @@ -From: Michael Biebl -Date: Sat, 12 Apr 2014 12:38:09 +0200 -Subject: Don't setup Sleep Monitor if not booted with systemd - -NetworkManager uses systemd for suspend/resume support. It listens for -the PrepareForSleep and Resume D-Bus signal sent by logind/systemd and -deactivates the interfaces on sleep and reactivates them on resume. -With a standalone logind we don't get a Resume signal and -NetworkManager remains in sleep mode where the devices are unmanaged. -As a workaround, skip the Sleep Monitor setup if not booted with -systemd. - -Closes: #742933 ---- - configure.ac | 3 ++- - src/Makefile.am | 2 ++ - src/nm-sleep-monitor-systemd.c | 5 +++++ - 3 files changed, 9 insertions(+), 1 deletion(-) - -diff --git a/configure.ac b/configure.ac -index b6bf38e..c21cb9d 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -373,8 +373,9 @@ fi - case $with_suspend_resume in - upower) ;; - systemd) -+ # Link against libsystemd-daemon for sd_booted() - PKG_CHECK_MODULES(SYSTEMD_INHIBIT, [libsystemd >= 209],, -- [PKG_CHECK_MODULES(SYSTEMD_INHIBIT, [libsystemd-login >= 183])]) -+ [PKG_CHECK_MODULES(SYSTEMD_INHIBIT, [libsystemd-login >= 183 libsystemd-daemon])]) - ;; - *) - AC_MSG_ERROR(--with-suspend-resume must be one of [upower, systemd]) -diff --git a/src/Makefile.am b/src/Makefile.am -index 808e59e..84ece6c 100644 ---- a/src/Makefile.am -+++ b/src/Makefile.am -@@ -411,6 +411,7 @@ AM_CPPFLAGS += \ - $(LIBNDP_CFLAGS) \ - $(LIBSOUP_CFLAGS) \ - $(SYSTEMD_LOGIN_CFLAGS) \ -+ $(SYSTEMD_INHIBIT_CFLAGS) \ - $(SYSTEMD_DHCP_CFLAGS) \ - \ - -DBINDIR=\"$(bindir)\" \ -@@ -449,6 +450,7 @@ libNetworkManager_la_LIBADD = \ - $(GUDEV_LIBS) \ - $(LIBNL_LIBS) \ - $(SYSTEMD_LOGIN_LIBS) \ -+ $(SYSTEMD_INHIBIT_LIBS) \ - $(LIBNDP_LIBS) \ - $(LIBDL) \ - $(LIBM) -diff --git a/src/nm-sleep-monitor-systemd.c b/src/nm-sleep-monitor-systemd.c -index c0bc65e..0c97335 100644 ---- a/src/nm-sleep-monitor-systemd.c -+++ b/src/nm-sleep-monitor-systemd.c -@@ -25,6 +25,7 @@ - #include - #include - #include -+#include - - #include "nm-logging.h" - #include "nm-dbus-manager.h" -@@ -193,6 +194,10 @@ on_proxy_acquired (GObject *object, - static void - nm_sleep_monitor_init (NMSleepMonitor *self) - { -+ if (!sd_booted()) { -+ nm_log_warn (LOGD_SUSPEND, "Skipping Sleep Monitor setup, system not booted with systemd"); -+ return; -+ } - self->inhibit_fd = -1; - g_dbus_proxy_new_for_bus (G_BUS_TYPE_SYSTEM, - G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START | diff --git a/debian/patches/0004-Use-symlinks-for-nmtui.patch b/debian/patches/0004-Use-symlinks-for-nmtui.patch deleted file mode 100644 index f9d58275..00000000 --- a/debian/patches/0004-Use-symlinks-for-nmtui.patch +++ /dev/null @@ -1,36 +0,0 @@ -From: Michael Biebl -Date: Thu, 10 Jul 2014 03:33:18 +0200 -Subject: Use symlinks for nmtui - -Make /usr/bin/nmtui-* symbolic links to /usr/bin/nmtui. ---- - clients/tui/Makefile.am | 2 +- - configure.ac | 2 ++ - 2 files changed, 3 insertions(+), 1 deletion(-) - -diff --git a/clients/tui/Makefile.am b/clients/tui/Makefile.am -index ad9335d..09f2700 100644 ---- a/clients/tui/Makefile.am -+++ b/clients/tui/Makefile.am -@@ -24,7 +24,7 @@ links = nmtui-edit nmtui-connect nmtui-hostname - - install-exec-hook: - for link in $(links); do \ -- ln -f $(DESTDIR)$(bindir)/nmtui $(DESTDIR)$(bindir)/$$link; \ -+ cd $(DESTDIR)$(bindir) && $(LN_S) -f nmtui $$link; \ - done - - uninstall-hook: -diff --git a/configure.ac b/configure.ac -index c21cb9d..ae2ec6d 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -45,6 +45,8 @@ AM_PROG_CC_C_O - # C++ only required if --enable-qt=yes - AC_PROG_CXX - -+AC_PROG_LN_S -+ - dnl Initialize libtool - LT_PREREQ([2.2]) - LT_INIT([disable-static]) diff --git a/debian/patches/0005-Mark-virtual-ethernet-interfaces-as-unmanaged.patch b/debian/patches/0005-Mark-virtual-ethernet-interfaces-as-unmanaged.patch deleted file mode 100644 index fbfd7eff..00000000 --- a/debian/patches/0005-Mark-virtual-ethernet-interfaces-as-unmanaged.patch +++ /dev/null @@ -1,69 +0,0 @@ -From: Michael Biebl -Date: Thu, 10 Jul 2014 03:38:42 +0200 -Subject: Mark virtual ethernet interfaces as unmanaged - -We do not want to interfere with VBox and VMware network interfaces, so ignore -any virtual ethernet interfaces and mark them as unmanaged. ---- - src/devices/nm-device-ethernet.c | 41 ++++++++++++++++++++++++++++++++++++++++ - 1 file changed, 41 insertions(+) - -diff --git a/src/devices/nm-device-ethernet.c b/src/devices/nm-device-ethernet.c -index ac408d3..116d4d3 100644 ---- a/src/devices/nm-device-ethernet.c -+++ b/src/devices/nm-device-ethernet.c -@@ -250,6 +250,45 @@ out: - g_object_unref (client); - } - -+static void -+nm_device_check_virtual (NMDeviceEthernet *self) -+{ -+ GUdevDevice *dev = NULL; -+ GUdevClient *client = NULL; -+ const char *iface = NULL; -+ const char *subsystems[] = { "net", NULL }; -+ const char *sysfs_path; -+ const char *virtual = "/sys/devices/virtual/net"; -+ -+ iface = nm_device_get_iface (NM_DEVICE (self)); -+ -+ client = g_udev_client_new (subsystems); -+ if (!client) { -+ nm_log_warn (LOGD_DEVICE | LOGD_HW, "(%s): failed to initialize GUdev client", iface); -+ goto out; -+ } -+ -+ dev = g_udev_client_query_by_subsystem_and_name (client, "net", iface); -+ if (!dev) { -+ nm_log_warn (LOGD_DEVICE | LOGD_HW, "(%s): failed to find device with udev", iface); -+ goto out; -+ } -+ -+ sysfs_path = g_udev_device_get_sysfs_path (dev); -+ -+ if (g_ascii_strncasecmp (sysfs_path, virtual, strlen (virtual)) == 0) { -+ nm_log_info (LOGD_DEVICE | LOGD_HW, "(%s): device is virtual, marking as unmanaged", iface); -+ nm_device_set_initial_unmanaged_flag (NM_DEVICE (self), NM_UNMANAGED_DEFAULT, TRUE); -+ } -+ -+out: -+ if (client) -+ g_object_unref (client); -+ if (dev) -+ g_object_unref (dev); -+} -+ -+ - static GObject* - constructor (GType type, - guint n_construct_params, -@@ -272,6 +311,8 @@ constructor (GType type, - - /* s390 stuff */ - _update_s390_subchannels (NM_DEVICE_ETHERNET (object)); -+ -+ nm_device_check_virtual (NM_DEVICE_ETHERNET (object)); - } - - return object; diff --git a/debian/patches/0006-Use-the-correct-path-when-calling-dnssec-trigger-scr.patch b/debian/patches/0006-Use-the-correct-path-when-calling-dnssec-trigger-scr.patch deleted file mode 100644 index 9385e97f..00000000 --- a/debian/patches/0006-Use-the-correct-path-when-calling-dnssec-trigger-scr.patch +++ /dev/null @@ -1,23 +0,0 @@ -From: Arto Jantunen -Date: Sat, 27 Sep 2014 11:13:32 +0300 -Subject: Use the correct path when calling dnssec-trigger-script - -Debian systems don't have /usr/libexec, so the script is installed in -a different path. ---- - src/dns-manager/nm-dns-unbound.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/dns-manager/nm-dns-unbound.c b/src/dns-manager/nm-dns-unbound.c -index 533290c..b5452bf 100644 ---- a/src/dns-manager/nm-dns-unbound.c -+++ b/src/dns-manager/nm-dns-unbound.c -@@ -42,7 +42,7 @@ update (NMDnsPlugin *plugin, - * without calling custom scripts. The dnssec-trigger functionality - * may be eventually merged into NetworkManager. - */ -- return nm_spawn_process ("/usr/libexec/dnssec-trigger-script --async --update") == 0; -+ return nm_spawn_process ("/usr/lib/dnssec-trigger/dnssec-trigger-script --async --update") == 0; - } - - static gboolean diff --git a/debian/patches/0007-fix-arping-path.patch b/debian/patches/0007-fix-arping-path.patch deleted file mode 100644 index 6e7afd4c..00000000 --- a/debian/patches/0007-fix-arping-path.patch +++ /dev/null @@ -1,29 +0,0 @@ -From: Laurent Bigonville -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-device.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c -index a989953..abe99d4 100644 ---- a/src/devices/nm-device.c -+++ b/src/devices/nm-device.c -@@ -5095,7 +5095,7 @@ send_arps (NMDevice *self, const char *mode_arg) - if (num == 0) - 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 (LOGD_DEVICE | LOGD_IP4, "arping could not be found; no ARPs will be sent"); - return; diff --git a/debian/patches/0008-Fix-dependencies-in-libnm.pc.patch b/debian/patches/0008-Fix-dependencies-in-libnm.pc.patch deleted file mode 100644 index 8c7b0aa7..00000000 --- a/debian/patches/0008-Fix-dependencies-in-libnm.pc.patch +++ /dev/null @@ -1,23 +0,0 @@ -From: Michael Biebl -Date: Fri, 23 Jan 2015 21:19:55 +0100 -Subject: Fix dependencies in libnm.pc - -The new libnm library doesn't use libdbus-glib, so drop that from -Requires. ---- - libnm/libnm.pc.in | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/libnm/libnm.pc.in b/libnm/libnm.pc.in -index 6392799..5fe26b6 100644 ---- a/libnm/libnm.pc.in -+++ b/libnm/libnm.pc.in -@@ -6,7 +6,7 @@ includedir=@includedir@ - Name: libnm - Description: Convenience library for clients of NetworkManager - Version: @VERSION@ --Requires: gio-2.0 dbus-glib-1 -+Requires: gio-2.0 - Cflags: -I${includedir}/libnm - Libs: -L${libdir} -lnm - diff --git a/debian/patches/0009-Check-at-runtime-whether-to-start-ModemManager.patch b/debian/patches/0009-Check-at-runtime-whether-to-start-ModemManager.patch deleted file mode 100644 index 2b77012e..00000000 --- a/debian/patches/0009-Check-at-runtime-whether-to-start-ModemManager.patch +++ /dev/null @@ -1,70 +0,0 @@ -From: Didier Raboud -Date: Mon, 2 Feb 2015 16:06:32 +0100 -Subject: Check at runtime whether to start ModemManager - -This makes NetworkManager use runtime detection to manage the -ModemManager lifecycle when not run by systemd. Under systemd, we expect -the ModemManager service to be started by systemd, under non-systemd, we -use the dbus activation feature to start ModemManager. - -Closes: #770871 ---- - src/devices/wwan/nm-modem-manager.c | 15 +++++---------- - 1 file changed, 5 insertions(+), 10 deletions(-) - -diff --git a/src/devices/wwan/nm-modem-manager.c b/src/devices/wwan/nm-modem-manager.c -index f0e5692..b8ecba1 100644 ---- a/src/devices/wwan/nm-modem-manager.c -+++ b/src/devices/wwan/nm-modem-manager.c -@@ -25,6 +25,7 @@ - #include - - #include -+#include - - #include "nm-modem-manager.h" - #include "nm-logging.h" -@@ -202,10 +203,9 @@ modem_manager_name_owner_changed (MMManager *modem_manager, - if (!name_owner) { - nm_log_info (LOGD_MB, "ModemManager disappeared from bus"); - --#if !HAVE_SYSTEMD - /* If not managed by systemd, schedule relaunch */ -- schedule_modem_manager_relaunch (self, 0); --#endif -+ if (!sd_booted()) -+ schedule_modem_manager_relaunch (self, 0); - - return; - } -@@ -226,8 +226,6 @@ modem_manager_name_owner_changed (MMManager *modem_manager, - */ - } - --#if !HAVE_SYSTEMD -- - static void - modem_manager_poke_cb (GDBusConnection *connection, - GAsyncResult *res, -@@ -276,8 +274,6 @@ modem_manager_poke (NMModemManager *self) - g_object_ref (self)); /* user_data */ - } - --#endif /* HAVE_SYSTEMD */ -- - static void - modem_manager_check_name_owner (NMModemManager *self) - { -@@ -291,10 +287,9 @@ modem_manager_check_name_owner (NMModemManager *self) - return; - } - --#if !HAVE_SYSTEMD - /* If the lifecycle is not managed by systemd, poke */ -- modem_manager_poke (self); --#endif -+ if (!sd_booted()) -+ modem_manager_poke (self); - } - - static void diff --git a/debian/patches/0010-build-install-nm-settings-ifcfg-rh.5-man-page-condit.patch b/debian/patches/0010-build-install-nm-settings-ifcfg-rh.5-man-page-condit.patch deleted file mode 100644 index faf28e14..00000000 --- a/debian/patches/0010-build-install-nm-settings-ifcfg-rh.5-man-page-condit.patch +++ /dev/null @@ -1,32 +0,0 @@ -From: Michael Biebl -Date: Mon, 9 Feb 2015 01:12:16 +0100 -Subject: build: install nm-settings-ifcfg-rh.5 man page conditionally - -Only install nm-settings-ifcfg-rh.5 man page if the ifcfg-rh -configuration plugin has been enabled. ---- - man/Makefile.am | 10 ++++++++-- - 1 file changed, 8 insertions(+), 2 deletions(-) - -diff --git a/man/Makefile.am b/man/Makefile.am -index 4577cb4..5ed5ad5 100644 ---- a/man/Makefile.am -+++ b/man/Makefile.am -@@ -67,9 +67,15 @@ docbook_generated_man_pages = \ - nmcli-examples.5 - - docbook_autogenerated_man_pages = \ -- nm-settings.5 \ -- nm-settings-keyfile.5 \ -+ nm-settings.5 -+ -+docbook_autogenerated_man_pages = \ -+ nm-settings-keyfile.5 -+ -+if CONFIG_PLUGIN_IFCFG_RH -+docbook_autogenerated_man_pages += \ - nm-settings-ifcfg-rh.5 -+endif - - EXTRA_DIST += \ - nm-settings.xml \ diff --git a/debian/patches/0011-Don-t-make-NetworkManager-D-Bus-activatable.patch b/debian/patches/0011-Don-t-make-NetworkManager-D-Bus-activatable.patch deleted file mode 100644 index ce028367..00000000 --- a/debian/patches/0011-Don-t-make-NetworkManager-D-Bus-activatable.patch +++ /dev/null @@ -1,40 +0,0 @@ -From: Michael Biebl -Date: Sun, 29 Mar 2015 22:57:50 +0200 -Subject: Don't make NetworkManager D-Bus activatable - -If the NetworkManager daemon has been stopped manually we don't want it -to be autostarted by a client request. ---- - data/Makefile.am | 7 ------- - data/NetworkManager.service.in | 1 - - 2 files changed, 8 deletions(-) - -diff --git a/data/Makefile.am b/data/Makefile.am -index e91361a..a7c8070 100644 ---- a/data/Makefile.am -+++ b/data/Makefile.am -@@ -19,13 +19,6 @@ endif - NetworkManager-dispatcher.service: NetworkManager-dispatcher.service.in - $(edit) $< >$@ - --servicedir = $(datadir)/dbus-1/system-services --service_in_files = org.freedesktop.NetworkManager.service.in --service_DATA = $(service_in_files:.service.in=.service) -- --$(service_DATA): $(service_in_files) Makefile -- $(edit) $< >$@ -- - install-exec-local: - install -d $(DESTDIR)$(systemdsystemunitdir)/network-online.target.wants - ln -sf $(systemdsystemunitdir)/NetworkManager-wait-online.service $(DESTDIR)$(systemdsystemunitdir)/network-online.target.wants -diff --git a/data/NetworkManager.service.in b/data/NetworkManager.service.in -index 1883b40..5282e5b 100644 ---- a/data/NetworkManager.service.in -+++ b/data/NetworkManager.service.in -@@ -11,6 +11,5 @@ KillMode=process - - [Install] - WantedBy=multi-user.target --Alias=dbus-org.freedesktop.NetworkManager.service - Also=NetworkManager-dispatcher.service - diff --git a/debian/patches/0012-Don-t-block-network.target-on-NetworkManager-wait-on.patch b/debian/patches/0012-Don-t-block-network.target-on-NetworkManager-wait-on.patch deleted file mode 100644 index 1ddb666d..00000000 --- a/debian/patches/0012-Don-t-block-network.target-on-NetworkManager-wait-on.patch +++ /dev/null @@ -1,57 +0,0 @@ -From: Michael Biebl -Date: Sun, 29 Mar 2015 22:58:43 +0200 -Subject: Don't block network.target on NetworkManager-wait-online.service - -network.target is supposed to be a passive unit which is pulled in my -the network management service. - -Also, we want NetworkManager-wait-online.service be hooked up in -network-online.target, not multi-user.target. - -While at it, add a few other smaller fixes, like the addition of -Documentation= and RemainAfterExit=yes - -http://www.freedesktop.org/wiki/Software/systemd/NetworkTarget/ -https://bugzilla.gnome.org/show_bug.cgi?id=746039 ---- - data/Makefile.am | 4 ---- - data/NetworkManager-wait-online.service.in | 7 ++++--- - 2 files changed, 4 insertions(+), 7 deletions(-) - -diff --git a/data/Makefile.am b/data/Makefile.am -index a7c8070..60443bf 100644 ---- a/data/Makefile.am -+++ b/data/Makefile.am -@@ -18,10 +18,6 @@ endif - - NetworkManager-dispatcher.service: NetworkManager-dispatcher.service.in - $(edit) $< >$@ -- --install-exec-local: -- install -d $(DESTDIR)$(systemdsystemunitdir)/network-online.target.wants -- ln -sf $(systemdsystemunitdir)/NetworkManager-wait-online.service $(DESTDIR)$(systemdsystemunitdir)/network-online.target.wants - endif - - examplesdir = $(docdir)/examples -diff --git a/data/NetworkManager-wait-online.service.in b/data/NetworkManager-wait-online.service.in -index 6ad6942..1753d20 100644 ---- a/data/NetworkManager-wait-online.service.in -+++ b/data/NetworkManager-wait-online.service.in -@@ -1,13 +1,14 @@ - [Unit] - Description=Network Manager Wait Online -+Documentation=man:nm-online(1) - Requisite=NetworkManager.service - After=NetworkManager.service --Wants=network.target --Before=network.target network-online.target -+Before=network-online.target - - [Service] - Type=oneshot - ExecStart=@bindir@/nm-online -s -q --timeout=30 -+RemainAfterExit=yes - - [Install] --WantedBy=multi-user.target -+WantedBy=network-online.target diff --git a/debian/patches/Check-at-runtime-whether-to-start-ModemManager.patch b/debian/patches/Check-at-runtime-whether-to-start-ModemManager.patch new file mode 100644 index 00000000..2b77012e --- /dev/null +++ b/debian/patches/Check-at-runtime-whether-to-start-ModemManager.patch @@ -0,0 +1,70 @@ +From: Didier Raboud +Date: Mon, 2 Feb 2015 16:06:32 +0100 +Subject: Check at runtime whether to start ModemManager + +This makes NetworkManager use runtime detection to manage the +ModemManager lifecycle when not run by systemd. Under systemd, we expect +the ModemManager service to be started by systemd, under non-systemd, we +use the dbus activation feature to start ModemManager. + +Closes: #770871 +--- + src/devices/wwan/nm-modem-manager.c | 15 +++++---------- + 1 file changed, 5 insertions(+), 10 deletions(-) + +diff --git a/src/devices/wwan/nm-modem-manager.c b/src/devices/wwan/nm-modem-manager.c +index f0e5692..b8ecba1 100644 +--- a/src/devices/wwan/nm-modem-manager.c ++++ b/src/devices/wwan/nm-modem-manager.c +@@ -25,6 +25,7 @@ + #include + + #include ++#include + + #include "nm-modem-manager.h" + #include "nm-logging.h" +@@ -202,10 +203,9 @@ modem_manager_name_owner_changed (MMManager *modem_manager, + if (!name_owner) { + nm_log_info (LOGD_MB, "ModemManager disappeared from bus"); + +-#if !HAVE_SYSTEMD + /* If not managed by systemd, schedule relaunch */ +- schedule_modem_manager_relaunch (self, 0); +-#endif ++ if (!sd_booted()) ++ schedule_modem_manager_relaunch (self, 0); + + return; + } +@@ -226,8 +226,6 @@ modem_manager_name_owner_changed (MMManager *modem_manager, + */ + } + +-#if !HAVE_SYSTEMD +- + static void + modem_manager_poke_cb (GDBusConnection *connection, + GAsyncResult *res, +@@ -276,8 +274,6 @@ modem_manager_poke (NMModemManager *self) + g_object_ref (self)); /* user_data */ + } + +-#endif /* HAVE_SYSTEMD */ +- + static void + modem_manager_check_name_owner (NMModemManager *self) + { +@@ -291,10 +287,9 @@ modem_manager_check_name_owner (NMModemManager *self) + return; + } + +-#if !HAVE_SYSTEMD + /* If the lifecycle is not managed by systemd, poke */ +- modem_manager_poke (self); +-#endif ++ if (!sd_booted()) ++ modem_manager_poke (self); + } + + static void diff --git a/debian/patches/Debian-specific-tweaks-for-NetworkManager-systemd-se.patch b/debian/patches/Debian-specific-tweaks-for-NetworkManager-systemd-se.patch new file mode 100644 index 00000000..546d20e1 --- /dev/null +++ b/debian/patches/Debian-specific-tweaks-for-NetworkManager-systemd-se.patch @@ -0,0 +1,33 @@ +From: Michael Biebl +Date: Wed, 2 Apr 2014 03:15:53 +0200 +Subject: Debian specific tweaks for NetworkManager systemd service file + +This patch is needed to avoid a dependency loop which is generated +by early boot (rcS) SysV init scripts depending on the $network LSB +system facility (either directly or indirectly via $remote_fs). + +The $network LSB system facility is mapped to network.target. + +Those rcS SysV init scripts are started in sysinit.target, +NetworkManager.service is started via multi-user.target, which depends +on sysinit.target. + +As long as we have rcS SysV init scripts which such a dependency on +$remote_fs or $network we can not make NetworkManager.service a provider +for network.target. +--- + data/NetworkManager.service.in | 2 -- + 1 file changed, 2 deletions(-) + +diff --git a/data/NetworkManager.service.in b/data/NetworkManager.service.in +index b2e61ff..1883b40 100644 +--- a/data/NetworkManager.service.in ++++ b/data/NetworkManager.service.in +@@ -1,7 +1,5 @@ + [Unit] + Description=Network Manager +-Wants=network.target +-Before=network.target @DISTRO_NETWORK_SERVICE@ + + [Service] + Type=dbus diff --git a/debian/patches/Don-t-block-network.target-on-NetworkManager-wait-on.patch b/debian/patches/Don-t-block-network.target-on-NetworkManager-wait-on.patch new file mode 100644 index 00000000..1ddb666d --- /dev/null +++ b/debian/patches/Don-t-block-network.target-on-NetworkManager-wait-on.patch @@ -0,0 +1,57 @@ +From: Michael Biebl +Date: Sun, 29 Mar 2015 22:58:43 +0200 +Subject: Don't block network.target on NetworkManager-wait-online.service + +network.target is supposed to be a passive unit which is pulled in my +the network management service. + +Also, we want NetworkManager-wait-online.service be hooked up in +network-online.target, not multi-user.target. + +While at it, add a few other smaller fixes, like the addition of +Documentation= and RemainAfterExit=yes + +http://www.freedesktop.org/wiki/Software/systemd/NetworkTarget/ +https://bugzilla.gnome.org/show_bug.cgi?id=746039 +--- + data/Makefile.am | 4 ---- + data/NetworkManager-wait-online.service.in | 7 ++++--- + 2 files changed, 4 insertions(+), 7 deletions(-) + +diff --git a/data/Makefile.am b/data/Makefile.am +index a7c8070..60443bf 100644 +--- a/data/Makefile.am ++++ b/data/Makefile.am +@@ -18,10 +18,6 @@ endif + + NetworkManager-dispatcher.service: NetworkManager-dispatcher.service.in + $(edit) $< >$@ +- +-install-exec-local: +- install -d $(DESTDIR)$(systemdsystemunitdir)/network-online.target.wants +- ln -sf $(systemdsystemunitdir)/NetworkManager-wait-online.service $(DESTDIR)$(systemdsystemunitdir)/network-online.target.wants + endif + + examplesdir = $(docdir)/examples +diff --git a/data/NetworkManager-wait-online.service.in b/data/NetworkManager-wait-online.service.in +index 6ad6942..1753d20 100644 +--- a/data/NetworkManager-wait-online.service.in ++++ b/data/NetworkManager-wait-online.service.in +@@ -1,13 +1,14 @@ + [Unit] + Description=Network Manager Wait Online ++Documentation=man:nm-online(1) + Requisite=NetworkManager.service + After=NetworkManager.service +-Wants=network.target +-Before=network.target network-online.target ++Before=network-online.target + + [Service] + Type=oneshot + ExecStart=@bindir@/nm-online -s -q --timeout=30 ++RemainAfterExit=yes + + [Install] +-WantedBy=multi-user.target ++WantedBy=network-online.target diff --git a/debian/patches/Don-t-make-NetworkManager-D-Bus-activatable.patch b/debian/patches/Don-t-make-NetworkManager-D-Bus-activatable.patch new file mode 100644 index 00000000..ce028367 --- /dev/null +++ b/debian/patches/Don-t-make-NetworkManager-D-Bus-activatable.patch @@ -0,0 +1,40 @@ +From: Michael Biebl +Date: Sun, 29 Mar 2015 22:57:50 +0200 +Subject: Don't make NetworkManager D-Bus activatable + +If the NetworkManager daemon has been stopped manually we don't want it +to be autostarted by a client request. +--- + data/Makefile.am | 7 ------- + data/NetworkManager.service.in | 1 - + 2 files changed, 8 deletions(-) + +diff --git a/data/Makefile.am b/data/Makefile.am +index e91361a..a7c8070 100644 +--- a/data/Makefile.am ++++ b/data/Makefile.am +@@ -19,13 +19,6 @@ endif + NetworkManager-dispatcher.service: NetworkManager-dispatcher.service.in + $(edit) $< >$@ + +-servicedir = $(datadir)/dbus-1/system-services +-service_in_files = org.freedesktop.NetworkManager.service.in +-service_DATA = $(service_in_files:.service.in=.service) +- +-$(service_DATA): $(service_in_files) Makefile +- $(edit) $< >$@ +- + install-exec-local: + install -d $(DESTDIR)$(systemdsystemunitdir)/network-online.target.wants + ln -sf $(systemdsystemunitdir)/NetworkManager-wait-online.service $(DESTDIR)$(systemdsystemunitdir)/network-online.target.wants +diff --git a/data/NetworkManager.service.in b/data/NetworkManager.service.in +index 1883b40..5282e5b 100644 +--- a/data/NetworkManager.service.in ++++ b/data/NetworkManager.service.in +@@ -11,6 +11,5 @@ KillMode=process + + [Install] + WantedBy=multi-user.target +-Alias=dbus-org.freedesktop.NetworkManager.service + Also=NetworkManager-dispatcher.service + diff --git a/debian/patches/Don-t-setup-Sleep-Monitor-if-not-booted-with-systemd.patch b/debian/patches/Don-t-setup-Sleep-Monitor-if-not-booted-with-systemd.patch new file mode 100644 index 00000000..5da03672 --- /dev/null +++ b/debian/patches/Don-t-setup-Sleep-Monitor-if-not-booted-with-systemd.patch @@ -0,0 +1,77 @@ +From: Michael Biebl +Date: Sat, 12 Apr 2014 12:38:09 +0200 +Subject: Don't setup Sleep Monitor if not booted with systemd + +NetworkManager uses systemd for suspend/resume support. It listens for +the PrepareForSleep and Resume D-Bus signal sent by logind/systemd and +deactivates the interfaces on sleep and reactivates them on resume. +With a standalone logind we don't get a Resume signal and +NetworkManager remains in sleep mode where the devices are unmanaged. +As a workaround, skip the Sleep Monitor setup if not booted with +systemd. + +Closes: #742933 +--- + configure.ac | 3 ++- + src/Makefile.am | 2 ++ + src/nm-sleep-monitor-systemd.c | 5 +++++ + 3 files changed, 9 insertions(+), 1 deletion(-) + +diff --git a/configure.ac b/configure.ac +index 68dff7a..f6c79ea 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -373,8 +373,9 @@ fi + case $with_suspend_resume in + upower) ;; + systemd) ++ # Link against libsystemd-daemon for sd_booted() + PKG_CHECK_MODULES(SYSTEMD_INHIBIT, [libsystemd >= 209],, +- [PKG_CHECK_MODULES(SYSTEMD_INHIBIT, [libsystemd-login >= 183])]) ++ [PKG_CHECK_MODULES(SYSTEMD_INHIBIT, [libsystemd-login >= 183 libsystemd-daemon])]) + ;; + *) + AC_MSG_ERROR(--with-suspend-resume must be one of [upower, systemd]) +diff --git a/src/Makefile.am b/src/Makefile.am +index a24ac6c..6339cb7 100644 +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -412,6 +412,7 @@ AM_CPPFLAGS += \ + $(LIBNDP_CFLAGS) \ + $(LIBSOUP_CFLAGS) \ + $(SYSTEMD_LOGIN_CFLAGS) \ ++ $(SYSTEMD_INHIBIT_CFLAGS) \ + $(SYSTEMD_DHCP_CFLAGS) \ + \ + -DBINDIR=\"$(bindir)\" \ +@@ -450,6 +451,7 @@ libNetworkManager_la_LIBADD = \ + $(GUDEV_LIBS) \ + $(LIBNL_LIBS) \ + $(SYSTEMD_LOGIN_LIBS) \ ++ $(SYSTEMD_INHIBIT_LIBS) \ + $(LIBNDP_LIBS) \ + $(LIBDL) \ + $(LIBM) +diff --git a/src/nm-sleep-monitor-systemd.c b/src/nm-sleep-monitor-systemd.c +index c0bc65e..0c97335 100644 +--- a/src/nm-sleep-monitor-systemd.c ++++ b/src/nm-sleep-monitor-systemd.c +@@ -25,6 +25,7 @@ + #include + #include + #include ++#include + + #include "nm-logging.h" + #include "nm-dbus-manager.h" +@@ -193,6 +194,10 @@ on_proxy_acquired (GObject *object, + static void + nm_sleep_monitor_init (NMSleepMonitor *self) + { ++ if (!sd_booted()) { ++ nm_log_warn (LOGD_SUSPEND, "Skipping Sleep Monitor setup, system not booted with systemd"); ++ return; ++ } + self->inhibit_fd = -1; + g_dbus_proxy_new_for_bus (G_BUS_TYPE_SYSTEM, + G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START | diff --git a/debian/patches/Force-online-state-with-unmanaged-devices.patch b/debian/patches/Force-online-state-with-unmanaged-devices.patch new file mode 100644 index 00000000..27f668b1 --- /dev/null +++ b/debian/patches/Force-online-state-with-unmanaged-devices.patch @@ -0,0 +1,195 @@ +From: Michael Biebl +Date: Wed, 2 Apr 2014 03:15:53 +0200 +Subject: Force online state with unmanaged devices + +If we have unmanaged devices in /e/n/i, monitor the ifupdown state file +and in case we find active interfaces besides lo, forcefully set the +online state to CONNECTED. + +Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=512286 +--- + src/nm-manager.c | 122 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 122 insertions(+) + +diff --git a/src/nm-manager.c b/src/nm-manager.c +index 0fa88d1..0a39dfb 100644 +--- a/src/nm-manager.c ++++ b/src/nm-manager.c +@@ -64,6 +64,8 @@ + #define NM_AUTOIP_DBUS_SERVICE "org.freedesktop.nm_avahi_autoipd" + #define NM_AUTOIP_DBUS_IFACE "org.freedesktop.nm_avahi_autoipd" + ++#define IFUPDOWN_STATE_FILE "/run/network/ifstate" ++ + static gboolean impl_manager_get_devices (NMManager *manager, + GPtrArray **devices, + GError **err); +@@ -198,6 +200,11 @@ typedef struct { + GFileMonitor *fw_monitor; + guint fw_changed_id; + ++ /* ifupdown state file monitor */ ++ GFileMonitor *ifstate_monitor; ++ guint ifstate_monitor_id; ++ gboolean ifstate_force_online; ++ + guint timestamp_update_id; + + gboolean startup; +@@ -621,6 +628,29 @@ find_best_device_state (NMManager *manager) + return best_state; + } + ++static NMState ++find_unmanaged_state (NMManager *manager, NMState current_state) ++{ ++ NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (manager); ++ 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); ++ ++ ++ if (state == NM_DEVICE_STATE_UNMANAGED) { ++ const char *iface = nm_device_get_ip_iface (dev); ++ if (priv->ifstate_force_online) { ++ new_state = NM_STATE_CONNECTED_GLOBAL; ++ nm_log_dbg (LOGD_CORE, "Unmanaged device found: %s; state CONNECTED forced.", iface); ++ } ++ } ++ } ++ return new_state; ++} ++ + static void + nm_manager_update_state (NMManager *manager) + { +@@ -638,6 +668,9 @@ nm_manager_update_state (NMManager *manager) + + nm_connectivity_set_online (priv->connectivity, new_state >= NM_STATE_CONNECTED_LOCAL); + ++ if (new_state != NM_STATE_CONNECTED_GLOBAL) ++ new_state = find_unmanaged_state (manager, new_state); ++ + if (new_state == NM_STATE_CONNECTED_SITE) { + nm_connectivity_check_async (priv->connectivity, + checked_connectivity, +@@ -4172,6 +4205,65 @@ impl_manager_check_connectivity (NMManager *manager, + nm_auth_chain_add_call (chain, NM_AUTH_PERMISSION_NETWORK_CONTROL, TRUE); + } + ++static void ++check_ifstate_file (gpointer user_data) ++{ ++ NMManager *self = NM_MANAGER (user_data); ++ NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self); ++ GIOChannel *channel; ++ gchar *line; ++ gboolean online = FALSE; ++ ++ channel = g_io_channel_new_file (IFUPDOWN_STATE_FILE, "r", NULL); ++ if (!channel) { ++ nm_log_warn (LOGD_CORE, "Error: failed to open %s", IFUPDOWN_STATE_FILE); ++ return; ++ } ++ ++ while (g_io_channel_read_line (channel, &line, NULL, NULL, NULL) ++ != G_IO_STATUS_EOF && !online) { ++ g_strstrip (line); ++ if (strlen (line) > 0 && g_strcmp0 (line, "lo=lo") != 0) { ++ online = TRUE; ++ } ++ g_free (line); ++ } ++ ++ g_io_channel_shutdown (channel, FALSE, NULL); ++ g_io_channel_unref (channel); ++ ++ if (priv->ifstate_force_online != online) { ++ priv->ifstate_force_online = online; ++ nm_manager_update_state (self); ++ } ++} ++ ++static void ++ifstate_file_changed (GFileMonitor *monitor, ++ GFile *file, ++ GFile *other_file, ++ GFileMonitorEvent event_type, ++ gpointer user_data) ++{ ++ NMManager *self = NM_MANAGER (user_data); ++ NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self); ++ ++ switch (event_type) { ++// case G_FILE_MONITOR_EVENT_CREATED: ++//#if GLIB_CHECK_VERSION(2,23,4) ++// case G_FILE_MONITOR_EVENT_MOVED: ++//#endif ++// case G_FILE_MONITOR_EVENT_ATTRIBUTE_CHANGED: ++ case G_FILE_MONITOR_EVENT_CHANGED: ++ case G_FILE_MONITOR_EVENT_CHANGES_DONE_HINT: ++ nm_log_dbg (LOGD_CORE, "ifupdown state file %s was changed", IFUPDOWN_STATE_FILE); ++ check_ifstate_file (user_data); ++ break; ++ default: ++ break; ++ } ++} ++ + void + nm_manager_start (NMManager *self) + { +@@ -4220,6 +4312,9 @@ nm_manager_start (NMManager *self) + system_create_virtual_devices (self); + + check_if_startup_complete (self); ++ ++ /* Trigger ifupdown state file check */ ++ check_ifstate_file (self); + } + + void +@@ -4916,6 +5011,22 @@ nm_manager_init (NMManager *manager) + KERNEL_FIRMWARE_DIR); + } + ++ /* Monitor the ifupdown state file */ ++ file = g_file_new_for_path (IFUPDOWN_STATE_FILE); ++ priv->ifstate_monitor = g_file_monitor_file (file, G_FILE_MONITOR_NONE, NULL, NULL); ++ g_object_unref (file); ++ ++ if (priv->ifstate_monitor) { ++ priv->ifstate_monitor_id = g_signal_connect (priv->ifstate_monitor, "changed", ++ G_CALLBACK (ifstate_file_changed), ++ manager); ++ nm_log_info (LOGD_CORE, "monitoring ifupdown state file '%s'.", ++ IFUPDOWN_STATE_FILE); ++ } else { ++ nm_log_warn (LOGD_CORE, "failed to monitor ifupdown state file '%s'.", ++ IFUPDOWN_STATE_FILE); ++ } ++ + /* Update timestamps in active connections */ + priv->timestamp_update_id = g_timeout_add_seconds (300, (GSourceFunc) periodic_update_active_connection_timestamps, manager); + } +@@ -5113,6 +5224,17 @@ dispose (GObject *object) + g_clear_object (&priv->fw_monitor); + } + ++ if (priv->ifstate_monitor) { ++ if (priv->ifstate_monitor_id) ++ g_signal_handler_disconnect (priv->ifstate_monitor, priv->ifstate_monitor_id); ++ ++ if (priv->ifstate_force_online) ++ g_source_remove (priv->ifstate_force_online); ++ ++ g_file_monitor_cancel (priv->ifstate_monitor); ++ g_object_unref (priv->ifstate_monitor); ++ } ++ + for (iter = priv->factories; iter; iter = iter->next) { + NMDeviceFactory *factory = iter->data; + diff --git a/debian/patches/Mark-virtual-ethernet-interfaces-as-unmanaged.patch b/debian/patches/Mark-virtual-ethernet-interfaces-as-unmanaged.patch new file mode 100644 index 00000000..fbfd7eff --- /dev/null +++ b/debian/patches/Mark-virtual-ethernet-interfaces-as-unmanaged.patch @@ -0,0 +1,69 @@ +From: Michael Biebl +Date: Thu, 10 Jul 2014 03:38:42 +0200 +Subject: Mark virtual ethernet interfaces as unmanaged + +We do not want to interfere with VBox and VMware network interfaces, so ignore +any virtual ethernet interfaces and mark them as unmanaged. +--- + src/devices/nm-device-ethernet.c | 41 ++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 41 insertions(+) + +diff --git a/src/devices/nm-device-ethernet.c b/src/devices/nm-device-ethernet.c +index ac408d3..116d4d3 100644 +--- a/src/devices/nm-device-ethernet.c ++++ b/src/devices/nm-device-ethernet.c +@@ -250,6 +250,45 @@ out: + g_object_unref (client); + } + ++static void ++nm_device_check_virtual (NMDeviceEthernet *self) ++{ ++ GUdevDevice *dev = NULL; ++ GUdevClient *client = NULL; ++ const char *iface = NULL; ++ const char *subsystems[] = { "net", NULL }; ++ const char *sysfs_path; ++ const char *virtual = "/sys/devices/virtual/net"; ++ ++ iface = nm_device_get_iface (NM_DEVICE (self)); ++ ++ client = g_udev_client_new (subsystems); ++ if (!client) { ++ nm_log_warn (LOGD_DEVICE | LOGD_HW, "(%s): failed to initialize GUdev client", iface); ++ goto out; ++ } ++ ++ dev = g_udev_client_query_by_subsystem_and_name (client, "net", iface); ++ if (!dev) { ++ nm_log_warn (LOGD_DEVICE | LOGD_HW, "(%s): failed to find device with udev", iface); ++ goto out; ++ } ++ ++ sysfs_path = g_udev_device_get_sysfs_path (dev); ++ ++ if (g_ascii_strncasecmp (sysfs_path, virtual, strlen (virtual)) == 0) { ++ nm_log_info (LOGD_DEVICE | LOGD_HW, "(%s): device is virtual, marking as unmanaged", iface); ++ nm_device_set_initial_unmanaged_flag (NM_DEVICE (self), NM_UNMANAGED_DEFAULT, TRUE); ++ } ++ ++out: ++ if (client) ++ g_object_unref (client); ++ if (dev) ++ g_object_unref (dev); ++} ++ ++ + static GObject* + constructor (GType type, + guint n_construct_params, +@@ -272,6 +311,8 @@ constructor (GType type, + + /* s390 stuff */ + _update_s390_subchannels (NM_DEVICE_ETHERNET (object)); ++ ++ nm_device_check_virtual (NM_DEVICE_ETHERNET (object)); + } + + return object; diff --git a/debian/patches/Use-symlinks-for-nmtui.patch b/debian/patches/Use-symlinks-for-nmtui.patch new file mode 100644 index 00000000..aacb4700 --- /dev/null +++ b/debian/patches/Use-symlinks-for-nmtui.patch @@ -0,0 +1,36 @@ +From: Michael Biebl +Date: Thu, 10 Jul 2014 03:33:18 +0200 +Subject: Use symlinks for nmtui + +Make /usr/bin/nmtui-* symbolic links to /usr/bin/nmtui. +--- + clients/tui/Makefile.am | 2 +- + configure.ac | 2 ++ + 2 files changed, 3 insertions(+), 1 deletion(-) + +diff --git a/clients/tui/Makefile.am b/clients/tui/Makefile.am +index ad9335d..09f2700 100644 +--- a/clients/tui/Makefile.am ++++ b/clients/tui/Makefile.am +@@ -24,7 +24,7 @@ links = nmtui-edit nmtui-connect nmtui-hostname + + install-exec-hook: + for link in $(links); do \ +- ln -f $(DESTDIR)$(bindir)/nmtui $(DESTDIR)$(bindir)/$$link; \ ++ cd $(DESTDIR)$(bindir) && $(LN_S) -f nmtui $$link; \ + done + + uninstall-hook: +diff --git a/configure.ac b/configure.ac +index f6c79ea..ffcca3d 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -45,6 +45,8 @@ AM_PROG_CC_C_O + # C++ only required if --enable-qt=yes + AC_PROG_CXX + ++AC_PROG_LN_S ++ + dnl Initialize libtool + LT_PREREQ([2.2]) + LT_INIT([disable-static]) diff --git a/debian/patches/Use-the-correct-path-when-calling-dnssec-trigger-scr.patch b/debian/patches/Use-the-correct-path-when-calling-dnssec-trigger-scr.patch new file mode 100644 index 00000000..b5241593 --- /dev/null +++ b/debian/patches/Use-the-correct-path-when-calling-dnssec-trigger-scr.patch @@ -0,0 +1,23 @@ +From: Arto Jantunen +Date: Sat, 27 Sep 2014 11:13:32 +0300 +Subject: Use the correct path when calling dnssec-trigger-script + +Debian systems don't have /usr/libexec, so the script is installed in +a different path. +--- + src/dns-manager/nm-dns-unbound.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/dns-manager/nm-dns-unbound.c b/src/dns-manager/nm-dns-unbound.c +index 5723bf8..2dcc220 100644 +--- a/src/dns-manager/nm-dns-unbound.c ++++ b/src/dns-manager/nm-dns-unbound.c +@@ -42,7 +42,7 @@ update (NMDnsPlugin *plugin, + * without calling custom scripts. The dnssec-trigger functionality + * may be eventually merged into NetworkManager. + */ +- return nm_spawn_process ("/usr/libexec/dnssec-trigger-script --async --update", NULL) == 0; ++ return nm_spawn_process ("/usr/lib/dnssec-trigger/dnssec-trigger-script --async --update", NULL) == 0; + } + + static gboolean diff --git a/debian/patches/build-install-nm-settings-ifcfg-rh.5-man-page-condit.patch b/debian/patches/build-install-nm-settings-ifcfg-rh.5-man-page-condit.patch new file mode 100644 index 00000000..faf28e14 --- /dev/null +++ b/debian/patches/build-install-nm-settings-ifcfg-rh.5-man-page-condit.patch @@ -0,0 +1,32 @@ +From: Michael Biebl +Date: Mon, 9 Feb 2015 01:12:16 +0100 +Subject: build: install nm-settings-ifcfg-rh.5 man page conditionally + +Only install nm-settings-ifcfg-rh.5 man page if the ifcfg-rh +configuration plugin has been enabled. +--- + man/Makefile.am | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) + +diff --git a/man/Makefile.am b/man/Makefile.am +index 4577cb4..5ed5ad5 100644 +--- a/man/Makefile.am ++++ b/man/Makefile.am +@@ -67,9 +67,15 @@ docbook_generated_man_pages = \ + nmcli-examples.5 + + docbook_autogenerated_man_pages = \ +- nm-settings.5 \ +- nm-settings-keyfile.5 \ ++ nm-settings.5 ++ ++docbook_autogenerated_man_pages = \ ++ nm-settings-keyfile.5 ++ ++if CONFIG_PLUGIN_IFCFG_RH ++docbook_autogenerated_man_pages += \ + nm-settings-ifcfg-rh.5 ++endif + + EXTRA_DIST += \ + nm-settings.xml \ diff --git a/debian/patches/fix-arping-path.patch b/debian/patches/fix-arping-path.patch new file mode 100644 index 00000000..d23762f3 --- /dev/null +++ b/debian/patches/fix-arping-path.patch @@ -0,0 +1,29 @@ +From: Laurent Bigonville +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-device.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c +index 4752628..25b17b3 100644 +--- a/src/devices/nm-device.c ++++ b/src/devices/nm-device.c +@@ -5137,7 +5137,7 @@ send_arps (NMDevice *self, const char *mode_arg) + if (num == 0) + 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 (LOGD_DEVICE | LOGD_IP4, "arping could not be found; no ARPs will be sent"); + return; diff --git a/debian/patches/series b/debian/patches/series index eed36928..a6227112 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,12 +1,11 @@ -0001-Debian-specific-tweaks-for-NetworkManager-systemd-se.patch -0002-Force-online-state-with-unmanaged-devices.patch -0003-Don-t-setup-Sleep-Monitor-if-not-booted-with-systemd.patch -0004-Use-symlinks-for-nmtui.patch -0005-Mark-virtual-ethernet-interfaces-as-unmanaged.patch -0006-Use-the-correct-path-when-calling-dnssec-trigger-scr.patch -0007-fix-arping-path.patch -0008-Fix-dependencies-in-libnm.pc.patch -0009-Check-at-runtime-whether-to-start-ModemManager.patch -0010-build-install-nm-settings-ifcfg-rh.5-man-page-condit.patch -0011-Don-t-make-NetworkManager-D-Bus-activatable.patch -0012-Don-t-block-network.target-on-NetworkManager-wait-on.patch +Debian-specific-tweaks-for-NetworkManager-systemd-se.patch +Force-online-state-with-unmanaged-devices.patch +Don-t-setup-Sleep-Monitor-if-not-booted-with-systemd.patch +Use-symlinks-for-nmtui.patch +Mark-virtual-ethernet-interfaces-as-unmanaged.patch +Use-the-correct-path-when-calling-dnssec-trigger-scr.patch +fix-arping-path.patch +Check-at-runtime-whether-to-start-ModemManager.patch +build-install-nm-settings-ifcfg-rh.5-man-page-condit.patch +Don-t-make-NetworkManager-D-Bus-activatable.patch +Don-t-block-network.target-on-NetworkManager-wait-on.patch -- cgit 1.3.0-6-gf8a5