X-Git-Url: http://git.grml.org/?a=blobdiff_plain;ds=sidebyside;f=components%2F9990-mount-nfs.sh;fp=components%2F9990-mount-nfs.sh;h=6a3ae55c9f26c41cf5be2ea8533c499d56e58807;hb=a331218718282c5496ff062a0f6aa55908224862;hp=0000000000000000000000000000000000000000;hpb=0aa07bd386f516176364e710e8b9132036c72986;p=live-boot-grml.git diff --git a/components/9990-mount-nfs.sh b/components/9990-mount-nfs.sh new file mode 100755 index 0000000..6a3ae55 --- /dev/null +++ b/components/9990-mount-nfs.sh @@ -0,0 +1,28 @@ +#!/bin/sh + +#set -e + +do_nfsmount () +{ + rc=1 + + modprobe -q nfs + + if [ -n "${NFSOPTS}" ] + then + NFSOPTS="-o ${NFSOPTS}" + fi + + log_begin_msg "Trying nfsmount -o nolock -o ro ${NFSOPTS} ${NFSROOT} ${mountpoint}" + + # FIXME: This while loop is an ugly HACK round an nfs bug + i=0 + while [ "$i" -lt 60 ] + do + nfsmount -o nolock -o ro ${NFSOPTS} "${NFSROOT}" "${mountpoint}" && rc=0 && break + sleep 1 + i="$(($i + 1))" + done + + return ${rc} +}