Blame 0026-network-if-rd.neednet-0-we-don-t-need-a-bootdev.patch

Harald Hoyer b38677
From f4f8fb5c10cc8d0047123324197aff25f0a63e04 Mon Sep 17 00:00:00 2001
Harald Hoyer b38677
From: Harald Hoyer <harald@redhat.com>
Harald Hoyer b38677
Date: Tue, 26 Jan 2016 12:26:03 +0100
Harald Hoyer b38677
Subject: [PATCH] network: if rd.neednet=0 we don't need a bootdev
Harald Hoyer b38677
Harald Hoyer b38677
otherwise dracut would wait for the bootdev interface to appear and be
Harald Hoyer b38677
setup
Harald Hoyer b38677
---
Harald Hoyer b38677
 modules.d/40network/parse-ip-opts.sh | 9 ++++-----
Harald Hoyer b38677
 1 file changed, 4 insertions(+), 5 deletions(-)
Harald Hoyer b38677
Harald Hoyer b38677
diff --git a/modules.d/40network/parse-ip-opts.sh b/modules.d/40network/parse-ip-opts.sh
Harald Hoyer b38677
index 12f4765..5779ef8 100755
Harald Hoyer b38677
--- a/modules.d/40network/parse-ip-opts.sh
Harald Hoyer b38677
+++ b/modules.d/40network/parse-ip-opts.sh
Harald Hoyer b38677
@@ -40,6 +40,8 @@ if [ -n "$NEEDBOOTDEV" ] && getargbool 1 rd.neednet; then
Harald Hoyer b38677
     #[ -z "$BOOTDEV" ] && warn "Please supply bootdev argument for multiple ip= lines"
Harald Hoyer b38677
     echo "rd.neednet=1" > /etc/cmdline.d/dracut-neednet.conf
Harald Hoyer b38677
     info "Multiple ip= arguments: assuming rd.neednet=1"
Harald Hoyer b38677
+else
Harald Hoyer b38677
+    unset NEEDBOOTDEV
Harald Hoyer b38677
 fi
Harald Hoyer b38677
 
Harald Hoyer b38677
 # Check ip= lines
Harald Hoyer b38677
@@ -48,17 +50,14 @@ for p in $(getargs ip=); do
Harald Hoyer b38677
     ip_to_var $p
Harald Hoyer b38677
 
Harald Hoyer b38677
     # make first device specified the BOOTDEV
Harald Hoyer b38677
-    if [ -z "$BOOTDEV" ] && [ -n "$dev" ]; then
Harald Hoyer b38677
+    if [ -n "$NEEDBOOTDEV" ] && [ -z "$BOOTDEV" ] && [ -n "$dev" ]; then
Harald Hoyer b38677
         BOOTDEV="$dev"
Harald Hoyer b38677
-        [ -n "$NEEDBOOTDEV" ] && info "Setting bootdev to '$BOOTDEV'"
Harald Hoyer b38677
+        info "Setting bootdev to '$BOOTDEV'"
Harald Hoyer b38677
     fi
Harald Hoyer b38677
 
Harald Hoyer b38677
     # skip ibft since we did it above
Harald Hoyer b38677
     [ "$autoconf" = "ibft" ] && continue
Harald Hoyer b38677
 
Harald Hoyer b38677
-    # We need to have an ip= line for the specified bootdev
Harald Hoyer b38677
-    [ -n "$NEEDBOOTDEV" ] && [ "$dev" = "$BOOTDEV" ] && BOOTDEVOK=1
Harald Hoyer b38677
-
Harald Hoyer b38677
     # Empty autoconf defaults to 'dhcp'
Harald Hoyer b38677
     if [ -z "$autoconf" ] ; then
Harald Hoyer b38677
         warn "Empty autoconf values default to dhcp"