source: BOOK/introduction/common/how.xml@ b5a58b8

clfs-1.2 clfs-2.1 clfs-3.0.0-systemd clfs-3.0.0-sysvinit systemd sysvinit
Last change on this file since b5a58b8 was 576a66b, checked in by Jim Gifford <clfs@…>, 19 years ago

r3547@server (orig r1619): chris | 2006-05-16 11:37:05 -0700
Changed a number of occurences of LFS to CLFS

  • Property mode set to 100644
File size: 5.7 KB
RevLine 
[3f8be484]1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
3 "http://www.oasis-open.org/docbook/xml/4.4/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
[576a66b]11 <title>How to Build a CLFS System</title>
[3f8be484]12
[576a66b]13 <para>The CLFS system will be built by using a previously installed
[3f8be484]14 Linux distribution (such as Debian, Mandrake, 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 an entire separate distribution
[39a9546]22 onto your machine, you may wish to
[3f8be484]23 use the Linux From Scratch LiveCD. The CD works well as a host system,
24 providing all the tools you need to successfully follow the instructions
25 in this book. Additionally, it contains all the source packages, patches
26 and a copy of this book. So once you have the CD, no network connection
27 or additional downloads are necessary. For more information about the
28 LFS LiveCD or to download a copy, visit <ulink url="&livecd-root;"/></para>
29
30 <!-- -->
[8659630]31 <para>THE TEXT BELOW NEEDS TO BE REWRITTEN</para>
[3f8be484]32
33 <para><xref linkend="chapter-partitioning"/> of this book describes how
34 to create a new Linux native partition and file system, the place
[576a66b]35 where the new CLFS system will be compiled and installed. <xref
[3f8be484]36 linkend="chapter-getting-materials"/> explains which packages and
[576a66b]37 patches need to be downloaded to build a CLFS system and how to store
[3f8be484]38 them on the new file system. <xref linkend="chapter-final-preps"/>
39 discusses the setup for an appropriate working environment. Please read
40 <xref linkend="chapter-final-preps"/> carefully as it explains several
41 important issues the developer should be aware of before beginning to
[8659630]42 work through <xref linkend="chapter-cross-tools"/> and
[3f8be484]43 beyond.</para>
44
[5da8aa0]45 <para><xref linkend="chapter-cross-tools"/> explains the installation of
46 cross-compile tools which will be built on the host but be able to compile
47 programs that run on the target machine. These cross-compile tools will
48 be used to create a temporary, minimal system that will be the basis for
[576a66b]49 building the final CLFS system. Some of these packages are needed to resolve
[5da8aa0]50 circular dependencies&mdash;for example, to compile a compiler, you need a
51 compiler.</para>
52
53 <para>The process of building cross-compile tools first involves installing
54 binutils into /cross-tools, so that the linker can be used with the building
55 of everything else in the temp-system. GCC is then compiled statically and
56 installed into /cross-tools, and this cross-compiler is used to build glibc
57 into /tools for the temp-system. The GCC cross-compiler is then rebuilt
58 dynamically - this final cross-compiler is what will be used to build the
59 rest of the temporary system. When this is done, the CLFS installation
60 process will no longer depend on the host distribution, with the exception
61 of the running kernel.
62 <!-- still needs some work - needs to provide a better technical
63explanation, especially the reasoning for compiling gcc statically then dynamically... --></para>
64
65 <para>The packages in <xref linkend="chapter-temp-system"/> are then built
66 using the cross-compiled tools in /cross-tools, and linked against the
67 C library that was installed during the building of the cross-tools.</para>
[3f8be484]68
69 <para>This effort to isolate the new system from the host distribution
70 may seem excessive, but a full technical explanation is provided at the
[134ba96]71 beginning of <xref linkend="chapter-temp-system"/>.</para>
[3f8be484]72
[576a66b]73 <para>In <xref linkend="chapter-building-system"/>, the full CLFS system is
[5da8aa0]74 built. Depending on the system you are cross-compiling for, either you will
75 boot the minimal temp-system on the target machine, or chroot into it.</para>
76
77 <para>The <command>chroot</command> (change root) program is used to enter
[3f8be484]78 a virtual environment and start a new shell whose root directory will be set
[576a66b]79 to the CLFS partition. This is very similar to rebooting and instructing the
80 kernel to mount the CLFS partition as the root partition.
[3f8be484]81 The major advantage is that <quote>chrooting</quote> allows the builder to
[576a66b]82 continue using the host while CLFS is being built. While waiting for package
[3f8be484]83 compilation to complete, a user can switch to a different virtual console
84 (VC) or X desktop and continue using the computer as normal.</para>
85
[576a66b]86 <para>Some systems cannot be built by chrooting so they must be
87 booted instead. Generally, if you building for a different arch than
88 the host system, you must reboot because the kernel will likely not
89 support the target machine. Booting involves installing a few
90 additional packages that are needed for bootup, installing
91 bootscripts, and building a miminal kernel.</para>
[5da8aa0]92
[576a66b]93 <para>To finish the installation, the CLFS-Bootscripts are set up in <xref
[3f8be484]94 linkend="chapter-bootscripts"/>, and the kernel and boot loader are set
95 up in <xref linkend="chapter-bootable"/>. <xref
96 linkend="chapter-finalizing"/> contains information on furthering the
[576a66b]97 CLFS experience beyond this book. After the steps in this book have
[3f8be484]98 been implemented, the computer will be ready to reboot into the new
[576a66b]99 CLFS system.</para>
[3f8be484]100 <!-- -->
101
102 <para>This is the process in a nutshell. Detailed information on each
103 step is discussed in the following chapters and package descriptions.
104 Items that may seem complicated will be clarified, and everything will
[576a66b]105 fall into place as the reader embarks on the CLFS adventure.</para>
[3f8be484]106
107</sect1>
Note: See TracBrowser for help on using the repository browser.