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