Blame SOURCES/0257-nfs-nfs-lib.sh-add-anaconda_nfsv6_to_var.patch

712866
From 4350c73199b3d2ac1e22b5e2e093de12ca5ad598 Mon Sep 17 00:00:00 2001
712866
From: Harald Hoyer <harald@redhat.com>
712866
Date: Thu, 2 Jul 2015 15:21:35 +0200
712866
Subject: [PATCH] nfs/nfs-lib.sh: add anaconda_nfsv6_to_var()
712866
712866
add "nfs:[[2001:0db8:85a3:08d3:1319:8a2e:0370:7344]]/path" style parsing
712866
712866
https://bugzilla.redhat.com/show_bug.cgi?id=1190098
712866
(cherry picked from commit ba665de454e7d6ef1da4ba95308fb9f65c7a9497)
712866
---
712866
 modules.d/95nfs/nfs-lib.sh | 18 ++++++++++++++++++
712866
 1 file changed, 18 insertions(+)
712866
712866
diff --git a/modules.d/95nfs/nfs-lib.sh b/modules.d/95nfs/nfs-lib.sh
5c6c2a
index bf7d044b..4f24f698 100755
712866
--- a/modules.d/95nfs/nfs-lib.sh
712866
+++ b/modules.d/95nfs/nfs-lib.sh
712866
@@ -17,6 +17,7 @@ nfs_to_var() {
712866
     # FIXME: local netif=${2:-$netif}?
712866
     case "$1" in
712866
         nfs://*) rfc2224_nfs_to_var "$1" ;;
712866
+        nfs:*[*) anaconda_nfsv6_to_var "$1" ;;
712866
         nfs:*:*:/*) anaconda_nfs_to_var "$1" ;;
712866
         *) nfsroot_to_var "$1" ;;
712866
     esac
712866
@@ -86,6 +87,23 @@ anaconda_nfs_to_var() {
712866
     path="/${1##*:/}"
712866
 }
712866
 
712866
+# IPv6 nfs path will be treated separately
712866
+anaconda_nfsv6_to_var() {
712866
+    nfs="nfs"
712866
+    path="$1:"
712866
+    options="${path#*:/}"
712866
+    path="/${options%%:*}"
712866
+    server="${1#*nfs:}"
712866
+    if str_starts $server '['; then
712866
+        server="${server%:/*}"
712866
+        options="${options#*:*}"
712866
+    else
712866
+        server="${server%:/*}"
712866
+        options="${server%%:*}"
712866
+        server="${server#*:}"
712866
+    fi
712866
+}
712866
+
712866
 # nfsroot_from_dhcp NETIF
712866
 # fill in missing server/path from DHCP options.
712866
 nfsroot_from_dhcp() {