3a5905
From 934e69b64f4eff5df84d0d94a39aca1933bf3419 Mon Sep 17 00:00:00 2001
3a5905
From: Martin Wilck <mwilck@suse.de>
3a5905
Date: Fri, 27 Sep 2019 13:26:10 +0200
3a5905
Subject: [PATCH] 35network-legacy: only skip waiting for interfaces if netroot
3a5905
 is set
3a5905
3a5905
Commmit 8a33e52e2f94 assumes that dracut's work is done if a root device
3a5905
is found. This holds usually for booting computers, but it may be wrong
3a5905
for other environments.
3a5905
3a5905
Only short-cut the waiting if $netroot is also set.
3a5905
3a5905
Fixes: 8a33e52e2f94 ("network: stop waiting for interfaces if root device is present")
3a5905
References: bsc#1152006
3a5905
3a5905
Resolves: rhbz#2115199
3a5905
---
3a5905
 modules.d/35network-legacy/net-genrules.sh | 6 +++++-
3a5905
 1 file changed, 5 insertions(+), 1 deletion(-)
3a5905
3a5905
diff --git a/modules.d/35network-legacy/net-genrules.sh b/modules.d/35network-legacy/net-genrules.sh
3a5905
index 0d4ef27b..d531bb56 100755
3a5905
--- a/modules.d/35network-legacy/net-genrules.sh
3a5905
+++ b/modules.d/35network-legacy/net-genrules.sh
3a5905
@@ -96,7 +96,11 @@ command -v fix_bootif >/dev/null || . /lib/net-lib.sh
3a5905
 
3a5905
         for iface in $IFACES; do
3a5905
             if [ "$bootdev" = "$iface" ] || [ "$NEEDNET" = "1" ]; then
3a5905
-                echo "${DRACUT_SYSTEMD+systemctl is-active initrd-root-device.target || }[ -f /tmp/net.${iface}.did-setup ]" >$hookdir/initqueue/finished/wait-$iface.sh
3a5905
+		if [ -n "$netroot" ] && [ -n "$DRACUT_SYSTEMD" ]; then
3a5905
+                    echo "systemctl is-active initrd-root-device.target || [ -f /tmp/net.${iface}.did-setup ]"
3a5905
+		else
3a5905
+                    echo "[ -f /tmp/net.${iface}.did-setup ]"
3a5905
+		fi >$hookdir/initqueue/finished/wait-$iface.sh
3a5905
             fi
3a5905
         done
3a5905
     # Default: We don't know the interface to use, handle all