Blame 0015-nfs-nfs-lib.sh-add-anaconda_nfsv6_to_var.patch

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