From c527fd1f14c27855a37f2e8ac5346ce8d940ced2 Mon Sep 17 00:00:00 2001 From: Tudor Florea Date: Thu, 16 Oct 2014 03:05:19 +0200 Subject: initial commit for Enea Linux 4.0-140929 Migrated from the internal git server on the daisy-enea-point-release branch Signed-off-by: Tudor Florea --- .../init-ifupdown/init-ifupdown-1.0/nfsroot | 39 ++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 meta/recipes-core/init-ifupdown/init-ifupdown-1.0/nfsroot (limited to 'meta/recipes-core/init-ifupdown/init-ifupdown-1.0/nfsroot') diff --git a/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/nfsroot b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/nfsroot new file mode 100644 index 0000000000..750c0a98f9 --- /dev/null +++ b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/nfsroot @@ -0,0 +1,39 @@ +#! /bin/sh + +# In case the interface is used as nfsroot, avoid ifup, otherwise +# nfsroot may lose response + +nfsroot=0 + +if test "x$IFACE" = xlo ; then + exit 0 +fi + +exec 9<&0 < /proc/mounts +while read dev mtpt fstype rest; do + if test $mtpt = "/" ; then + case $fstype in + nfs | nfs4) + nfsroot=1 + nfs_addr=`echo $rest | sed -e 's/^.*addr=\([0-9.]*\).*$/\1/'` + break + ;; + *) + ;; + esac + fi +done +exec 0<&9 9<&- + +test $nfsroot -eq 0 && exit 0 + +if [ -x /bin/ip -o -x /sbin/ip ] ; then + nfs_iface=`ip route get $nfs_addr | grep dev | sed -e 's/^.*dev \([-a-z0-9.]*\).*$/\1/'` +fi + +if test "x$IFACE" = "x$nfs_iface" ; then + echo "ifup skipped for nfsroot interface $nfs_iface" + exit 1 +fi + +exit 0 -- cgit v1.2.3-54-g00ecf