use install paramter in postinstall script

Shabazian, Chip chip.shabazian at bankofamerica.com
Thu Mar 25 15:32:12 UTC 2010


Keep in mind that you have a total character limit of 255 characters on
the command line.  As long as you can keep it short enough, parsing the
command line is a nice easy way to pass parameters to the build, whether
it's in the %pre or the %post.

 

From: kickstart-list-bounces at redhat.com
[mailto:kickstart-list-bounces at redhat.com] On Behalf Of Hardik Modi
Sent: Thursday, March 25, 2010 7:26 AM
To: Discussion list about Kickstart
Subject: Re: use install paramter in postinstall script

 

I do something like this:

%pre
cat /proc/cmdline > /tmp/cmdline

%post --nochroot
cp /tmp/cmdline /mnt/sysimage/tmp/cmdline

%post 
# Process using /tmp/cmdline from inside chroot environment

Repeat for other variables you want to carry forward.

Hardik.

On Thu, Mar 25, 2010 at 9:45 AM, Chris Lumens <clumens at redhat.com>
wrote:

> rdLine = (open("/proc/cmdline", "r").read())
> offNUS = (rdLine.find('nus') == -1) and (rdLine.find('nlis') == -1)
> onRaid = rdLine.find('hwraid') == -1
> onInst = rdLine.find('install') != -1
> .
> .
> ###
>
> Please can you tell me how I can use this variables in the %post
> section, maybe I have missed some documentation in the internet.

kickstart doesn't have any variables so you'll either have to write
these values out to another file in your %post, or duplicate the above
code in your %post.

- Chris


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

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/kickstart-list/attachments/20100325/a6ad4efc/attachment.htm>


More information about the Kickstart-list mailing list