diff --git a/SOURCES/kdump-lib.sh b/SOURCES/kdump-lib.sh index aa2dfd6..3439e7e 100755 --- a/SOURCES/kdump-lib.sh +++ b/SOURCES/kdump-lib.sh @@ -315,9 +315,9 @@ kdump_get_persistent_dev() { echo $(get_persistent_dev "$dev") } -is_atomic() +is_ostree() { - grep -q "ostree" /proc/cmdline + test -f /run/ostree-booted } # fixme, try the best to decide whether the ipv6 addr is allocated by slaac or dhcp6 @@ -332,11 +332,6 @@ is_ipv6_auto() fi } -is_atomic() -{ - grep -q "ostree" /proc/cmdline -} - is_ipv6_address() { echo $1 | grep -q ":" @@ -703,8 +698,13 @@ prepare_kdump_kernel() boot_dirlist=${KDUMP_BOOTDIR:-"/boot /boot/efi /efi /"} boot_imglist="$KDUMP_IMG-$kdump_kernelver$KDUMP_IMG_EXT $machine_id/$kdump_kernelver/$KDUMP_IMG" + # The kernel of OSTree based systems is not in the standard locations. + if is_ostree; then + boot_dirlist="$(echo /boot/ostree/*) $boot_dirlist" + fi + # Use BOOT_IMAGE as reference if possible, strip the GRUB root device prefix in (hd0,gpt1) format - boot_img="$(sed "s/^BOOT_IMAGE=\((\S*)\)\?\(\S*\) .*/\2/" /proc/cmdline)" + boot_img="$(grep -P -o '^BOOT_IMAGE=(\S+)' /proc/cmdline | sed "s/^BOOT_IMAGE=\((\S*)\)\?\(\S*\)/\2/")" if [[ "$boot_img" == *"$kdump_kernelver" ]]; then boot_imglist="$boot_img $boot_imglist" fi diff --git a/SPECS/kexec-tools.spec b/SPECS/kexec-tools.spec index 38a5c66..7061908 100644 --- a/SPECS/kexec-tools.spec +++ b/SPECS/kexec-tools.spec @@ -1,6 +1,6 @@ Name: kexec-tools Version: 2.0.24 -Release: 5%{?dist} +Release: 6%{?dist} License: GPLv2 Group: Applications/System Summary: The kexec/kdump userspace component @@ -393,6 +393,12 @@ done %endif %changelog +* Mon Jul 18 2022 Pingfan Liu - 2.0.24-6 +- kdump-lib: Add the CoreOS kernel dir to the boot_dirlist +- kdump-lib: attempt to fix BOOT_IMAGE detection +- kdump-lib: change how ostree based systems are detected +- kdump-lib: clear up references to Atomic/CoreOS + * Mon Jul 4 2022 Pingfan Liu - 2.0.24-5 - kdump-lib: use non-debug kernels first