probing for network devices during the pre phase

Lance Braswell ltbraswell at yahoo.com
Fri Jul 22 14:41:38 UTC 2005


Thanks for the /proc/net/dev hint Klaus. Here is the
relavant anaconda step for the same:

#!/usr/bin/python

import sys
sys.path.append('/usr/lib/anaconda')

import network

interfaces = network.Network().available()
for interface in interfaces.keys() :
        print interface


#end

I am anxiously awaiting the details of your
/sbin/loader hack :) Hope you can get in touch with
the wiki owner.


--- Klaus Steden <klaus.steden at thomson.net> wrote:

> > Basically I have the same question as posed in the
> > thread below:
> > 
> >
>
http://www.redhat.com/archives/kickstart-list/2003-December/msg00043.html
> > 
> > In the %pre phase, I'm working on a small
> interactive
> > menu to grab some basic info from which I will
> write
> > out a complete ks.cfg using %include statements.
> For
> > the network section, I would like to probe the
> system
> > for network devices and prompt the user to choose
> one
> > (and only one). I can't find anything obvious in
> the
> > isys.py module like I can for probing disk drives.
> > There is /usr/lib/anaconda/kudzu-probe-stub which
> > might be a possibility. I guess I could parse
> ifconfig
> > -a output but that seems kind of messy. Anyone
> know a
> > better way to get at this info?
> > 
> I don't know about inside anaconda but you could try
> to parse /proc/net/dev,
> like this:
> 
> list=`cat /proc/net/dev | grep : |awk -F: '{print
> $1}'`
> 
> and then:
> 
> select nic in $list
> do
>     <stuff>
> done
> 
> ... on a related note, I did some hacking of the
> anaconda process itself and
> have developed a method for inserting code in
> between /sbin/loader (a.k.a
> init) and anaconda itself during kickstart ... some
> people have asked me to
> explain in detail, but I though it would be more
> useful to put it on the
> Anaconda Wiki ... but I'm having some difficulty
> getting in touch with people
> so far.
> 
> So if anyone out there reads this and knows the
> email address of Greg Morgan
> (who maintains the Anaconda Wiki), please email me
> off list - it is much
> appreciated!
> 
> cheers,
> Klaus
> 
> _______________________________________________
> Kickstart-list mailing list
> Kickstart-list at redhat.com
>
https://www.redhat.com/mailman/listinfo/kickstart-list
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 




More information about the Kickstart-list mailing list