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 6s. Otherwise dracut-kdump-capture.service would
fail because network isn't ready. Note the user's custom value for
wait-device-timeout is respected.
Signed-off-by: Coiby Xu <coxu(a)redhat.com>
---
dracut-module-setup.sh | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
index 91bebcb..75f82af 100755
--- a/dracut-module-setup.sh
+++ b/dracut-module-setup.sh
@@ -371,6 +371,12 @@ kdump_copy_nmconnection_file() {
# profile e.g. connection.master could be Interface name of the master
# device or UUID of the master connection.
sed -i -r "s/(^uuid=).*$/\1${_old_uuid}/g"
"${initdir}/$_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 -E 's/(\[connection\])/\1\nwait-device-timeout=60000/'
"${initdir}/$_initrd_nmconnection_file_path"
+
nmcli connection del "$_uuid"
}
--
2.34.1