Extracting variables from within ks.cfg, interpreted from command-line

Jesse Keating jkeating at j2solutions.net
Mon Mar 20 23:28:24 UTC 2006


On Monday 20 March 2006 15:05, Dan Trainor wrote:
> What kind of "bad luck" have you found?  I'm still hot after this one,
> and it's really bothering me.
>
> Bash is available to me in %pre, yes?  This stuff would even work in sh,
> as far as my testing shows.
>
> %pre does get parsed before my network info is used with the 'network'
> directive in my kickstart file, right?

So what I ended up doing was using python.  Python is there because anaconda 
uses it.  %pre can use the network as supplied on how to get the ks file or 
the content itself.  Not necessarily the same network info supplied in the 
'network' section as that is used for the installed system, not for the 
installer.  I personally do PXE booting and get the ks config file from a 
webserver, so the environment already has network going.  I pull down a pre 
script from a webserver (use IP as DNS does not work in install env), then 
execute the python prescript to parse /proc/cmdline for arguments that will 
lead to stub files getting created.  Later in the kickstart script those stub 
files are included for the various things.

Here is a really ugly early version of this script.  I can't find the latest 
one I was responsible for, but here ya go:

http://geek.j2solutions.net/stuff/autokickrhel4.py

-- 
Jesse Keating RHCE      (geek.j2solutions.net)
Fedora Legacy Team      (www.fedoralegacy.org)
GPG Public Key          (geek.j2solutions.net/jkeating.j2solutions.pub)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/kickstart-list/attachments/20060320/64838cff/attachment.sig>


More information about the Kickstart-list mailing list