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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Chris Lumens wrote:
I'm using something similar to this, to define network arguments:

network --device=eth0 \
	--bootproto=static \
	--ip=`/usr/bin/echo ${IPADDR}` \
	--netmask=`/usr/bin/echo ${NMADDR}` \
	--gateway=`/usr/bin/echo ${GWADDR}` \
	--nameserver=`/usr/bin/echo ${NSADDR}`

...to no avail. I see the literal contents (IPADDR=`/usr/bin/echo ) inside my system config scripts, instead of the extracted value being written to these files. I've even gone so far as to get rid of my echo statement in an attempt to get it to work, as well as just placing ${VARNAME}, to get more familiar with how Anaconda extracts these values trying to find my mistake.

I'm sure what I'm doing is not overly complicated - but for now, I'm stuck. If anyone has any feedback, I'd be very eager to hear back from you.

Kickstart doesn't have any provisions for reading environment variables
or capturing the output of programs like you're trying to do.  However,
you can do this stuff in a %pre script, as that just gets fed to the
shell (or whatever you set the interpreter to).  So you could write a
pre script that generates the dynamic chunks and writes it to a file,
then %include that file up in the command section.

That should work.

- Chris


Hello again, Chris -

I'm using %pre to write to a file called /tmp/netsettings. I'm then trying to %include it from within my commands section.

Every time, I'm given an error saying that /tmp/netsettings cannot be found. I cannot verify this, or it's location, because Anaconda bombs out and locks up vt2.

I think I'm lost in chroot land. Do I need to mount a disk in %pre in order to write my temp file? What would you suggest?

Thanks!
-dant


[Index of Archives]     [Red Hat General]     [CentOS Users]     [Fedora Users]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux