Apply the timeout configuration of nm-initrd-generator

Resolves: bz2076416
Upstream: Fedora
Conflict: None

commit 6b586a903632831b05f591048fdb7de4af273088
Author: Coiby Xu <coxu@redhat.com>
Date:   Thu Sep 22 22:08:43 2022 +0800

    Apply the timeout configuration of nm-initrd-generator

    nm-wait-online-initrd.service installed by dracut's 35-networkmanager
    module calls nm-online with "-s" which means it returns immediately when
    NetworkManager logs "startup complete" after certain timeouts are
    reached. "startup complete" doesn't necessarily network connectivity has
    been established. nm-initrd-generator has a set of timeouts that in most
    of cases when applied, "startup-complete" means network connectivity has
    been established. So apply it when setting up kdump network.

    Suggested-by: Thomas Haller <thaller@redhat.com>
    Signed-off-by: Coiby Xu <coxu@redhat.com>
    Reviewed-by: Thomas Haller <thaller@redhat.com>
    Reviewed-by: Philipp Rudo <prudo@redhat.com>

Signed-off-by: Coiby Xu <coxu@redhat.com>
This commit is contained in:
Coiby Xu 2022-11-23 09:42:18 +08:00
parent 668875e186
commit 214e9d0bef
1 changed files with 17 additions and 0 deletions

View File

@ -365,6 +365,22 @@ kdump_setup_ifname() {
echo "$_ifname"
}
apply_nm_initrd_generator_timeouts() {
local _timeout_conf
_timeout_conf=$_DRACUT_KDUMP_NM_TMP_DIR/timeout_conf
cat << EOF > "$_timeout_conf"
[device-95-kdump]
carrier-wait-timeout=30000
[connection-95-kdump]
ipv4.dhcp-timeout=90
ipv6.dhcp-timeout=90
EOF
inst "$_timeout_conf" "/etc/NetworkManager/conf.d/95-kdump-timeouts.conf"
}
use_ipv4_or_ipv6() {
local _netif=$1 _uuid=$2
@ -416,6 +432,7 @@ clone_and_modify_nmconnection() {
use_ipv4_or_ipv6 "$_dev" "$_uuid"
nmcli connection modify --temporary uuid "$_uuid" connection.wait-device-timeout 60000 &> >(ddebug)
_cloned_nmconnection_file_path=$(nmcli --get-values UUID,FILENAME connection show | sed -n "s/^${_uuid}://p")
_tmp_nmconnection_file_path=$_DRACUT_KDUMP_NM_TMP_DIR/$(basename "$_nmconnection_file_path")
cp "$_cloned_nmconnection_file_path" "$_tmp_nmconnection_file_path"