From patchwork Sun Jul 22 00:46:03 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: busybox:udhcpc: fix the root_is_nfs() function Date: Sun, 22 Jul 2012 00:46:03 -0000 From: rongqing.li@windriver.com X-Patchwork-Id: 32793 Message-Id: <1342917963-2253-1-git-send-email-rongqing.li@windriver.com> To: From: Roy.Li [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. Signed-off-by: Roy.Li --- meta/recipes-core/busybox/files/simple.script | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/meta/recipes-core/busybox/files/simple.script b/meta/recipes-core/busybox/files/simple.script index 27368f0..dc2121d 100644 --- a/meta/recipes-core/busybox/files/simple.script +++ b/meta/recipes-core/busybox/files/simple.script @@ -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