Alan McKay
2010-Jan-12 22:42 UTC
[CentOS] more kickstart - saving %pre decisions for %post
Hey again folks, How can I save answers to questions in %pre, for use in %post? I'm assuming (though have not yet tried) that variables won't live that long. Could I save them off to /tmp in a file, and retrieve them? e.g. %pre echo "VARNAME=$VARNAME" >> /tmp/varfile %post grep ^VARNAME= /tmp/varile Or some such ... -- ?Don't eat anything you've ever seen advertised on TV? - Michael Pollan, author of "In Defense of Food"
On Tue, 2010-01-12 at 17:42 -0500, Alan McKay wrote:> Hey again folks, > > How can I save answers to questions in %pre, for use in %post? > > I'm assuming (though have not yet tried) that variables won't live that long. > > Could I save them off to /tmp in a file, and retrieve them? > > e.g. > > %pre > echo "VARNAME=$VARNAME" >> /tmp/varfile > > > %post > grep ^VARNAME= /tmp/varile > > > Or some such ...--- Never used %pre or how that part really functions but where is the temp file stored, ram ? Why not store it in memory registers or I have your idea wrong? John
From: Alan McKay <alan.mckay at gmail.com>> How can I save answers to questions in %pre, for use in %post? > I'm assuming (though have not yet tried) that variables won't live that long. > Could I save them off to /tmp in a file, and retrieve them?Yes but post can be used 'chrooted' or 'non-chrooted'. So be sure to put it in the correct tmp... http://www.redhat.com/docs/manuals/enterprise/RHEL-5-manual/Installation_Guide-en-US/s1-kickstart2-postinstallconfig.html JD