Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2048690
To indicate they are for internal use only, underscore them.
Reported-by: rcheerla@redhat.com Signed-off-by: Coiby Xu coxu@redhat.com --- 92-crashkernel.install | 2 +- kdumpctl | 4 ++-- kexec-tools.spec | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/92-crashkernel.install b/92-crashkernel.install index 1d67a133..19bd0784 100755 --- a/92-crashkernel.install +++ b/92-crashkernel.install @@ -7,7 +7,7 @@ KERNEL_IMAGE="$4"
case "$COMMAND" in add) - kdumpctl reset-crashkernel-for-installed_kernel "$KERNEL_VERSION" + kdumpctl _reset-crashkernel-for-installed_kernel "$KERNEL_VERSION" exit 0 ;; esac diff --git a/kdumpctl b/kdumpctl index 0e37d36e..19febd53 100755 --- a/kdumpctl +++ b/kdumpctl @@ -1764,12 +1764,12 @@ main() shift reset_crashkernel "$@" ;; - reset-crashkernel-after-update) + _reset-crashkernel-after-update) if [[ $(kdump_get_conf_val auto_reset_crashkernel) != no ]]; then reset_crashkernel_after_update fi ;; - reset-crashkernel-for-installed_kernel) + _reset-crashkernel-for-installed_kernel) if [[ $(kdump_get_conf_val auto_reset_crashkernel) != no ]]; then reset_crashkernel_for_installed_kernel "$2" fi diff --git a/kexec-tools.spec b/kexec-tools.spec index ee43b13c..5f0e1b53 100644 --- a/kexec-tools.spec +++ b/kexec-tools.spec @@ -343,7 +343,7 @@ done # 2. "[ $1 == 1 ]" in posttrans scriptlet means both install and upgrade. The # former case is used to set up crashkernel for osbuild if [ ! -f /run/ostree-booted ] && [ $1 == 1 ]; then - kdumpctl reset-crashkernel-after-update + 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
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/#_synta...
Reported-by: Jan Stodola jstodola@redhat.com Signed-off-by: Coiby Xu coxu@redhat.com --- kdumpctl | 16 ++++++++++++++++ kexec-tools.spec | 5 +++++ 2 files changed, 21 insertions(+)
diff --git a/kdumpctl b/kdumpctl index 19febd53..e705acd0 100755 --- a/kdumpctl +++ b/kdumpctl @@ -1597,6 +1597,12 @@ reset_crashkernel() 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 # # called by reset_crashkernel_after_update and inherit its array variable @@ -1606,6 +1612,10 @@ update_crashkernel_in_grub_etc_default_after_update() local _crashkernel _fadump_val 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)
if [[ -z $_crashkernel ]]; then @@ -1681,6 +1691,12 @@ reset_crashkernel_for_installed_kernel() local _installed_kernel _running_kernel _crashkernel _crashkernel_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 exit 1 fi diff --git a/kexec-tools.spec b/kexec-tools.spec index 5f0e1b53..8f84f8d5 100644 --- a/kexec-tools.spec +++ b/kexec-tools.spec @@ -266,6 +266,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 %endif 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 :
Reviewed-by: Lichen Liu lichliu@redhat.com
On Fri, Sep 16, 2022 at 6:27 PM Coiby Xu coxu@redhat.com wrote:
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/#_synta...
Reported-by: Jan Stodola jstodola@redhat.com Signed-off-by: Coiby Xu coxu@redhat.com
kdumpctl | 16 ++++++++++++++++ kexec-tools.spec | 5 +++++ 2 files changed, 21 insertions(+)
diff --git a/kdumpctl b/kdumpctl index 19febd53..e705acd0 100755 --- a/kdumpctl +++ b/kdumpctl @@ -1597,6 +1597,12 @@ reset_crashkernel() 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 # # called by reset_crashkernel_after_update and inherit its array variable @@ -1606,6 +1612,10 @@ update_crashkernel_in_grub_etc_default_after_update() local _crashkernel _fadump_val local _dump_mode _old_default_crashkernel _new_default_crashkernel
if _is_package_install; thenreturnfi_crashkernel=$(_read_kernel_arg_in_grub_etc_default crashkernel) if [[ -z $_crashkernel ]]; then@@ -1681,6 +1691,12 @@ reset_crashkernel_for_installed_kernel() local _installed_kernel _running_kernel _crashkernel _crashkernel_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 anacondaif _is_package_install && ! _is_osbuild; thenreturnfiif ! _installed_kernel=$(_find_kernel_path_by_release "$1"); then exit 1 fidiff --git a/kexec-tools.spec b/kexec-tools.spec index 5f0e1b53..8f84f8d5 100644 --- a/kexec-tools.spec +++ b/kexec-tools.spec @@ -266,6 +266,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 %endif 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 :
-- 2.37.2 _______________________________________________ kexec mailing list -- kexec@lists.fedoraproject.org To unsubscribe send an email to kexec-leave@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/kexec@lists.fedoraproject.org Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue
On Thu, Oct 20, 2022 at 10:51:45AM +0800, Lichen Liu wrote:
Reviewed-by: Lichen Liu lichliu@redhat.com
Thanks for reviewing the two patches!
On Fri, Sep 16, 2022 at 6:27 PM Coiby Xu coxu@redhat.com wrote:
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/#_synta...
Reported-by: Jan Stodola jstodola@redhat.com Signed-off-by: Coiby Xu coxu@redhat.com
kdumpctl | 16 ++++++++++++++++ kexec-tools.spec | 5 +++++ 2 files changed, 21 insertions(+)
diff --git a/kdumpctl b/kdumpctl index 19febd53..e705acd0 100755 --- a/kdumpctl +++ b/kdumpctl @@ -1597,6 +1597,12 @@ reset_crashkernel() 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 # # called by reset_crashkernel_after_update and inherit its array variable @@ -1606,6 +1612,10 @@ update_crashkernel_in_grub_etc_default_after_update() local _crashkernel _fadump_val local _dump_mode _old_default_crashkernel _new_default_crashkernel
if _is_package_install; thenreturnfi_crashkernel=$(_read_kernel_arg_in_grub_etc_default crashkernel) if [[ -z $_crashkernel ]]; then@@ -1681,6 +1691,12 @@ reset_crashkernel_for_installed_kernel() local _installed_kernel _running_kernel _crashkernel _crashkernel_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 anacondaif _is_package_install && ! _is_osbuild; thenreturnfiif ! _installed_kernel=$(_find_kernel_path_by_release "$1"); then exit 1 fidiff --git a/kexec-tools.spec b/kexec-tools.spec index 5f0e1b53..8f84f8d5 100644 --- a/kexec-tools.spec +++ b/kexec-tools.spec @@ -266,6 +266,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 %endif 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 :
-- 2.37.2 _______________________________________________ kexec mailing list -- kexec@lists.fedoraproject.org To unsubscribe send an email to kexec-leave@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/kexec@lists.fedoraproject.org Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue
Reviewed-by: Lichen Liu lichliu@redhat.com
On Fri, Sep 16, 2022 at 6:27 PM Coiby Xu coxu@redhat.com wrote:
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2048690
To indicate they are for internal use only, underscore them.
Reported-by: rcheerla@redhat.com Signed-off-by: Coiby Xu coxu@redhat.com
92-crashkernel.install | 2 +- kdumpctl | 4 ++-- kexec-tools.spec | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/92-crashkernel.install b/92-crashkernel.install index 1d67a133..19bd0784 100755 --- a/92-crashkernel.install +++ b/92-crashkernel.install @@ -7,7 +7,7 @@ KERNEL_IMAGE="$4"
case "$COMMAND" in add)
kdumpctl reset-crashkernel-for-installed_kernel "$KERNEL_VERSION"
kdumpctl _reset-crashkernel-for-installed_kernel "$KERNEL_VERSION" exit 0 ;;esac diff --git a/kdumpctl b/kdumpctl index 0e37d36e..19febd53 100755 --- a/kdumpctl +++ b/kdumpctl @@ -1764,12 +1764,12 @@ main() shift reset_crashkernel "$@" ;;
reset-crashkernel-after-update)
_reset-crashkernel-after-update) if [[ $(kdump_get_conf_val auto_reset_crashkernel) != no ]]; then reset_crashkernel_after_update fi ;;
reset-crashkernel-for-installed_kernel)
_reset-crashkernel-for-installed_kernel) if [[ $(kdump_get_conf_val auto_reset_crashkernel) != no ]]; then reset_crashkernel_for_installed_kernel "$2" fidiff --git a/kexec-tools.spec b/kexec-tools.spec index ee43b13c..5f0e1b53 100644 --- a/kexec-tools.spec +++ b/kexec-tools.spec @@ -343,7 +343,7 @@ done # 2. "[ $1 == 1 ]" in posttrans scriptlet means both install and upgrade. The # former case is used to set up crashkernel for osbuild if [ ! -f /run/ostree-booted ] && [ $1 == 1 ]; then
- kdumpctl reset-crashkernel-after-update
- 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 -- 2.37.2 _______________________________________________ kexec mailing list -- kexec@lists.fedoraproject.org To unsubscribe send an email to kexec-leave@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/kexec@lists.fedoraproject.org Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue