summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/nfsroot
diff options
context:
space:
mode:
authorConstantin Musca <constantinx.musca@intel.com>2013-02-04 19:13:20 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-02-06 09:37:28 +0000
commit4cb7c9a7ca3632c15414177e6e3ee399ad48ba08 (patch)
treeb69eaf83119f8b92cddd9ce8ad7a99d265668937 /meta/recipes-core/init-ifupdown/init-ifupdown-1.0/nfsroot
parent7c106a3bb8a427321db579b682adfb4a2bd1eddc (diff)
downloadpoky-4cb7c9a7ca3632c15414177e6e3ee399ad48ba08.tar.gz
netbase: split up in netbase and init-ifupdown
- netbase should only include etc-rpc, etc-protocols, etc-services and the hosts file - the init script/configuration files should be in another package (init-ifupdown) [YOCTO #2486] (From OE-Core rev: 5ce5c3d1226d4a8a4997c63acc1b1b125770d005) Signed-off-by: Constantin Musca <constantinx.musca@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core/init-ifupdown/init-ifupdown-1.0/nfsroot')
-rw-r--r--meta/recipes-core/init-ifupdown/init-ifupdown-1.0/nfsroot39
1 files changed, 39 insertions, 0 deletions
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 @@
1#! /bin/sh
2
3# In case the interface is used as nfsroot, avoid ifup, otherwise
4# nfsroot may lose response
5
6nfsroot=0
7
8if test "x$IFACE" = xlo ; then
9 exit 0
10fi
11
12exec 9<&0 < /proc/mounts
13while read dev mtpt fstype rest; do
14 if test $mtpt = "/" ; then
15 case $fstype in
16 nfs | nfs4)
17 nfsroot=1
18 nfs_addr=`echo $rest | sed -e 's/^.*addr=\([0-9.]*\).*$/\1/'`
19 break
20 ;;
21 *)
22 ;;
23 esac
24 fi
25done
26exec 0<&9 9<&-
27
28test $nfsroot -eq 0 && exit 0
29
30if [ -x /bin/ip -o -x /sbin/ip ] ; then
31 nfs_iface=`ip route get $nfs_addr | grep dev | sed -e 's/^.*dev \([-a-z0-9.]*\).*$/\1/'`
32fi
33
34if test "x$IFACE" = "x$nfs_iface" ; then
35 echo "ifup skipped for nfsroot interface $nfs_iface"
36 exit 1
37fi
38
39exit 0