kfan / rpms / kexec-tools

Forked from rpms/kexec-tools 3 years ago
Clone

65b0f80 kdump-lib: Add get_ifcfg_filename() to get the proper ifcfg file

1 file Authored by Xunlei Pang 7 years ago, Committed by Dave Young 7 years ago,
1 file changed. 103 lines added. 0 lines removed.
    kdump-lib: Add get_ifcfg_filename() to get the proper ifcfg file
    
    Previously, we assumed the ifcfg file of a network "interface" is
    "/etc/sysconfig/network-scripts/ifcfg-<interface>", but actually
    it is not the case.
    
    For example, for network interface "enp0s25", we are able to
    generate like "/etc/sysconfig/network-scripts/ifcfg-enp0s25-test"
    for it via network-manager.
    
    The "suffix" in "ifcfg-<suffix>" is actually a "configuration"
    name not "interface" name, though normally we use the "interface"
    name as its "configuration" name. You can refer to "man ifup"
    for some detail.
    
    So, this patch adds some assistant helpers to acquire the right
    ifcfg file for an interface. Borrow some logic from script below:
    "/etc/sysconfig/network-scripts/network-functions"
    
    Signed-off-by: Xunlei Pang <xlpang@redhat.com>
    Acked-by: Dave Young <dyoung@redhat.com>
    
        
file modified
+103 -0