netbase: only bring up 'lo' when on remote rootfs
authorAndreas Oberritter <obi@opendreambox.org>
Mon, 6 Jul 2009 22:56:32 +0000 (00:56 +0200)
committerAndreas Oberritter <obi@opendreambox.org>
Mon, 6 Jul 2009 22:56:32 +0000 (00:56 +0200)
recipes/netbase/netbase/init
recipes/netbase/netbase_4.21.bb

index f4ff0f7..80672b6 100644 (file)
@@ -75,6 +75,18 @@ doopt () {
     fi
 }
 
+remote_rootfs() {
+    if sed -n 's/^[^ ]* \([^ ]*\) \([^ ]*\) .*$/\1 \2/p' /proc/mounts |
+      grep -q "^/ nfs$"; then
+        return 0
+    elif sed -n 's/^[^ ]* \([^ ]*\) \([^ ]*\) .*$/\1 \2/p' /proc/mounts |
+      grep -q "^/ smbfs$"; then
+        return 0
+    else
+        return 1
+    fi
+}
+
 case "$1" in
     start)
        # /etc/sysctl.conf is preferred
@@ -85,17 +97,17 @@ case "$1" in
        fi
 
         echo -n "Configuring network interfaces... "
-                               wpa_supplicantcheck
-        ifup -a
+       if remote_rootfs; then
+           ifup lo
+       else
+           wpa_supplicantcheck
+           ifup -a
+       fi
        echo "done."
        ;;
     stop)
-        if sed -n 's/^[^ ]* \([^ ]*\) \([^ ]*\) .*$/\1 \2/p' /proc/mounts | 
-          grep -q "^/ nfs$"; then
-            echo "NOT deconfiguring network interfaces: / is an NFS mount"
-        elif sed -n 's/^[^ ]* \([^ ]*\) \([^ ]*\) .*$/\1 \2/p' /proc/mounts |  
-          grep -q "^/ smbfs$"; then
-            echo "NOT deconfiguring network interfaces: / is an SMB mount"
+       if remote_rootfs; then
+           echo "NOT deconfiguring network interfaces: / is a remote filesystem"
        elif sed -n 's/^[^ ]* \([^ ]*\) \([^ ]*\) .*$/\2/p' /proc/mounts | 
           grep -qE '^(nfs|smbfs|ncp|coda)$'; then
             echo "NOT deconfiguring network interfaces: network shares still mounted."
index 4dfc182..958ed33 100644 (file)
@@ -2,7 +2,7 @@ DESCRIPTION = "This package provides the necessary \
 infrastructure for basic TCP/IP based networking."
 SECTION = "base"
 LICENSE = "GPL"
-PR = "r35"
+PR = "r36"
 
 inherit update-rc.d