diff --git a/kexec-tools.spec b/kexec-tools.spec index b164ca4..da97682 100644 --- a/kexec-tools.spec +++ b/kexec-tools.spec @@ -306,19 +306,6 @@ then mv /etc/sysconfig/kdump.new /etc/sysconfig/kdump fi -# try to reset kernel crashkernel value to new default value when upgrading -# the package -if ! grep -qs "ostree" /proc/cmdline && [ $1 == 2 ]; then - kdumpctl reset-crashkernel-after-update - rm /tmp/old_default_crashkernel 2>/dev/null -%ifarch ppc64 ppc64le - rm /tmp/old_default_crashkernel_fadump 2>/dev/null -%endif - # dnf would complain about the exit code not being 0. To keep it happy, - # always return 0 - : -fi - %postun %systemd_postun_with_restart kdump.service @@ -351,6 +338,21 @@ do fi done +%posttrans +# try to reset kernel crashkernel value to new default value when upgrading +# the package +if ! grep -qs "ostree" /proc/cmdline && [ $1 == 1 ]; then + kdumpctl reset-crashkernel-after-update + rm /tmp/old_default_crashkernel 2>/dev/null +%ifarch ppc64 ppc64le + rm /tmp/old_default_crashkernel_fadump 2>/dev/null +%endif + # dnf would complain about the exit code not being 0. To keep it happy, + # always return 0 + : +fi + + %files /usr/sbin/kexec %ifarch %{ix86} x86_64 ppc64 s390x ppc64le aarch64