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