On 04/09/14 at 01:25pm, Baoquan He wrote:
These utility function will be shared by several files, they are all
operation related to mount stuff.
v5-> v6:
Since in rhel7 nfs4 becomes default nfs version, and its fstype is
nfs4. So change the implementation of get_fs_type_from_target(),
whatever fstype returned from findmount, just echo nfs as fstype for all
nfs version.
Meantime define DEFAULT_PATH="/var/crash".
Signed-off-by: Baoquan He <bhe(a)redhat.com>
Hi, Bao
Things got changed since I committed Martin's patches for generic
cluster. I can't apply your patchset.
Could you rebase your patch on top of master branch please?
Thanks
WANG Chao
---
kdump-lib.sh | 24 ++++++++++++++++++++++++
mkdumprd | 2 +-
2 files changed, 25 insertions(+), 1 deletion(-)
diff --git a/kdump-lib.sh b/kdump-lib.sh
index de32650..9e5ed1d 100755
--- a/kdump-lib.sh
+++ b/kdump-lib.sh
@@ -3,6 +3,7 @@
# Kdump common variables and functions
#
+DEFAULT_PATH="/var/crash/"
FENCE_KDUMP_CONFIG="/etc/sysconfig/fence_kdump"
FENCE_KDUMP_SEND="/usr/libexec/fence_kdump_send"
FENCE_KDUMP_NODES="/etc/fence_kdump_nodes"
@@ -75,3 +76,26 @@ get_root_fs_device()
return
}
+get_mntpoint_from_path()
+{
+ echo $(df $1 | tail -1 | awk '{print $NF}')
+}
+
+get_target_from_path()
+{
+ echo $(df $1 | tail -1 | awk '{print $1}')
+}
+
+get_fs_type_from_target()
+{
+ local fstype
+ fstype=$(findmnt -k -f -n -r -o FSTYPE $1)
+ [[ $fstype = *nfs* ]] && fstype="nfs"
+ echo $fstype
+}
+
+get_mntpoint_from_target()
+{
+ echo $(findmnt -k -f -n -r -o TARGET $1)
+}
+
diff --git a/mkdumprd b/mkdumprd
index 84f1e18..3849866 100644
--- a/mkdumprd
+++ b/mkdumprd
@@ -12,7 +12,7 @@ export IN_KDUMP=1
conf_file="/etc/kdump.conf"
SSH_KEY_LOCATION="/root/.ssh/kdump_id_rsa"
SAVE_PATH=$(grep ^path $conf_file| cut -d' ' -f2)
-[ -z "$SAVE_PATH" ] && SAVE_PATH="/var/crash"
+[ -z "$SAVE_PATH" ] && SAVE_PATH=$DEFAULT_PATH
extra_modules=""
dracut_args=("--hostonly" "-o" "plymouth dash resume")
OVERRIDE_RESETTABLE=0
--
1.8.5.3