From f37a64257fac6dcd843c3edd63ebf1761c6157d3 Mon Sep 17 00:00:00 2001 From: Michael Biebl Date: Thu, 10 Jul 2014 04:23:08 +0200 Subject: Update patches. - Drop "Add D-Bus policy for group netdev" patch. Usage of D-Bus "at_console" permissions has been removed upstream and access for unprivleged users is now handled entirely with PolicyKit. - Add patch to use symbolic links instead of hard links for /usr/bin/nmtui-*. - Add patch to treat virtual ethernet devices as unmanaged to avoid interfering with VBox and VMware network interfaces. - Refresh remaining patches. --- debian/changelog | 9 + .../0001-Add-D-Bus-policy-for-group-netdev.patch | 79 --------- ...ific-tweaks-for-NetworkManager-systemd-se.patch | 33 ++++ ...ific-tweaks-for-NetworkManager-systemd-se.patch | 33 ---- ...Force-online-state-with-unmanaged-devices.patch | 194 +++++++++++++++++++++ ...-Sleep-Monitor-if-not-booted-with-systemd.patch | 76 ++++++++ ...Force-online-state-with-unmanaged-devices.patch | 168 ------------------ ...-Sleep-Monitor-if-not-booted-with-systemd.patch | 70 -------- debian/patches/0004-Use-symlinks-for-nmtui.patch | 36 ++++ ...-virtual-ethernet-interfaces-as-unmanaged.patch | 69 ++++++++ debian/patches/series | 9 +- 11 files changed, 422 insertions(+), 354 deletions(-) delete mode 100644 debian/patches/0001-Add-D-Bus-policy-for-group-netdev.patch create mode 100644 debian/patches/0001-Debian-specific-tweaks-for-NetworkManager-systemd-se.patch delete mode 100644 debian/patches/0002-Debian-specific-tweaks-for-NetworkManager-systemd-se.patch create mode 100644 debian/patches/0002-Force-online-state-with-unmanaged-devices.patch create mode 100644 debian/patches/0003-Don-t-setup-Sleep-Monitor-if-not-booted-with-systemd.patch delete mode 100644 debian/patches/0003-Force-online-state-with-unmanaged-devices.patch delete mode 100644 debian/patches/0004-Don-t-setup-Sleep-Monitor-if-not-booted-with-systemd.patch create mode 100644 debian/patches/0004-Use-symlinks-for-nmtui.patch create mode 100644 debian/patches/0005-Mark-virtual-ethernet-interfaces-as-unmanaged.patch (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 30e4151a..48b3b4cf 100644 --- a/debian/changelog +++ b/debian/changelog @@ -16,6 +16,15 @@ network-manager (0.9.10.0-1) UNRELEASED; urgency=medium upgrades. * Specify the path to the pppd and pppoe binary via the corresponding configure switch. + * Update patches. + - Drop "Add D-Bus policy for group netdev" patch. Usage of D-Bus + "at_console" permissions has been removed upstream and access for + unprivleged users is now handled entirely with PolicyKit. + - Add patch to use symbolic links instead of hard links for + /usr/bin/nmtui-*. + - Add patch to treat virtual ethernet devices as unmanaged to avoid + interfering with VBox and VMware network interfaces. + - Refresh remaining patches. -- Michael Biebl Sun, 06 Jul 2014 03:04:21 +0200 diff --git a/debian/patches/0001-Add-D-Bus-policy-for-group-netdev.patch b/debian/patches/0001-Add-D-Bus-policy-for-group-netdev.patch deleted file mode 100644 index 4c55530c..00000000 --- a/debian/patches/0001-Add-D-Bus-policy-for-group-netdev.patch +++ /dev/null @@ -1,79 +0,0 @@ -From: Michael Biebl -Date: Wed, 2 Apr 2014 03:15:53 +0200 -Subject: Add D-Bus policy for group netdev - -This is more or less a verbatim copy of the at_console section. ---- - src/org.freedesktop.NetworkManager.conf | 61 +++++++++++++++++++++++++++++++++ - 1 file changed, 61 insertions(+) - ---- a/src/org.freedesktop.NetworkManager.conf -+++ b/src/org.freedesktop.NetworkManager.conf -@@ -87,6 +87,67 @@ - send_interface="org.freedesktop.NetworkManager" - send_member="wake"/> - -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ - - - 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 new file mode 100644 index 00000000..fd9cf261 --- /dev/null +++ b/debian/patches/0001-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 84a9c95..2fb510f 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-Debian-specific-tweaks-for-NetworkManager-systemd-se.patch b/debian/patches/0002-Debian-specific-tweaks-for-NetworkManager-systemd-se.patch deleted file mode 100644 index c6fedf14..00000000 --- a/debian/patches/0002-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 ddc1627..526a56e 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 - - [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 new file mode 100644 index 00000000..461944b7 --- /dev/null +++ b/debian/patches/0002-Force-online-state-with-unmanaged-devices.patch @@ -0,0 +1,194 @@ +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 09a1985..9aff2a4 100644 +--- a/src/nm-manager.c ++++ b/src/nm-manager.c +@@ -74,6 +74,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); +@@ -209,6 +211,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; +@@ -648,6 +655,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) + { +@@ -663,6 +693,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, +@@ -4071,6 +4103,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) + { +@@ -4114,6 +4205,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); + } + + static gboolean +@@ -4793,6 +4887,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); + } +@@ -4984,6 +5094,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 new file mode 100644 index 00000000..fd566af0 --- /dev/null +++ b/debian/patches/0003-Don-t-setup-Sleep-Monitor-if-not-booted-with-systemd.patch @@ -0,0 +1,76 @@ +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 94b0758..a77d55a 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -351,7 +351,8 @@ fi + case $with_suspend_resume in + upower) ;; + systemd) +- PKG_CHECK_MODULES(SYSTEMD_INHIBIT, [libsystemd-login >= 183]) ++ # Link against libsystemd-daemon for sd_booted() ++ 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 2929e18..85f761b 100644 +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -322,6 +322,7 @@ AM_CPPFLAGS += \ + $(LIBSOUP_CFLAGS) \ + $(POLKIT_CFLAGS) \ + $(SYSTEMD_LOGIN_CFLAGS) \ ++ $(SYSTEMD_INHIBIT_CFLAGS) \ + \ + -DBINDIR=\"$(bindir)\" \ + -DDATADIR=\"$(datadir)\" \ +@@ -364,6 +365,7 @@ libNetworkManager_la_LIBADD = \ + $(LIBNL_LIBS) \ + $(POLKIT_LIBS) \ + $(SYSTEMD_LOGIN_LIBS) \ ++ $(SYSTEMD_INHIBIT_LIBS) \ + $(LIBDL) \ + $(LIBM) + +diff --git a/src/nm-sleep-monitor-systemd.c b/src/nm-sleep-monitor-systemd.c +index 55134c4..9bbcd4c 100644 +--- a/src/nm-sleep-monitor-systemd.c ++++ b/src/nm-sleep-monitor-systemd.c +@@ -26,6 +26,7 @@ + #include + #include + #include ++#include + + #include "nm-logging.h" + #include "nm-dbus-manager.h" +@@ -164,6 +165,10 @@ sleep_setup (NMSleepMonitor *self) + 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; + sleep_setup (self); + take_inhibitor (self); diff --git a/debian/patches/0003-Force-online-state-with-unmanaged-devices.patch b/debian/patches/0003-Force-online-state-with-unmanaged-devices.patch deleted file mode 100644 index 7fe346bd..00000000 --- a/debian/patches/0003-Force-online-state-with-unmanaged-devices.patch +++ /dev/null @@ -1,168 +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 | 104 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ - 1 file changed, 104 insertions(+) - ---- a/src/nm-manager.c -+++ b/src/nm-manager.c -@@ -78,6 +78,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); -@@ -250,6 +252,11 @@ - guint fw_monitor_id; - guint fw_changed_id; - -+ /* ifupdown state file monitor */ -+ GFileMonitor *ifstate_monitor; -+ guint ifstate_monitor_id; -+ gboolean ifstate_force_online; -+ - guint timestamp_update_id; - - GHashTable *nm_bridges; -@@ -620,6 +627,14 @@ - } - } - -+ 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; -+ nm_log_dbg (LOGD_CORE, "Unmanaged device found: %s; state CONNECTED forced.", iface); -+ } -+ } -+ - if (nm_device_is_activating (dev)) - new_state = NM_STATE_CONNECTING; - else if (new_state != NM_STATE_CONNECTING) { -@@ -3963,6 +3978,65 @@ - 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) - { -@@ -4025,6 +4099,9 @@ - /* FIXME: remove when we handle bridges non-destructively */ - g_hash_table_unref (priv->nm_bridges); - priv->nm_bridges = NULL; -+ -+ /* Trigger ifupdown state file check */ -+ check_ifstate_file (self); - } - - static gboolean -@@ -4586,6 +4663,17 @@ - g_object_unref (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); -+ } -+ - g_slist_free (priv->factories); - - if (priv->timestamp_update_id) { -@@ -4945,6 +5033,22 @@ - 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); -+ } -+ - load_device_factories (manager); - - /* Update timestamps in active connections */ diff --git a/debian/patches/0004-Don-t-setup-Sleep-Monitor-if-not-booted-with-systemd.patch b/debian/patches/0004-Don-t-setup-Sleep-Monitor-if-not-booted-with-systemd.patch deleted file mode 100644 index 4b19a331..00000000 --- a/debian/patches/0004-Don-t-setup-Sleep-Monitor-if-not-booted-with-systemd.patch +++ /dev/null @@ -1,70 +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(-) - ---- a/configure.ac -+++ b/configure.ac -@@ -327,7 +327,8 @@ - case $with_suspend_resume in - upower) ;; - systemd) -- PKG_CHECK_MODULES(SYSTEMD_INHIBIT, [libsystemd-login >= 183]) -+ # Link against libsystemd-daemon for sd_booted() -+ PKG_CHECK_MODULES(SYSTEMD_INHIBIT, [libsystemd-login >= 183 libsystemd-daemon]) - ;; - *) - AC_MSG_ERROR(--with-suspend-resume must be one of [upower, systemd]) ---- a/src/Makefile.am -+++ b/src/Makefile.am -@@ -304,6 +304,7 @@ - $(LIBNL_CFLAGS) \ - $(POLKIT_CFLAGS) \ - $(SYSTEMD_LOGIN_CFLAGS) \ -+ $(SYSTEMD_INHIBIT_CFLAGS) \ - $(LIBSOUP_CFLAGS) \ - $(AM_CPPFLAGS) \ - -DBINDIR=\"$(bindir)\" \ -@@ -346,6 +347,7 @@ - $(LIBNL_LIBS) \ - $(POLKIT_LIBS) \ - $(SYSTEMD_LOGIN_LIBS) \ -+ $(SYSTEMD_INHIBIT_LIBS) \ - $(LIBSOUP_LIBS) \ - $(LIBM) \ - $(LIBDL) ---- 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" -@@ -304,6 +305,10 @@ - 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; - sleep_setup (self); - take_inhibitor (self); diff --git a/debian/patches/0004-Use-symlinks-for-nmtui.patch b/debian/patches/0004-Use-symlinks-for-nmtui.patch new file mode 100644 index 00000000..bdb55fdb --- /dev/null +++ b/debian/patches/0004-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. +--- + configure.ac | 2 ++ + tui/Makefile.am | 2 +- + 2 files changed, 3 insertions(+), 1 deletion(-) + +diff --git a/configure.ac b/configure.ac +index a77d55a..3c216a2 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -46,6 +46,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/tui/Makefile.am b/tui/Makefile.am +index 755b689..7f4e7d6 100644 +--- a/tui/Makefile.am ++++ b/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/debian/patches/0005-Mark-virtual-ethernet-interfaces-as-unmanaged.patch b/debian/patches/0005-Mark-virtual-ethernet-interfaces-as-unmanaged.patch new file mode 100644 index 00000000..8cc4c813 --- /dev/null +++ b/debian/patches/0005-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 f4a90c7..bed6b33 100644 +--- a/src/devices/nm-device-ethernet.c ++++ b/src/devices/nm-device-ethernet.c +@@ -265,6 +265,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, +@@ -290,6 +329,8 @@ constructor (GType type, + + /* s390 stuff */ + _update_s390_subchannels (NM_DEVICE_ETHERNET (self)); ++ ++ nm_device_check_virtual (NM_DEVICE_ETHERNET (self)); + } + + return object; diff --git a/debian/patches/series b/debian/patches/series index 43a216a5..196ff3f7 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,4 +1,5 @@ -0001-Add-D-Bus-policy-for-group-netdev.patch -0002-Debian-specific-tweaks-for-NetworkManager-systemd-se.patch -0003-Force-online-state-with-unmanaged-devices.patch -0004-Don-t-setup-Sleep-Monitor-if-not-booted-with-systemd.patch +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 -- cgit 1.3.0-6-gf8a5