Changes in / [ceb61b9:9247501d]


Ignore:
Files:
6 added
31 edited

Legend:

Unmodified
Added
Removed
  • chapter01/how.xml

    rceb61b9 r9247501d  
    99  <?dbhtml filename="how.html"?>
    1010
    11   <title>How to Build an LFS System</title>
     11  <title>How to Cross Build an LFS System</title>
    1212
    1313  <para>The LFS system will be built by using an already installed
    14   Linux distribution (such as Debian, OpenMandriva, Fedora, or openSUSE). This
    15   existing Linux system (the host) will be used as a starting point to
     14  UNIX-like system (such as Debian Linux or Mac OS X). This
     15  existing UNIX-like system (the host) will be used as a starting point to
    1616  provide necessary programs, including a compiler, linker, and shell,
    1717  to build the new system. Select the <quote>development</quote> option
     
    5454  cross-compile basic utilities using the just built cross-toolchain.</para>
    5555
    56   <para><xref linkend="chapter-chroot-temporary-tools"/> then enters a
    57   "chroot" environment and uses the previously built tools to build
    58   the additional tools needed to build and test the final system.</para>
     56  <para><xref linkend="chapter-chroot-temporary-tools"/> then boots the
     57  minimal Linux environment on the target machine and uses the previously
     58  built tools to build the additional tools needed to build and test the
     59  final system.  Note that in the book the minimal Linux environment may be
     60  referred as <quote>chroot environment</quote> only to keep the consistency
     61  with the original LFS book.</para>
    5962
    6063  <para>This effort to isolate the new system from the host distribution may
     
    6366
    6467  <para>In <xref linkend="chapter-building-system"/> the
    65   full LFS system is built. Another advantage provided by the chroot
    66   environment is that it allows you to continue using the host system
    67   while LFS is being built. While waiting for package compilations to
    68   complete, you can continue using your computer as normal.</para>
     68  full LFS system is built.</para>
    6969
    7070  <para>To finish the installation, the basic system configuration is set up in
  • chapter02/aboutlfs.xml

    rceb61b9 r9247501d  
    1515  throughout the LFS build process. It should be set to the name of the
    1616  directory where you will be building your LFS system - we will use
    17   <filename class="directory">/mnt/lfs</filename> as an example, but you may
    18   choose any directory name you want. If you are building LFS on a separate
    19   partition, this directory will be the mount point for the partition.
    20   Choose a directory location and set the variable with the
    21   following command:</para>
     17  <filename class="directory">/mnt/lfs</filename> as an example, but the
     18  choose any directory name you want. Choose a directory location and set the
     19  variable with the following command:</para>
    2220
    2321<screen role="nodump"><userinput>export LFS=<replaceable>/mnt/lfs</replaceable></userinput></screen>
     
    2826  <quote>/mnt/lfs</quote> (or whatever value the variable was set to) when it
    2927  processes the command line.</para>
     28
     29  <para>Create the directory:</para>
     30
     31<screen role="nodump"><userinput>mkdir -pv $LFS</userinput></screen>
     32
     33  <para>If you don't have much space in the partition holding the directory,
     34  you can mount another partition on it.</para>
    3035
    3136  <caution>
  • chapter02/chapter02.xml

    rceb61b9 r9247501d  
    1515  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="hostreqs.xml"/>
    1616  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="stages.xml"/>
    17   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="creatingpartition.xml"/>
    18   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="creatingfilesystem.xml"/>
    1917  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="aboutlfs.xml"/>
    20   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="mounting.xml"/>
    2118
    2219</chapter>
  • chapter02/hostreqs.xml

    rceb61b9 r9247501d  
    3636
    3737    <listitem>
     38      <!-- needed to cross build the kernel in chapter 6 -->
     39      <para><emphasis role="strong">Bc-1.07.0</emphasis></para>
     40    </listitem>
     41
     42    <listitem>
    3843      <para><emphasis role="strong">Bison-2.7</emphasis> (/usr/bin/yacc
    3944      should be a link to bison or a small script that executes bison)</para>
     
    7176    <listitem>
    7277      <para><emphasis role="strong">Gzip-1.3.12</emphasis></para>
    73     </listitem>
    74 
    75     <listitem>
    76       <para><emphasis role="strong">Linux Kernel-&min-kernel;</emphasis></para>
    77 
    78       <para>The reason for the kernel version requirement is that we specify
    79       that version when building <application>glibc</application> in
    80       <xref linkend="chapter-cross-tools"/> and
    81       <xref linkend="chapter-building-system"/>,
    82       at the recommendation of the developers.  It is also required by
    83       udev.</para>
    84 
    85       <para>If the host kernel is earlier than &min-kernel; you will need to replace
    86       the kernel with a more up to date version. There are two ways
    87       you can go about this. First, see if your Linux vendor provides a &min-kernel;
    88       or later kernel package. If so, you may wish to install it. If your
    89       vendor doesn't offer an acceptable kernel package, or you would prefer not to
    90       install it, you can compile a kernel yourself. Instructions for
    91       compiling the kernel and configuring the boot loader (assuming the host
    92       uses GRUB) are located in <xref linkend="chapter-bootable"/>.</para>
    93 
    9478    </listitem>
    9579
     
    161145unset MYSH
    162146
     147bc --version | head -n1
    163148echo -n "Binutils: "; ld --version | head -n1 | cut -d" " -f3-
    164149bison --version | head -n1
  • chapter02/stages.xml

    rceb61b9 r9247501d  
    6565    <itemizedlist>
    6666      <listitem>
    67          <para>The /mnt/lfs partition must be mounted.</para>
     67        <para>You must boot the temporary system on the target machine.</para>
    6868      </listitem>
    6969
    7070      <listitem>
    71         <para>A few operations, from <quote>Changing Ownership</quote> to
    72         <quote>Entering the Chroot Environment</quote>, must be done as the
    73         <systemitem class="username">root</systemitem> user, with the LFS
    74         environment variable set for the &root; user.</para>
     71        <para>A few operations, from
     72        <quote>Preparing Virtual Kernel File Systems</quote> to
     73        <quote>Setting up Environment</quote>, must be done.</para>
    7574      </listitem>
    7675
    7776      <listitem>
    78          <para> When entering chroot, the LFS environment variable must be set
    79          for <systemitem class="username">root</systemitem>. The LFS
    80          variable is not used after entering the chroot environment.</para>
     77        <para>The operations in <xref linkend="ch-tools-lo"/> must be done
     78        before starting or continuing from
     79        <xref linkend="chapter-building-system"/>.</para>
    8180      </listitem>
    8281
    83       <listitem>
    84          <para> The virtual file systems must be mounted.  This can be done
    85          before or after entering chroot by changing to a host virtual terminal
    86          and, as <systemitem class="username">root</systemitem>, running the
    87          commands in
    88          <xref linkend='ch-tools-bindmount'/> and
    89          <xref linkend='ch-tools-kernfsmount'/>.</para>
    90       </listitem>
    9182    </itemizedlist>
    9283  </sect2>
  • chapter04/aboutsbus.xml

    rceb61b9 r9247501d  
    3838
    3939  <note>
     40    <para>In the cross edition, the SBUs are kept same as the original LFS
     41    book.  They should only be considered as a reference. It obviously does
     42    not make sense to predict the building time in Chapter 7 or 8 with
     43    <quote>1 SBU</quote> measured in Chapter 5, as the target machine and
     44    the machine running the host distro may be completely different.</para>
     45  </note>
     46
     47  <note>
    4048    <para>For many modern systems with multiple processors (or cores) the
    4149    compilation time for a package can be reduced by performing a "parallel
  • chapter04/addinguser.xml

    rceb61b9 r9247501d  
    8181  <systemitem class="username">lfs</systemitem> the owner:</para>
    8282
    83 <screen><userinput>chown -v lfs $LFS/{usr{,/*},lib,var,etc,bin,sbin,tools}
    84 case $(uname -m) in
    85   x86_64) chown -v lfs $LFS/lib64 ;;
    86 esac</userinput></screen>
     83<screen><userinput>chown -v lfs $LFS/{usr{,/*},lib*,boot,var,etc,bin,sbin,tools}</userinput></screen>
    8784
    8885<note><para>In some host systems, the following <command>su</command> command does not complete
  • chapter04/creatingminlayout.xml

    rceb61b9 r9247501d  
    2222  <systemitem class="username">root</systemitem>:</para>
    2323
    24 <screen><userinput>mkdir -pv $LFS/{etc,var} $LFS/usr/{bin,lib,sbin}
     24<screen><userinput>mkdir -pv $LFS/{boot,etc,var} $LFS/usr/{bin,lib,sbin}
    2525
    2626for i in bin lib sbin; do
    2727  ln -sv usr/$i $LFS/$i
    28 done
     28done</userinput></screen>
    2929
    30 case $(uname -m) in
    31   x86_64) mkdir -pv $LFS/lib64 ;;
    32 esac</userinput></screen>
     30  <para>Some targets (for example, x86_64) needs
     31  <filename class="directory">/lib64</filename> directory.  If you are
     32  building for one of those targets, create it as
     33  <systemitem class="username">root</systemitem>:</para>
     34
     35<screen><userinput>mkdir -pv $LFS/lib64</userinput></screen>
    3336
    3437  <para>Programs in <xref linkend="chapter-temporary-tools"/> will be compiled
  • chapter04/settingenviron.xml

    rceb61b9 r9247501d  
    4545LFS=/mnt/lfs
    4646LC_ALL=POSIX
    47 LFS_TGT=$(uname -m)-lfs-linux-gnu
     47LFS_TGT=<replaceable>x86_64</replaceable>-lfs-linux-gnu
    4848PATH=/usr/bin
    4949if [ ! -L /bin ]; then PATH=/bin:$PATH; fi
     
    106106
    107107    <varlistentry>
    108       <term><parameter>LFS_TGT=(uname -m)-lfs-linux-gnu</parameter></term>
     108      <term><parameter>LFS_TGT=<replaceable>x86_64</replaceable>-lfs-linux-gnu</parameter></term>
    109109      <listitem>
    110110  <para>The <envar>LFS_TGT</envar> variable sets a non-default, but compatible machine
    111111  description for use when building our cross compiler and linker and when cross
    112112  compiling our temporary toolchain. More information is contained in
    113   <xref linkend="ch-tools-toolchaintechnotes" role=""/>.</para>
     113  <xref linkend="ch-tools-toolchaintechnotes" role=""/>.
     114  If you are not building for 64-bit x86, replace
     115  <replaceable>x86_64</replaceable> with some value suitable for your target
     116  machine, for example <literal>i686</literal> for 32-bit x86.</para>
    114117      </listitem>
    115118    </varlistentry>
  • chapter05/gcc-pass1.xml

    rceb61b9 r9247501d  
    6363mv -v mpc-&mpc-version; mpc</userinput></screen>
    6464
    65     <para>On x86_64 hosts, set the default directory name for
    66     64-bit libraries to <quote>lib</quote>:</para>
    67 
    68 <screen><userinput remap="pre">case $(uname -m) in
    69   x86_64)
    70     sed -e '/m64=/s/lib64/lib/' \
    71         -i.orig gcc/config/i386/t-linux64
    72  ;;
    73 esac</userinput></screen>
     65    <para>For x86_64 target, set the default directory name for
     66    64-bit libraries to <quote>lib</quote>.  The command is unnecessary,
     67    but harmless for 32-bit x86.  If you are building for another target,
     68    you may need to adjust the command for your target.</para>
     69
     70<screen><userinput remap="pre">sed -e '/m64=/s/lib64/lib/' \
     71    -i.orig gcc/config/i386/t-linux64</userinput></screen>
    7472
    7573    <para>The GCC documentation recommends building GCC
  • chapter05/glibc.xml

    rceb61b9 r9247501d  
    4646    <para>First, create a symbolic link for LSB compliance. Additionally,
    4747    for x86_64, create a compatibility symbolic link required for proper
    48     operation of the dynamic library loader:</para>
    49 
    50 <screen><userinput remap="pre">case $(uname -m) in
    51     i?86)   ln -sfv ld-linux.so.2 $LFS/lib/ld-lsb.so.3
     48    operation of the dynamic library loader.  It's needed to adjust the
     49    command if you are building LFS for a target other than 32-bit or
     50    64-bit x86.</para>
     51
     52<screen><userinput remap="pre">case $LFS_TGT in
     53    i?86*)   ln -sfv ld-linux.so.2 $LFS/lib/ld-lsb.so.3
    5254    ;;
    53     x86_64) ln -sfv ../lib/ld-linux-x86-64.so.2 $LFS/lib64
    54             ln -sfv ../lib/ld-linux-x86-64.so.2 $LFS/lib64/ld-lsb-x86-64.so.3
     55    x86_64*) ln -sfv ../lib/ld-linux-x86-64.so.2 $LFS/lib64
     56             ln -sfv ../lib/ld-linux-x86-64.so.2 $LFS/lib64/ld-lsb-x86-64.so.3
    5557    ;;
    5658esac</userinput></screen>
     
    9092      --host=$LFS_TGT                    \
    9193      --build=$(../scripts/config.guess) \
    92       --enable-kernel=&min-kernel;                \
     94      --enable-kernel=&linux-major-version;.&linux-minor-version;               \
    9395      --with-headers=$LFS/usr/include    \
    9496      libc_cv_slibdir=/usr/lib</userinput></screen>
     
    107109
    108110      <varlistentry>
    109         <term><parameter>--enable-kernel=&min-kernel;</parameter></term>
    110         <listitem>
    111           <para>This tells Glibc to compile the library with support
    112           for &min-kernel; and later Linux kernels.  Workarounds for older
    113           kernels are not enabled.</para>
     111        <term><parameter>--enable-kernel=&linux-major-version;.&linux-minor-version;</parameter></term>
     112        <listitem>
     113          <para>This option tells the build system that this glibc may
     114          be used with kernels as old as
     115          &linux-major-version;.&linux-minor-version;. This means generating
     116          workarounds in case a system call introduced in a later version
     117          cannot be used.</para>
    114118        </listitem>
    115119      </varlistentry>
  • chapter05/linux-headers.xml

    rceb61b9 r9247501d  
    5757    be available. The headers are first placed in
    5858    <filename class="directory">./usr</filename>, then copied to the needed
    59     location.</para>
    60 
    61 <screen><userinput remap="make">make headers
     59    location.  Replace <replaceable>x86</replaceable> with a value suitable
     60    for your target machine if it's not a 32-bit or 64-bit x86:</para>
     61
     62<screen><userinput remap="make">make headers ARCH=<replaceable>x86</replaceable>
    6263find usr/include -type f ! -name '*.h' -delete
    6364</userinput><userinput remap="install">cp -rv usr/include $LFS/usr</userinput></screen>
  • chapter06/chapter06.xml

    rceb61b9 r9247501d  
    3232  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="gcc-pass2.xml"/>
    3333
     34  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="util-linux.xml"/>
     35  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="grub.xml"/>
     36  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="kernel.xml"/>
     37  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="grub-cfg.xml"/>
     38
    3439</chapter>
  • chapter06/gcc-pass2.xml

    rceb61b9 r9247501d  
    5959mv -v mpc-&mpc-version; mpc</userinput></screen>
    6060
    61     <para>If building on x86_64, change the default directory name for 64-bit
    62     libraries to <quote>lib</quote>:</para>
     61    <para>For x86_64 target, set the default directory name for
     62    64-bit libraries to <quote>lib</quote>.  The command is unnecessary,
     63    but harmless for 32-bit x86.  If you are building for another target,
     64    you may need to adjust the command for your target.</para>
    6365
    64 <screen><userinput remap="pre">case $(uname -m) in
    65   x86_64)
    66     sed -e '/m64=/s/lib64/lib/' -i.orig gcc/config/i386/t-linux64
    67   ;;
    68 esac</userinput></screen>
     66<screen><userinput remap="pre">sed -e '/m64=/s/lib64/lib/' \
     67    -i.orig gcc/config/i386/t-linux64</userinput></screen>
    6968
    7069    <para>Override the building rule of libgcc and libstdc++ headers, to
  • chapter07/chapter07.xml

    rceb61b9 r9247501d  
    1010  <?dbhtml filename="chapter07.html"?>
    1111
    12   <title>Entering Chroot and Building Additional Temporary Tools</title>
     12  <title>Booting the Target System and Building Additional Temporary Tools</title>
    1313
    1414  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="introduction.xml"/>
    15   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="changingowner.xml"/>
     15  <!--xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="changingowner.xml"/-->
    1616  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="kernfs.xml"/>
    1717  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="chroot.xml"/>
     
    2424  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="texinfo.xml"/>
    2525  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="util-linux.xml"/>
     26  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="iproute2.xml"/>
    2627
    2728<!--
  • chapter07/chroot.xml

    rceb61b9 r9247501d  
    77
    88<sect1 id="ch-tools-chroot">
    9   <?dbhtml filename="chroot.html"?>
     9  <?dbhtml filename="env.html"?>
    1010
    11   <title>Entering the Chroot Environment</title>
     11  <title>Setting up the Environment</title>
    1212
    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
    17   class="username">root</systemitem>, run the following command to enter the
    18   environment that is, at the moment, populated with only the temporary
    19   tools:</para>
     13    <para>The current shell is also the <command>init</command> process,
     14    so exiting from it will cause kernel panic.  Prevent exiting from the
     15    shell accidentally:</para>
    2016
    21 <screen role="nodump"><userinput>chroot "$LFS" /usr/bin/env -i   \
     17<screen role="nodump"><userinput>enable -n exit
     18readonly IGNOREEOF=1000</userinput></screen>
     19
     20    <para>The standard I/O streams of the initial shell process is connected
     21    with <filename>/dev/console</filename>.  However, the testsuite of some
     22    packages may expect the standard I/O streams to be connected with a
     23    <quote>real</quote> TTY device node.  Spawn a new shell process on the
     24    TTY device with <command>agetty</command>:</para>
     25
     26<screen role="nodump"><userinput>agetty -n -l /bin/bash <replaceable>tty0</replaceable></userinput></screen>
     27
     28    <para>If you are working via a serial console, replace
     29    <replaceable>tty0</replaceable> with the name of the serial console
     30    device node, for example <literal>ttyS0</literal>.</para>
     31
     32    <para>The command above spawns a new shell process on the TTY device
     33    specified in the command, and the initial shell process will run in
     34    background as an init process with very limited functions. The new shell
     35    process will output:</para>
     36
     37<screen role="nodump"><computeroutput>bash: cannot set terminal process group (-1): Inappropriate ioctl for device
     38bash: no job control in this shell</computeroutput></screen>
     39
     40    <para>This is normal because the shell is not assigned with a
     41    controlling terminal yet.  Now set up controlling terminal and
     42    environment variables:</para>
     43
     44<screen><userinput>exec setsid -c /usr/bin/env -i  \
    2245    HOME=/root                  \
    2346    TERM="$TERM"                \
    24     PS1='(lfs chroot) \u:\w\$ ' \
     47    PS1='(lfs) \u:\w\$ '        \
    2548    PATH=/usr/bin:/usr/sbin     \
    2649    /bin/bash --login</userinput></screen>
    2750
     51    <para>The command replace the current shell process with a new shell
     52    process, with controlling terminal set up.</para>
     53
    2854  <para>The <parameter>-i</parameter> option given to the <command>env</command>
    29   command will clear all variables of the chroot environment. After that, only
     55  command will clear all variables of the environment. After that, only
    3056  the <envar>HOME</envar>, <envar>TERM</envar>, <envar>PS1</envar>, and
    3157  <envar>PATH</envar> variables are set again. The
    3258  <parameter>TERM=$TERM</parameter> construct will set the <envar>TERM</envar>
    33   variable inside chroot to the same value as outside chroot. This variable is
     59  variable to the default value specified by <command>agetty</command>. This variable is
    3460  needed for programs like <command>vim</command> and <command>less</command>
    3561  to operate properly.  If other variables are desired, such as
     
    3763  them again.</para>
    3864
    39   <para>From this point on, there is no need to use the
    40   <envar>LFS</envar> variable anymore because all work will be restricted
    41   to the LFS file system.  This is because the Bash shell is told that
    42   <filename class="directory">$LFS</filename> is now the root
    43   (<filename class="directory">/</filename>) directory.</para>
    44 
    4565  <para>Notice that <filename class="directory">/tools/bin</filename> is not
    4666  in the <envar>PATH</envar>. This means that the cross toolchain will no longer be
    47   used in the chroot environment.</para>
     67  used on the target machine.</para>
    4868
    4969  <para>Note that the <command>bash</command> prompt will say
     
    5171  <filename>/etc/passwd</filename> file has not been created yet.</para>
    5272
     73  <para>Now set up a temporary hostname, which is required by test suite of
     74  some packages:</para>
     75
     76<screen><userinput>hostname lfs</userinput></screen>
     77
    5378  <note>
    5479    <para>It is important that all the commands throughout the remainder of this
    55     chapter and the following chapters are run from within the chroot
    56     environment. If you leave this environment for any reason (rebooting for
     80    chapter and the following chapters are run from within the environment
     81    we've set. If you leave this environment for any reason (rebooting for
    5782    example), ensure that the virtual kernel filesystems are mounted as
    58     explained in <xref linkend="ch-tools-bindmount"/> and <xref
    59     linkend="ch-tools-kernfsmount"/> and enter chroot again before continuing
    60     with the installation.</para>
     83    explained in <xref linkend="ch-tools-kernfsmount"/> and
     84    <xref linkend="ch-tools-devadjust"/> and set up the environment again before
     85    continuing with the installation.</para>
    6186  </note>
    6287
  • chapter07/cleanup.xml

    rceb61b9 r9247501d  
    5858
    5959    <para>
    60       The following steps are performed from outside the chroot
    61       environment. That means, you have to leave the chroot environment
    62       first before continuing. The reason for that is to
    63       get access to file system locations outside of the chroot
    64       environment to store/read the backup archive which should
    65       not be placed within the
    66       <filename class="directory">$LFS</filename> hierarchy for
    67       safety reasons.
     60       If you are making a backup, mount the partition for backup:
    6861    </para>
    6962
    70     <para>
    71        If you have decided to make a backup, leave the chroot environment:
    72     </para>
    73 
    74 <screen role="nodump"><userinput>exit</userinput></screen>
    75 
    76     <important>
    77       <para>
    78         All of the following instructions are executed by
    79         <systemitem class="username">root</systemitem> on your host system.
    80         Take extra care about the commands you're going to run as mistakes
    81         here can modify your host system. Be aware that the
    82         environment variable <envar>LFS</envar>
    83         is set for user <systemitem class="username">lfs</systemitem> by default
    84         but may <emphasis>not</emphasis> be set for
    85         <systemitem class="username">root</systemitem>.
    86      </para>
    87      <para>
    88         Whenever commands are to be executed by <systemitem class="username">root</systemitem>,
    89         make sure you have set <envar>LFS</envar>.
    90      </para>
    91      <para>
    92         This has been discussed in <xref linkend='ch-partitioning-aboutlfs'/>.
    93       </para>
    94     </important>
    95 
    96     <para>Before making a backup, unmount the virtual file systems:</para>
    97 
    98 <screen role="nodump"><userinput>mountpoint -q $LFS/dev/shm &amp;&amp; umount $LFS/dev/shm
    99 umount $LFS/dev/pts
    100 umount $LFS/{sys,proc,run,dev}</userinput></screen>
     63<screen role="nodump"><userinput>mount -v /dev/sda<replaceable>4</replaceable> /mnt</userinput></screen>
    10164
    10265    <para>
    10366      Make sure you have at least 1 GB free disk space (the source tarballs
    104       will be included in the backup archive) on the filesystem containing
    105       directory where you create the backup archive.
     67      will be included in the backup archive) in the partition prepared for
     68      backup.
    10669    </para>
    10770
     
    12992    </note>
    13093
    131 <screen role="nodump"><userinput>cd $LFS
    132 tar -cJpf $HOME/lfs-temp-tools-&version;.tar.xz .</userinput></screen>
     94<screen role="nodump"><userinput>cd /
     95tar -cJpf /mnt/lfs-temp-tools-&version;.tar.xz . \
     96    --exclude="dev/*" --exclude="proc/*"
     97    --exclude="sys/*" --exclude="run/*"
     98    --exclude="mnt/*"</userinput></screen>
    13399
    134     <note>
    135       <para>
    136         If continuing to chapter 8, don't forget to reenter the chroot
    137         environment as explained in the <quote>Important</quote> box below.
    138       </para>
    139     </note>
     100    <para>Unmount the partition containing the backup:</para>
     101
     102<screen role="nodump"><userinput>umount /mnt</userinput></screen>
    140103
    141104  </sect2>
     
    147110      In case some mistakes have been made and you need to start over, you can
    148111      use this backup to restore the system and save some recovery time.
    149       Since the sources are located under
    150       <filename class="directory">$LFS</filename>, they are included in the
    151       backup archive as well, so they do not need to be downloaded again. After
    152       checking that <envar>$LFS</envar> is set properly,
    153       restore the backup by executing the following commands:
     112      Since the sources are included in the
     113      backup archive as well, so they do not need to be downloaded again.
    154114    </para>
     115
     116    <warning><para>
     117      Power off the target system and reconnect the disk containing LFS
     118      temporary system to the host for restoring the backup.  It's necessary
     119      to avoid overwriting some binaries being used.  Because the package
     120      providing <command>shutdown</command> command is not built yet, the
     121      system can't be shut down cleanly.  Issue <command>sync</command> to
     122      ensure all filesystem writes cached in memory to be really written
     123      into the disk, then power off the system physically (for example,
     124      unplug the AC cord).
     125    </para></warning>
     126
     127    <para>Mount the LFS partition and the backup partition on
     128    <emphasis role="bold">the host system</emphasis>:</para>
    155129
    156130<!-- Make the following look different so users don't blindly run the
    157131     restore when they don't need to. -->
    158132
     133<screen role="nodump"><computeroutput>mkdir -pv /mnt/lfs-{target,backup}
     134mount -v -t ext4 <replaceable>/dev/sdx</replaceable>3 /mnt/lfs-target
     135mount -v -t ext4 <replaceable>/dev/sdx4</replaceable> /mnt/lfs-backup</computeroutput></screen>
     136
     137
    159138    <warning><para>The following commands are extremely dangerous.  If
    160139    you run <command>rm -rf ./*</command> as the &root; user and you
    161     do not change to the $LFS directory or the <envar>LFS</envar>
    162     environment variable is not set for the &root; user, it will destroy
    163     your entire host system.  YOU ARE WARNED.</para></warning>
     140    do not change to the <filename>lfs-target</filename> directory,
     141    it will destroy your entire host system.
     142    YOU ARE WARNED.</para></warning>
    164143
    165 <screen role="nodump"><computeroutput>cd $LFS
     144<screen role="nodump"><computeroutput>cd /mnt/lfs-target
    166145rm -rf ./*
    167 tar -xpf $HOME/lfs-temp-tools-&version;.tar.xz</computeroutput></screen>
     146tar -xpf /mnt/lfs-backup/lfs-temp-tools-&version;.tar.xz</computeroutput></screen>
    168147
    169148    <para>
    170        Again, double check that the environment has been setup properly
    171        and continue building the rest of the system.
     149       Again, unmount the two partitions, reconnect the device to the target
     150       machine, boot it and continue building the rest of system:
    172151    </para>
     152
     153<screen role="nodump"><computeroutput>umount /mnt/lfs-{target,backup}</computeroutput></screen>
    173154
    174155    <important>
    175156      <para>
    176          If you left the chroot environment to create a backup or restart
    177          building using a restore, remember to check that the virtual
    178          filesystems are still mounted (<command>findmnt | grep
    179          $LFS</command>).  If they are not mounted, remount them now as
    180          described in <xref linkend='ch-tools-kernfs'/> and re-enter the chroot
     157         If you reboot your target machine and restart
     158         building using a restore, remount the virtual filesystems now as
     159         described in <xref linkend='ch-tools-kernfs'/> and re-enter the build
    181160         environment (see <xref linkend='ch-tools-chroot'/>) before continuing.
    182161       </para>
  • chapter07/introduction.xml

    rceb61b9 r9247501d  
    1111  <title>Introduction</title>
    1212
     13  <warning>
     14    <para>Please make sure the temporary system is already booted on the
     15    target machine.  All commands in this chapter and the following chapters
     16    should be executed on the target machine instead of the host distro,
     17    unless the book explicitly says a command is for the host.  Running a
     18    command for the temporary system on the host can completely destroy the
     19    host distro.</para>
     20  </warning>
     21
    1322  <para>This chapter shows how to build the last missing bits of the temporary
    1423  system: the tools needed to build the various packages.  Now
    15   that all circular dependencies have been resolved, a <quote>chroot</quote>
    16   environment, completely isolated from the host operating system (except for
    17   the running kernel), can be used for the build.</para>
     24  that all circular dependencies have been resolved and the temporary system
     25  is already bootable, we can boot it on the target machine and it would be
     26  completely isolated from the host operating system.  Then we can continue
     27  to build on the target machine.</para>
    1828
    19   <para>For proper operation of the isolated environment, some communication
    20   with the running kernel must be established. This is done via the
     29  <para>For proper operation of the temporary system, some communication
     30  with the running kernel must be established. This is done through the
    2131  so-called <emphasis>Virtual Kernel File Systems</emphasis>, which will be
    22   mounted before entering the chroot environment. You may want to verify
    23   that they are mounted by issuing the <command>findmnt</command> command.</para>
     32  mounted as soon as possible after boot. You may want to check
     33  that they are mounted by issuing <command>mount</command>.</para>
    2434
    25   <para>Until <xref linkend="ch-tools-chroot"/>, the commands must be
    26   run as <systemitem class="username">root</systemitem>, with the
    27   <envar>LFS</envar> variable set. After entering chroot, all commands
    28   are run as &root;, fortunately without access to the OS of the computer
    29   you built LFS on. Be careful anyway, as it is easy to destroy the whole
    30   LFS system with bad commands.</para>
     35  <para>All commands in this and following chapters are run as &root; on the
     36  target system, fortunately without access to the host system.
     37  Be careful anyway, as if the storage devices of your target system already
     38  contain some important data, it's possible to destroy them with bad
     39  commands.</para>
    3140
    3241</sect1>
  • chapter07/kernfs.xml

    rceb61b9 r9247501d  
    1919    with the kernel itself. These file systems are virtual: no disk
    2020    space is used for them. The content of the file systems resides in
    21     memory. These file systems must be mounted in the $LFS directory tree
    22     so the applications can find them in the chroot environment.</para>
     21    memory.</para>
    2322
    2423    <para>Begin by creating directories on which the file systems will be
    2524    mounted:</para>
    2625
    27 <screen><userinput>mkdir -pv $LFS/{dev,proc,sys,run}</userinput></screen>
    28 
    29   <sect2 id="ch-tools-bindmount">
    30     <title>Mounting and Populating /dev</title>
    31 
    32       <para>During a normal boot of the LFS system, the kernel automatically
    33       mounts the <systemitem class="filesystem">devtmpfs</systemitem>
    34       filesystem on the
    35       <filename class="directory">/dev</filename> directory; the kernel
    36       creates device nodes on that virtual filesystem during the boot process
    37       or when a device is first detected or accessed. The udev daemon may
    38       change the owner or permission of the device nodes created by the
    39       kernel, or create new device nodes or symlinks to ease the work of
    40       distro maintainers or system administrators.  (See
    41       <xref linkend='ch-config-udev-device-node-creation'/> for details.)
    42       If the host kernel supports &devtmpfs;, we can simply mount a
    43       &devtmpfs; at <filename class='directory'>$LFS/dev</filename> and rely
    44       on the kernel to populate it (the LFS building process does not need
    45       the additional work onto &devtmpfs; by udev daemon).</para>
    46 
    47       <para>But, some host kernels may lack &devtmpfs; support and these
    48       host distros maintain the content of
    49       <filename class="directory">/dev</filename> with different methods.
    50       So the only host-agnostic way for populating
    51       <filename class="directory">$LFS/dev</filename> is
    52       bind mounting the host system's
    53       <filename class="directory">/dev</filename> directory. A bind mount is
    54       a special type of mount that allows you to create a mirror of a
    55       directory or mount point at some other location. Use the following
    56       command to do this:</para>
    57 
    58 <screen><userinput>mount -v --bind /dev $LFS/dev</userinput></screen>
    59 
    60   </sect2>
     26<screen><userinput>mkdir -pv /{proc,sys,run}</userinput></screen>
    6127
    6228  <sect2 id="ch-tools-kernfsmount">
    6329    <title>Mounting Virtual Kernel File Systems</title>
    6430
    65       <para>Now mount the remaining virtual kernel filesystems:</para>
     31    <para>The kernel has already mounted
     32    <systemitem class="filesystem">devtmpfs</systemitem>.
     33    Mount the remaining virtual kernel filesystems:</para>
    6634
    67 <screen><userinput>mount -v --bind /dev/pts $LFS/dev/pts
    68 mount -vt proc proc $LFS/proc
    69 mount -vt sysfs sysfs $LFS/sys
    70 mount -vt tmpfs tmpfs $LFS/run</userinput></screen>
    71 <!--
     35<screen><userinput>mkdir -pv /dev/{pts,shm}
     36mount -vt devpts /dev/pts /dev/pts -o gid=5,mode=620
     37mount -vt proc  proc  /proc
     38mount -vt sysfs sysfs /sys
     39mount -vt tmpfs tmpfs /run
     40mount -vt tmpfs tmpfs /dev/shm -o nosuid,nodev</userinput></screen>
     41
    7242    <variablelist>
    7343      <title>The meaning of the mount options for devpts:</title>
     
    9767
    9868    </variablelist>
    99 -->
    100       <para>In some host systems, <filename>/dev/shm</filename> is a
    101       symbolic link to <filename class="directory">/run/shm</filename>.
    102       The /run tmpfs was mounted above so in this case only a
    103       directory needs to be created.</para>
    10469
    105       <para>In other host systems <filename>/dev/shm</filename> is a mount point
    106       for a tmpfs. In that case the mount of /dev above will only create
    107       /dev/shm as a directory in the chroot environment. In this situation
    108       we must explicitly mount a tmpfs:</para>
     70  </sect2>
    10971
    110 <screen><userinput>if [ -h $LFS/dev/shm ]; then
    111   mkdir -pv $LFS/$(readlink $LFS/dev/shm)
    112 else
    113   mount -t tmpfs -o nosuid,nodev tmpfs $LFS/dev/shm
    114 fi</userinput></screen>
     72  <sect2 id="ch-tools-devadjust">
     73    <title>Adjusting devtmpfs</title>
     74
     75    <para>Now <systemitem class='filesystem'>proc</systemitem> filesystem
     76    is mounted, we can replace the device nodes for standard I/O streams
     77    with symlinks to pseudo files in
     78    <filename class="directory">/proc/self/fd</filename> (which are symlinks
     79    to the files connected to the standard I/O streams for the current
     80    process).  And, create another symlink recommended by the kernel
     81    documentation.  These are necessary for I/O redirection in the building
     82    system of some packages to function properly:</para>
     83
     84<screen><userinput>ln -sfv /proc/self/fd/0 /dev/stdin
     85ln -sfv /proc/self/fd/1 /dev/stdout
     86ln -sfv /proc/self/fd/2 /dev/stderr
     87ln -sv  /proc/self/fd   /dev</userinput></screen>
    11588
    11689  </sect2>
  • chapter08/coreutils.xml

    rceb61b9 r9247501d  
    110110    meant to be run as user <systemitem class="username">root</systemitem>:</para>
    111111
    112 <screen><userinput remap="test">make NON_ROOT_USERNAME=tester check-root</userinput></screen>
     112    <!-- CLFS note: "su -c" to set the supplementary group IDs.
     113         For a normal LFS build, they are already set by 'login' or 'su'.
     114         But for CLFS there is no such tool available at the beginning of
     115         chapter 7.  Currently coreutils is the only package of which the
     116         test suite needs the supplementary GIDs set up.  -->
     117<screen><userinput remap="test">su -c 'make NON_ROOT_USERNAME=tester check-root'</userinput></screen>
    113118
    114119    <para>We're going to run the remainder of the tests as the
  • chapter08/gcc.xml

    rceb61b9 r9247501d  
    5555    <screen><userinput remap="pre">patch -Np1 -i ../&gcc-upstream-fixes-patch;</userinput></screen>
    5656-->
    57     <para>If building on x86_64, change the default directory name for 64-bit
    58     libraries to <quote>lib</quote>:</para>
    59 
    60 <screen><userinput remap="pre">case $(uname -m) in
    61   x86_64)
    62     sed -e '/m64=/s/lib64/lib/' \
    63         -i.orig gcc/config/i386/t-linux64
    64   ;;
    65 esac</userinput></screen>
     57
     58    <para>For x86_64 target, set the default directory name for
     59    64-bit libraries to <quote>lib</quote>.  The command is unnecessary,
     60    but harmless for 32-bit x86.  If you are building for another target,
     61    you may need to adjust the command for your target.</para>
     62
     63<screen><userinput remap="pre">sed -e '/m64=/s/lib64/lib/' \
     64    -i.orig gcc/config/i386/t-linux64</userinput></screen>
    6665
    6766    <para>The GCC documentation recommends building GCC in a dedicated build directory:</para>
  • chapter08/glibc.xml

    rceb61b9 r9247501d  
    7373<screen><userinput remap="configure">../configure --prefix=/usr                            \
    7474             --disable-werror                         \
    75              --enable-kernel=&min-kernel;                      \
     75             --enable-kernel=&linux-major-version;.&linux-minor-version;                     \
    7676             --enable-stack-protector=strong          \
    7777             --with-headers=/usr/include              \
     
    9090
    9191      <varlistentry>
    92         <term><parameter>--enable-kernel=&min-kernel;</parameter></term>
     92        <term><parameter>--enable-kernel=&linux-major-version;.&linux-minor-version;</parameter></term>
    9393        <listitem>
    9494          <para>This option tells the build system that this glibc may
    95           be used with kernels as old as &min-kernel;. This means generating
     95          be used with kernels as old as
     96          &linux-major-version;.&linux-minor-version;. This means generating
    9697          workarounds in case a system call introduced in a later version
    9798          cannot be used.</para>
  • chapter10/fstab.xml

    rceb61b9 r9247501d  
    2626#                                                              order
    2727
    28 /dev/<replaceable>&lt;xxx&gt;</replaceable>     /            <replaceable>&lt;fff&gt;</replaceable>    defaults            1     1
    29 /dev/<replaceable>&lt;yyy&gt;</replaceable>     swap         swap     pri=1               0     0
     28/dev/<replaceable>sda</replaceable>3      /            ext4     defaults            1     1
     29/dev/<replaceable>sda</replaceable>2      /boot        ext4     defaults            0     2
    3030proc           /proc        proc     nosuid,noexec,nodev 0     0
    3131sysfs          /sys         sysfs    nosuid,noexec,nodev 0     0
     
    4444#                                                              order
    4545
    46 /dev/<replaceable>&lt;xxx&gt;</replaceable>     /            <replaceable>&lt;fff&gt;</replaceable>    defaults            1     1
    47 /dev/<replaceable>&lt;yyy&gt;</replaceable>     swap         swap     pri=1               0     0
     46/dev/<replaceable>sda</replaceable>3      /            ext4     defaults            1     1
     47/dev/<replaceable>sda</replaceable>2      /boot        ext4     defaults            0     2
    4848
    4949# End /etc/fstab</literal>
    5050EOF</userinput></screen>
    5151
    52   <para>Replace <replaceable>&lt;xxx&gt;</replaceable>,
    53   <replaceable>&lt;yyy&gt;</replaceable>, and <replaceable>&lt;fff&gt;</replaceable>
    54   with the values appropriate for the system, for example, <filename
    55   class="partition">sda2</filename>, <filename
    56   class="partition">sda5</filename>, and <systemitem
    57   class="filesystem">ext4</systemitem>. For details on the six
     52  <para>Replace <replaceable>sda</replaceable> to the name of the device
     53  node for your disk where LFS is being built.  For details on the six
    5854  fields in this file, see <command>man 5 fstab</command>.</para>
    5955
  • chapter10/grub.xml

    rceb61b9 r9247501d  
    7777    is /boot/grub/.</para>
    7878
    79     <para>The location of the boot partition is a choice of the user that
    80     affects the configuration.  One recommendation is to have a separate small
    81     (suggested size is 200 MB) partition just for boot information.  That way
    82     each build, whether LFS or some commercial distro, can access the same boot
    83     files and access can be made from any booted system.  If you choose to do
    84     this, you will need to mount the separate partition, move all files in the
    85     current <filename class="directory">/boot</filename> directory (e.g. the
    86     linux kernel you just built in the previous section) to the new partition.
    87     You will then need to unmount the partition and remount it as <filename
    88     class="directory">/boot</filename>.  If you do this, be sure to update
    89     <filename>/etc/fstab</filename>.</para>
    90 
    91     <para>Using the current lfs partition will also work, but configuration
    92     for multiple systems is more difficult.</para>
    93 
    94     <para>Using the above information, determine the appropriate
    95     designator for the root partition (or boot partition, if a separate
    96     one is used). For the following example, it is assumed that the root
    97     (or separate boot) partition is <filename
    98     class="partition">sda2</filename>.</para>
     79    <para>For the following example, it is assumed that the root
     80    partition is <filename class="partition">sda3</filename>, and the
     81    seperate boot partition is
     82    <filename class="partition">sda2</filename>.  Replace
     83    <replaceable>sda</replaceable> to the name of the device node for your
     84    disk where LFS is being built.</para>
    9985
    10086    <para>Install the GRUB files into <filename
     
    145131
    146132menuentry "GNU/Linux, Linux &linux-version;-lfs-&version;" {
    147         linux   /boot/vmlinuz-&linux-version;-lfs-&version; root=/dev/sda2 ro
     133        linux   /vmlinuz-&linux-version;-lfs-&version; root=/dev/sda3 ro
    148134}</literal>
    149135EOF</userinput></screen>
  • chapter10/kernel.xml

    rceb61b9 r9247501d  
    336336
    337337    <caution>
    338       <para>If you've decided to use a separate &boot-dir; partition for the
    339       LFS system (maybe sharing a &boot-dir; partition with the host
    340       distro) , the files copied below should go there. The easiest way to
     338      <para>As the cross-built LFS system has a separate &boot-dir;
     339      partition, the files copied below should go there. The easiest way to
    341340      do that is to create the entry for &boot-dir; in &fstab; first (read
    342341      the previous section for details), then issue the following command
    343       as the &root; user in the
    344       <emphasis>chroot environment</emphasis>:</para>
     342      as the &root; user:</para>
    345343
    346344<screen role="nodump"><userinput>mount /boot</userinput></screen>
    347345
    348       <para>The path to the device node is omitted in the command because
    349       <command>mount</command> can read it from &fstab;.</para>
     346      <para>We don't need to specify the path to the device node, as it's
     347      already given in <filename>/etc/fstab</filename>.</para>
    350348    </caution>
    351349
  • chapter11/afterlfs.xml

    rceb61b9 r9247501d  
    7474
    7575  <sect3>
    76   <title>Work from the LFS host in chroot</title>
    77 
    78     <para>
    79       This method provides a complete graphical environment where a full
    80       featured browser and copy/paste capabilities are available. This method
    81       allows using applications like the host's version of wget to download
    82       package sources to a location available when working in the chroot
    83       envirnment.
    84     </para>
    85 
    86     <para>
    87        In order to properly build packages in chroot, you will also need to
    88        remember to mount the virtual file systems if they are not already
    89        mounted. One way to do this is to create a script on the
    90        <emphasis role="bold">HOST</emphasis> system:
    91     </para>
    92 
    93 <screen><command>cat &gt; ~/mount-virt.sh &lt;&lt; "EOF"
    94 #!/bin/bash
    95 
    96 function mountbind
    97 {
    98    if ! mountpoint $LFS/$1 >/dev/null; then
    99      $SUDO mount --bind /$1 $LFS/$1
    100      echo $LFS/$1 mounted
    101    else
    102      echo $LFS/$1 already mounted
    103    fi
    104 }
    105 
    106 function mounttype
    107 {
    108    if ! mountpoint $LFS/$1 >/dev/null; then
    109      $SUDO mount -t $2 $3 $4 $5 $LFS/$1
    110      echo $LFS/$1 mounted
    111    else
    112      echo $LFS/$1 already mounted
    113    fi
    114 }
    115 
    116 if [ $EUID -ne 0 ]; then
    117   SUDO=sudo
    118 else
    119   SUDO=""
    120 fi
    121 
    122 if [ x$LFS == x ]; then
    123   echo "LFS not set"
    124   exit 1
    125 fi
    126 
    127 mountbind dev
    128 mounttype dev/pts devpts devpts -o gid=5,mode=620
    129 mounttype proc    proc   proc
    130 mounttype sys     sysfs  sysfs
    131 mounttype run     tmpfs  run
    132 if [ -h $LFS/dev/shm ]; then
    133   mkdir -pv $LFS/$(readlink $LFS/dev/shm)
    134 else
    135   mounttype dev/shm tmpfs tmpfs -o nosuid,nodev
    136 fi
    137 
    138 #mountbind usr/src
    139 #mountbind boot
    140 #mountbind home
    141 EOF</command></screen>
    142 
    143     <para>
    144        Note that the last three commands in the script are commented out. These
    145        are useful if those directories are mounted as separate partitions on the
    146        host system and will be mounted when booting the completed LFS/BLFS system.
    147     </para>
    148 
    149     <para>
    150         The script can be run with <command>bash ~/mount-virt.sh</command> as
    151         either a regular user (recommended) or as &root;. If run as a regular
    152         user, sudo is required on the host system.
    153     </para>
    154 
    155     <para>
    156         Another issue pointed out by the script is where to store downloaded
    157         package files. This location is arbitrary. It can be in a regular
    158         user's home directory such as ~/sources or in a global location like
    159         /usr/src. Our recommendation is not to mix BLFS sources and LFS sources
    160         in (from the chroot environment) /sources. In any case, the packages
    161         must be accessible inside the chroot environment.
    162     </para>
    163 
    164     <para>
    165         A last convenience feature presented here is to streamline the process
    166         of entering the chroot environment. This can be done with an alias
    167         placed in a user's ~/.bashrc file on the host system:
    168     </para>
    169 
    170 <screen><command>alias lfs='sudo /usr/sbin/chroot /mnt/lfs /usr/bin/env -i HOME=/root TERM="$TERM" PS1="\u:\w\\\\$ "
    171 PATH=/bin:/usr/bin:/sbin:/usr/sbin /bin/bash --login'</command></screen>
    172 
    173      <para>
    174        This alias is a little tricky because of the quoting and levels of
    175        backslash characters. It must be all on a single line. The above command
    176        has been split in two for presentation purposes.
    177     </para>
    178 
    179   </sect3>
    180 
    181   <sect3>
    18276  <title>Work remotely via ssh</title>
    18377
     
    18781        <ulink url="&blfs-book;postlfs/openssh.html">sshd</ulink> and
    18882        <ulink url="&blfs-book;basicnet/wget.html">wget</ulink>
    189        on the LFS system, usually in chroot. It also requires a second
    190        computer. This method has the advantage of being simple by not requiring
    191        the complexity of the chroot environment. It also uses your LFS built
    192        kernel for all additional packages and still provides a complete system
    193        for installing packages.
     83       on the LFS system, usually in the LFS command line. It also requires
     84       a second computer.
    19485    </para>
    19586
     
    20899        <ulink url="&blfs-book;basicnet/links.html">links</ulink>
    209100        (or <ulink url="&blfs-book;basicnet/lynx.html">lynx</ulink>)
    210        in chroot and then rebooting into the new LFS system. At this
     101       after rebooting into the new LFS system.  You may need a removable
     102       stroage device to copy these packages into the target system. At this
    211103       point the default system has six virtual consoles. Switching
    212104       consoles is as easy as using the
  • chapter11/reboot.xml

    rceb61b9 r9247501d  
    9999
    100100  <para>Now that we have said that, let's move on to booting our shiny new LFS
    101   installation for the first time! <emphasis>First exit from the chroot
    102   environment</emphasis>:</para>
     101  installation for the first time!</para>
    103102
    104 <screen><userinput>logout</userinput></screen>
    105 <!-- We need to show the user the details...-->
     103  <para>Unmount the boot partition:</para>
    106104
    107   <para>Then unmount the virtual file systems:</para>
     105<screen role="nodump"><userinput>umount /boot</userinput></screen>
    108106
    109 <screen><userinput>umount -v $LFS/dev/pts
    110 mountpoint -q $LFS/dev/shm &amp;&amp; umount $LFS/dev/shm
    111 umount -v $LFS/dev
    112 umount -v $LFS/run
    113 umount -v $LFS/proc
    114 umount -v $LFS/sys</userinput></screen>
     107  <para>Synchronize cached writes to prevent data loss on reboot without a
     108  fully functional <command>init</command> process:</para>
    115109
    116   <para>If multiple partitions were created, unmount the other
    117   partitions before unmounting the main one, like this:</para>
     110<screen role="nodump"><userinput>sync</userinput></screen>
    118111
    119 <screen role="nodump"><userinput>umount -v $LFS/home
    120 umount -v $LFS</userinput></screen>
     112  <para>Now, reboot the system:</para>
    121113
    122   <para>Unmount the LFS file system itself:</para>
     114<screen role="nodump"><userinput>reboot -ff</userinput></screen>
    123115
    124 <screen role="nodump"><userinput>umount -v $LFS</userinput></screen>
    125 
    126   <para>Now, reboot the system.</para>
    127 
    128 <!-- Commented out because we don't have a host system requirement on
    129      its init, and different init system may recommend different commands
    130      for reboot.  -->
    131 <!--<screen role="nodump"><userinput>shutdown -r now</userinput></screen>-->
     116  <para><parameter>-ff</parameter> option allows to reboot the system
     117  without support from the <command>init</command> process.</para>
    132118
    133119  <para>Assuming the GRUB boot loader was set up as outlined earlier, the menu
  • git-version.sh

    rceb61b9 r9247501d  
    5050sha="$(git describe --abbrev=1)"
    5151rev=$(echo "$sha" | sed 's/-g[^-]*$//')
    52 version="$rev"
    53 versiond="$rev-systemd"
     52version="cross-$rev"
     53versiond="cross-$rev-systemd"
    5454
    5555if [ "$(git diff HEAD | wc -l)" != "0" ]; then
  • packages.ent

    rceb61b9 r9247501d  
    307307<!ENTITY grub-fin-du "159 MB">
    308308<!ENTITY grub-fin-sbu "0.7 SBU">
     309<!ENTITY grub-tmp-du "158 MB">
     310<!ENTITY grub-tmp-sbu "0.7 SBU">
    309311
    310312<!ENTITY gzip-version "1.12">
     
    350352<!ENTITY iproute2-fin-du "16 MB">
    351353<!ENTITY iproute2-fin-sbu "0.2 SBU">
     354<!ENTITY iproute2-tmp-du "15 MB">
     355<!ENTITY iproute2-tmp-sbu "less than 0.1 SBU">
    352356
    353357<!ENTITY jinja2-version "3.1.2">
     
    437441<!ENTITY linux-knl-du "1200 - 8800 MB (typically about 1700 MB)">
    438442<!ENTITY linux-knl-sbu "1.5 - 130.0 SBU (typically about 12 SBU)">
     443<!ENTITY linux-tmp-du "1200 MB">
     444<!ENTITY linux-tmp-sbu "1.5 SBU">
    439445
    440446<!ENTITY linux-headers-tmp-du "1.4 GB">
     
    713719<!ENTITY util-linux-md5 "cd11456f4ddd31f7fbfdd9488c0c0d02">
    714720<!ENTITY util-linux-home "https://git.kernel.org/pub/scm/utils/util-linux/util-linux.git/">
     721
    715722<!ENTITY util-linux-tmp-du "149 MB">
    716723<!ENTITY util-linux-tmp-sbu "0.6 SBU">
    717724<!ENTITY util-linux-fin-du "283 MB">
    718725<!ENTITY util-linux-fin-sbu "1.0 SBU">
     726<!ENTITY mount-setsid-du "85 MB">
     727<!ENTITY mount-setsid-sbu "less than 0.1 SBU">
    719728
    720729<!ENTITY vim-version "9.0.0228">
  • prologue/architecture.xml

    rceb61b9 r9247501d  
    1313<para>The primary target architectures of LFS are the AMD/Intel x86 (32-bit)
    1414and x86_64 (64-bit) CPUs.  On the other hand, the instructions in this book are
    15 also known to work, with some modifications, with the Power PC and ARM CPUs. To
    16 build a system that utilizes one of these CPUs, the main prerequisite, in
    17 addition to those on the next page, is an existing Linux system such as an
    18 earlier LFS installation, Ubuntu, Red Hat/Fedora, SuSE, or other distribution
    19 that targets the architecture that you have. Also note that a 32-bit
    20 distribution can be installed and used as a host system on a 64-bit AMD/Intel
    21 computer.</para>
     15also known to work, with some modifications, with the Power PC and ARM
     16CPUs.</para>
    2217
    2318<para>For building LFS, the gain of building on a 64-bit system
  • prologue/preface.xml

    rceb61b9 r9247501d  
    1616  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="architecture.xml"/>
    1717  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="prerequisites.xml"/>
     18  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="cross.xml"/>
    1819  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="standards.xml"/>
    1920  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="why.xml"/>
Note: See TracChangeset for help on using the changeset viewer.