]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
99base: Remove duplicate nfsroot_to_var from dracut-lib.sh
authorDaniel Molkentin <daniel.molkentin@suse.com>
Wed, 30 Oct 2019 08:30:32 +0000 (09:30 +0100)
committerHarald Hoyer <harald@hoyer.xyz>
Fri, 6 Mar 2020 10:02:15 +0000 (11:02 +0100)
It already lives in nfs-lib.sh, which is the more correct library scope.

Fixes #17

modules.d/95nfs/parse-nfsroot.sh
modules.d/99base/dracut-lib.sh

index f715767bb31aeb57c92391262217d374e0bb3b55..44a69d486b9eafe5f9012a431794e13009d87b8d 100755 (executable)
@@ -24,6 +24,7 @@
 #
 
 type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
+ . /lib/nfs-lib.sh
 
 # This script is sourced, so root should be set. But let's be paranoid
 [ -z "$root" ] && root=$(getarg root=)
index 207a2b5cb5f262e628bb9ef2ff37541ef51f366b..c53cd13b94bbcc93bc8d8428496f37be14942665 100755 (executable)
@@ -579,39 +579,6 @@ else
     }
 fi
 
-# root=nfs:[<server-ip>:]<root-dir>[:<nfs-options>]
-# root=nfs4:[<server-ip>:]<root-dir>[:<nfs-options>]
-nfsroot_to_var() {
-    # strip nfs[4]:
-    local arg="$@:"
-    nfs="${arg%%:*}"
-    arg="${arg##$nfs:}"
-
-    # check if we have a server
-    if strstr "$arg" ':/' ; then
-        server="${arg%%:/*}"
-        arg="/${arg##*:/}"
-    fi
-
-    path="${arg%%:*}"
-
-    # rest are options
-    options="${arg##$path}"
-    # strip leading ":"
-    options="${options##:}"
-    # strip  ":"
-    options="${options%%:}"
-
-    # Does it really start with '/'?
-    [ -n "${path%%/*}" ] && path="error";
-
-    #Fix kernel legacy style separating path and options with ','
-    if [ "$path" != "${path#*,}" ] ; then
-        options=${path#*,}
-        path=${path%%,*}
-    fi
-}
-
 # Create udev rule match for a device with its device name, or the udev property
 # ID_FS_UUID or ID_FS_LABEL
 #