From 32322960234c8ec91e0d42835a3ec5ee63305070 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 2 Feb 2019 11:00:00 +0100 Subject: Adding upstream version 20190202. Signed-off-by: Daniel Baumann --- system-boot/components/9990-mount-nfs.sh | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100755 system-boot/components/9990-mount-nfs.sh (limited to 'system-boot/components/9990-mount-nfs.sh') diff --git a/system-boot/components/9990-mount-nfs.sh b/system-boot/components/9990-mount-nfs.sh new file mode 100755 index 0000000..6a3ae55 --- /dev/null +++ b/system-boot/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} +} -- cgit v1.2.3