Files
master/chapter01/how.html
2015-05-23 18:57:59 +08:00

145 lines
7.8 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!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=utf-8" />
<title>
1.1.&nbsp;如何构建 LFS 系统
</title>
<link rel="stylesheet" type="text/css" href="../stylesheets/lfs.css" />
<meta name="generator" content="DocBook XSL Stylesheets V1.78.1" />
<link rel="stylesheet" href="../stylesheets/lfs-print.css" type="text/css"
media="print" />
</head>
<body class="lfs" id="lfs-7.7-systemd">
<div class="navheader">
<h4>
Linux From Scratch - Version 7.7-systemd
</h4>
<h3>
第一章 介绍
</h3>
<ul>
<li class="prev">
<a accesskey="p" href="chapter01.html" title=
"介绍">上一页</a>
<p>
介绍
</p>
</li>
<li class="next">
<a accesskey="n" href="whatsnew.html" title=
"上次发布以来的更新">下一页</a>
<p>
上次发布以来的更新
</p>
</li>
<li class="up">
<a accesskey="u" href="chapter01.html" title=
"第一章 简介">返回</a>
</li>
<li class="home">
<a accesskey="h" href="../index.html" title=
"Linux From Scratch - Version 7.7-systemd">主页</a>
</li>
</ul>
</div>
<div class="sect1" lang="en" xml:lang="en">
<h1 class="sect1">
<a id="ch-intro-how" name="ch-intro-how"></a>1.1. 如何构建 LFS 系统
</h1>
<p>
LFS系统需要在一个已经安装好的 Linux 发行版(比如 Debian、OpenMandriva、Fedora 或 OpenSUSE中构建。这个已有的 Linux 系统(即宿主)作为构建新系统的起始点,提供了必要的程序,包括一个编译器、链接器和 shell。请在安装发行版的过程中选择
<span class="quote">&ldquo;<span class="quote">development开发</span>&rdquo;</span>选项以便使用这些开发工具。
</p>
<p>
除了将一个独立发行版安装到你的电脑上之外,你也可以使用商业发行版的 LiveCD。
</p>
<p>
本书的<a class="xref" href="../chapter02/chapter02.html" title=
"第二章 准备分区">第二章</a>描述了如何创建一个的新 Linux 本地分区和文件系统,这就是编译和安装新的 LFS 系统的地方。<a class="xref" href="../chapter03/chapter03.html" title=
"第三章 软件包与补丁">第三章</a>介绍了构建LFS系统所需下载的软件包和补丁以及如何把他们保存在新的文件系统里。 <a class="xref"
href="../chapter04/chapter04.html" title=
"第四章 最后的准备">第四章</a>讨论了如何设置恰当的工作环境。因为它阐述了几个需要注意的重要问题,在你按照<a class="xref" href=
"../chapter05/chapter05.html" title=
"第五章 构建一个临时文件系统">第五章</a>及之后的内容开始工作前,请仔细阅读<a class="xref" href="../chapter04/chapter04.html" title=
"第四章 最后的准备">第四章</a>
</p>
<p>
<a class="xref" href="../chapter05/chapter05.html" title=
"第五章 构建一个临时文件系统">第五章</a>阐述了构成基本开发套件(即工具链)的大量软件包的安装,在<a class="xref" href="../chapter06/chapter06.html"
title="第六章 安装基本的系统软件">第六章</a>中将用这个开发套件构建真正的系统。其中一些包是需要解决循环依赖——比如,你需要一个编译器来编译一个编译
器。
</p>
<p>
<a class="xref" href="../chapter05/chapter05.html" title=
"第五章 构建一个临时文件系统">第五章</a>还将向你展示如何构建第一遍的工具链,包括 Binutils 和 GCC
(第一遍基本上就是重新安装这两个核心软件包)。下一步是构建 Glibc即C语言库。Glibc
将用第一遍构建的工具链编译。然后,第二遍的工具链就被编译好了。这次,工具链将被动态连接到新建成的 Glibc。
<a class="xref" href=
"../chapter05/chapter05.html" title=
"第五章 构建一个临时文件系统">第五章</a>中剩余的包将用这个第二遍的工具链编译。当这些工作完成以后LFS 的安装过程就不会再依赖于宿主发行版了,除了正在运行的内核。
</p>
<p>
把新系统从宿主发行版中分离出来的工作看起来可能有点多余。<a class="xref" href=
"../chapter05/toolchaintechnotes.html" title=
"5.2.&nbsp;工具链技术备注">5.2 &ldquo;工具链技术备注&rdquo;</a>这一节给出了为什么要这么做的完整技术说明。
</p>
<p>
<a class="xref" href="../chapter06/chapter06.html" title=
"第六章 安装基本的系统软件">第六章</a>,会构建完整的 LFS 系统。我们将使用 <span class=
"command"><strong>chroot</strong></span> (change root 改变根目录) 程序来进入一个虚拟环境并启动一个新的 shell这个 shell 的根目录将被指向到LFS分区。这个过程非常像是重启并让内核把 LFS 分区挂载为根分区。系统并没有真正的重启,而是在使用
<span class="command"><strong>chroot</strong></span> 实现的,因为创建一个可启动的系统还需要有一些目前尚未完成的额外工作。
使用“chroot”的最大好处是它在运行过程中允许你在构建 LFS 的同时继续使用宿主系统。在等待包的编译过程中,你可以继续正常使用你的电脑。
</p>
<p>
为了完成安装,还需要<a class="xref" href="../chapter07/chapter07.html" title=
"第七章 基本系统配置">第七章</a>中的基本的系统配置方法,
<a class="xref" href=
"../chapter08/chapter08.html" title=
"第八章 让 LFS 系统可引导">第八章</a>中的内核和启动引导程序的配置方法。
<a class="xref" href="../chapter09/chapter09.html" title=
"Chapter&nbsp;9.&nbsp;The End">第九章</a>包含了学完本书以后继续使用 LFS 的一些建议。在本书内的步骤完成之后,电脑就可以重启进入新的 LFS 系统了。
</p>
<p>
流程大概就是这样。每一步的详细信息都会在之后的章节和软件包的描述里讨论。当你踏上这段 LFS 之旅,就会理清这些看起来很复杂的东西,每一个都将对号入座。
</p>
</div>
<div class="navfooter">
<div class="book">
<div class="titlepage">
<div class="author">
<span class="firstname">翻译团队:<a href="http://lctt.github.io/" target="_blank">LCTT</a></span>
<span class="surname">译者/校对:<a href="http://github.com/H-mudcup" target="_blank">H-mudcup</a>,<a href="http://github.com/wxy" target="_blank">wxy</a></span>
</div>
</div>
</div>
<ul>
<li class="prev">
<a accesskey="p" href="chapter01.html" title=
"Introduction">上一页</a>
<p>
介绍
</p>
</li>
<li class="next">
<a accesskey="n" href="whatsnew.html" title=
"上次发布以来的更新">下一页</a>
<p>
上次发布以来的更新
</p>
</li>
<li class="up">
<a accesskey="u" href="chapter01.html" title=
"第一章 介绍">返回</a>
</li>
<li class="home">
<a accesskey="h" href="../index.html" title=
"Linux From Scratch - Version 7.7-systemd">主页</a>
</li>
</ul>
</div>
</body>
</html>