From 4a468829e730f4e2cee7c1bc9f9992f86ad05895 Mon Sep 17 00:00:00 2001 From: Minfei Huang Date: Fri, 17 Apr 2015 16:26:25 +0800 Subject: [PATCH] kdump-lib: Add new function to judge the system is Atomic or not For Atomic system, the cmdline will contain the specific string "ostree". So we can filter out the "ostree" to judge the system is Atomic or not. Signed-off-by: Minfei Huang Acked-by: Dave Young Acked-by: Baoquan He --- kdump-lib.sh | 5 +++++ kdumpctl | 4 +--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/kdump-lib.sh b/kdump-lib.sh index ca7563a..8b0516f 100755 --- a/kdump-lib.sh +++ b/kdump-lib.sh @@ -220,3 +220,8 @@ is_ipv6_target() _server=${_server:-$_server_tmp} echo $_server | grep -q ":" } + +is_atomic() +{ + grep -q "ostree" /proc/cmdline +} diff --git a/kdumpctl b/kdumpctl index 31ceb47..ca053a1 100755 --- a/kdumpctl +++ b/kdumpctl @@ -294,14 +294,12 @@ get_pcs_cluster_modified_files() check_boot_dir() { - local _is_atomic #If user specify a boot dir for kdump kernel, let's use it. Otherwise #check whether it's a atomic host. If yes parse the subdirectory under #/boot; If not just find it under /boot. [ -n "$KDUMP_BOOTDIR" ] && return - _is_atomic=$(cat /proc/cmdline | grep "ostree") - if [ -z "$_is_atomic" ] || [ "$(uname -m)" = "s390x" ]; then + if ! is_atomic || [ "$(uname -m)" = "s390x" ]; then KDUMP_BOOTDIR="/boot" else eval $(cat /proc/cmdline| grep "BOOT_IMAGE" | cut -d' ' -f1)