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 <mhuang@redhat.com>
Acked-by: Dave Young <dyoung@redhat.com>
Acked-by: Baoquan He <bhe@redhat.com>
This commit is contained in:
Minfei Huang 2015-04-17 16:26:25 +08:00 committed by Baoquan He
parent ef94190ce5
commit 4a468829e7
2 changed files with 6 additions and 3 deletions

View File

@ -220,3 +220,8 @@ is_ipv6_target()
_server=${_server:-$_server_tmp} _server=${_server:-$_server_tmp}
echo $_server | grep -q ":" echo $_server | grep -q ":"
} }
is_atomic()
{
grep -q "ostree" /proc/cmdline
}

View File

@ -294,14 +294,12 @@ get_pcs_cluster_modified_files()
check_boot_dir() check_boot_dir()
{ {
local _is_atomic
#If user specify a boot dir for kdump kernel, let's use it. Otherwise #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 #check whether it's a atomic host. If yes parse the subdirectory under
#/boot; If not just find it under /boot. #/boot; If not just find it under /boot.
[ -n "$KDUMP_BOOTDIR" ] && return [ -n "$KDUMP_BOOTDIR" ] && return
_is_atomic=$(cat /proc/cmdline | grep "ostree") if ! is_atomic || [ "$(uname -m)" = "s390x" ]; then
if [ -z "$_is_atomic" ] || [ "$(uname -m)" = "s390x" ]; then
KDUMP_BOOTDIR="/boot" KDUMP_BOOTDIR="/boot"
else else
eval $(cat /proc/cmdline| grep "BOOT_IMAGE" | cut -d' ' -f1) eval $(cat /proc/cmdline| grep "BOOT_IMAGE" | cut -d' ' -f1)