diff options
author | Xi Ruoyao <xry111@xry111.site> | 2022-11-18 12:35:53 +0800 |
---|---|---|
committer | Xi Ruoyao <xry111@xry111.site> | 2022-11-18 12:40:53 +0800 |
commit | f714a8fa3bdd85d28bd9eb49ab0f1f59e39a5054 (patch) | |
tree | b52d09e1e0f6dfe3cab6d6189d9a423ac8ad7e3c /chapter07 | |
parent | 7054cc64eaf9737732a1d63eb5edc9a04af94459 (diff) |
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.
Diffstat (limited to 'chapter07')
-rw-r--r-- | chapter07/chroot.xml | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/chapter07/chroot.xml b/chapter07/chroot.xml index 69bc6ce69..b8de03dc2 100644 --- a/chapter07/chroot.xml +++ b/chapter07/chroot.xml @@ -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 |