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