Kickstart %include directive and %pre script issues

Jason Kohles email at jasonkohles.com
Thu Apr 21 16:24:36 UTC 2005


On Thu, Apr 21, 2005 at 04:26:36PM +0200, Christian.Rohrmeier at SCHERING.DE wrote:
> Hello Dear Kickstarters,
> 
> I'm running RHEL 2.1, 3, and 4, all of which need to be served by the
> kickstart script in question.
> 
> I have found a problem with the "%include" directive when including a file
> that is created by the %pre script.
> 
> What I want to do: dynamic disk partitioning. A great example of this can
> be found on page 56 of the RHEL 3 System Administration Guide. The idea is,
> in your %pre script you check out the disk situation, or ask the user
> something, and write the apropriate kickstart partitioning commands (as
> they would normally be found in the commands section of the kickstart
> script) into a file. This file was already included (via the %include
> directive) in the commands section of the kickstart file.
> 
> And thats the catch: while anaconda parses the kickstart script, it
> encounters the %include before it executes the the %pre script, and it dies
> a horrible death, spewing python errors, because it can't get to those
> precious "part" commands.
> 
It depends on the version of anaconda, the way it worked prior to AS2.1
was that the %pre sections were all run first, then the whole kickstart
file was re-read, ignoring the %pre sections.  Red Hat decided to change
the way this works, and the approach they took was to remove the old
way, release AS2.1, and then start working on adding in the new way.
Unfortunately what this means is that this really won't work with 2.1,
as the code needed to support it doesn't even exist in anaconda for that
version.

What I ended up doing was backporting the support for this to the AS2.1
installer.  You can find a working copy of kickstart.py on my website at
http://www.jasonkohles.com/snippets/Red-Hat-Linux/as21-pre-fix.html,
drop it your RHupdates folder, and you should get this functionality
back.

-- 
Jason Kohles                         A witty saying proves nothing.
email at jasonkohles.com                   -- Voltaire (1694 - 1778)
http://www.jasonkohles.com/




More information about the Kickstart-list mailing list