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