On Fri, Apr 22, 2022 at 05:29:41PM +0200, Philipp Rudo wrote:
Hi Coiby,
On Sat, 2 Apr 2022 11:23:47 +0800
Coiby Xu <coxu(a)redhat.com> wrote:
> 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"
you can use
sed -i '/\[connection\]/a wait-device-timeout=60000/' $file
to add a line after a match
Great, thanks for the tip!
Thanks
Philipp
> +
> nmcli connection del "$_uuid"
> }
>
--
Best regards,
Coiby