[rhel7-branch 2/2] Fix nfs4 stage2 and repo handling (#1230329)

bcl installerbot-noreply at redhat.com
Fri Jun 12 21:17:08 UTC 2015


From: "Brian C. Lane" <bcl at redhat.com>

The reason for this is because anaconda's nfs and dracut's nfs are
different.  dracut expects options at the end, anaconda puts them after
nfs: dracut has a special case to handle anaconda's nfs: form but not
nfs4: so this converts nfs4 to use nfs:nfsvers=4

Resolvese rhbz#1230329
---
 dracut/anaconda-netroot.sh | 25 +++++++++++++++++++------
 1 file changed, 19 insertions(+), 6 deletions(-)

diff --git a/dracut/anaconda-netroot.sh b/dracut/anaconda-netroot.sh
index 79d43c4..936499e 100755
--- a/dracut/anaconda-netroot.sh
+++ b/dracut/anaconda-netroot.sh
@@ -32,13 +32,26 @@ case $repo in
         # after this point.
         repo=${repo//\\x20/ }
 
-        # HACK: work around some Mysterious NFS4 Badness (#811242 and friends)
-        # by defaulting to nfsvers=3 when no version is requested
-        nfs_to_var "$repo" $netif
-        if [ "$nfs" != "nfs4" ] && ! strstr "$options" "vers="; then
-            repo="nfs:${options:+$options,}nfsvers=3:$server:$path"
+        # Convert nfs4 to nfs:nfsvers=4
+        #
+        # The reason for this is because anaconda's nfs and dracut's nfs are different.
+        # dracut expects options at the end, anaconda puts them after nfs:
+        # dracut has a special case to handle anaconda's nfs: form but not nfs4:
+        if str_starts "$repo" "nfs4:"; then
+            repo=nfs:${repo#nfs4:}
+            nfs_to_var "$repo" $netif
+            if ! strstr "$options" "vers="; then
+                repo="nfs:${options:+$options,}nfsvers=4:$server:$path"
+            fi
+        else
+            # HACK: work around some Mysterious NFS4 Badness (#811242 and friends)
+            # by defaulting to nfsvers=3 when no version is requested
+            nfs_to_var "$repo" $netif
+            if ! strstr "$options" "vers="; then
+                repo="nfs:${options:+$options,}nfsvers=3:$server:$path"
+            fi
+            # END HACK. FIXME: Figure out what is up with nfs4, jeez
         fi
-        # END HACK. FIXME: Figure out what is up with nfs4, jeez
         if [ "${repo%.iso}" == "$repo" ]; then
             mount_nfs "$repo" "$repodir" "$netif" || warn "Couldn't mount $repo"
             anaconda_live_root_dir $repodir


-- 
To view this commit on github, visit https://github.com/rhinstaller/anaconda/commit/bc5a7d181f0b0887e787e3eea063ff86d24a53f9


More information about the anaconda-patches mailing list