445416 kdump-lib: always specify version in is_squash_available

Authored and Committed by Pingfan Liu a year ago
1 file changed. 31 lines added. 33 lines removed.
    kdump-lib: always specify version in is_squash_available
    
    Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2165839
    Upstream: Fedora
    Conflict: None
    
    commit 88919b73f01ed630843893b0fcf4fec57b91ac22
    Author: Philipp Rudo <prudo@redhat.com>
    Date:   Thu Jan 12 16:31:04 2023 +0100
    
        kdump-lib: always specify version in is_squash_available
    
        is_squash_available is only used in dracut-module-setup.sh and mkdumprd.
        Neither of the two scripts calls prepare_kdump_bootinfo which determines
        and sets KDUMP_KERNELVER. Thus KDUMP_KERNELVER is only non-zero if it
        explicitly specified by the user in /etc/sysconfig/kdump (and the file
        gets sourced, which is not the case for drachu-module-setup.sh).
    
        In theory this can even lead to bugs. For example consider the case when
        a debug kernel is running. In that case kdumpctl will try to use the
        non-debug version of the kernel while is_squash_available will make its
        decision based on the debug version. So in case the debug kernel has
        squash available but the non-debug kernel doesn't mkdumprd will try to
        add it nevertheless.
    
        Thus factor out the kernel version detection from prepare_kdump_bootinfo
        and make use of the new function when checking for the availability of
        those kernel modules.
    
        Signed-off-by: Philipp Rudo <prudo@redhat.com>
        Reviewed-by: Coiby Xu <coxu@redhat.com>
    
    Signed-off-by: Pingfan Liu <piliu@redhat.com>
    
        
file modified
+31 -33