From 8ef83047f979cb4addce1547008b3981359e3304 Mon Sep 17 00:00:00 2001 From: Manuel Canales Esparcia Date: Thu, 2 Feb 2006 21:03:09 +0000 Subject: Indenting chapter 6, part 3 git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@7325 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689 --- chapter06/chroot.xml | 92 +++++++++++++++++++++++++--------------------------- 1 file changed, 45 insertions(+), 47 deletions(-) (limited to 'chapter06/chroot.xml') diff --git a/chapter06/chroot.xml b/chapter06/chroot.xml index d02c94e40..ca3e86a92 100644 --- a/chapter06/chroot.xml +++ b/chapter06/chroot.xml @@ -1,61 +1,59 @@ - %general-entities; ]> + -Entering the Chroot Environment - + + + Entering the Chroot Environment -It is time to enter the chroot environment to begin -building and installing the final LFS system. As user -root, run the following command to enter the -realm that is, at the moment, populated with only the temporary -tools: + It is time to enter the chroot environment to begin building and + installing the final LFS system. As user root, run the following command to enter the + realm that is, at the moment, populated with only the temporary tools: chroot "$LFS" /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 -The -i option given to the -env command will clear all variables of the chroot -environment. After that, only the HOME, -TERM, PS1, and -PATH variables are set again. The -TERM=$TERM construct will set the -TERM variable inside chroot to the same value as -outside chroot. This variable is needed for programs like -vim and less to operate -properly. If other variables are needed, such as -CFLAGS or CXXFLAGS, this is -a good place to set them again. - -From this point on, there is no need to use the -LFS variable anymore, because all work will be -restricted to the LFS file system. This is because the Bash shell is -told that $LFS is now the root -(/) directory. - -Notice that /tools/bin comes last -in the PATH. This means that a temporary tool will no longer be -used once its final version is installed. This occurs when the shell does not -remember the locations of executed binaries—for this -reason, hashing is switched off by passing the +h option -to bash. - -It is important that all the commands throughout the remainder -of this chapter and the following chapters are run from within the -chroot environment. If you leave this environment for any reason -(rebooting for example), remember to first mount the proc and devpts file systems (discussed in the -previous section) and enter chroot again before continuing with the -installations. - -Note that the bash prompt will say -I have no name! This is normal because the -/etc/passwd file has not been created yet. + The -i option given to the env + command will clear all variables of the chroot environment. After that, only + the HOME, TERM, PS1, and + PATH variables are set again. The + TERM=$TERM construct will set the TERM + variable inside chroot to the same value as outside chroot. This variable is + needed for programs like vim and less + to operate properly. If other variables are needed, such as + CFLAGS or CXXFLAGS, this is a good place to set + them again. + + From this point on, there is no need to use the + LFS variable anymore, because all work will be restricted + to the LFS file system. This is because the Bash shell is told that + $LFS is now the root + (/) directory. + + Notice that /tools/bin comes last + in the PATH. This means that a temporary tool will no longer be + used once its final version is installed. This occurs when the shell does not + remember the locations of executed binaries—for this + reason, hashing is switched off by passing the +h option + to bash. + + It is important that all the commands throughout the remainder of this + chapter and the following chapters are run from within the chroot environment. + If you leave this environment for any reason (rebooting for example), remember + to first mount the proc and + devpts file systems (discussed + in the previous section) and enter chroot again before continuing with the + installations. + + Note that the bash prompt will say + I have no name! This is normal because the + /etc/passwd file has not been created yet. - -- cgit v1.2.3-54-g00ecf