[PATCH 04/11] NFS root: add missing DHCP root-path/nfsroot=[IP:]/path[,options] format

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

 



Reported-by: Seewer Philippe <philippe.seewer@xxxxxx>
---
 modules.d/95nfs/nfs-netroot.sh |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/modules.d/95nfs/nfs-netroot.sh b/modules.d/95nfs/nfs-netroot.sh
index 0591a31..8d552e9 100755
--- a/modules.d/95nfs/nfs-netroot.sh
+++ b/modules.d/95nfs/nfs-netroot.sh
@@ -14,6 +14,10 @@ if [ "$root" = "dhcp" -o "$root" = "nfs" -o "$root" = "nfs4" ]; then
 	if check_occurances "$new_root_path" ':' 2; then
 	    root="$nfsver:$new_root_path"
 	fi ;;
+    *:/*,*)
+	if check_occurances "$new_root_path" ':' 1; then
+	    root="$nfsver:$new_root_path"
+	fi ;;
     *:/*)
 	if check_occurances "$new_root_path" ':' 1; then
 	    root="$nfsver:$new_root_path:"
@@ -22,6 +26,10 @@ if [ "$root" = "dhcp" -o "$root" = "nfs" -o "$root" = "nfs4" ]; then
 	if check_occurances "$new_root_path" ':' 1; then
 	    root="$nfsver::$new_root_path"
 	fi ;;
+    /*,*)
+	if check_occurances "$new_root_path" ':' 0; then
+	    root="$nfsver::$new_root_path"
+	fi ;;
     /*)
 	if check_occurances "$new_root_path" ':' 0; then
 	    root="$nfsver::$new_root_path:"
@@ -40,6 +48,14 @@ if [ -z "${root%%nfs:*}" -o -z "${root%%nfs4:*}" ]; then
     if [ -z "$nfsserver" -o "$nfsserver" = "$nfspath" ]; then
 	nfsserver=$new_dhcp_server_identifier
     fi
+
+    # Handle alternate syntax of path,options
+    if [ "$nfsflags" = "$nfspath" -a "${root#*,}" != "$root" ]; then
+	nfspath=${root%%,*}
+	nfsflags=${root#*,}
+    fi
+
+    # Catch the case when no additional flags are set
     if [ "$nfspath" = "$nfsflags" ]; then
 	unset nfsflags
     fi
-- 
1.6.0.6

--
To unsubscribe from this list: send the line "unsubscribe initramfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux