]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
network/net-genrules.sh: generate rules for all interfaces
authorHarald Hoyer <harald@redhat.com>
Fri, 10 Jun 2016 12:32:48 +0000 (14:32 +0200)
committerHarald Hoyer <harald@redhat.com>
Fri, 10 Jun 2016 14:24:24 +0000 (16:24 +0200)
previously, if "rd.neednet" and bond was specified, only the bond
interface was configured.

https://bugzilla.redhat.com/show_bug.cgi?id=1282680

modules.d/40network/net-genrules.sh

index 750a4d7fdf26416541640a17e82d1f6225b9e265..526dd5cfba3d7d994acc89c5255d3b09ad3e223b 100755 (executable)
@@ -16,7 +16,7 @@ command -v fix_bootif >/dev/null || . /lib/net-lib.sh
     # bridge: attempt only the defined interface
     if [ -e /tmp/bridge.info ]; then
         . /tmp/bridge.info
-        IFACES="$IFACES ${bridgeslaves%% *}"
+        RAW_IFACES="$RAW_IFACES $bridgeslaves"
         MASTER_IFACES="$MASTER_IFACES $bridgename"
     fi
 
@@ -27,7 +27,7 @@ command -v fix_bootif >/dev/null || . /lib/net-lib.sh
         unset bondname
         . "$i"
         # It is enough to fire up only one
-        IFACES="$IFACES ${bondslaves%% *}"
+        RAW_IFACES="$RAW_IFACES $bondslaves"
         MASTER_IFACES="$MASTER_IFACES ${bondname}"
     done
 
@@ -36,15 +36,17 @@ command -v fix_bootif >/dev/null || . /lib/net-lib.sh
         unset teamslaves
         unset teammaster
         . "$i"
-        IFACES="$IFACES ${teamslaves}"
+        RAW_IFACES="$RAW_IFACES ${teamslaves}"
         MASTER_IFACES="$MASTER_IFACES ${teammaster}"
     done
 
     if [ -e /tmp/vlan.info ]; then
         . /tmp/vlan.info
-        IFACES="$IFACES $phydevice"
+        RAW_IFACES="$RAW_IFACES $phydevice"
         MASTER_IFACES="$MASTER_IFACES ${vlanname}"
     fi
+    MASTER_IFACES="$(trim "$MASTER_IFACES")"
+    RAW_IFACES="$(trim "$RAW_IFACES")"
 
     if [ -z "$IFACES" ]; then
         [ -e /tmp/net.ifaces ] && read IFACES < /tmp/net.ifaces
@@ -59,10 +61,10 @@ command -v fix_bootif >/dev/null || . /lib/net-lib.sh
     runcmd="RUN+=\"/sbin/initqueue --name ifup-\$env{INTERFACE} --unique --onetime $ifup\""
 
     # We have some specific interfaces to handle
-    if [ -n "$IFACES" ]; then
+    if [ -n "${RAW_IFACES}${IFACES}" ]; then
         echo 'SUBSYSTEM!="net", GOTO="net_end"'
         echo 'ACTION!="add|change|move", GOTO="net_end"'
-        for iface in $IFACES; do
+        for iface in $IFACES $RAW_IFACES; do
             case "$iface" in
                 ??:??:??:??:??:??)  # MAC address
                     cond="ATTR{address}==\"$iface\""
@@ -83,13 +85,7 @@ command -v fix_bootif >/dev/null || . /lib/net-lib.sh
         done
         echo 'LABEL="net_end"'
 
-        if [ -n "$MASTER_IFACES" ]; then
-            wait_ifaces=$MASTER_IFACES
-        else
-            wait_ifaces=$IFACES
-        fi
-
-        for iface in $wait_ifaces; do
+        for iface in $IFACES; do
             if [ "$bootdev" = "$iface" ] || [ "$NEEDNET" = "1" ]; then
                 echo "[ -f /tmp/net.${iface}.did-setup ]" >$hookdir/initqueue/finished/wait-$iface.sh
             fi