Changeset 37e35d2 for chapter07/chroot.xml
- Timestamp:
- 06/29/2020 07:55:01 AM (4 years ago)
- Branches:
- multilib-10.1
- Children:
- c4804e8
- Parents:
- d4fdde6
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
chapter07/chroot.xml
rd4fdde6 r37e35d2 6 6 ]> 7 7 8 <sect1 id="ch- system-chroot">8 <sect1 id="ch-tools-chroot"> 9 9 <?dbhtml filename="chroot.html"?> 10 10 11 11 <title>Entering the Chroot Environment</title> 12 12 13 <para>It is time to enter the chroot environment to begin building and 14 installing the final LFS system. As user <systemitem 13 <para>Now that all the packages which are required to build the rest of the 14 needed tools are on the system, it is time to enter the chroot environment to 15 finish installing the remaining temporary tools. This environment will be in 16 use also for installing the final system. As user <systemitem 15 17 class="username">root</systemitem>, run the following command to enter the 16 realm that is, at the moment, populated with only the temporary tools:</para> 18 environment that is, at the moment, populated with only the temporary 19 tools:</para> 17 20 18 <screen role="nodump"><userinput>chroot "$LFS" / tools/bin/env -i\21 <screen role="nodump"><userinput>chroot "$LFS" /usr/bin/env -i \ 19 22 HOME=/root \ 20 23 TERM="$TERM" \ 21 24 PS1='(lfs chroot) \u:\w\$ ' \ 22 PATH=/bin:/usr/bin:/sbin:/usr/sbin :/tools/bin\23 / tools/bin/bash --login +h</userinput></screen>25 PATH=/bin:/usr/bin:/sbin:/usr/sbin \ 26 /bin/bash --login +h</userinput></screen> 24 27 25 28 <para>The <parameter>-i</parameter> option given to the <command>env</command> … … 30 33 variable inside chroot to the same value as outside chroot. This variable is 31 34 needed for programs like <command>vim</command> and <command>less</command> 32 to operate properly. If other variables are needed, such as35 to operate properly. If other variables are desired, such as 33 36 <envar>CFLAGS</envar> or <envar>CXXFLAGS</envar>, this is a good place to set 34 37 them again.</para> 35 38 36 39 <para>From this point on, there is no need to use the 37 <envar>LFS</envar> variable anymore ,because all work will be restricted40 <envar>LFS</envar> variable anymore because all work will be restricted 38 41 to the LFS file system. This is because the Bash shell is told that 39 42 <filename class="directory">$LFS</filename> is now the root 40 43 (<filename class="directory">/</filename>) directory.</para> 41 44 42 <para>Notice that <filename class="directory">/tools/bin</filename> comes last43 in the <envar>PATH</envar>. This means that a temporary toolwill no longer be44 used once its final version is installed. This occurs when the shell does not45 <para>Notice that <filename class="directory">/tools/bin</filename> is not 46 in the <envar>PATH</envar>. This means that the cross toolchain will no longer be 47 used in the chroot environment. This occurs when the shell does not 45 48 <quote>remember</quote> the locations of executed binaries—for this 46 49 reason, hashing is switched off by passing the <parameter>+h</parameter> option … … 56 59 environment. If you leave this environment for any reason (rebooting for 57 60 example), ensure that the virtual kernel filesystems are mounted as 58 explained in <xref linkend="ch- system-bindmount"/> and <xref59 linkend="ch- system-kernfsmount"/> and enter chroot again before continuing61 explained in <xref linkend="ch-tools-bindmount"/> and <xref 62 linkend="ch-tools-kernfsmount"/> and enter chroot again before continuing 60 63 with the installation.</para> 61 64 </note>
Note:
See TracChangeset
for help on using the changeset viewer.