File 0614-35network-legacy-only-skip-waiting-for-interfaces-if.patch of Package dracut.16003

From 37a9f917d1e45649093343f4b4befdfaf1b82296 Mon Sep 17 00:00:00 2001
From: Martin Wilck <mwilck@suse.com>
Date: Fri, 27 Sep 2019 13:26:10 +0200
Subject: [PATCH 3/3] 35network-legacy: only skip waiting for interfaces if
 netroot is set

Commmit 8a33e52e2f94 assumes that dracut's work is done if a root device
is found. This holds usually for booting computers, but it may be wrong
for other environments.

Only short-cut the waiting if $netroot is also set.

Fixes: 8a33e52e2f94 ("network: stop waiting for interfaces if root device is present")
References: bsc#1152006
---
 modules.d/40network/net-genrules.sh | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/modules.d/40network/net-genrules.sh b/modules.d/40network/net-genrules.sh
index a5a9ae22..e1069607 100755
--- a/modules.d/40network/net-genrules.sh
+++ b/modules.d/40network/net-genrules.sh
@@ -86,7 +86,11 @@ command -v fix_bootif >/dev/null || . /lib/net-lib.sh
 
         for iface in $wait_ifaces; do
             if [ "$bootdev" = "$iface" ] || [ "$NEEDNET" = "1" ]; then
-                echo "${DRACUT_SYSTEMD+systemctl is-active initrd-root-device.target || }[ -f /tmp/net.${iface}.did-setup ]" >$hookdir/initqueue/finished/wait-$iface.sh
+		if [ -n "$netroot" ] && [ -n "$DRACUT_SYSTEMD" ]; then
+                    echo "systemctl is-active initrd-root-device.target || [ -f /tmp/net.${iface}.did-setup ]"
+		else
+                    echo "[ -f /tmp/net.${iface}.did-setup ]"
+		fi >$hookdir/initqueue/finished/wait-$iface.sh
             fi
         done
     # Default: We don't know the interface to use, handle all
-- 
2.16.4

openSUSE Build Service is sponsored by