<div dir="auto">Valdis, thank you for your feedback.<div dir="auto"><br></div><div dir="auto">As you may know, --nochroot is used on %post sections in Kickstart files to tell Anaconda to run post install scripts without chroot. The default is to run them with chroot; but that's a default in Anaconda, not Virtual box.</div><div dir="auto"><br></div><div dir="auto">I used the redhat67_ks.cfg Kickstart file VirtualBox includes as a template to write a customized Kickstart file for use with CentOS 7, but I didn't include --nochroot after seeing the comment. The redhat_postinstall.sh script failed, but it worked with --nochroot. It took me a while to figure that out though, because I trusted the information the comment provided to be correct.</div><div dir="auto"><br></div><div dir="auto">I assume the Kickstart files for Red Hat distributions are all using --nochroot because the redhat_postinstall.sh script included with VirtualBox doesn't work with chroot, someone else already realized that, and they included --nochroot accordingly.</div><div dir="auto"><br></div><div dir="auto">I<span style="font-family:sans-serif"> would have changed the comment to state the script expects NOT to be running chrooted, but I don't know if that's true in every case. I haven't tested other distributions, so I don't know if there's variation on this between older distributions, or even CentOS and Red Hat Enterprise Linux. I</span><span style="font-family:sans-serif"> only have reason to believe it's true in some, or at least this one case; and if that's correct, then the comment provides incorrect information, which has potential to mislead other people, as it did me.</span></div><div dir="auto"><br></div><div dir="auto">I agree with you that an analysis of the code would be desirable; and if anyone has enough familiarity with the code in the redhat_postinstall.sh script, bandwidth to do an analysis, and would like to volunteer, that would be appreciated.</div><div dir="auto"><br></div><div dir="auto">Due to changes in Red Hat 8, I'm also writing a Kickstart file for CentOS 8. This may require me looking closer at redhat_postinstall.sh and becoming more familiar with it. I can't commit to it; but if this becomes the case, I may not only contribute the new Kickstart file but may also be able to answer some of your other questions. Depending on schedule, this may take a while; so in the interim, I thought it best to try to avoid others any problems that may be caused by the comment. It's not an ultimate, or ideal, solution; but it seemed a small, quick, and iterative improvement, nonetheless.</div><div dir="auto"><br></div><div dir="auto">With the above in mind, would you be amenable to suggesting different language for the comment, which at least bring the issue to the attention of the reader?</div><div dir="auto"><div dir="auto"><br><div data-smartmail="gmail_signature" dir="auto">Timothy Tacker<br></div></div></div><br><div class="gmail_quote" dir="auto"><div dir="ltr" class="gmail_attr">On Sun, Jul 19, 2020, 11:30 PM Valdis Klētnieks <<a href="mailto:valdis.kletnieks@vt.edu" target="_blank" rel="noreferrer">valdis.kletnieks@vt.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Sun, 19 Jul 2020 02:48:22 -0500, Timothy Tacker said:<br>
<br>
> All Kickstart files for Red Hat distributions in the UnattendedTemplates<br>
> directory run the redhat_postinstall.sh script with --nochroot in the %post<br>
> section.<br>
<br>
> Nonetheless, the redhat_postinstall.sh script includes the following<br>
> comment:<br>
> # Note! This script expects to be running chrooted (inside new sytem).<br>
><br>
> The patch below removes this comment. I'm licensing this patch under the<br>
> MIT license. Please review and consider integrating. Feedback is welcome.<br>
> Thanks!<br>
<br>
I'd be leery of a patch that simply discards a comment - it obviously *used*<br>
to be important enough to make the note.  Probably what is *actually* needed<br>
here is an analysis of what the code used to do, what it does now, and whether<br>
it should be refactored to make --nochroot the default rather than every single<br>
user having to specify it.<br>
<br>
Homework problem for the student - if the script doesn't actually expect to<br>
be in a chroot by default, why are all the calls passing --nochroot? What change<br>
in behavior does that cause? And what can go wrong if somebody doesn't know<br>
it expects to be chrooted?<br>
<br>
(Sorry, over the last four decades I've seen entirely too many "let's remove<br>
the comment" patches that ended up sprouting a CVE because somebody didn't<br>
know something important because it wasn't documented...)<br>
</blockquote></div></div>