Splitting out a first bunch of functions out to /live/live/boot/.
[live-boot-grml.git] / scripts / boot / mount-nfs.sh
1 #!/bin/sh
2
3 do_nfsmount ()
4 {
5         rc=1
6
7         modprobe -q nfs
8
9         if [ -n "${NFSOPTS}" ]
10         then
11                 NFSOPTS="-o ${NFSOPTS}"
12         fi
13
14         log_begin_msg "Trying nfsmount -o nolock -o ro ${NFSOPTS} ${NFSROOT} ${mountpoint}"
15
16         # FIXME: This while loop is an ugly HACK round an nfs bug
17         i=0
18         while [ "$i" -lt 60 ]
19         do
20                 nfsmount -o nolock -o ro ${NFSOPTS} "${NFSROOT}" "${mountpoint}" && rc=0 && break
21                 sleep 1
22                 i="$(($i + 1))"
23         done
24
25         return ${rc}
26 }