chroot: reword how chroot works

Technically chroot command "tells" bash nothing.  It basically calls
chroot("$LFS"), then chdir("/"), then
execve(["/usr/bin/env", "-i", ...]).  The kernel also does not tell bash
something like "hey, the root is now $LFS" but just executes (almost) all
system calls from bash as-if $LFS is /.

The man page of chroot says:

DESCRIPTION
       Run COMMAND with root directory set to NEWROOT.

Just use the same grammar construction here.
This commit is contained in:
Xi Ruoyao 2022-11-18 12:35:53 +08:00
parent 7054cc64ea
commit f714a8fa3b
No known key found for this signature in database
GPG Key ID: ACAAD20E19E710E3

View File

@ -38,9 +38,10 @@
<para>From this point on, there is no need to use the
<envar>LFS</envar> variable any more because all work will be restricted
to the LFS file system; the <command>chroot</command> command tells the Bash shell that
<filename class="directory">$LFS</filename> is now the root
(<filename class="directory">/</filename>) directory.</para>
to the LFS file system; the <command>chroot</command> command runs the
Bash shell with the root
(<filename class="directory">/</filename>) directory set to
<filename class='directory'>$LFS</filename>.</para>
<para>Notice that <filename class="directory">/tools/bin</filename> is not
in the <envar>PATH</envar>. This means that the cross toolchain will no longer be