Blame 0076-network-wait-for-all-required-interfaces-if-rd.needn.patch

Harald Hoyer 75f812
From feaf30ffaa3365febe06ef3f0086778a6d364f0c Mon Sep 17 00:00:00 2001
Harald Hoyer 75f812
From: Harald Hoyer <harald@redhat.com>
Harald Hoyer 75f812
Date: Thu, 30 May 2013 11:38:23 +0200
Harald Hoyer 75f812
Subject: [PATCH] network: wait for all required interfaces if "rd.neednet=1"
Harald Hoyer 75f812
Harald Hoyer 75f812
also set bootdev to the first configured interface, if missing
Harald Hoyer 75f812
Harald Hoyer 75f812
https://bugzilla.redhat.com/show_bug.cgi?id=801829
Harald Hoyer 75f812
---
Harald Hoyer 75f812
 modules.d/40network/net-genrules.sh  | 8 +++++---
Harald Hoyer 75f812
 modules.d/40network/parse-ip-opts.sh | 9 ++++++---
Harald Hoyer 75f812
 2 files changed, 11 insertions(+), 6 deletions(-)
Harald Hoyer 75f812
Harald Hoyer 75f812
diff --git a/modules.d/40network/net-genrules.sh b/modules.d/40network/net-genrules.sh
Harald Hoyer 75f812
index 8bf6a89..8f28c93 100755
Harald Hoyer 75f812
--- a/modules.d/40network/net-genrules.sh
Harald Hoyer 75f812
+++ b/modules.d/40network/net-genrules.sh
Harald Hoyer 75f812
@@ -14,8 +14,10 @@ fix_bootif() {
Harald Hoyer 75f812
     echo $macaddr | sed 'y/ABCDEF/abcdef/'
Harald Hoyer 75f812
 }
Harald Hoyer 75f812
 
Harald Hoyer 75f812
+getargbool 0 rd.neednet && NEEDNET=1
Harald Hoyer 75f812
+
Harald Hoyer 75f812
 # Don't continue if we don't need network
Harald Hoyer 75f812
-if [ -z "$netroot" ] && [ ! -e "/tmp/net.ifaces" ] && ! getargbool 0 rd.neednet >/dev/null; then
Harald Hoyer 75f812
+if [ -z "$netroot" ] && [ ! -e "/tmp/net.ifaces" ] && [ "$NEEDNET" != "1" ]; then
Harald Hoyer 75f812
     return
Harald Hoyer 75f812
 fi
Harald Hoyer 75f812
 
Harald Hoyer 75f812
@@ -73,13 +75,13 @@ fi
Harald Hoyer 75f812
     elif [ -n "$IFACES" ] ; then
Harald Hoyer 75f812
         for iface in $IFACES ; do
Harald Hoyer 75f812
             printf 'SUBSYSTEM=="net", ENV{INTERFACE}=="%s", RUN+="%s"\n' "$iface" "/sbin/initqueue --onetime $ifup"
Harald Hoyer 75f812
-            if [ "$bootdev" = "$iface" ]; then
Harald Hoyer 75f812
+            if [ "$bootdev" = "$iface" ] || [ "$NEEDNET" = "1" ]; then
Harald Hoyer 75f812
                 echo "[ -f /tmp/setup_net_${iface}.ok ]" >$hookdir/initqueue/finished/wait-$iface.sh
Harald Hoyer 75f812
             fi
Harald Hoyer 75f812
         done
Harald Hoyer 75f812
 
Harald Hoyer 75f812
         for iface in $MASTER_IFACES; do
Harald Hoyer 75f812
-            if [ "$bootdev" = "$iface" ]; then
Harald Hoyer 75f812
+            if [ "$bootdev" = "$iface" ] || [ "$NEEDNET" = "1" ]; then
Harald Hoyer 75f812
                 echo "[ -f /tmp/setup_net_${iface}.ok ]" >$hookdir/initqueue/finished/wait-$iface.sh
Harald Hoyer 75f812
             fi
Harald Hoyer 75f812
         done
Harald Hoyer 75f812
diff --git a/modules.d/40network/parse-ip-opts.sh b/modules.d/40network/parse-ip-opts.sh
Harald Hoyer 75f812
index c7dc3ce..f64c936 100755
Harald Hoyer 75f812
--- a/modules.d/40network/parse-ip-opts.sh
Harald Hoyer 75f812
+++ b/modules.d/40network/parse-ip-opts.sh
Harald Hoyer 75f812
@@ -54,6 +54,12 @@ fi
Harald Hoyer 75f812
 for p in $(getargs ip=); do
Harald Hoyer 75f812
     ip_to_var $p
Harald Hoyer 75f812
 
Harald Hoyer 75f812
+    # make first device specified the BOOTDEV
Harald Hoyer 75f812
+    if [ -z "$BOOTDEV" ] && [ -n "$dev" ]; then
Harald Hoyer 75f812
+        BOOTDEV="$dev"
Harald Hoyer 75f812
+        [ -n "$NEEDBOOTDEV" ] && warn "Setting bootdev to '$BOOTDEV'"
Harald Hoyer 75f812
+    fi
Harald Hoyer 75f812
+
Harald Hoyer 75f812
     # skip ibft since we did it above
Harald Hoyer 75f812
     [ "$autoconf" = "ibft" ] && continue
Harald Hoyer 75f812
 
Harald Hoyer 75f812
@@ -121,6 +127,3 @@ fi
Harald Hoyer 75f812
 # Store BOOTDEV and IFACES for later use
Harald Hoyer 75f812
 [ -n "$BOOTDEV" ] && echo $BOOTDEV > /tmp/net.bootdev
Harald Hoyer 75f812
 [ -n "$IFACES" ]  && echo $IFACES > /tmp/net.ifaces
Harald Hoyer 75f812
-
Harald Hoyer 75f812
-# We need a ip= line for the configured bootdev=
Harald Hoyer 75f812
-[ -n "$NEEDBOOTDEV" ] && [ -z "$BOOTDEVOK" ] && die "Bootdev Argument '$BOOTDEV' not found"