David Whitney schreef:
> Hi,
>
> I am at the point of the CLFS guide where I am going to setup the
> Virtual Kernel File Systems and then 'chroot' so that I can continue
> with the rest of the build (i.e. Building the CLFS system).
>
> Can someone provide me with advice on how to incorporate a call to
> 'chroot' within a bash script, and then without operator intervention,
> continue with the rest of the build?  Also, I need to know how to exit
> 'chroot' when the build process is complete so that other steps, as
> outlined in the CLFS guide, can be performed.
>
> I am essentially a newbie at bash even though I have been scripting
> for years, but only at the most basic levels.
>
> Thank you.
Actually very easy, just add /whatever/shellscript to the end of the
line, note that the shellscript path is relative to the chroot.

chroot "${CLFS}" /tools/bin/env -i \
    HOME=/root TERM="${TERM}" PS1='\u:\w\$ ' \
    PATH=/bin:/usr/bin:/sbin:/usr/sbin:/tools/bin \
    /tools/bin/bash --login +h /whatever/shellscript

the shell script will then automatically leave the chroot once it is
finished running. To run the newly compiled bash in final-system, do
exec /bin/bash /whatever/shellscriptstage2 or something. You'll be able
to think of something. ;-)

Cheers,
Maarten
_______________________________________________
Clfs-support mailing list
[email protected]
http://lists.cross-lfs.org/cgi-bin/mailman/listinfo/clfs-support

Reply via email to