[OE-core] [PATCH] connman: Try to figure out NFS root interface if using DHCP

Jukka Rissanen jukka.rissanen at linux.intel.com
Tue Sep 17 07:48:00 UTC 2013


The commit c73487302270a7c2d3bbbb191ce1dd63ee2016dc missed the case
where the NFS is using DHCP.

[YOCTO #5176]

Signed-off-by: Jukka Rissanen <jukka.rissanen at linux.intel.com>
---
 meta/recipes-connectivity/connman/connman/connman | 23 +++++++++++++++--------
 1 file changed, 15 insertions(+), 8 deletions(-)

diff --git a/meta/recipes-connectivity/connman/connman/connman b/meta/recipes-connectivity/connman/connman/connman
index 2625ade..bf7a94a 100644
--- a/meta/recipes-connectivity/connman/connman/connman
+++ b/meta/recipes-connectivity/connman/connman/connman
@@ -30,16 +30,23 @@ do_start() {
 	EXTRA_PARAM=""
 	if test $nfsroot -eq 1 ; then
 	    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'`
+	    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
+	    if [ ! -z "$NET_ADDR" ]; then
+		if [ "$NET_ADDR" = dhcp ]; then
+		    ethn=`ifconfig | grep "^eth" | sed -e "s/\(eth[0-9]\)\(.*\)/\1/"`
+		    if [ ! -z "$ethn" ]; then
+			EXTRA_PARAM="-I $ethn"
 		    fi
-		done
+		else
+		    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
 	fi
 	if [ -f @LIBDIR@/connman/wired-setup ] ; then
-- 
1.7.11.7




More information about the Openembedded-core mailing list