mirror of
https://github.com/LCTT/LFS-BOOK-7.7-systemd.git
synced 2026-02-01 13:47:25 +00:00
117 lines
5.0 KiB
HTML
117 lines
5.0 KiB
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=utf-8" />
|
|
<title>
|
|
4.2. 创建 $LFS/tools 文件夹
|
|
</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="introduction.html" title=
|
|
"简介">上一页</a>
|
|
<p>
|
|
简介
|
|
</p>
|
|
</li>
|
|
<li class="next">
|
|
<a accesskey="n" href="addinguser.html" title=
|
|
"添加 LFS 用户">下一页</a>
|
|
<p>
|
|
添加 LFS 用户
|
|
</p>
|
|
</li>
|
|
<li class="up">
|
|
<a accesskey="u" href="chapter04.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-tools-creatingtoolsdir" name=
|
|
"ch-tools-creatingtoolsdir"></a>4.2. 创建 $LFS/tools 文件夹
|
|
</h1>
|
|
<p>
|
|
所有<a class="xref" href="../chapter05/chapter05.html" title="第五章 构建临时系统">第五章</a>中编译的软件都会安装到 <code class="filename">$LFS/tools</code> 文件夹,以确保和<a class="xref" href="../chapter06/chapter06.html" title="第六章 安装基本系统软件">第六章</a>中编译的软件相互分离。这里编译的软件是临时工具,不会成为最终 LFS 系统的一部分。将这些软件保存在单独的文件夹中,后面使用完之后就可以轻易的丢弃。这也可以防止这些程序在宿主机生成目录中突然停止工作(在<a class="xref" href="../chapter05/chapter05.html" title="Chapter 5. 第五章 构建临时系统">第五章</a>中很容易发生意外)。
|
|
</p>
|
|
<p>
|
|
以 <code class="systemitem">root</code> 用户运行以下的命令来创建需要的文件夹:
|
|
</p>
|
|
<pre class="userinput">
|
|
<kbd class="command">mkdir -v $LFS/tools</kbd>
|
|
</pre>
|
|
<p>
|
|
下一步是在宿主系统中创建 <code class="filename">/tools</code> 的符号链接,将其指向 LFS 分区中新建的文件夹。同样以 <code class="systemitem">root</code> 用户运行下面的命令:
|
|
</p>
|
|
<pre class="userinput">
|
|
<kbd class="command">ln -sv $LFS/tools /</kbd>
|
|
</pre>
|
|
<div class="admon note">
|
|
<img alt="[Note]" src="../images/note.png" />
|
|
<h3>
|
|
注意
|
|
</h3>
|
|
<p>
|
|
上面的命令是正确的。<span class="command"><strong>ln</strong></span> 命令有一些语法变种,所以在报告你觉得可能是一个错误之前检查一下<span class="command"><strong>info coreutils ln</strong></span> 以及 <code class="filename">ln(1)</code>。
|
|
</p>
|
|
</div>
|
|
<p>
|
|
创建的符号链接使得编译的工具链总是指向 <code class="filename">/tools</code> 文件夹,也就是说编译器、汇编器以及链接器在第五章中(我们仍然使用宿主机的一些工具的时候)和下一章中(当我们 <span class="quote">“<span class="quote">chrooted</span>”</span> 到 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/ictlyh" target="_blank">ictlyh</a>,<a href="http://github.com/wxy" target="_blank">wxy</a></span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<ul>
|
|
<li class="prev">
|
|
<a accesskey="p" href="introduction.html" title=
|
|
"简介">上一页</a>
|
|
<p>
|
|
简介
|
|
</p>
|
|
</li>
|
|
<li class="next">
|
|
<a accesskey="n" href="addinguser.html" title=
|
|
"添加 LFS 用户">下一页</a>
|
|
<p>
|
|
添加 LFS 用户
|
|
</p>
|
|
</li>
|
|
<li class="up">
|
|
<a accesskey="u" href="chapter04.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>
|