From: David Dillow Date: Sun, 7 Jun 2009 18:59:38 +0000 (-0400) Subject: NFS root: add missing DHCP root-path/nfsroot=[IP:]/path[,options] format X-Git-Tag: 0.1~89 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4107be9f9f1c2a635d3c504c4388601d3bb02e5f;p=thirdparty%2Fdracut.git NFS root: add missing DHCP root-path/nfsroot=[IP:]/path[,options] format Reported-by: Seewer Philippe --- diff --git a/modules.d/95nfs/nfs-netroot.sh b/modules.d/95nfs/nfs-netroot.sh index 0591a31b3..8d552e9e6 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