From a3da46d6c418d694eba6dc44fe91d841751f164d Mon Sep 17 00:00:00 2001 From: Coiby Xu Date: Fri, 18 Nov 2022 17:11:25 +0800 Subject: [PATCH] Skip reset_crashkernel_after_update during package install Currently, kexec-tools tries to reset crashkernel when using anaconda to install the system. But grubby isn't ready and complains that, 10:34:17,014 INF packaging: Configuring (running scriptlet for): kexec-tools-2.0.23-9.el9.x86_64 1646034766 53ff7158f8808774f4e3c3c87e504aa7a6d677b537754dac86c87925c8f0a397 10:34:17,205 INF dnf.rpm: grep: /boot/grub2/grubenv: No such file or directory grep: /boot/grub2/grubenv: No such file or directory grep: /boot/grub2/grubenv: No such file or directory kexec-tools is supposed to update the kernel crashkernel parameter after package upgrade. Unfortunately, the posttrans RPM scriptlet doesn't distinguish between package install and upgrade. This patch skips reset_crashkernel_after_update as similar to e218128e ("Only try to reset crashkernel for osbuild during package install"). Reported-by: Jan Stodola Signed-off-by: Coiby Xu --- kdumpctl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/kdumpctl b/kdumpctl index 7caaae5..b82d869 100755 --- a/kdumpctl +++ b/kdumpctl @@ -1657,6 +1657,10 @@ reset_crashkernel_after_update() local _kernel _crashkernel _dump_mode _fadump_val _old_default_crashkernel _new_default_crashkernel declare -A _crashkernel_vals + if _is_package_install; then + return + fi + _crashkernel_vals[old_kdump]=$(cat /tmp/old_default_crashkernel 2> /dev/null) _crashkernel_vals[old_fadump]=$(cat /tmp/old_default_crashkernel_fadump 2> /dev/null) _crashkernel_vals[new_kdump]=$(get_default_crashkernel kdump)