]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
NFS root: add missing DHCP root-path/nfsroot=[IP:]/path[,options] format
authorDavid Dillow <dave@thedillows.org>
Sun, 7 Jun 2009 18:59:38 +0000 (14:59 -0400)
committerDavid Dillow <dave@thedillows.org>
Sun, 7 Jun 2009 18:59:38 +0000 (14:59 -0400)
Reported-by: Seewer Philippe <philippe.seewer@bfh.ch>
modules.d/95nfs/nfs-netroot.sh

index 0591a31b370e0486bddc6e35833bc4057244a0e8..8d552e9e6d653e956fc9370058b88c87eb09dc5c 100755 (executable)
@@ -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