[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#377643: initramfs-tools: patch to retry nfsmount



Package: initramfs-tools
Version: 0.73d
Followup-For: Bug #377643

attached is a patch which should retry failed nfs mounts until sucess,
which is similar to the behaviour of in-kernel nfsroot (though i think
that has an incrementing sleep between retries).

please consider applying this patch, or a similar patch, as we don't
feel confident we can upload new ltsp packages without a reliable nfs
root option...

live well,
  vagrant
=== modified file 'scripts/nfs'
--- scripts/nfs	
+++ scripts/nfs	
@@ -2,17 +2,8 @@
 
 # FIXME This needs error checking
 
-# Paramter: Where the root should be mounted
-mountroot ()
+do_nfsmount ()
 {
-	[ "$quiet" != "y" ] && log_begin_msg "Running /scripts/nfs-top"
-	run_scripts /scripts/nfs-top
-	[ "$quiet" != "y" ] && log_end_msg
-
-	modprobe -q nfs
-	# For DHCP
-	modprobe -q af_packet
-
 	ipconfig ${DEVICE}
 	. /tmp/net-${DEVICE}.conf
 	if [ "x${NFSROOT}" = "xauto" ]; then
@@ -34,6 +25,25 @@
 	fi
 
 	nfsmount -o nolock ${roflag} ${NFSOPTS} ${NFSROOT} ${rootmnt}
+}
+
+# Paramter: Where the root should be mounted
+mountroot ()
+{
+	[ "$quiet" != "y" ] && log_begin_msg "Running /scripts/nfs-top"
+	run_scripts /scripts/nfs-top
+	[ "$quiet" != "y" ] && log_end_msg
+
+	modprobe -q nfs
+	# For DHCP
+	modprobe -q af_packet
+
+	while true ; do
+		do_nfsmount && break
+		[ "$quiet" != "y" ] && log_begin_msg "Retrying nfs mount"
+		[ "$quiet" != "y" ] && log_end_msg
+		sleep
+	done
 
 	[ "$quiet" != "y" ] && log_begin_msg "Running /scripts/nfs-bottom"
 	run_scripts /scripts/nfs-bottom


Reply to: