about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2013-01-29 02:25:35 +0100
committerMichael Biebl <biebl@debian.org>2013-01-29 02:25:38 +0100
commit3672f7938dd11b0d16e7cfe8804bc844a835bf80 (patch)
treef0ee9a0c9aa147a5a1d5e6c8984aff20f7400182
parent422513e768d88a30fd7d56d62c61989341c0810b (diff)
No longer run the ifblacklist_migrate.sh script upon installation.
This script was used to comment out DHCP type network interface configurations
in /etc/network/interfaces as otherwise NM would mark such devices as
unmanaged. This script was buggy though and sometimes created a broken network
configuration.
Since debian-installer in wheezy (7.0) will create proper configuration for NM
if the network-manager package is part of the installation, this is no longer
necessary.
If users make a minimal system installation and install the network-manager
package afterwards, show a warning in postinst if we find any interface
configurations in /etc/network/interfaces.
(Closes: #688355, #690987, #606268)
-rw-r--r--debian/changelog12
-rw-r--r--debian/network-manager.postinst15
-rw-r--r--debian/network-manager.postrm1
3 files changed, 24 insertions, 4 deletions
diff --git a/debian/changelog b/debian/changelog
index 1d7f8742..7cab49cd 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -9,6 +9,18 @@ network-manager (0.9.4.0-9) UNRELEASED; urgency=low
     devices as unmanaged by default. If such a network interface has been
     brought up by ifup, set the global online state to CONNECTED.
     (Closes: #512286)
+  * No longer run the ifblacklist_migrate.sh script upon installation. This
+    script was used to comment out DHCP type network interface configurations
+    in /etc/network/interfaces as otherwise NM would mark such devices as
+    unmanaged. This script was buggy though and sometimes created a broken
+    network configuration.
+    Since debian-installer in wheezy (7.0) will create proper configuration
+    for NM if the network-manager package is part of the installation, this is
+    no longer necessary.
+    If users make a minimal system installation and install the
+    network-manager package afterwards, show a warning in postinst if we
+    find any interface configurations in /etc/network/interfaces.
+    (Closes: #688355, #690987, #606268)
 
  -- Michael Biebl <biebl@debian.org>  Mon, 28 Jan 2013 18:25:50 +0100
 
diff --git a/debian/network-manager.postinst b/debian/network-manager.postinst
index b2dd4353..17c4950d 100644
--- a/debian/network-manager.postinst
+++ b/debian/network-manager.postinst
@@ -42,10 +42,17 @@ case "$1" in
             kill `pidof /usr/sbin/nm-system-settings` 2>/dev/null || true
         fi
 
-        if [ -z "$2" ] || dpkg --compare-versions "$2" lt-nl "0.8.1-4"; then
-            if [ -f /etc/network/interfaces ]; then
-                echo "Disabling interfaces configured with plain DHCP in /etc/network/interfaces so that NetworkManager can take them over"
-                /usr/lib/NetworkManager/ifblacklist_migrate.sh
+        NIF=/etc/network/interfaces
+        if [ -z "$2" ] && [ -f $NIF ]; then
+            ifaces=`grep -v '^#' $NIF | awk '/iface/ {print $2}' | sort -u | sed -e 's/lo//' -e '/^$/d' -e 's/^/- /'`
+            if [ -n "$ifaces" ]; then
+                echo "" 1>&2
+                echo "The following network interfaces were found in $NIF" 1>&2
+                echo "which means they are currently configured by ifupdown:" 1>&2
+                echo "$ifaces" 1>&2
+                echo "If you want to manage those interfaces with NetworkManager instead" 1>&2
+                echo "remove their configuration from $NIF." 1>&2
+                echo "" 1>&2
             fi
         fi
         ;;
diff --git a/debian/network-manager.postrm b/debian/network-manager.postrm
index 5bc3e9b4..a95aa9a1 100644
--- a/debian/network-manager.postrm
+++ b/debian/network-manager.postrm
@@ -28,6 +28,7 @@ case "$1" in
         ;;
     remove)
         # Restore the ifupdown configuration that were disabled at installation
+        # TODO: drop this code in jessie
         backup_suffix=0
         while test -e /etc/network/interfaces.bak-${backup_suffix}; do
             backup_suffix=$(($backup_suffix + 1))