a0a3b4
From e6ae0c61285a7ff2a5be88b276b8d0b309e0ba2e Mon Sep 17 00:00:00 2001
a0a3b4
From: Harald Hoyer <harald@redhat.com>
a0a3b4
Date: Fri, 10 Jun 2016 14:32:48 +0200
a0a3b4
Subject: [PATCH] network/net-genrules.sh: generate rules for all interfaces
a0a3b4
a0a3b4
previously, if "rd.neednet" and bond was specified, only the bond
a0a3b4
interface was configured.
a0a3b4
a0a3b4
https://bugzilla.redhat.com/show_bug.cgi?id=1282680
a0a3b4
---
a0a3b4
 modules.d/40network/net-genrules.sh | 22 +++++++++-------------
a0a3b4
 1 file changed, 9 insertions(+), 13 deletions(-)
a0a3b4
a0a3b4
diff --git a/modules.d/40network/net-genrules.sh b/modules.d/40network/net-genrules.sh
1755ca
index 750a4d7f..526dd5cf 100755
a0a3b4
--- a/modules.d/40network/net-genrules.sh
a0a3b4
+++ b/modules.d/40network/net-genrules.sh
a0a3b4
@@ -16,7 +16,7 @@ command -v fix_bootif >/dev/null || . /lib/net-lib.sh
a0a3b4
     # bridge: attempt only the defined interface
a0a3b4
     if [ -e /tmp/bridge.info ]; then
a0a3b4
         . /tmp/bridge.info
a0a3b4
-        IFACES="$IFACES ${bridgeslaves%% *}"
a0a3b4
+        RAW_IFACES="$RAW_IFACES $bridgeslaves"
a0a3b4
         MASTER_IFACES="$MASTER_IFACES $bridgename"
a0a3b4
     fi
a0a3b4
 
a0a3b4
@@ -27,7 +27,7 @@ command -v fix_bootif >/dev/null || . /lib/net-lib.sh
a0a3b4
         unset bondname
a0a3b4
         . "$i"
a0a3b4
         # It is enough to fire up only one
a0a3b4
-        IFACES="$IFACES ${bondslaves%% *}"
a0a3b4
+        RAW_IFACES="$RAW_IFACES $bondslaves"
a0a3b4
         MASTER_IFACES="$MASTER_IFACES ${bondname}"
a0a3b4
     done
a0a3b4
 
a0a3b4
@@ -36,15 +36,17 @@ command -v fix_bootif >/dev/null || . /lib/net-lib.sh
a0a3b4
         unset teamslaves
a0a3b4
         unset teammaster
a0a3b4
         . "$i"
a0a3b4
-        IFACES="$IFACES ${teamslaves}"
a0a3b4
+        RAW_IFACES="$RAW_IFACES ${teamslaves}"
a0a3b4
         MASTER_IFACES="$MASTER_IFACES ${teammaster}"
a0a3b4
     done
a0a3b4
 
a0a3b4
     if [ -e /tmp/vlan.info ]; then
a0a3b4
         . /tmp/vlan.info
a0a3b4
-        IFACES="$IFACES $phydevice"
a0a3b4
+        RAW_IFACES="$RAW_IFACES $phydevice"
a0a3b4
         MASTER_IFACES="$MASTER_IFACES ${vlanname}"
a0a3b4
     fi
a0a3b4
+    MASTER_IFACES="$(trim "$MASTER_IFACES")"
a0a3b4
+    RAW_IFACES="$(trim "$RAW_IFACES")"
a0a3b4
 
a0a3b4
     if [ -z "$IFACES" ]; then
a0a3b4
         [ -e /tmp/net.ifaces ] && read IFACES < /tmp/net.ifaces
a0a3b4
@@ -59,10 +61,10 @@ command -v fix_bootif >/dev/null || . /lib/net-lib.sh
a0a3b4
     runcmd="RUN+=\"/sbin/initqueue --name ifup-\$env{INTERFACE} --unique --onetime $ifup\""
a0a3b4
 
a0a3b4
     # We have some specific interfaces to handle
a0a3b4
-    if [ -n "$IFACES" ]; then
a0a3b4
+    if [ -n "${RAW_IFACES}${IFACES}" ]; then
a0a3b4
         echo 'SUBSYSTEM!="net", GOTO="net_end"'
a0a3b4
         echo 'ACTION!="add|change|move", GOTO="net_end"'
a0a3b4
-        for iface in $IFACES; do
a0a3b4
+        for iface in $IFACES $RAW_IFACES; do
a0a3b4
             case "$iface" in
a0a3b4
                 ??:??:??:??:??:??)  # MAC address
a0a3b4
                     cond="ATTR{address}==\"$iface\""
a0a3b4
@@ -83,13 +85,7 @@ command -v fix_bootif >/dev/null || . /lib/net-lib.sh
a0a3b4
         done
a0a3b4
         echo 'LABEL="net_end"'
a0a3b4
 
a0a3b4
-        if [ -n "$MASTER_IFACES" ]; then
a0a3b4
-            wait_ifaces=$MASTER_IFACES
a0a3b4
-        else
a0a3b4
-            wait_ifaces=$IFACES
a0a3b4
-        fi
a0a3b4
-
a0a3b4
-        for iface in $wait_ifaces; do
a0a3b4
+        for iface in $IFACES; do
a0a3b4
             if [ "$bootdev" = "$iface" ] || [ "$NEEDNET" = "1" ]; then
a0a3b4
                 echo "[ -f /tmp/net.${iface}.did-setup ]" >$hookdir/initqueue/finished/wait-$iface.sh
a0a3b4
             fi