5f0dd72
From db9b5851f3bca0844890d529c7560c89ef81b92a Mon Sep 17 00:00:00 2001
5f0dd72
From: Daniel Molkentin <daniel.molkentin@suse.com>
5f0dd72
Date: Wed, 30 Oct 2019 09:30:32 +0100
5f0dd72
Subject: [PATCH] 99base: Remove duplicate nfsroot_to_var from dracut-lib.sh
5f0dd72
5f0dd72
It already lives in nfs-lib.sh, which is the more correct library scope.
5f0dd72
5f0dd72
Fixes #17
5f0dd72
---
5f0dd72
 modules.d/95nfs/parse-nfsroot.sh |  1 +
5f0dd72
 modules.d/99base/dracut-lib.sh   | 33 ---------------------------------
5f0dd72
 2 files changed, 1 insertion(+), 33 deletions(-)
5f0dd72
5f0dd72
diff --git a/modules.d/95nfs/parse-nfsroot.sh b/modules.d/95nfs/parse-nfsroot.sh
5f0dd72
index f715767b..44a69d48 100755
5f0dd72
--- a/modules.d/95nfs/parse-nfsroot.sh
5f0dd72
+++ b/modules.d/95nfs/parse-nfsroot.sh
5f0dd72
@@ -24,6 +24,7 @@
5f0dd72
 #
5f0dd72
 
5f0dd72
 type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
5f0dd72
+ . /lib/nfs-lib.sh
5f0dd72
 
5f0dd72
 # This script is sourced, so root should be set. But let's be paranoid
5f0dd72
 [ -z "$root" ] && root=$(getarg root=)
5f0dd72
diff --git a/modules.d/99base/dracut-lib.sh b/modules.d/99base/dracut-lib.sh
5f0dd72
index 207a2b5c..c53cd13b 100755
5f0dd72
--- a/modules.d/99base/dracut-lib.sh
5f0dd72
+++ b/modules.d/99base/dracut-lib.sh
5f0dd72
@@ -579,39 +579,6 @@ else
5f0dd72
     }
5f0dd72
 fi
5f0dd72
 
5f0dd72
-# root=nfs:[<server-ip>:]<root-dir>[:<nfs-options>]
5f0dd72
-# root=nfs4:[<server-ip>:]<root-dir>[:<nfs-options>]
5f0dd72
-nfsroot_to_var() {
5f0dd72
-    # strip nfs[4]:
5f0dd72
-    local arg="$@:"
5f0dd72
-    nfs="${arg%%:*}"
5f0dd72
-    arg="${arg##$nfs:}"
5f0dd72
-
5f0dd72
-    # check if we have a server
5f0dd72
-    if strstr "$arg" ':/' ; then
5f0dd72
-        server="${arg%%:/*}"
5f0dd72
-        arg="/${arg##*:/}"
5f0dd72
-    fi
5f0dd72
-
5f0dd72
-    path="${arg%%:*}"
5f0dd72
-
5f0dd72
-    # rest are options
5f0dd72
-    options="${arg##$path}"
5f0dd72
-    # strip leading ":"
5f0dd72
-    options="${options##:}"
5f0dd72
-    # strip  ":"
5f0dd72
-    options="${options%%:}"
5f0dd72
-
5f0dd72
-    # Does it really start with '/'?
5f0dd72
-    [ -n "${path%%/*}" ] && path="error";
5f0dd72
-
5f0dd72
-    #Fix kernel legacy style separating path and options with ','
5f0dd72
-    if [ "$path" != "${path#*,}" ] ; then
5f0dd72
-        options=${path#*,}
5f0dd72
-        path=${path%%,*}
5f0dd72
-    fi
5f0dd72
-}
5f0dd72
-
5f0dd72
 # Create udev rule match for a device with its device name, or the udev property
5f0dd72
 # ID_FS_UUID or ID_FS_LABEL
5f0dd72
 #
5f0dd72