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 <mhuang(a)redhat.com>
---
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)
--
1.9.3