]> code.ossystems Code Review - openembedded-core.git/commitdiff
connman: Ignore the NFS root network interface in init script
authorJukka Rissanen <jukka.rissanen@linux.intel.com>
Fri, 6 Sep 2013 07:23:00 +0000 (10:23 +0300)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 6 Sep 2013 22:01:50 +0000 (23:01 +0100)
The connman init.d script tried to ignore all the network interfaces
if NFS root is configured. We should only ignore the interface
that is used by NFS root.

[YOCTO #4587]

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-connectivity/connman/connman/connman

index 67ba7c8a2a3dcb924ea8b2d02bb97bd5074fa46d..2625adeead8647a7333aee0c807b5b9384421803 100644 (file)
@@ -29,8 +29,18 @@ done
 do_start() {
        EXTRA_PARAM=""
        if test $nfsroot -eq 1 ; then
-               ethn=`ifconfig | grep eth | sed -e "s/\(eth[0-9]\)\(.*\)/\1/"`
-               EXTRA_PARAM="-I $ethn"
+           NET_DEVS=`cat /proc/net/dev | sed -ne 's/^\([a-zA-Z0-9 ]*\):.*$/\1/p'`
+           NET_ADDR=`cat /proc/cmdline | sed -ne 's/^.*ip=\([^ ]*\):.*$/\1/p'`
+
+           if [ x$NET_ADDR != x ]; then
+               for i in $NET_DEVS; do
+                   ADDR=`ifconfig $i | sed 's/addr://g' | sed -ne 's/^.*inet \([0-9.]*\) .*$/\1/p'`
+                   if [ "$NET_ADDR" = "$ADDR" ]; then
+                       EXTRA_PARAM="-I $i"
+                       break
+                   fi
+               done
+           fi
        fi
        if [ -f @LIBDIR@/connman/wired-setup ] ; then
                . @LIBDIR@/connman/wired-setup