summaryrefslogtreecommitdiff
path: root/packages/initscripts/initscripts-openmoko/mountnfs.sh
diff options
context:
space:
mode:
authorChia-I Wu <olv@openmoko.com>2008-10-28 16:49:38 +0800
committerJohn Lee <john_lee@openmoko.org>2009-01-12 14:29:03 +0800
commit321b7dc88878ff24a48065048e01957d440a81c5 (patch)
treebcc1f0efb06afb662e250a45b83585870413eb30 /packages/initscripts/initscripts-openmoko/mountnfs.sh
parent0cd7f559c01c45f5fc287e533b7456fc2ba79cb9 (diff)
fastboot: initscripts-openmoko: Replacement for initscripts.
Move the common files into 'files' dir and keep Openmoko specific files under initscripts-openmoko. 'finish' was renamed to 'finish.sh', so various recipes have to be modified as well.
Diffstat (limited to 'packages/initscripts/initscripts-openmoko/mountnfs.sh')
-rw-r--r--packages/initscripts/initscripts-openmoko/mountnfs.sh87
1 files changed, 87 insertions, 0 deletions
diff --git a/packages/initscripts/initscripts-openmoko/mountnfs.sh b/packages/initscripts/initscripts-openmoko/mountnfs.sh
new file mode 100644
index 0000000000..2631392483
--- /dev/null
+++ b/packages/initscripts/initscripts-openmoko/mountnfs.sh
@@ -0,0 +1,87 @@
+#
+# mountnfs.sh Now that TCP/IP is configured, mount the NFS file
+# systems in /etc/fstab if needed. If possible,
+# start the portmapper before mounting (this is needed for
+# Linux 2.1.x and up).
+#
+# Also mounts SBM filesystems now, so the name of
+# this script is getting increasingly inaccurate.
+#
+# Version: @(#)mountnfs.sh 2.83 05-Oct-2001 miquels@cistron.nl
+#
+
+. /etc/default/rcS
+
+#
+# Run in a subshell because of I/O redirection.
+#
+test -x /sbin/portmap && test -f /etc/fstab && (
+
+#
+# Read through fstab line by line. If it is NFS, set the flag
+# for mounting NFS filesystems. If any NFS partition is found and it
+# not mounted with the nolock option, we start the portmapper.
+#
+portmap=no
+mount_nfs=no
+mount_smb=no
+mount_ncp=no
+while read device mountpt fstype options
+do
+ case "$device" in
+ ""|\#*)
+ continue
+ ;;
+ esac
+
+ case "$options" in
+ *noauto*)
+ continue
+ ;;
+ esac
+
+ if test "$fstype" = nfs
+ then
+ mount_nfs=yes
+ case "$options" in
+ *nolock*)
+ ;;
+ *)
+ portmap=yes
+ ;;
+ esac
+ fi
+ if test "$fstype" = smbfs
+ then
+ mount_smb=yes
+ fi
+ if test "$fstype" = ncpfs
+ then
+ mount_ncp=yes
+ fi
+done
+
+exec 0>&1
+
+if test "$portmap" = yes
+then
+ if test -x /sbin/portmap
+ then
+ echo -n "Starting portmapper... "
+ start-stop-daemon --start --quiet --exec /sbin/portmap
+ sleep 2
+ fi
+fi
+
+if test "$mount_nfs" = yes || test "$mount_smb" = yes || test "$mount_ncp" = yes
+then
+ echo "Mounting remote filesystems..."
+ test "$mount_nfs" = yes && mount -a -t nfs
+ test "$mount_smb" = yes && mount -a -t smbfs
+ test "$mount_ncp" = yes && mount -a -t ncpfs
+fi
+
+) < /etc/fstab
+
+: exit 0
+