From e47ec659e9091db6253d38b91c723c87068416c1 Mon Sep 17 00:00:00 2001 From: Lichen Liu Date: Tue, 7 Mar 2023 10:35:54 +0800 Subject: [PATCH] kdump-lib: clear up references to Atomic/CoreOS Resolves: bz2174836 Upstream: Fedora Conflict: None commit 980f10aa40852da41907dc0aeb59ad7d3e8f4c30 Author: Dusty Mabe Date: Wed Jun 22 11:58:31 2022 -0400 kdump-lib: clear up references to Atomic/CoreOS There are many variants on OSTree based systems these days so we should probably refer to the class of systems as "OSTree based systems". Also, Atomic Host is dead. Signed-off-by: Dusty Mabe Acked-by: Coiby Xu Signed-off-by: Lichen Liu --- kdump-lib.sh | 2 +- kdumpctl | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/kdump-lib.sh b/kdump-lib.sh index 0c57a38..4c9f664 100755 --- a/kdump-lib.sh +++ b/kdump-lib.sh @@ -254,7 +254,7 @@ kdump_get_persistent_dev() echo $(get_persistent_dev "$dev") } -is_atomic() +is_ostree() { grep -q "ostree" /proc/cmdline } diff --git a/kdumpctl b/kdumpctl index 7ebeb43..3eb2f73 100755 --- a/kdumpctl +++ b/kdumpctl @@ -1407,7 +1407,7 @@ _update_kernel_cmdline() { local _kernel_path=$1 _crashkernel=$2 _dump_mode=$3 _fadump_val=$4 - if is_atomic; then + if is_ostree; then if rpm-ostree kargs | grep -q "crashkernel="; then rpm-ostree kargs --replace="crashkernel=$_crashkernel" else @@ -1540,13 +1540,13 @@ reset_crashkernel() esac done - # 1. CoreOS uses "rpm-ostree kargs" instead of grubby to manage kernel command - # line. --kernel=ALL doesn't make sense for CoreOS. - # 2. CoreOS doesn't support POWER so the dump mode is always kdump. + # 1. OSTree systems use "rpm-ostree kargs" instead of grubby to manage kernel command + # line. --kernel=ALL doesn't make sense for OStree. + # 2. We don't have any OSTree POWER systems so the dump mode is always kdump. # 3. "rpm-ostree kargs" would prompt the user to reboot the system after # modifying the kernel command line so there is no need for kexec-tools # to repeat it. - if is_atomic; then + if is_ostree; then _old_crashkernel=$(rpm-ostree kargs | sed -n -E 's/.*(^|\s)crashkernel=(\S*).*/\2/p') _new_dump_mode=kdump _new_crashkernel=$(kdump_get_arch_recommend_crashkernel "$_new_dump_mode")