17094c
From 7b14ab060e50d0035e4c0b1979d49234aa8896b0 Mon Sep 17 00:00:00 2001
17094c
From: Lukas Nykryn <lnykryn@redhat.com>
17094c
Date: Mon, 10 Feb 2020 14:03:30 +0100
17094c
Subject: [PATCH] 40network: bump rd.net.timeout.carrier to 10 seconds
17094c
17094c
On some devices kernel currently takes 5.2 seconds to detect carrier,
17094c
so let's make the default in dracut bit more sensible.
17094c
17094c
See also https://bugzilla.redhat.com/show_bug.cgi?id=1772010
17094c
17094c
(cherry picked from commit 579fbb9fc4205dc216b9642238739d898d2ed02d)
17094c
17094c
Resolves: #1798761
17094c
---
17094c
 dracut.cmdline.7.asc           | 2 +-
17094c
 modules.d/40network/net-lib.sh | 2 +-
17094c
 2 files changed, 2 insertions(+), 2 deletions(-)
17094c
17094c
diff --git a/dracut.cmdline.7.asc b/dracut.cmdline.7.asc
17094c
index 3cee5a00..ab9a24ad 100644
17094c
--- a/dracut.cmdline.7.asc
17094c
+++ b/dracut.cmdline.7.asc
17094c
@@ -645,7 +645,7 @@ NFS
17094c
     Wait <seconds> until IPv6 automatic addresses are assigned. Default is 40 seconds.
17094c
 
17094c
 **rd.net.timeout.carrier=**__<seconds>__::
17094c
-    Wait <seconds> until carrier is recognized. Default is 5 seconds.
17094c
+    Wait <seconds> until carrier is recognized. Default is 10 seconds.
17094c
 
17094c
 CIFS
17094c
 ~~~
17094c
diff --git a/modules.d/40network/net-lib.sh b/modules.d/40network/net-lib.sh
17094c
index 0f3ca6a8..6babcccf 100755
17094c
--- a/modules.d/40network/net-lib.sh
17094c
+++ b/modules.d/40network/net-lib.sh
17094c
@@ -717,7 +717,7 @@ iface_has_carrier() {
17094c
     interface="/sys/class/net/$interface"
17094c
     [ -d "$interface" ] || return 2
17094c
     local timeout="$(getargs rd.net.timeout.carrier=)"
17094c
-    timeout=${timeout:-5}
17094c
+    timeout=${timeout:-10}
17094c
     timeout=$(($timeout*10))
17094c
 
17094c
     linkup "$1"
17094c