Discussion:
chroot
rpjday
2002-06-04 13:25:51 UTC
Permalink
given that a ks file can have only one %post section (right?),
and that section is either --nochroot or not (right?), if i
want to get both effects, can i just start with the --nochroot
directive and, in the middle of the %post section, do a simple

chroot /mnt/sysimage

and keep going? is there anything tricky or non-intuitive about
this i should know about?

rday
James Oden
2002-06-04 13:07:55 UTC
Permalink
Post by rpjday
given that a ks file can have only one %post section (right?),
and that section is either --nochroot or not (right?), if i
want to get both effects, can i just start with the --nochroot
directive and, in the middle of the %post section, do a simple
chroot /mnt/sysimage
and keep going? is there anything tricky or non-intuitive about
this i should know about?
Well, the answer I would think does not lie in kickstart but the chroot
command. The chroot command is going to do the chroot call and then
launch /bin/sh (or is /bin/bash on linux...either way its the same shell).
So if you really wanted to do that you would need to either create
a script with a here document or have one installed by an rpm and have
your chroot call be made like:

chroot /mnt/sysimage path_to_script_in_chroot_env

Though I was looking at some anaconda source the other day that led me
to believe you could have multiple %post sections; wish I could recall where
that was.

...james
Post by rpjday
rday
_______________________________________________
Kickstart-list mailing list
https://listman.redhat.com/mailman/listinfo/kickstart-list
rpjday
2002-06-04 13:48:06 UTC
Permalink
Post by James Oden
Post by rpjday
given that a ks file can have only one %post section (right?),
and that section is either --nochroot or not (right?), if i
want to get both effects, can i just start with the --nochroot
directive and, in the middle of the %post section, do a simple
chroot /mnt/sysimage
and keep going? is there anything tricky or non-intuitive about
this i should know about?
Well, the answer I would think does not lie in kickstart but the chroot
command. The chroot command is going to do the chroot call and then
launch /bin/sh (or is /bin/bash on linux...either way its the same shell).
So if you really wanted to do that you would need to either create
a script with a here document or have one installed by an rpm and have
chroot /mnt/sysimage path_to_script_in_chroot_env
ok, i'll think about that. admittedly, i don't have a persuasive
reason to need this feature -- it was more for just curiosity and
wondering whether *anyone* had ever found a compelling need to
do this and, if so, how?
Post by James Oden
Though I was looking at some anaconda source the other day that led me
to believe you could have multiple %post sections; wish I could recall where
that was.
and *that* would be useful to know, too. again, not sure what i'd
do with that information, but what the heck.

rday
James Oden
2002-06-04 13:49:39 UTC
Permalink
<SNIP>
Post by rpjday
Post by James Oden
Though I was looking at some anaconda source the other day that led me
to believe you could have multiple %post sections; wish I could recall where
that was.
and *that* would be useful to know, too. again, not sure what i'd
do with that information, but what the heck.
Well I can see it would make running both a chrooted and non chrooted
script in the same kickstart session more easily done (obviosly we have
discussed how it could be done, but I would not classify it as the
"clear path" (-;)...james
Steve M Bibayoff
2002-06-04 17:13:50 UTC
Permalink
Post by rpjday
ok, i'll think about that. admittedly, i don't have a persuasive
reason to need this feature -- it was more for just curiosity and
wondering whether *anyone* had ever found a compelling need to
do this and, if so, how?
Post by James Oden
Though I was looking at some anaconda source the other day that
led me
Post by James Oden
to believe you could have multiple %post sections; wish I could
recall where
Post by James Oden
that was.
and *that* would be useful to know, too. again, not sure what i'd
do with that information, but what the heck.
I used both a
%post -nochroot
...
%post
...

sections in < RH7.1

I used the -nochroot section to get files off the CD and onto the HD,
and used the chroot'ed post section to run various scripts and such that
where easier to run in a chroot'ed envirment then having to rewrite them
with actual path names (ie /sys/???? )

hth

Steve
Taylor, ForrestX
2002-06-04 17:40:31 UTC
Permalink
Post by rpjday
given that a ks file can have only one %post section (right?),
and that section is either --nochroot or not (right?)
Wrong. I have been using both since 7.1 (IIRC). I just use %post, and
then a %post --nochroot.

Forrest
--
rpjday
2002-06-04 17:44:02 UTC
Permalink
Post by Taylor, ForrestX
Post by rpjday
given that a ks file can have only one %post section (right?),
and that section is either --nochroot or not (right?)
Wrong. I have been using both since 7.1 (IIRC). I just use %post, and
then a %post --nochroot.
you do the "--nochroot" *after*? i can understand if you do it first,
but what does it mean to do it afterwards?

rday
Taylor, ForrestX
2002-06-04 18:02:34 UTC
Permalink
Post by rpjday
Post by Taylor, ForrestX
Post by rpjday
given that a ks file can have only one %post section (right?),
and that section is either --nochroot or not (right?)
Wrong. I have been using both since 7.1 (IIRC). I just use %post, and
then a %post --nochroot.
you do the "--nochroot" *after*? i can understand if you do it first,
but what does it mean to do it afterwards?
rday
I run all of the scripts that require the chroot, and after, I use
--nochroot to grab directories/scripts from the CD.

Forrest
--
rpjday
2002-06-04 18:09:33 UTC
Permalink
Post by Taylor, ForrestX
Post by rpjday
you do the "--nochroot" *after*? i can understand if you do it first,
but what does it mean to do it afterwards?
rday
I run all of the scripts that require the chroot, and after, I use
--nochroot to grab directories/scripts from the CD.
ah, so each %post section is totally independent from the others,
and can be chrooted or not, regardless of the order. cool.

rday

Loading...