[PATCH f17-branch] Fix nfs/nfsiso (NM handover problems / empty net.ifaces)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Commit 0544eff was supposed to make anaconda try to write net.ifaces
whenever an interface came up, but because of a quoting error it
*emptied* /tmp/net.ifaces instead. It also didn't handle adding things
to net.ifaces correctly. This patch fixes both problems.
---
 dracut/anaconda-lib.sh           |   18 ++++++++++++------
 dracut/parse-anaconda-options.sh |    2 +-
 2 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/dracut/anaconda-lib.sh b/dracut/anaconda-lib.sh
index 9793e82..e03e0fb 100755
--- a/dracut/anaconda-lib.sh
+++ b/dracut/anaconda-lib.sh
@@ -97,14 +97,20 @@ set_neednet() {
 
 # Save the dhclient lease and put the interface name into /tmp/net.ifaces,
 # so the 'ifcfg' module will write out a proper ifcfg etc. for NetworkManager.
-# TODO: this should probably be in 40network/net-lib.sh
+# FIXME: this will probably be in 40network/net-lib.sh soon
 save_netinfo() {
-    local netif="$1"
-    echo "$netif" >> /tmp/net.ifaces # XXX is it OK to list a netif twice?
-    read IFACES < /tmp/net.ifaces
-    for f in /tmp/dhclient.$iface.*; do
-        [ -f $f ] && cp -f $f /tmp/net.${f#/tmp/dhclient.}
+    local netif="$1" IFACES="" f="" i=""
+    [ -e /tmp/net.ifaces ] && read IFACES < /tmp/net.ifaces
+    # Add $netif to the front of IFACES (if it's not there already).
+    set -- "$netif"
+    for i in $IFACES; do [ "$i" != "$netif" ] && set -- "$@" "$i"; done
+    IFACES="$*"
+    for i in $IFACES; do
+        for f in /tmp/dhclient.$i.*; do
+            [ -f $f ] && cp -f $f /tmp/net.${f#/tmp/dhclient.}
+        done
     done
+    echo $IFACES > /tmp/net.ifaces
 }
 
 parse_kickstart() {
diff --git a/dracut/parse-anaconda-options.sh b/dracut/parse-anaconda-options.sh
index 10ebebd..da18cae 100755
--- a/dracut/parse-anaconda-options.sh
+++ b/dracut/parse-anaconda-options.sh
@@ -103,7 +103,7 @@ if [ -n "$updates" ]; then
 fi
 
 # make sure we get ifcfg for every interface that comes up
-echo "save_netinfo $netif" > $hookdir/initqueue/online/anaconda-ifcfg.sh
+echo 'save_netinfo $netif' > $hookdir/initqueue/online/anaconda-ifcfg.sh
 
 # re-read the commandline args
 unset CMDLINE
-- 
1.7.7.6

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux