probing for network devices during the pre phase

Klaus Steden klaus.steden at thomson.net
Thu Jul 21 23:12:34 UTC 2005


> 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




More information about the Kickstart-list mailing list