Re: multiple %post sections?

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

 



>  > >  from memory, i vaguely recall that it's possible for a
>  > >  kickstart file to have multiple %post sections, each of which
>  > >  can independently have a different interpreter and can decide
>  > >  whether or not to chroot.  is this true?
>  > >
>  > >  rday
>  >
>  > I second that.  You definately can do this.  The main reason is not
>  > usually for the interpreters, but to run some stuff in a non chrooted
>  > environment and some stuff in the chrooted environment.
>
>  but (even though it sounds like a silly idea), can you flip-flop
>  back and forth between the two.  as in, once you do a chrooted
>  environment, can you follow that with a non-chrooted env?
>  and no, i can't think of any applications at the moment. :-)

Yes you can.  Here is a simple application.  You have opted not to put some
install scripts into an RPM (for whatever reason), and you don't want to
put
them in your kickstart file, as their quite long.  So you place the scripts
in:

     /scripts

on the CDROM ISO.  Now in your kickstart file you have:

     #
     # Get scripts on to system.
     %post --nochroot
     cp -rp /scripts /mnt/sysimage/scripts

     #
     # Run scripts and then remove them.
     %post
     cd /tmp/scripts
     for a_script in *
     do
          $a_script
     done
     cd /
     rm -rf /tmp/scripts

Just real generic example but that is how you would do it and one reason
why.
There are a multitude of others.

Cheers....james


rday







[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