From f714a8fa3bdd85d28bd9eb49ab0f1f59e39a5054 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Fri, 18 Nov 2022 12:35:53 +0800 Subject: 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. --- chapter07/chroot.xml | 7 ++++--- 1 file 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 @@ From this point on, there is no need to use the LFS variable any more because all work will be restricted - to the LFS file system; the chroot command tells the Bash shell that - $LFS is now the root - (/) directory. + to the LFS file system; the chroot command runs the + Bash shell with the root + (/) directory set to + $LFS. Notice that /tools/bin is not in the PATH. This means that the cross toolchain will no longer be -- cgit v1.2.3-54-g00ecf