During boot, it may take some time for a device driver to detect the
its devices. By default, NetworkManager doesn't wait for the device to
be available (this is not an issue for the 1st kernel because NM keeps
running in the 1st kernel). So we need to set
connection.wait-device-timeout=60000 [1] as the same to nm-initrd-generator
to tell NM to wait for 60s. Otherwise dracut-kdump-capture.service would
fail because network isn't ready. Note the user's custom value for
wait-device-timeout is respected.
[1]
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/803...
Signed-off-by: Coiby Xu <coxu(a)redhat.com>
---
dracut-module-setup.sh | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
index ab7fe54..1707b82 100755
--- a/dracut-module-setup.sh
+++ b/dracut-module-setup.sh
@@ -410,6 +410,11 @@ kdump_copy_nmconnection_file() {
_nmconnection_name=$(basename "$_nmconnection_file_path")
_initrd_nmconnection_file_path="/etc/NetworkManager/system-connections/$_nmconnection_name"
inst "$_nmconnection_file_path"
"$_initrd_nmconnection_file_path"
+
+ # Ask NM to wait 60s for the network device to be available
+ # wait-device-timeout=60000 is inserted after "[connection]" so the
+ # user's custom value could overwrite it
+ sed -i '/\[connection\]/a wait-device-timeout=60000'
"${initdir}/$_initrd_nmconnection_file_path"
}
kdump_setup_bridge() {
--
2.37.1