From 214e9d0befe2556f5b8b5c126c3cfec8e4505bd1 Mon Sep 17 00:00:00 2001 From: Coiby Xu Date: Wed, 23 Nov 2022 09:42:18 +0800 Subject: [PATCH] Apply the timeout configuration of nm-initrd-generator Resolves: bz2076416 Upstream: Fedora Conflict: None commit 6b586a903632831b05f591048fdb7de4af273088 Author: Coiby Xu 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 Signed-off-by: Coiby Xu Reviewed-by: Thomas Haller Reviewed-by: Philipp Rudo Signed-off-by: Coiby Xu --- dracut-module-setup.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index 299e105..5227688 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -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"