From 067f15f3f1ebd21f9974ab359a12b90a43ff5ec8 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Jun 02 2021 12:11:56 +0000 Subject: import kexec-tools-2.0.20-50.el8 --- diff --git a/SOURCES/dracut-module-setup.sh b/SOURCES/dracut-module-setup.sh index 22740db..8c02006 100755 --- a/SOURCES/dracut-module-setup.sh +++ b/SOURCES/dracut-module-setup.sh @@ -233,7 +233,7 @@ cal_netmask_by_prefix() { #$2: srcaddr #if it use static ip echo it, or echo null kdump_static_ip() { - local _netdev="$1" _srcaddr="$2" _ipv6_flag + local _netdev="$1" _srcaddr="$2" kdumpnic="$3" _ipv6_flag local _netmask _gateway _ipaddr _target _nexthop _prefix _ipaddr=$(ip addr show dev $_netdev permanent | awk "/ $_srcaddr\/.* /{print \$2}") @@ -270,7 +270,7 @@ kdump_static_ip() { _target="[$_target]" _nexthop="[$_nexthop]" fi - echo "rd.route=$_target:$_nexthop:$_netdev" + echo "rd.route=$_target:$_nexthop:$kdumpnic" done >> ${initdir}/etc/cmdline.d/45route-static.conf } @@ -408,14 +408,16 @@ kdump_setup_znet() { # Setup dracut to bringup a given network interface kdump_setup_netdev() { local _netdev=$1 _srcaddr=$2 - local _static _proto _ip_conf _ip_opts _ifname_opts + local _static _proto _ip_conf _ip_opts _ifname_opts kdumpnic local _netmac=$(kdump_get_mac_addr $_netdev) + kdumpnic=$(kdump_setup_ifname $_netdev) + if [ "$(uname -m)" = "s390x" ]; then kdump_setup_znet $_netdev fi - _static=$(kdump_static_ip $_netdev $_srcaddr) + _static=$(kdump_static_ip $_netdev $_srcaddr $kdumpnic) if [ -n "$_static" ]; then _proto=none elif is_ipv6_address $_srcaddr; then @@ -425,7 +427,7 @@ kdump_setup_netdev() { fi _ip_conf="${initdir}/etc/cmdline.d/40ip.conf" - _ip_opts=" ip=${_static}$(kdump_setup_ifname $_netdev):${_proto}" + _ip_opts=" ip=${_static}$kdumpnic:${_proto}" # dracut doesn't allow duplicated configuration for same NIC, even they're exactly the same. # so we have to avoid adding duplicates @@ -445,7 +447,7 @@ kdump_setup_netdev() { elif kdump_is_vlan "$_netdev"; then kdump_setup_vlan "$_netdev" else - _ifname_opts=" ifname=$(kdump_setup_ifname $_netdev):$_netmac" + _ifname_opts=" ifname=$kdumpnic:$_netmac" echo "$_ifname_opts" >> $_ip_conf fi diff --git a/SOURCES/kdump-lib.sh b/SOURCES/kdump-lib.sh index 034638c..0279904 100755 --- a/SOURCES/kdump-lib.sh +++ b/SOURCES/kdump-lib.sh @@ -849,6 +849,11 @@ get_recommend_size() last_sz="" last_unit="" + start=${_ck_cmdline: :1} + if [ $mem_size -lt $start ]; then + echo "0M" + return + fi IFS=',' for i in $_ck_cmdline; do end=$(echo $i | awk -F "-" '{ print $2 }' | awk -F ":" '{ print $1 }') @@ -876,9 +881,9 @@ kdump_get_arch_recommend_size() fi arch=$(lscpu | grep Architecture | awk -F ":" '{ print $2 }' | tr [:lower:] [:upper:]) - if [ $arch == "X86_64" ] || [ $arch == "S390" ]; then + if [ $arch == "X86_64" ] || [ $arch == "S390X" ]; then ck_cmdline="1G-4G:160M,4G-64G:192M,64G-1T:256M,1T-:512M" - elif [ $arch == "ARM64" ]; then + elif [ $arch == "AARCH64" ]; then ck_cmdline="2G-:448M" elif [ $arch == "PPC64LE" ]; then if is_fadump_capable; then diff --git a/SPECS/kexec-tools.spec b/SPECS/kexec-tools.spec index f0c50f1..d945299 100644 --- a/SPECS/kexec-tools.spec +++ b/SPECS/kexec-tools.spec @@ -1,6 +1,6 @@ Name: kexec-tools Version: 2.0.20 -Release: 48%{?dist} +Release: 50%{?dist} License: GPLv2 Group: Applications/System Summary: The kexec/kdump userspace component @@ -383,6 +383,13 @@ done %endif %changelog +* Tue May 25 2021 Pingfan Liu - 2.0.20-50 +- rd.route should use the name from kdump_setup_ifname +- get kdump ifname once in kdump_install_netdev + +* Tue May 25 2021 Pingfan Liu - 2.0.20-49 +- kdump-lib.sh: fix the case if no enough total RAM for kdump in get_recommend_size() + * Thu May 20 2021 Pingfan Liu - 2.0.20-48 - kdumpctl: Add kdumpctl estimate - mkdumprd: make use of the new get_luks_crypt_dev helper