a99684 Only try to reset crashkernel for osbuild during package install

Authored and Committed by Coiby Xu 2 years ago
    Only try to reset crashkernel for osbuild during package install
    
    Resolves: bz2060319
    Upstream: Fedora
    Conflict: None
    
    commit e218128e282066440a4a654707309d785066d79a
    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>
    
        
file modified
+16 -0
file modified
+5 -0