Only try to reset crashkernel for osbuild during package install
Resolves: bz2060319
Upstream: Fedora
Conflict: None
commit e218128e28
Author: Coiby Xu <coxu@redhat.com>
Date: Thu Sep 8 14:30:02 2022 +0800
Only try to reset crashkernel for osbuild during package install
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2060319
Currently, kexec-tools tries to reset crashkernel when using anaconda to
install the system. But grubby isn't ready and complains that,
10:33:17,631 INF packaging: Configuring (running scriptlet for): kernel-core-5.14.0-70.el9.x86_64 1645746534 03dcd32db234b72440ee6764d59b32347c5f0cd98ac3fb55beb47214a76f33b4
10:34:16,696 INF dnf.rpm: grep: /boot/grub2/grubenv: No such file or directory
grep: /boot/grub2/grubenv: No such file or directory
We only need to try resetting crashkernel for osbuild. Skip it for other
cases. To tell if it's package install instead of package upgrade, make
use of %pre to write a file /tmp/kexec-tools-install when "$1 == 1" [1].
[1] https://docs.fedoraproject.org/en-US/packaging-guidelines/Scriptlets/#_syntax
Reported-by: Jan Stodola <jstodola@redhat.com>
Signed-off-by: Coiby Xu <coxu@redhat.com>
Reviewed-by: Lichen Liu <lichenliu@redhat.com>
Signed-off-by: Coiby Xu <coxu@redhat.com>
This commit is contained in:
parent
b1b95d234b
commit
a9968490a2
16
kdumpctl
16
kdumpctl
@ -1624,6 +1624,12 @@ reset_crashkernel()
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# to tell if it's package install other than upgrade
|
||||||
|
_is_package_install()
|
||||||
|
{
|
||||||
|
[[ -f /tmp/kexec_tools_package_install ]]
|
||||||
|
}
|
||||||
|
|
||||||
# update the crashkernel value in GRUB_ETC_DEFAULT if necessary
|
# update the crashkernel value in GRUB_ETC_DEFAULT if necessary
|
||||||
#
|
#
|
||||||
# called by reset_crashkernel_after_update and inherit its array variable
|
# called by reset_crashkernel_after_update and inherit its array variable
|
||||||
@ -1633,6 +1639,10 @@ update_crashkernel_in_grub_etc_default_after_update()
|
|||||||
local _crashkernel _fadump_val
|
local _crashkernel _fadump_val
|
||||||
local _dump_mode _old_default_crashkernel _new_default_crashkernel
|
local _dump_mode _old_default_crashkernel _new_default_crashkernel
|
||||||
|
|
||||||
|
if _is_package_install; then
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
_crashkernel=$(_read_kernel_arg_in_grub_etc_default crashkernel)
|
_crashkernel=$(_read_kernel_arg_in_grub_etc_default crashkernel)
|
||||||
|
|
||||||
if [[ -z $_crashkernel ]]; then
|
if [[ -z $_crashkernel ]]; then
|
||||||
@ -1708,6 +1718,12 @@ reset_crashkernel_for_installed_kernel()
|
|||||||
local _installed_kernel _running_kernel _crashkernel _crashkernel_running
|
local _installed_kernel _running_kernel _crashkernel _crashkernel_running
|
||||||
local _dump_mode_running _fadump_val_running
|
local _dump_mode_running _fadump_val_running
|
||||||
|
|
||||||
|
# During package install, only try to reset crashkernel for osbuild
|
||||||
|
# thus to avoid calling grubby when installing os via anaconda
|
||||||
|
if _is_package_install && ! _is_osbuild; then
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
if ! _installed_kernel=$(_find_kernel_path_by_release "$1"); then
|
if ! _installed_kernel=$(_find_kernel_path_by_release "$1"); then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
@ -278,6 +278,11 @@ if [ ! -f /run/ostree-booted ] && [ $1 == 2 ] && grep -q get-default-crashkernel
|
|||||||
kdumpctl get-default-crashkernel fadump > /tmp/old_default_crashkernel_fadump 2>/dev/null
|
kdumpctl get-default-crashkernel fadump > /tmp/old_default_crashkernel_fadump 2>/dev/null
|
||||||
%endif
|
%endif
|
||||||
fi
|
fi
|
||||||
|
# indicate it's package install so kdumpctl later will only reset crashkernel
|
||||||
|
# value for osbuild.
|
||||||
|
if [ $1 == 1 ]; then
|
||||||
|
touch /tmp/kexec_tools_package_install
|
||||||
|
fi
|
||||||
# don't block package update
|
# don't block package update
|
||||||
:
|
:
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user