busybox:udhcpc: fix the root_is_nfs() function

[YOCTO #2788]

The system will be hung when udhcpc starts, if nfs is mounted
at "/" directory and default route is different after starting
udhcpc.

The cause is that root_is_nfs() does not work after kernel-2.6.37,
since the device name has been changed from /dev/root to
${IPADDR}:${NFSDIR} on /proc/mounts. which leads to remove
the default routes to nfs server,

Now we use a loose match to check if rootfs is nfs.

(From OE-Core rev: 9921cb0104ea36daf909c110bb6767e5fd307da0)

Signed-off-by: Roy.Li <rongqing.li@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Roy.Li 2012-07-24 09:23:19 +08:00 committed by Richard Purdie
parent 1a4a077fac
commit 2ccbf35ed1
2 changed files with 3 additions and 2 deletions

View File

@ -1,5 +1,5 @@
require busybox.inc
PR = "r10"
PR = "r11"
SRC_URI = "http://www.busybox.net/downloads/busybox-${PV}.tar.bz2;name=tarball \
file://B921600.patch \

View File

@ -10,7 +10,8 @@ RESOLV_CONF="/etc/resolv.conf"
# return 0 if root is mounted on a network filesystem
root_is_nfs() {
grep -qe '^/dev/root.*\(nfs\|smbfs\|ncp\|coda\) .*' /proc/mounts
sed -n 's/^[^ ]* \([^ ]*\) \([^ ]*\) .*$/\1 \2/p' /proc/mounts |
grep -q "^/ \(nfs\|smbfs\|ncp\|coda\)$"
}
have_bin_ip=0