1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
---|
4 | <!ENTITY % general-entities SYSTEM "../general.ent">
|
---|
5 | %general-entities;
|
---|
6 | ]>
|
---|
7 |
|
---|
8 | <sect1 id="ch-intro-how">
|
---|
9 | <?dbhtml filename="how.html"?>
|
---|
10 |
|
---|
11 | <title>How to Build an LFS System</title>
|
---|
12 |
|
---|
13 | <para>The LFS system will be built by using a previously installed
|
---|
14 | Linux distribution (such as Debian, Mandriva, Red Hat, or SUSE). This
|
---|
15 | existing Linux system (the host) will be used as a starting point to
|
---|
16 | provide necessary programs, including a compiler, linker, and shell,
|
---|
17 | to build the new system. Select the <quote>development</quote> option
|
---|
18 | during the distribution installation to be able to access these
|
---|
19 | tools.</para>
|
---|
20 |
|
---|
21 | <para>As an alternative to installing a separate distribution
|
---|
22 | onto your machine, you may wish to use the Linux From Scratch LiveCD.
|
---|
23 | The CD works well as a host system, providing all the tools you need
|
---|
24 | to successfully follow the instructions in this book. Additionally,
|
---|
25 | it contains all the source packages, patches and a copy of this book.
|
---|
26 | So once you have the CD, no network connection or additional downloads
|
---|
27 | are necessary. For more information about the LFS LiveCD or to download
|
---|
28 | a copy, visit <ulink url="&livecd-root;"/>.</para>
|
---|
29 |
|
---|
30 | <note>
|
---|
31 | <para>The LFS LiveCD might not work on newer hardware configurations,
|
---|
32 | failing to boot or failing to detect some devices, like SATA hard
|
---|
33 | drives.</para>
|
---|
34 |
|
---|
35 | <para>The LFS LiveCD team is working to fix these issues, but they need your
|
---|
36 | help testing it, reporting found problems, and collaborating on the LiveCD
|
---|
37 | development.</para>
|
---|
38 |
|
---|
39 | <para>Please, send your LFS LiveCD reports or development help collaborations
|
---|
40 | to the <ulink url="mailto:livecd@linuxfromscratch.org">LFS LiveCD
|
---|
41 | mailing list</ulink>.</para>
|
---|
42 | </note>
|
---|
43 |
|
---|
44 | <para><xref linkend="chapter-partitioning"/> of this book describes how
|
---|
45 | to create a new Linux native partition and file system, the place
|
---|
46 | where the new LFS system will be compiled and installed. <xref
|
---|
47 | linkend="chapter-getting-materials"/> explains which packages and
|
---|
48 | patches need to be downloaded to build an LFS system and how to store
|
---|
49 | them on the new file system. <xref linkend="chapter-final-preps"/>
|
---|
50 | discusses the setup of an appropriate working environment. Please read
|
---|
51 | <xref linkend="chapter-final-preps"/> carefully as it explains several
|
---|
52 | important issues the reader should be aware of before beginning to
|
---|
53 | work through <xref linkend="chapter-temporary-tools"/> and beyond.</para>
|
---|
54 |
|
---|
55 | <para><xref linkend="chapter-temporary-tools"/> explains the
|
---|
56 | installation of a number of packages that will form the basic
|
---|
57 | development suite (or toolchain) which is used to build the actual
|
---|
58 | system in <xref linkend="chapter-building-system"/>. Some of these
|
---|
59 | packages are needed to resolve circular dependencies—for example,
|
---|
60 | to compile a compiler, you need a compiler.</para>
|
---|
61 |
|
---|
62 | <para><xref linkend="chapter-temporary-tools"/> also shows the user how to
|
---|
63 | build a first pass of the toolchain, including Binutils and GCC (first pass
|
---|
64 | basically means these two core packages will be reinstalled).
|
---|
65 | The next step is to build Glibc, the C library. Glibc will be compiled by
|
---|
66 | the toolchain programs built in the first pass. Then, a second pass of the
|
---|
67 | toolchain will be built. This time, the toolchain will be dynamically linked
|
---|
68 | against the newly built Glibc. The remaining <xref
|
---|
69 | linkend="chapter-temporary-tools"/> packages are built using this second
|
---|
70 | pass toolchain. When this is done, the LFS installation process will no
|
---|
71 | longer depend on the host distribution, with the exception of the running
|
---|
72 | kernel. </para>
|
---|
73 |
|
---|
74 | <para>This effort to isolate the new system from the host distribution may
|
---|
75 | seem excessive, but a full technical explanation is provided in
|
---|
76 | <xref linkend="ch-tools-toolchaintechnotes"/>.</para>
|
---|
77 |
|
---|
78 | <para>In <xref linkend="chapter-building-system"/>, the full LFS system is
|
---|
79 | built. The <command>chroot</command> (change root) program is used to enter
|
---|
80 | a virtual environment and start a new shell whose root directory will be
|
---|
81 | set to the LFS partition. This is very similar to rebooting and instructing
|
---|
82 | the kernel to mount the LFS partition as the root partition. The system
|
---|
83 | does not actually reboot, but instead <command>chroot</command>'s because
|
---|
84 | creating a bootable system requires additional work which is not necessary
|
---|
85 | just yet. The major advantage is that <quote>chrooting</quote> allows the
|
---|
86 | builder to continue using the host while LFS is being built. While waiting
|
---|
87 | for package compilation to complete, a user can switch to a different
|
---|
88 | virtual console (VC) or X desktop and continue using the computer as
|
---|
89 | normal.</para>
|
---|
90 |
|
---|
91 | <para>To finish the installation, the LFS-Bootscripts are set up in
|
---|
92 | <xref linkend="chapter-bootscripts"/>, and the kernel and boot loader are set
|
---|
93 | up in <xref linkend="chapter-bootable"/>. <xref linkend="chapter-finalizing"/>
|
---|
94 | contains information on furthering the LFS experience beyond this book.
|
---|
95 | After the steps in this book have been implemented, the computer will be
|
---|
96 | ready to reboot into the new LFS system.</para>
|
---|
97 |
|
---|
98 | <para>This is the process in a nutshell. Detailed information on each
|
---|
99 | step is discussed in the following chapters and package descriptions.
|
---|
100 | Items that may seem complicated will be clarified, and everything will
|
---|
101 | fall into place as the reader embarks on the LFS adventure.</para>
|
---|
102 |
|
---|
103 | </sect1>
|
---|