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@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/anaconda-devel-list