On Thu, 2008-11-13 at 09:15 -0500, David Straub wrote:
On Wed, Nov 12, 2008 10:34 PM Jeremy Katz <katzj(a)redhat.com>
wrote:
>The main reason has been that there are ... interesting questions about
>the environment it should run in. What are you using them for and maybe
>that's enough to talk me into it :-)
Since pykickstart already handles pre-install scripts, I pretty much just
copied the imgcreate functions that deal with the post-install scripts for
consistency. I suppose this is the important function:
[snip]
I have this called as the first action in the install function,
just before
yum runs. I think the only changes I made to this from the post function are
that I removed the chroot conditional (since %pre is always --nochroot), and
that it writes the temporary script files to the system's /tmp rather than the
image's /tmp (since it doesn't exist at this point).
What were the concerns regarding the environment? All I needed was the
ability to get at a shell in the install image before yum is called, which is
all that does.
Yeah, the code is clearly trivial. But if we're to correspond with the
other case that %pre is used (the installer), then we need to run the
script before we get any install roots or similar created. At which
point, the question is what are you trying to accomplish with the %pre
and is there a better way?
For the installer case, the "typical" use of pre is either doing more
complicated formatting or doing some sort of system determination and
then writing out pieces of the ks.cfg to later be %include'd
Jeremy