Yeah, I finally understood what that little note on the %pre section in the Kickstart manual meant - The pre-installation script section of kickstart cannot manage multiple install trees or source media. This information must be included for each created ks.cfg file, as the pre-installation script occurs during the second stage of the installation process. So I ended up creating a ks.php that generated the cfg based on the requesting IP and just return that. -- sh > -----Original Message----- > From: kickstart-list-bounces@xxxxxxxxxx > [mailto:kickstart-list-bounces@xxxxxxxxxx] On Behalf Of John > Summerfield > Sent: Tuesday, March 31, 2009 7:13 PM > To: Discussion list about Kickstart > Subject: Re: Scripting the url --url install method? > > Hajducko, Steven wrote: > > Is it possible to use a %pre script in any way to customize > the install method? I'm attempting to create a kickstart > file that we can move around our network, however, some of > our networks require different URL's to grab the ks file and > to find the install media. > > > > What I have currently isn't working as anaconda doesn't > seem to like that it can't find the install method before it > runs the %pre section. > > > > Here is what I have currently - > > > > install > > %include /tmp/url > > > > ... > > > > %pre > > > > # Append network hostname as some tiers don't have DNS - if > we don't > > have DNS # then the hostname becomes 'localhost' when using the > > network information from the # boot line HOSTNAME=$( cat > /proc/cmdline > > | sed -e s'/ /\n/g' | grep '^hostname=' ) echo "network > --${HOSTNAME}" > > > /tmp/hostname > > > > # Get our architecture > > ARCH=$(uname -i) > > > > # Figure out the kickstart URL from the boot line so we can > find the > > install media KSURL=$(cat /proc/cmdline | sed -e 's/ /\n/g' | grep > > '^ks=' | cut -d= -f2 | cut -d/ -f1,2,3) echo "url > > --url=${KSURL}/yum/rhel5-server-${ARCH}/disc1" > /tmp/url > > > > ... > > > > We boot from the DVD and enter the network information on > the linux: boot command, so ultimately our boot line looks > something like: > > > > linux ks=http://yum.example.com:9300/ks/hp-rhel5.cfg > > hostname=test1.example.com ip=1.1.1.2 netmask=255.255.255.0 > > gateway=1.1.1.1 dns=1.1.1.3 > > > > I don't see any errors when viewing the logs - it just > prompts me for the install method. > > > > I've also tried something like the following in hopes that > when it re-read the kickstart file, the URL line existed and > it would use that instead - unfortunately that didn't work either. > > > > install > > %include /tmp/url > > cdrom > > > > Better, > ks=http://kickstart.example.com/cgi/ks?<stuff to suit you> ks > could take into account the source IP address in framing its response. > > dhcpd can be configured to give different responses depending on who's > asking: PXE can get one set of responses, anaconda another, > debian-installer a third, Windows can get something > completely different. > > > > -- > > Cheers > John > > -- spambait > 1aaaaaaa@xxxxxxxxxxxxxxxx Z1aaaaaaa@xxxxxxxxxxxxxxxx > -- Advice > http://webfoot.com/advice/email.top.php > http://www.catb.org/~esr/faqs/smart-questions.html > http://support.microsoft.com/kb/555375 > > You cannot reply off-list:-) > > _______________________________________________ > Kickstart-list mailing list > Kickstart-list@xxxxxxxxxx > https://www.redhat.com/mailman/listinfo/kickstart-list > _______________________________________________ Kickstart-list mailing list Kickstart-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/kickstart-list