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 04-03-2012, 09:32 PM
Will Woods
 
Default dracut: fix kssendmac/inst.ks.sendmac

Can't get MAC addresses until after the network modules have loaded, so
schedule set_ks_sendmac to happen at the start of the mainloop.
---
dracut/parse-anaconda-kickstart.sh | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/dracut/parse-anaconda-kickstart.sh b/dracut/parse-anaconda-kickstart.sh
index c426ced..afc3d63 100755
--- a/dracut/parse-anaconda-kickstart.sh
+++ b/dracut/parse-anaconda-kickstart.sh
@@ -32,11 +32,11 @@ case "${kickstart%%:*}" in
esac
export kickstart

-# FIXME: this won't work! needs to be run after udev starts.
# inst.ks.sendmac: send MAC addresses in HTTP headers
-if getargbool 0 kssendmac inst.ks.sendmac; then
- ifnum=0
+set_ks_sendmac() {
+ local ifnum=0 mac="" ifname=""
for ifname in /sys/class/net/*; do
+ [ -e "$ifname/address" ] || continue
mac=$(cat $ifname/address)
ifname=${ifname#/sys/class/net/}
# TODO: might need to choose devices better
@@ -45,11 +45,15 @@ if getargbool 0 kssendmac inst.ks.sendmac; then
ifnum=$(($ifnum+1))
fi
done
+}
+if getargbool 0 kssendmac inst.ks.sendmac; then
+ # needs to run in mainloop (after modules load etc.)
+ initqueue --unique --settled --onetime --name "01-sendmac" set_ks_sendmac
fi

-
# inst.ks.sendsn: send system serial number as HTTP header
if getargbool 0 kssendsn inst.ks.sendsn; then
+ # doesn't need to wait - dmi is builtin
system_serial=$(cat /sys/class/dmi/id/product_serial 2>/dev/null)
if [ -z "$system_serial" ]; then
warn "inst.ks.sendsn: can't find system serial number"
--
1.7.7.6

_______________________________________________
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 01:34 AM.

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