connman: Try to figure out NFS root interface if using DHCP

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

[YOCTO #5176]

(From OE-Core rev: 29be8e79a200d33555d2887578975e33b8417795)

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Jukka Rissanen 2013-09-17 10:48:00 +03:00 committed by Richard Purdie
parent 06078af4ca
commit 42ef04b364
1 changed files with 15 additions and 8 deletions

View File

@ -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