FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian User

 
 
LinkBack Thread Tools
 
Old 03-27-2012, 12:28 AM
Will Woods
 
Default Fix nfs/nfsiso (NM handover problems / empty net.ifaces)

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@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 03-27-2012, 12:42 AM
"Brian C. Lane"
 
Default Fix nfs/nfsiso (NM handover problems / empty net.ifaces)

On Mon, Mar 26, 2012 at 08:28:57PM -0400, Will Woods wrote:
> 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.

Ack

--
Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA (PST8PDT)
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 

Thread Tools




All times are GMT. The time now is 04:19 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org