RE: Includes in pre scripts

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

 



Think about it this way, the %include is replaced in the kickstart file
by the file included.

So, if your command section looked like this:

install
text
lang en_US
langsupport --default en_US en_US
...
%include /tmp/timezone
...

And in your %pre you had this:
echo "TZ=America/New_York" > /tmp/timezone

Anaconda would replace the %include line in the kickstart file so that
this is what really got built:

install
text
lang en_US
langsupport --default en_US en_US
...
TZ=America/New_York 
...

Does that explain what %include is doing?


-----Original Message-----
From: kickstart-list-bounces@xxxxxxxxxx
[mailto:kickstart-list-bounces@xxxxxxxxxx] On Behalf Of Hearn, Stan J.
Sent: Wednesday, March 26, 2008 11:52 AM
To: Discussion list about Kickstart
Subject: RE: Includes in pre scripts

Okay, I think I get it.  "%include" can have anaconda specific commands
where as "sh some_file" would specifically be shell scripting.  But
can't the "%include" contain shell commands?

I don't mean to be obtuse, but I was surprised to hear that include
wasn't working by executing the shell contents, but I'm assuming that is
because it was outside a %pre or %post?  Shell commands are not allowed
outside %pre or %post, right?


-----Original Message-----
From: kickstart-list-bounces@xxxxxxxxxx
[mailto:kickstart-list-bounces@xxxxxxxxxx] On Behalf Of Ben Riggs
Sent: Wednesday, March 26, 2008 2:40 PM
To: Discussion list about Kickstart
Subject: Re: Includes in pre scripts

%post

#do some logic
cat stuff > some_file

%include some_file

Ben

Hearn, Stan J. wrote:
> What is the difference between "%include something" and "sh
/something"?
>
>
> What is a good reason to use %include then?  
>
> Are you saying this because the include is above the %pre?  In other
> words, do you also want to use "sh /tmp/something" instead of include
in
> a %pre or %post stanza?
>
> Stan 
>
> -----Original Message-----
> From: kickstart-list-bounces@xxxxxxxxxx
> [mailto:kickstart-list-bounces@xxxxxxxxxx] On Behalf Of
> michael@xxxxxxxxxxx
> Sent: Wednesday, March 26, 2008 2:02 PM
> To: Discussion list about Kickstart
> Subject: Re: Includes in pre scripts
>
> Gerrard Geldenhuis wrote:
>   
>> Hi
>> I am trying to do the following in satellite:
>>
>> At the top of the kickstart file:
>> device scsi cciss
>> zerombr yes
>> clearpart --all
>> %include /tmp/partinfo
>>
>> In my pre script :
>> %pre
>> wget http://blah.com/pub/ks-scripts/post.sh -O /tmp/post.sh
>> wget http://blah.com/pub/ks-scripts/pre.sh -O /tmp/pre.sh
>> %include /tmp/pre.sh
>>     
>
> You don't want to include /tmp/pre.sh, you want to run it
>
> sh /tmp/pre.sh
>
>
> Michael
>
> _______________________________________________
> 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
>   

_______________________________________________
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

_______________________________________________
Kickstart-list mailing list
Kickstart-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/kickstart-list

[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