Ignore:
Timestamp:
02/03/2006 06:23:22 PM (18 years ago)
Author:
Manuel Canales Esparcia <manuel@…>
Children:
fa994c9
Parents:
b4cd3c5
Message:

Ported r7294 to r7325 from trunk to alphabetical branch.

git-svn-id: http://svn.linuxfromscratch.org/LFS/branches/alphabetical/BOOK@7333 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

File:
1 edited

Legend:

Unmodified
Added
Removed
  • chapter06/chroot.xml

    rb4cd3c5 re6ab4b5  
    11<?xml version="1.0" encoding="ISO-8859-1"?>
    2 <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
     2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
     3  "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
    34  <!ENTITY % general-entities SYSTEM "../general.ent">
    45  %general-entities;
    56]>
     7
    68<sect1 id="ch-system-chroot">
    7 <title>Entering the Chroot Environment</title>
    8 <?dbhtml filename="chroot.html"?>
     9  <?dbhtml filename="chroot.html"?>
    910
    10 <para>It is time to enter the chroot environment to begin
    11 building and installing the final LFS system. As user
    12 <emphasis>root</emphasis>, run the following command to enter the
    13 realm that is, at the moment, populated with only the temporary
    14 tools:</para>
     11  <title>Entering the Chroot Environment</title>
     12
     13  <para>It is time to enter the chroot environment to begin building and
     14  installing the final LFS system. As user <systemitem
     15  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>
    1517
    1618<screen><userinput>chroot "$LFS" /tools/bin/env -i \
     
    1921    /tools/bin/bash --login +h</userinput></screen>
    2022
    21 <para>The <parameter>-i</parameter> option given to the
    22 <command>env</command> command will clear all variables of the chroot
    23 environment. After that, only the <envar>HOME</envar>,
    24 <envar>TERM</envar>, <envar>PS1</envar>, and
    25 <envar>PATH</envar> variables are set again. The
    26 <parameter>TERM=$TERM</parameter> construct will set the
    27 <envar>TERM</envar> variable inside chroot to the same value as
    28 outside chroot. This variable is needed for programs like
    29 <command>vim</command> and <command>less</command> to operate
    30 properly.  If other variables are needed, such as
    31 <envar>CFLAGS</envar> or <envar>CXXFLAGS</envar>, this is
    32 a good place to set them again.</para>
     23  <para>The <parameter>-i</parameter> option given to the <command>env</command>
     24  command will clear all variables of the chroot environment. After that, only
     25  the <envar>HOME</envar>, <envar>TERM</envar>, <envar>PS1</envar>, and
     26  <envar>PATH</envar> variables are set again. The
     27  <parameter>TERM=$TERM</parameter> construct will set the <envar>TERM</envar>
     28  variable inside chroot to the same value as outside chroot. This variable is
     29  needed for programs like <command>vim</command> and <command>less</command>
     30  to operate properly.  If other variables are needed, such as
     31  <envar>CFLAGS</envar> or <envar>CXXFLAGS</envar>, this is a good place to set
     32  them again.</para>
    3333
    34 <para>From this point on, there is no need to use the
    35 <envar>LFS</envar> variable anymore, because all work will be
    36 restricted to the LFS file system.  This is because the Bash shell is
    37 told that <filename class="directory">$LFS</filename> is now the root
    38 (<filename class="directory">/</filename>) directory.</para>
     34  <para>From this point on, there is no need to use the
     35  <envar>LFS</envar> variable anymore, because all work will be restricted
     36  to the LFS file system.  This is because the Bash shell is told that
     37  <filename class="directory">$LFS</filename> is now the root
     38  (<filename class="directory">/</filename>) directory.</para>
    3939
    40 <para>Notice that <filename class="directory">/tools/bin</filename> comes last
    41 in the <envar>PATH</envar>. This means that a temporary tool will no longer be
    42 used once its final version is installed. This occurs when the shell does not
    43 <quote>remember</quote> the locations of executed binaries&mdash;for this
    44 reason, hashing is switched off by passing the <parameter>+h</parameter> option
    45 to <command>bash</command>.</para>
     40  <para>Notice that <filename class="directory">/tools/bin</filename> comes last
     41  in the <envar>PATH</envar>. This means that a temporary tool will no longer be
     42  used once its final version is installed. This occurs when the shell does not
     43  <quote>remember</quote> the locations of executed binaries&mdash;for this
     44  reason, hashing is switched off by passing the <parameter>+h</parameter> option
     45  to <command>bash</command>.</para>
    4646
    47 <para>It is important that all the commands throughout the remainder
    48 of this chapter and the following chapters are run from within the
    49 chroot environment. If you leave this environment for any reason
    50 (rebooting for example), remember to first mount the <systemitem
    51 class="filesystem">proc</systemitem> and <systemitem
    52 class="filesystem">devpts</systemitem> file systems (discussed in the
    53 previous section) and enter chroot again before continuing with the
    54 installations.</para>
     47  <para>It is important that all the commands throughout the remainder of this
     48  chapter and the following chapters are run from within the chroot environment.
     49  If you leave this environment for any reason (rebooting for example), remember
     50  to first mount the <systemitem class="filesystem">proc</systemitem> and
     51  <systemitem class="filesystem">devpts</systemitem> file systems (discussed
     52  in the previous section) and enter chroot again before continuing with the
     53  installations.</para>
    5554
    56 <para>Note that the <command>bash</command> prompt will say
    57 <computeroutput>I have no name!</computeroutput> This is normal because the
    58 <filename>/etc/passwd</filename> file has not been created yet.</para>
     55  <para>Note that the <command>bash</command> prompt will say
     56  <computeroutput>I have no name!</computeroutput> This is normal because the
     57  <filename>/etc/passwd</filename> file has not been created yet.</para>
    5958
    6059</sect1>
    61 
Note: See TracChangeset for help on using the changeset viewer.