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

[initramfs-tools PATCH] scripts/nfs: cleanup retry logic



The condition of log_end_msg was always true.
Calling do_nfsmount before the loop lets us drop two other checks.

Signed-off-by: Ferenc Wagner <wferi@niif.hu>
---
 scripts/nfs |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/scripts/nfs b/scripts/nfs
index 5c41573..02b3830 100644
--- a/scripts/nfs
+++ b/scripts/nfs
@@ -69,14 +69,14 @@ mountroot()
 		delay=${ROOTDELAY}
 	fi
 
-	# loop until nfsmount succeds
+	# loop until nfsmount succeeds
+	do_nfsmount
 	while [ ${retry_nr} -lt ${delay} ] && [ ! -e ${rootmnt}${init} ]; do
-		[ ${retry_nr} -gt 0 ] && \
 		[ "$quiet" != "y" ] && log_begin_msg "Retrying nfs mount"
+		/bin/sleep 1
 		do_nfsmount
 		retry_nr=$(( ${retry_nr} + 1 ))
-		[ ! -e ${rootmnt}${init} ] && /bin/sleep 1
-		[ ${retry_nr} -gt 0 ] && [ "$quiet" != "y" ] && log_end_msg
+		[ "$quiet" != "y" ] && log_end_msg
 	done
 
 	[ "$quiet" != "y" ] && log_begin_msg "Running /scripts/nfs-bottom"
-- 
1.6.5


Reply to: