summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/initscripts/initscripts-1.0/mountnfs.sh
diff options
context:
space:
mode:
authorTudor Florea <tudor.florea@enea.com>2014-10-16 03:05:19 +0200
committerTudor Florea <tudor.florea@enea.com>2014-10-16 03:05:19 +0200
commitc527fd1f14c27855a37f2e8ac5346ce8d940ced2 (patch)
treebb002c1fdf011c41dbd2f0927bed23ecb5f83c97 /meta/recipes-core/initscripts/initscripts-1.0/mountnfs.sh
downloadpoky-daisy-140929.tar.gz
initial commit for Enea Linux 4.0-140929daisy-140929
Migrated from the internal git server on the daisy-enea-point-release branch Signed-off-by: Tudor Florea <tudor.florea@enea.com>
Diffstat (limited to 'meta/recipes-core/initscripts/initscripts-1.0/mountnfs.sh')
-rwxr-xr-xmeta/recipes-core/initscripts/initscripts-1.0/mountnfs.sh88
1 files changed, 88 insertions, 0 deletions
diff --git a/meta/recipes-core/initscripts/initscripts-1.0/mountnfs.sh b/meta/recipes-core/initscripts/initscripts-1.0/mountnfs.sh
new file mode 100755
index 0000000000..fe6c19605f
--- /dev/null
+++ b/meta/recipes-core/initscripts/initscripts-1.0/mountnfs.sh
@@ -0,0 +1,88 @@
1#!/bin/sh
2### BEGIN INIT INFO
3# Provides: mountnfs
4# Required-Start: $local_fs $network $rpcbind
5# Required-Stop:
6# Default-Start: S
7# Default-Stop:
8### END INIT INFO
9
10#
11# Run in a subshell because of I/O redirection.
12#
13test -f /etc/fstab && (
14
15#
16# Read through fstab line by line. If it is NFS, set the flag
17# for mounting NFS filesystems. If any NFS partition is found and it
18# not mounted with the nolock option, we start the rpcbind.
19#
20rpcbind=no
21mount_nfs=no
22mount_smb=no
23mount_ncp=no
24mount_cifs=no
25while read device mountpt fstype options
26do
27 case "$device" in
28 ""|\#*)
29 continue
30 ;;
31 esac
32
33 case "$options" in
34 *noauto*)
35 continue
36 ;;
37 esac
38
39 if test "$fstype" = nfs
40 then
41 mount_nfs=yes
42 case "$options" in
43 *nolock*)
44 ;;
45 *)
46 rpcbind=yes
47 ;;
48 esac
49 fi
50 if test "$fstype" = smbfs
51 then
52 mount_smb=yes
53 fi
54 if test "$fstype" = ncpfs
55 then
56 mount_ncp=yes
57 fi
58 if test "$fstype" = cifs
59 then
60 mount_cifs=yes
61 fi
62done
63
64exec 0>&1
65
66if test "$rpcbind" = yes
67then
68 if test -x /usr/sbin/rpcbind
69 then
70 echo -n "Starting rpcbind... "
71 start-stop-daemon --start --quiet --exec /usr/sbin/rpcbind
72 sleep 2
73 fi
74fi
75
76if test "$mount_nfs" = yes || test "$mount_smb" = yes || test "$mount_ncp" = yes || test "$mount_cifs" = yes
77then
78 echo "Mounting remote filesystems..."
79 test "$mount_nfs" = yes && mount -a -t nfs
80 test "$mount_smb" = yes && mount -a -t smbfs
81 test "$mount_ncp" = yes && mount -a -t ncpfs
82 test "$mount_cifs" = yes && mount -a -t cifs
83fi
84
85) < /etc/fstab
86
87: exit 0
88