⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 how.html

📁 CLFS(Cross-Compiled Linux From Scratch)的文档 Version CLFS-SVN-20060417
💻 HTML
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml">  <head>    <meta http-equiv="Content-Type" content=    "application/xhtml+xml; charset=iso-8859-1" />    <title>      1.2.&nbsp;How to Build an LFS System    </title>    <link rel="stylesheet" href="../stylesheets/lfs.css" type="text/css" />    <meta name="generator" content="DocBook XSL Stylesheets V1.69.1" />    <link rel="stylesheet" href="../stylesheets/lfs-print.css" type=    "text/css" media="print" />  </head>  <body id="lfs" class="CLFS-SVN-20060417-MIPS">    <div class="navheader">      <div class="headertitles">        <h4>          Cross-Compiled Linux From Scratch - Version CLFS-SVN-20060417-MIPS        </h4>        <h3>          Chapter&nbsp;1.&nbsp;Introduction        </h3>      </div>      <ul class="headerlinks">        <li class="prev">          <a accesskey="p" href="chapter.html" title="Introduction">Prev</a>          <p>            Introduction          </p>        </li>        <li class="next">          <a accesskey="n" href="build-info.html" title=          "Recommendend Build Information">Next</a>          <p>            Recommendend Build Information          </p>        </li>        <li class="up">          <a accesskey="u" href="chapter.html" title=          "Chapter&nbsp;1.&nbsp;Introduction">Up</a>.        </li>        <li class="home">          <a accesskey="h" href="../index.html" title=          "Cross-Compiled Linux From Scratch - Version CLFS-SVN-20060417-MIPS">          Home</a>        </li>      </ul>    </div>    <div class="sect1" lang="en" xml:lang="en">      <div class="titlepage">        <h1 class="sect1">          1.2. How to Build an LFS System        </h1>      </div>      <p>        The LFS system will be built by using a previously installed Linux        distribution (such as Debian, Mandrake, Red Hat, or SuSE). This        existing Linux system (the host) will be used as a starting point to        provide necessary programs, including a compiler, linker, and shell,        to build the new system. Select the &ldquo;<span class=        "quote">development</span>&rdquo; option during the distribution        installation to be able to access these tools.      </p>      <p>        As an alternative to installing an entire separate distribution onto        your machine, you may wish to use the Linux From Scratch LiveCD. The        CD works well as a host system, providing all the tools you need to        successfully follow the instructions in this book. Additionally, it        contains all the source packages, patches and a copy of this book. So        once you have the CD, no network connection or additional downloads        are necessary. For more information about the LFS LiveCD or to        download a copy, visit <a href=        "http://www.linuxfromscratch.org/livecd/"><i>http://www.linuxfromscratch.org/livecd/</i></a>      </p>      <p>        THE TEXT BELOW NEEDS TO BE REWRITTEN      </p>      <p>        <a href="../partitioning/chapter.html">Preparing a New Partition</a>        of this book describes how to create a new Linux native partition and        file system, the place where the new LFS system will be compiled and        installed. <a href="../materials/chapter.html">Packages and        Patches</a> explains which packages and patches need to be downloaded        to build an LFS system and how to store them on the new file system.        <a href="../final-preps/chapter.html">Final Preparations</a>        discusses the setup for an appropriate working environment. Please        read <a href="../final-preps/chapter.html">Final Preparations</a>        carefully as it explains several important issues the developer        should be aware of before beginning to work through <a href=        "../cross-tools/chapter.html">Constructing Cross-Compile Tools</a>        and beyond.      </p>      <p>        <a href="../cross-tools/chapter.html">Constructing Cross-Compile        Tools</a> explains the installation of cross-compile tools which will        be built on the host but be able to compile programs that run on the        target machine. These cross-compile tools will be used to create a        temporary, minimal system that will be the basis for building the        final LFS system. Some of these packages are needed to resolve        circular dependencies&mdash;for example, to compile a compiler, you        need a compiler.      </p>      <p>        The process of building cross-compile tools first involves installing        binutils into /cross-tools, so that the linker can be used with the        building of everything else in the temp-system. GCC is then compiled        statically and installed into /cross-tools, and this cross-compiler        is used to build glibc into /tools for the temp-system. The GCC        cross-compiler is then rebuilt dynamically - this final        cross-compiler is what will be used to build the rest of the        temporary system. When this is done, the CLFS installation process        will no longer depend on the host distribution, with the exception of        the running kernel.      </p>      <p>        The packages in <a href="../temp-system/chapter.html">Constructing a        Temporary System</a> are then built using the cross-compiled tools in        /cross-tools, and linked against the C library that was installed        during the building of the cross-tools.      </p>      <p>        This effort to isolate the new system from the host distribution may        seem excessive, but a full technical explanation is provided at the        beginning of <a href="../temp-system/chapter.html">Constructing a        Temporary System</a>.      </p>      <p>        In <a href="../final-system/chapter.html">Installing Basic System        Software</a>, the full LFS system is built. Depending on the system        you are cross-compiling for, either you will boot the minimal        temp-system on the target machine, or chroot into it.      </p>      <p>        The <span><strong class="command">chroot</strong></span> (change        root) program is used to enter a virtual environment and start a new        shell whose root directory will be set to the LFS partition. This is        very similar to rebooting and instructing the kernel to mount the LFS        partition as the root partition. The major advantage is that        &ldquo;<span class="quote">chrooting</span>&rdquo; allows the builder        to continue using the host while LFS is being built. While waiting        for package compilation to complete, a user can switch to a different        virtual console (VC) or X desktop and continue using the computer as        normal.      </p>      <p>        Some systems cannot be built by chrooting so they must be booted        instead. Generally, if you building for a different arch than the        host system, you must reboot because the kernel will likely not        support the target machine. Booting involves installing a few        additional packages that are needed for bootup, installing        bootscripts, and building a miminal kernel.      </p>      <p>        To finish the installation, the LFS-Bootscripts are set up in        <a href="../bootscripts/chapter.html">Setting Up System        Bootscripts</a>, and the kernel and boot loader are set up in        <a href="../bootable/chapter.html">Making the LFS System        Bootable</a>. <a href="../the-end/chapter.html">The End</a> contains        information on furthering the LFS experience beyond this book. After        the steps in this book have been implemented, the computer will be        ready to reboot into the new LFS system.      </p>      <p>        This is the process in a nutshell. Detailed information on each step        is discussed in the following chapters and package descriptions.        Items that may seem complicated will be clarified, and everything        will fall into place as the reader embarks on the LFS adventure.      </p>    </div>    <div class="navfooter">      <ul>        <li class="prev">          <a accesskey="p" href="chapter.html" title="Introduction">Prev</a>          <p>            Introduction          </p>        </li>        <li class="next">          <a accesskey="n" href="build-info.html" title=          "Recommendend Build Information">Next</a>          <p>            Recommendend Build Information          </p>        </li>        <li class="up">          <a accesskey="u" href="chapter.html" title=          "Chapter&nbsp;1.&nbsp;Introduction">Up</a>.        </li>        <li class="home">          <a accesskey="h" href="../index.html" title=          "Cross-Compiled Linux From Scratch - Version CLFS-SVN-20060417-MIPS">          Home</a>.        </li>      </ul>    </div>  </body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -