1 <?xml version="1.0" encoding="ISO-8859-1"?>
2 <!DOCTYPE preface PUBLIC "-//OASIS//DTD DocBook XML V4.3CR2//EN" "http://www.docbook.org/xml/4.3CR2/docbookx.dtd">
4 <?dbhtml dir="prologue"?>
6 <?dbhtml filename="preface.html"?>
8 <sect1 id="pf-foreword">
9 <title>Foreword</title>
10 <?dbhtml filename="foreword.html"?>
12 <para>Having used a number of different Linux distributions, I was never
13 fully satisfied with any of them. I didn't like the arrangement of
14 the bootscripts. I didn't like the way certain programs were configured by
15 default. Much more of that sort of thing bothered me. Finally I realized
16 that if I wanted full satisfaction from my Linux system I would have to
17 build my own system from scratch, using only the source code. I resolved
18 not to use pre-compiled packages of any kind, nor CD-ROM or boot disk that
19 would install some basic utilities. I would use my current Linux system to
20 develop my own.</para>
22 <para>This wild idea seemed very difficult at the time and often seemed
23 an impossible task. After sorting out all kinds of problems, such as
24 dependencies and compile-time errors, a custom-built Linux system was
25 created that was fully operational. I called this system a Linux From Scratch
26 system, or LFS for short.</para>
28 <para>I hope you will have a great time working on your own LFS!</para>
33 gerard@linuxfromscratch.org
39 <sect1 id="pre-audience">
40 <title>Audience</title>
41 <?dbhtml filename="audience.html"?>
44 <title>Who would want to read this book</title>
46 <para>There are many reasons why somebody would want to read this book. The
47 principal reason being to install a Linux system straight from the source
48 code. A question many people raise is "Why go through all the hassle of
49 manually building a Linux system from scratch when you can just download and
50 install an existing one?". That is a good question and is the impetus for this
51 section of the book.</para>
53 <para>One important reason for LFS's existence is to help people learn how a
54 Linux system works from the inside out. Building an LFS system helps demonstrate
55 to you what makes Linux tick, how things work together and depend on each
56 other. One of the best things that this learning experience provides is the
57 ability to customize Linux to your own tastes and needs.</para>
59 <para>A key benefit of LFS is that you have more control of your system
60 without relying on someone else's Linux implementation. With LFS, you are
61 in the driver's seat and dictate every aspect of your system, such as the
62 directory layout and bootscript setup. You also dictate where, why and how
63 programs are installed.</para>
65 <para>Another benefit of LFS is the ability to create a very compact Linux
66 system. When installing a regular distribution, you are usually forced to
67 install several programs which you are likely never to use. They're just
68 sitting there wasting precious disk space (or worse, CPU cycles). It isn't
69 difficult to build an LFS system less than 100 MB. Does that still sound like a
70 lot? A few of us have been working on creating a very small embedded LFS
71 system. We successfully built a system that was just enough to run the Apache
72 web server with approximately 8MB of disk space used. Further stripping could
73 bring that down to 5 MB or less. Try that with a regular distribution.</para>
75 <para>We could compare distributed Linux to a hamburger you buy at a
76 fast-food restaurant -- you have no idea what you are eating. LFS, on the
77 other hand, doesn't give you a hamburger, but the recipe to make a hamburger.
78 This allows you to review it, to omit unwanted ingredients, and to
79 add your own ingredients which enhance the flavor of your burger. When you
80 are satisfied with the recipe, you go on to preparing it. You make it just
81 the way you like it: broil it, bake it, deep-fry it, barbecue it, or eat it
84 <para>Another analogy that we can use is that of comparing LFS with a
85 finished house. LFS will give you the skeletal plan of a house, but it's up
86 to you to build it. You have the freedom to adjust your plans as you
89 <para>One last advantage of a custom built Linux system is security.
90 By compiling the entire system from source code, you are empowered to audit
91 everything and apply all the security patches you feel are needed. You don't
92 have to wait for somebody else to compile binary packages that fix a security
93 hole. Unless you examine the patch and implement it yourself you have no
94 guarantee that the new binary package was built correctly and actually fixes the
95 problem (adequately).</para>
97 <para>There are too many good reasons to build your own LFS system for them all
98 to be listed here. This section is only the tip of the iceberg. As you
99 continue in your LFS experience, you will find on your own the power that
100 information and knowledge truly bring.</para>
105 <title>Who would not want to read this book</title>
107 <para>There are probably some who, for whatever reason, would feel that they do not
108 want to read this book. If you do not wish to build your own Linux system from
109 scratch, then you probably don't want to read this book. Our goal is to help
110 you build a complete and usable foundation-level system. If you only want to
111 know what happens while your computer boots, then we recommend the <quote>From
112 Power Up To Bash Prompt</quote> HOWTO. The HOWTO builds a bare system which is
113 similar to that of this book, but it focuses strictly on creating a system
114 capable of booting to a BASH prompt.</para>
116 <para>While you decide which to read, consider your objective. If you wish
117 to build a Linux system while learning a bit along the way, then this book
118 is probably your best choice. If your objective is strictly educational and
119 you do not have any plans for your finished system, then the
120 <quote>From Power Up To Bash Prompt</quote> HOWTO is probably a better choice.</para>
122 <para>The <quote>From Power Up To Bash Prompt</quote> HOWTO is located at
123 <ulink url="http://axiom.anu.edu.au/~okeefe/p2b/"/> or on The Linux
124 Documentation Project's website at
125 <ulink url="http://www.tldp.org/HOWTO/From-PowerUp-To-Bash-Prompt-HOWTO.html"/>.</para>
131 <sect1 id="pf-prerequisites">
132 <title>Prerequisites</title>
133 <?dbhtml filename="prerequisites.html"?>
135 <para>This book assumes that its reader has a good deal of knowledge about
136 using and installing Linux software. Before you begin building your LFS
137 system, you should read the following HOWTOs:</para>
140 <listitem><para>Software-Building-HOWTO</para>
142 <para>This is a comprehensive guide to building and installing "generic"
143 UNIX software distributions under Linux. This HOWTO is available at
144 <ulink url="http://www.tldp.org/HOWTO/Software-Building-HOWTO.html"/>.</para></listitem>
146 <listitem><para>The Linux Users' Guide</para>
148 <para>This guide covers the usage of assorted Linux software and is
150 <ulink url="http://espc22.murdoch.edu.au/~stewart/guide/guide.html"/>.</para></listitem>
152 <listitem><para>The Essential Pre-Reading Hint</para>
154 <para>This is an LFS Hint written specifically for new users of Linux. It is
155 mostly a list of links to excellent sources of information on a wide range of
156 topics. Any person attempting to install LFS, should at least have an
157 understanding of many of the topics in this hint. It is available at
159 <ulink url="http://www.linuxfromscratch.org/hints/downloads/files/essential_prereading.txt"/></para></listitem>
165 <sect1 id="pre-organization">
166 <title>Structure</title>
167 <?dbhtml filename="organization.html"?>
169 <para>This book is divided into the following four parts:</para>
172 <title>Part I - Introduction</title>
174 <para>Part I explains a few important things on how to proceed with the
175 installation, and gives meta information about the book (version, changelog,
176 acknowledgments, associated mailing lists, and so on).</para>
180 <title>Part II - Preparing for the build</title>
182 <para>Part II describes how to prepare for the building process: making a
183 partition, downloading the packages, and compiling temporary tools.</para>
187 <title>Part III - Building the LFS system</title>
189 <para>Part III guides you through the building of the LFS system: compiling
190 and installing all the packages one by one, setting up the boot scripts, and
191 installing the kernel. The resulting basic Linux system is the foundation
192 upon which you can build other software, to extend your system in the way
197 <title>Part IV - Appendices</title>
199 <para>Part IV consists of two appendices. The first is an alphabetical list of
200 all the packages that are installed -- for each package giving its official
201 download location, its contents, and its installation dependencies. The second
202 appendix lists all the programs and libraries installed by these packages in
203 alphabetical order, so you can easily find out to which package a certain
204 program or library belongs.</para>
206 <para>(Much of the first appendix is integrated into Parts II and III. This
207 enlarges the book somewhat, but we believe it makes for easier reading. Now
208 you don't have to keep referencing the appendix while doing the installation.
209 This going back and forth would be a real chore, especially if you're reading
210 a plain text version of the book.)</para>