1 |
r0bertz 07/09/17 17:54:10 |
2 |
|
3 |
Modified: metadoc.xml |
4 |
Added: alsa-guide.xml gentoo-x86-quickinstall.xml |
5 |
gnome-config.xml gpm.xml grub-error-guide.xml |
6 |
lvm2.xml mysql-upgrading.xml nano-basics-guide.xml |
7 |
portage-utils.xml vdr-guide.xml xfce-config.xml |
8 |
Removed: nano-guide.xml |
9 |
Log: |
10 |
add alsa-guide.xml gentoo-x86-quickinstall.xml gnome-config.xml gpm.xml grub-error-guide.xml lvm2.xml mysql-upgrading.xml nano-basics-guide.xml portage-utils.xml vdr-guide.xml xfce-config.xml |
11 |
|
12 |
Revision Changes Path |
13 |
1.5 xml/htdocs/doc/zh_cn/metadoc.xml |
14 |
|
15 |
file : http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/doc/zh_cn/metadoc.xml?rev=1.5&view=markup |
16 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/doc/zh_cn/metadoc.xml?rev=1.5&content-type=text/plain |
17 |
diff : http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/doc/zh_cn/metadoc.xml?r1=1.4&r2=1.5 |
18 |
|
19 |
Index: metadoc.xml |
20 |
=================================================================== |
21 |
RCS file: /var/cvsroot/gentoo/xml/htdocs/doc/zh_cn/metadoc.xml,v |
22 |
retrieving revision 1.4 |
23 |
retrieving revision 1.5 |
24 |
diff -u -r1.4 -r1.5 |
25 |
--- metadoc.xml 16 Sep 2007 18:21:32 -0000 1.4 |
26 |
+++ metadoc.xml 17 Sep 2007 17:54:10 -0000 1.5 |
27 |
@@ -1,6 +1,6 @@ |
28 |
<?xml version="1.0" encoding="UTF-8"?> |
29 |
<!DOCTYPE metadoc SYSTEM "/dtd/metadoc.dtd"> |
30 |
-<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/zh_cn/metadoc.xml,v 1.4 2007/09/16 18:21:32 r0bertz Exp $ --> |
31 |
+<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/zh_cn/metadoc.xml,v 1.5 2007/09/17 17:54:10 r0bertz Exp $ --> |
32 |
<!-- English CVS version: 1.192 --> |
33 |
|
34 |
<metadoc lang="zh_cn" parent="/doc/en/metadoc.xml"> |
35 |
@@ -226,10 +226,10 @@ |
36 |
<file id="2007.0-hb-install-gli-medium">/doc/zh_cn/handbook/2007.0/hb-install-gli-medium.xml</file> |
37 |
<file id="2007.0-hb-install-gtkfe">/doc/zh_cn/handbook/2007.0/hb-install-gtkfe.xml</file> |
38 |
<file id="2007.0-index">/doc/zh_cn/handbook/2007.0/index.xml</file> |
39 |
- <file id="lvm2">/doc/en/lvm2.xml</file> |
40 |
+ <file id="lvm2">/doc/zh_cn/lvm2.xml</file> |
41 |
<file id="gentoo-kernel">/doc/en/gentoo-kernel.xml</file> |
42 |
<file id="gentoo-ppc-faq">/doc/en/gentoo-ppc-faq.xml</file> |
43 |
- <file id="alsa-guide">/doc/en/alsa-guide.xml</file> |
44 |
+ <file id="alsa-guide">/doc/zh_cn/alsa-guide.xml</file> |
45 |
<file id="xorg-config">/doc/en/xorg-config.xml</file> |
46 |
<file id="quick-samba-howto">/doc/en/quick-samba-howto.xml</file> |
47 |
<file id="ltsp">/doc/en/ltsp.xml</file> |
48 |
@@ -243,9 +243,9 @@ |
49 |
<file id="java">/doc/en/java.xml</file> |
50 |
<file id="openafs">/doc/en/openafs.xml</file> |
51 |
<file id="kde-config">/doc/en/kde-config.xml</file> |
52 |
- <file id="nano-basics-guide">/doc/en/nano-basics-guide.xml</file> |
53 |
+ <file id="nano-basics-guide">/doc/zh_cn/nano-basics-guide.xml</file> |
54 |
<file id="shoutcast-config">/doc/en/shoutcast-config.xml</file> |
55 |
- <file id="vdr-guide">/doc/en/vdr-guide.xml</file> |
56 |
+ <file id="vdr-guide">/doc/zh_cn/vdr-guide.xml</file> |
57 |
<file id="xml-guide">/doc/en/xml-guide.xml</file> |
58 |
<file id="diskless-howto">/doc/en/diskless-howto.xml</file> |
59 |
<file id="prelink-howto">/doc/en/prelink-howto.xml</file> |
60 |
@@ -254,7 +254,7 @@ |
61 |
<file id="qmail-howto">/doc/en/qmail-howto.xml</file> |
62 |
<file id="source_mirrors">/doc/en/source_mirrors.xml</file> |
63 |
<file id="gentoo-ppc-install">/doc/en/gentoo-ppc-install.xml</file> |
64 |
- <file id="gentoo-x86-quickinstall">/doc/en/gentoo-x86-quickinstall.xml</file> |
65 |
+ <file id="gentoo-x86-quickinstall">/doc/zh_cn/gentoo-x86-quickinstall.xml</file> |
66 |
<file id="gentoo-x86-quickinstall+raid">/doc/en/gentoo-x86+raid+lvm2-quickinstall.xml</file> |
67 |
<file id="vi-guide">/doc/en/vi-guide.xml</file> |
68 |
<file id="virt-mail-howto">/doc/en/virt-mail-howto.xml</file> |
69 |
@@ -271,15 +271,15 @@ |
70 |
<file id="gentoo-x86-tipsntricks">/doc/en/gentoo-x86-tipsntricks.xml</file> |
71 |
<file id="gentoo-sparc-netboot-howto">/doc/en/gentoo-sparc-netboot-howto.xml</file> |
72 |
<file id="gentoo-sparc-obpreference">/doc/en/gentoo-sparc-obpreference.xml</file> |
73 |
- <file id="gnome-config">/doc/en/gnome-config.xml</file> |
74 |
+ <file id="gnome-config">/doc/zh_cn/gnome-config.xml</file> |
75 |
<file id="gnome-upgrade">/proj/en/desktop/gnome/howtos/gnome-2.18-upgrade.xml</file> |
76 |
- <file id="gpm">/doc/en/gpm.xml</file> |
77 |
+ <file id="gpm">/doc/zh_cn/gpm.xml</file> |
78 |
<file id="gentoo-security">/doc/en/gentoo-security.xml</file> |
79 |
<file id="home-router-howto">/doc/en/home-router-howto.xml</file> |
80 |
<file id="arm-requirements">/doc/en/arm-requirements.xml</file> |
81 |
<file id="power-management-guide">/doc/en/power-management-guide.xml</file> |
82 |
<file id="new-upgrade-to-gentoo-1.4">/doc/en/new-upgrade-to-gentoo-1.4.xml</file> |
83 |
- <file id="portage-utils">/doc/en/portage-utils.xml</file> |
84 |
+ <file id="portage-utils">/doc/zh_cn/portage-utils.xml</file> |
85 |
<file id="amd64-howtos">/proj/en/base/amd64/howtos/index.xml</file> |
86 |
<file id="amd64-howtos-bugs">/proj/en/base/amd64/howtos/bugs.xml</file> |
87 |
<file id="amd64-howtos-chroot">/proj/en/base/amd64/howtos/chroot-old.xml</file> |
88 |
@@ -343,7 +343,7 @@ |
89 |
<file id="hpc-howto">/doc/en/hpc-howto.xml</file> |
90 |
<file id="gnap-userguide">/proj/en/base/embedded/gnap-userguide.xml</file> |
91 |
<file id="kde-split-ebuilds">/doc/en/kde-split-ebuilds.xml</file> |
92 |
- <file id="grub-error-guide">/doc/en/grub-error-guide.xml</file> |
93 |
+ <file id="grub-error-guide">/doc/zh_cn/grub-error-guide.xml</file> |
94 |
<file id="usb-guide">/doc/en/usb-guide.xml</file> |
95 |
<file id="liveusb">/doc/en/liveusb.xml</file> |
96 |
<file id="fluxbox-config">/doc/en/fluxbox-config.xml</file> |
97 |
@@ -370,7 +370,7 @@ |
98 |
<file id="sudo-guide">/doc/en/sudo-guide.xml</file> |
99 |
<file id="freebsd-guide">/doc/en/gentoo-freebsd.xml</file> |
100 |
<file id="mips-faq">/doc/en/gentoo-mips-faq.xml</file> |
101 |
- <file id="mysql-upgrading">/doc/en/mysql-upgrading.xml</file> |
102 |
+ <file id="mysql-upgrading">/doc/zh_cn/mysql-upgrading.xml</file> |
103 |
<file id="mysql-upgrade-slotted">/doc/en/mysql-upgrade-slotted.xml</file> |
104 |
<file id="gcc-upgrading">/doc/en/gcc-upgrading.xml</file> |
105 |
<file id="x86-at-faq">/proj/en/base/x86/arch-testers-faq.xml</file> |
106 |
@@ -384,7 +384,7 @@ |
107 |
<file id="kernel-config">/doc/en/kernel-config.xml</file> |
108 |
<file id="zsh">/doc/en/zsh.xml</file> |
109 |
<file id="change-chost">/doc/en/change-chost.xml</file> |
110 |
- <file id="xfce-config">/doc/en/xfce-config.xml</file> |
111 |
+ <file id="xfce-config">/doc/zh_cn/xfce-config.xml</file> |
112 |
<file id="gcc-optimization">/doc/en/gcc-optimization.xml</file> |
113 |
<file id="vpnc-howto">/doc/en/vpnc-howto.xml</file> |
114 |
<file id="qa-autofailure">/proj/en/qa/autofailure.xml</file> |
115 |
|
116 |
|
117 |
|
118 |
1.1 xml/htdocs/doc/zh_cn/alsa-guide.xml |
119 |
|
120 |
file : http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/doc/zh_cn/alsa-guide.xml?rev=1.1&view=markup |
121 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/doc/zh_cn/alsa-guide.xml?rev=1.1&content-type=text/plain |
122 |
|
123 |
Index: alsa-guide.xml |
124 |
=================================================================== |
125 |
<?xml version='1.0' encoding="utf-8"?> |
126 |
<!DOCTYPE guide SYSTEM "/dtd/guide.dtd"> |
127 |
|
128 |
<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/zh_cn/alsa-guide.xml,v 1.1 2007/09/17 17:54:10 r0bertz Exp $ --> |
129 |
<!-- English CVS version: 1.80 --> |
130 |
|
131 |
<guide link="/doc/zh_cn/alsa-guide.xml" lang="zh_cn"> |
132 |
<title>Gentoo Linux ALSA指南</title> |
133 |
|
134 |
<author title="作者"> |
135 |
<mail link="fox2mike@g.o">Shyam Mani</mail> |
136 |
</author> |
137 |
<author title="作者"> |
138 |
<mail link="nightmorph@g.o">Joshua Saddler</mail> |
139 |
</author> |
140 |
<author title="贡献者"> |
141 |
<mail link="flameeyes@g.o">Diego Pettenò</mail> |
142 |
</author> |
143 |
<author title="译者"> |
144 |
<mail link="kunxi@×××××.org">奚焜</mail> |
145 |
</author> |
146 |
|
147 |
<abstract> |
148 |
本文档可以帮助用户在Gentoo Linux上设置ALSA |
149 |
</abstract> |
150 |
|
151 |
<!-- The content of this document is licensed under the CC-BY-SA license --> |
152 |
<!-- See http://creativecommons.org/licenses/by-sa/2.5 --> |
153 |
<license/> |
154 |
|
155 |
<version>2.22</version> |
156 |
<date>2007-05-07</date> |
157 |
|
158 |
<chapter> |
159 |
<title>简介</title> |
160 |
<section> |
161 |
<title>什么是ALSA?</title> |
162 |
<body> |
163 |
|
164 |
<p> |
165 |
ALSA是<e>Advanced Linux Sound Architecture,高级Linux声音架构</e>的简称,它在Linux操作系统上提供了音频和MIDI(<e>Musical Instrument Digital Interface</e>,音乐设备数字化接口)的支持。在2.6系列内核中,ALSA已经成为默认的声音子系统,用来替换2.4系列内核中的OSS(<e>Open Sound System</e>,开放声音系统)。 |
166 |
</p> |
167 |
|
168 |
<p> |
169 |
ALSA的主要特性包括:高效地支持从消费类入门级声卡到专业级音频设备所有类型的音频接口,完全模块化的设计, 支持对称多处理(SMP)和线程安全,对OSS的向后兼容,以及提供了用户空间的<c>alsa-lib</c>库来简化应用程序的开发。 |
170 |
</p> |
171 |
|
172 |
</body> |
173 |
</section> |
174 |
<section> |
175 |
<title>Gentoo上的ALSA</title> |
176 |
<body> |
177 |
|
178 |
<p> |
179 |
Gentoo的一个主要优势在于用户可以最大限度的控制如何安装和配置系统。Gentoo上的ALSA秉承了同样的原则。有两种方法可以使ALSA运行在您的系统上。我们将在下一章分别予以详细讨论。 |
180 |
</p> |
181 |
|
182 |
</body> |
183 |
</section> |
184 |
</chapter> |
185 |
|
186 |
<chapter> |
187 |
<title>安装ALSA</title> |
188 |
<section> |
189 |
<title>可选</title> |
190 |
<body> |
191 |
|
192 |
<warn> |
193 |
下述方法是互斥的,您不能够将ALSA编入内核,同时使用<c>media-sound/alsa-driver</c>, |
194 |
</warn> |
195 |
|
196 |
<p> |
197 |
两个选项是: |
198 |
</p> |
199 |
|
200 |
<ol> |
201 |
<li> |
202 |
采用内核提供的ALSA。这也是我们推荐的方法。 |
203 |
</li> |
204 |
<li>采用Gentoo的<c>media-sound/alsa-driver</c>软件包。</li> |
205 |
</ol> |
206 |
|
207 |
<p> |
208 |
内核自带的驱动和<c>alsa-driver</c>软件包可能有细微的差别;一方出现的特性和修复可能并没有加入到另一方。上游的开发者也意识到这一点,但是这两个驱动事实上是ALSA项目完全不同的开发分支;它们不完全一样。您应该知道它们有细微的不同,所以如果一个无法正常工作,就试试另一个吧!在我们作选择之前,让我们先看看各自的特点。 |
209 |
</p> |
210 |
|
211 |
<p> |
212 |
如果您打算采用内核提供的ALSA,以下是优点和缺点: |
213 |
</p> |
214 |
|
215 |
<table> |
216 |
<tr> |
217 |
<th>内核自带的ALSA</th> |
218 |
<th>优点和缺点</th> |
219 |
</tr> |
220 |
<tr> |
221 |
<th>+</th> |
222 |
<ti> |
223 |
不需要安装其他的软件包;内核已经集成了驱动。 |
224 |
</ti> |
225 |
</tr> |
226 |
<tr> |
227 |
<th>+</th> |
228 |
<ti>一揽子解决方案,不需要反复的emerge。</ti> |
229 |
</tr> |
230 |
<tr> |
231 |
<th>-</th> |
232 |
<ti>也许和<c>alsa-driver</c>使用的版本有些许不同。</ti> |
233 |
</tr> |
234 |
</table> |
235 |
|
236 |
<p> |
237 |
如果您采用<c>alsa-driver</c>, |
238 |
</p> |
239 |
|
240 |
<table> |
241 |
<tr> |
242 |
<th>alsa-driver</th> |
243 |
<th>优点和缺点</th> |
244 |
</tr> |
245 |
<tr> |
246 |
<th>+</th> |
247 |
<ti>也许是ALSA项目最新的驱动</ti> |
248 |
</tr> |
249 |
<tr> |
250 |
<th>+</th> |
251 |
<ti>对开发音频驱动会有帮助。</ti> |
252 |
</tr> |
253 |
<tr> |
254 |
<th>-</th> |
255 |
<ti>每一次重编内核都需要重新emerge <c>alsa-driver</c>。</ti> |
256 |
</tr> |
257 |
<tr> |
258 |
<th>-</th> |
259 |
<ti>需要关闭某些内核选性使其能正常工作。</ti> |
260 |
</tr> |
261 |
</table> |
262 |
|
263 |
</body> |
264 |
</section> |
265 |
<section> |
266 |
<title>所以……</title> |
267 |
<body> |
268 |
|
269 |
<p> |
270 |
如上所述,<c>alsa-driver</c>和内核自带的ALSA驱动的差别非常细微;考虑到易用性,我们建议您<e>首先</e>采用内核自带的驱动。在您向 <uri link="https://bugs.gentoo.org">Gentoo Bugzilla</uri> 提交任何和声音相关的问题之前,请先试着用<c>alsa-driver</c>重现它们,再提交缺陷报告。 |
271 |
</p> |
272 |
|
273 |
</body> |
274 |
</section> |
275 |
<section id="lspci"> |
276 |
<title>在您开始之前</title> |
277 |
<body> |
278 |
|
279 |
<p> |
280 |
无论您采用哪种方式,您必须要知道您的声卡用什么驱动。大多数情况下,声卡(板载和独立声卡)基于PCI总线,<c>lspci</c>将帮助您获取所需的信息。如果您没有安装<c>lspci</c>,请<c>emerge sys-apps/pciutils</c>。如果您使用的是USB声卡,<c>sys-apps/usbutils</c>的<c>lsusb</c><e>或许</e>有用。ISA声卡的用户,请试一下<c>sys-apps/isapnptools</c>。下列页面对使用ISA声卡的用户<e>也许</e>有所帮助: |
281 |
</p> |
282 |
|
283 |
<ul> |
284 |
<li> |
285 |
<uri link="http://www.roestock.demon.co.uk/isapnptools/">The ISAPNPTOOLS Page</uri> |
286 |
</li> |
287 |
<li> |
288 |
<uri link="http://www2.linuxjournal.com/article/3269">LinuxJournal PnP Article</uri> |
289 |
</li> |
290 |
<li> |
291 |
<uri link="http://www.tldp.org/HOWTO/Sound-HOWTO/x320.html">TLDP Sound HowTo</uri> |
292 |
</li> |
293 |
</ul> |
294 |
|
295 |
<note> |
296 |
为了便于解释,我们在下文中假设用户使用的是基于PCI总线的声卡。 |
297 |
</note> |
298 |
|
299 |
<p> |
300 |
下一步,我们将找出声卡的详细信息。 |
301 |
</p> |
302 |
|
303 |
<pre caption="声卡的详细信息"> |
304 |
# <i>lspci -v | grep -i audio</i> |
305 |
0000:00:0a.0 Multimedia audio controller: Creative Labs SB Live! EMU10k1 (rev 06) |
306 |
</pre> |
307 |
|
308 |
<p> |
309 |
现在我们知道机器里的声卡是Sound Blaster Live!,而且声卡的制造商是Creative Labs。看一下<uri link="http://bugtrack.alsa-project.org/main/index.php/Matrix:Main">ALSA声卡支持表</uri>,选择Creative Labs。您将会跳转到Creative Labs支持设备表的页面,您可以看到SB Live!采用<c>emu10k1</c>模块。这正是我们所需要的信息。如果您对技术细节有兴趣,您可以点击"详细信息"旁边的的链接,访问<c>emu10k1</c>的相关页面。 |
310 |
</p> |
311 |
|
312 |
<p> |
313 |
如果您想使用MIDI, 在emerge任何ALSA软件包之前,您必须在<path>/etc/make.conf</path>里,把<c>midi</c>加入到您的USE标记中。我们在下文中将会介绍如何<uri link="#midi">设置MIDI支持</uri>。 |
314 |
</p> |
315 |
|
316 |
</body> |
317 |
</section> |
318 |
<section id="kernel"> |
319 |
<title>采用内核提供的ALSA</title> |
320 |
<body> |
321 |
|
322 |
<p> |
323 |
如果您喜欢简洁,就选择这个方法。 |
324 |
</p> |
325 |
|
326 |
<note> |
327 |
自从2005.0版,Gentoo Linux使用2.6系列作为默认的内核。请确认您的内核是2.6系列。以下方法并<e>不适用</e>于2.4内核。 |
328 |
</note> |
329 |
|
330 |
<p> |
331 |
让我们配置内核来启用ALSA选项 |
332 |
</p> |
333 |
|
334 |
<impo> |
335 |
<c>genkernel</c>的用户请先运行<c>genkernel --menuconfig all</c>,然后参考<uri link="#doc_chap2_pre3">ALSA内核配置</uri>。 |
336 |
</impo> |
337 |
|
338 |
<pre caption="编译内核"> |
339 |
# <i>cd /usr/src/linux</i> |
340 |
# <i>make menuconfig</i> |
341 |
</pre> |
342 |
|
343 |
<note> |
344 |
上述例子假设<path>/usr/src/linux</path>符号链接指向您想使用的内核源代码。在下一步之前,请确定上述条件。 |
345 |
</note> |
346 |
|
347 |
<p> |
348 |
现在我们要看一下在2.6内核下要打开哪些选项使得ALSA能够支持我们的声卡。 |
349 |
</p> |
350 |
|
351 |
<p> |
352 |
请注意:由于考虑到易用性,下面的例子中ALSA都被编译成模块。我们建议您采用相同的步骤,从而可以使用<c>alsaconf</c>来配置您的声卡。请<e>不要</e>跳过本文的<uri link="#alsa-config">配置</uri>部分。如果您还是希望将其编入内核,请作相应的调整。 |
353 |
</p> |
354 |
|
355 |
<pre caption="ALSA内核配置"> |
356 |
Device Drivers ---> |
357 |
Sound ---> |
358 |
|
359 |
<comment>(这个选项需要打开)</comment> |
360 |
<M> Sound card support |
361 |
|
362 |
<comment>(确保OSS被禁用)</comment> |
363 |
Open Sound System ---> |
364 |
< > Open Sound System (DEPRECATED) |
365 |
|
366 |
<comment>(回到上一步进入ALSA)</comment> |
367 |
Advanced Linux Sound Architecture ---> |
368 |
<M> Advanced Linux Sound Architecture |
369 |
<comment>(如果您需要MIDI序列化或者路由,请选择此选项)</comment> |
370 |
<M> Sequencer support |
371 |
<comment>(老式的/dev/mixer*和/dev/dsp*支持。推荐。)</comment> |
372 |
<M> OSS Mixer API |
373 |
<M> OSS PCM (digital audio) API |
374 |
|
375 |
<comment>(您现在可以要支持的设备。通常您只有一种设备,如果您有多块声卡,请在这里激活全部设备。</comment> |
376 |
|
377 |
<comment>(主要用于测试和开发,除非您知道自己在作什么,一般用户不需要启用此选项。)</comment> |
378 |
Generic devices ---> |
379 |
|
380 |
<comment>(ISA声卡需要此选项)</comment> |
381 |
ISA devices ---> |
382 |
<comment>(如果您有Gravis设备,请选择此选项)</comment> |
383 |
<M> Gravis UltraSound Extreme |
384 |
|
385 |
<comment>(回到上一级进入PCI设备,现在大多数声卡是PCI设备)</comment> |
386 |
PCI devices ---> |
387 |
<comment>(我们现在为我们的声卡选择emu10k1驱动)</comment> |
388 |
<M> Emu10k1 (SB Live!, Audigy, E-mu APS) |
389 |
<comment>(或者是Intel的声卡)</comment> |
390 |
<M> Intel/SiS/nVidia/AMD/ALi AC97 Controller |
391 |
<comment>(或者您使用的是VIA的声卡)</comment> |
392 |
<M> VIA 82C686A/B, 8233/8235 AC97 Controller |
393 |
|
394 |
<comment>(如果您的声卡是USB接口,回到上一级,选择</comment> |
395 |
USB Devices ---> |
396 |
</pre> |
397 |
|
398 |
<p> |
399 |
现在所有的选项都配置好了,您可以(重新)编译内核,声卡的ALSA支持应该在重启后使用新内核时生效。不要忘了更新您的GRUB配置并使用新编译的内核。您可以前进到<uri link="#alsa-utilities">ALSA实用工具</uri>查看是否一切都工作正常。 |
400 |
|
401 |
</p> |
402 |
|
403 |
</body> |
404 |
</section> |
405 |
<section id="alsa-driver"> |
406 |
<title>采用ALSA驱动软件包</title> |
407 |
<body> |
408 |
|
409 |
<p> |
410 |
所以您决定采用<c>alsa-driver</c>的方法。让我们开始吧。为了保证只编译您的声卡驱动,我们要作一些小的调整。这并非必要,但是可以避免编译不需要的设备驱动。 |
411 |
</p> |
412 |
|
413 |
<p> |
414 |
如果您不清楚您的声卡需要什么样的驱动,请参看本文的<uri link="#lspci">lspci</uri>部分。如果您知道驱动的名字(在此以<c>emu10k1</c>为例),编辑<path>/etc/make.conf</path>,加入变量<c>ALSA_CARDS</c>。 |
415 |
</p> |
416 |
|
417 |
<pre caption="编辑/etc/make.conf,加入ALSA_CARDS"> |
418 |
<comment>(对于一块声卡)</comment> |
419 |
ALSA_CARDS="emu10k1" |
420 |
<comment>(对于多块声卡,用空格分隔名字)</comment> |
421 |
ALSA_CARDS="emu10k1 via82xx" |
422 |
</pre> |
423 |
|
424 |
<p> |
425 |
如果您已经编译了内核,又希望使用<c>alsa-driver</c>,请在执行下一步之前确定下列条件,否则<c>alsa-driver</c>很有可能无法正常工作。下述代码提供了一种检查的方法。 |
426 |
</p> |
427 |
|
428 |
<note> |
429 |
<c>genkernel</c> 可以前进至<uri link="#doc_chap2_pre6">安装alsa-driver</uri>, 他们的默认配置符合下列条件。 |
430 |
</note> |
431 |
|
432 |
<ol> |
433 |
<li> |
434 |
<c>CONFIG_SOUND</c>被启用。(启用基本的声音支持) |
435 |
</li> |
436 |
<li> |
437 |
<c>CONFIG_SOUND_PRIME</c>没有被启用。(内置的OSS支持被禁用) |
438 |
</li> |
439 |
<li> |
440 |
<c>CONFIG_SND</c>没有被启用。(内置的ALSA支持被禁用) |
441 |
</li> |
442 |
<li> |
443 |
<path>/usr/src/linux</path>指向使用ALSA的内核源代码。 |
444 |
</li> |
445 |
</ol> |
446 |
|
447 |
<pre caption=".config检查"> |
448 |
<comment>(假设linux符号链接指向正确的内核源代码)</comment> |
449 |
# <i>cd /usr/src/linux</i> |
450 |
# <i>grep SOUND .config</i> |
451 |
<comment>(1.为真)</comment> |
452 |
CONFIG_SOUND=y |
453 |
<comment>(2.为真)</comment> |
454 |
CONFIG_SOUND_PRIME is not set |
455 |
# <i>grep SND .config</i> |
456 |
<comment>(并且3.为真)</comment> |
457 |
CONFIG_SND is not set |
458 |
</pre> |
459 |
|
460 |
<p> |
461 |
下一步就是键入魔咒……哦,不,不是abracadabra。 |
462 |
</p> |
463 |
|
464 |
<pre caption="安装alsa-driver"> |
465 |
# <i>emerge alsa-driver</i> |
466 |
</pre> |
467 |
|
468 |
<impo> |
469 |
请注意,由于先前的驱动会被删除,您必须在(重新)编译内核以后,运行<c>emerge alsa-driver</c>。您可以安装<c>module-rebuild</c>软件包来简化这个步骤。它会跟踪模块包,并为您重新编译它们。首先运行<c>module-rebuild populate</c>来产生列表,然后在每一次(重新)编译内核后,运行<c>module-rebuild rebuild</c>, 所有外置的模块都会重新编译。 |
470 |
</impo> |
471 |
|
472 |
</body> |
473 |
</section> |
474 |
</chapter> |
475 |
|
476 |
<chapter> |
477 |
<title>配置/测试ALSA</title> |
478 |
<section id="alsa-utilities"> |
479 |
<title>ALSA实用工具</title> |
480 |
<body> |
481 |
|
482 |
<p> |
483 |
<c>alsa-utils</c>是ALSA不可或缺的一部分,它集成了一些非常有用的应用程序,包括ALSA启动脚本。所以我们强烈建议您安装<c>alsa-utils</c>。 |
484 |
</p> |
485 |
|
486 |
<pre caption="安装alsa-utils"> |
487 |
# <i>emerge alsa-utils</i> |
488 |
</pre> |
489 |
|
490 |
<note> |
491 |
如果您在<uri link="#kernel">内核</uri>里激活了ALSA,<e>并且</e>没有将其编译成模块,请前进至<uri link="#initscript">ALSA启动脚本</uri>部分。否则您需要配置ALSA。由<c>alsa-utils</c>提供的<c>alsaconf</c>使得这个过程相当容易。 |
492 |
</note> |
493 |
|
494 |
</body> |
495 |
</section> |
496 |
<section id="alsa-config"> |
497 |
<title>配置</title> |
498 |
<body> |
499 |
|
500 |
<p> |
501 |
最新版本的<c>udev</c> (<c>>=udev-103</c>)为您的声卡提供了某种程度上的内核级自动配置。如果可能的话,让内核自动来设置您的声卡。否则如下所示,用<c>alsaconf</c>来配置您的声卡。 |
502 |
</p> |
503 |
|
504 |
<note> |
505 |
在运行时<c>alsaconf</c>,请关闭所有<e>可能</e>访问声卡的程序。 |
506 |
</note> |
507 |
|
508 |
<p> |
509 |
要配置您的声卡,请以root身份登录控制台,键入<c>alsaconf</c>。 |
510 |
|
511 |
</p> |
512 |
|
513 |
<pre caption="启动alsaconf"> |
514 |
# <i>alsaconf</i> |
515 |
</pre> |
516 |
|
517 |
<p> |
518 |
您会看到一个由菜单引导的干净界面,它将自动探测您的设备,发现您的声卡。您会被要求从一个列表中选择您的声卡。然后它会请求修改<path>/etc/modules.d/alsa</path>,自动调整音量到合适的位置,运行<c>update-modules</c>并启动<path>/etc/init.d/alsasound</path>服务。<c>alsaconf</c>退出后,您可以进一步设置ALSA启动脚本。 |
519 |
</p> |
520 |
|
521 |
</body> |
522 |
</section> |
523 |
<section id="initscript"> |
524 |
<title>ALSA启动脚本</title> |
525 |
<body> |
526 |
|
527 |
<p> |
528 |
我们几乎完成了所有的配置。无论您采用何种方法来安装ALSA,您都需要在系统启动的时候,加载模块,初始化ALSA,恢复您的音量设定。ALSA启动脚本可以为您处理所有的这一切,它就是<c>alsasound</c>。 我们将它加入到启动运行级。 |
529 |
</p> |
530 |
|
531 |
<pre caption="将ALSA加入到启动运行级"> |
532 |
# <i>rc-update add alsasound boot</i> |
533 |
* alsasound added to runlevel boot |
534 |
* rc-update complete. |
535 |
</pre> |
536 |
|
537 |
<p> |
538 |
下一步,检查<path>/etc/conf.d/alsasound</path>文件,确保SAVE_ON_STOP变量设置为yes。这将在您关闭系统时保存您的声音设置。 |
539 |
</p> |
540 |
|
541 |
</body> |
542 |
</section> |
543 |
<section> |
544 |
<title>Audio组</title> |
545 |
<body> |
546 |
|
547 |
<p> |
548 |
在我们开始测试之前,最后还有一个<e>重要</e>设定。类Unix操作系统的经验——除非必要,不要运行在root权限,也适用于此;)。怎么做呢?大多数时间,您以普通用户的身份登录系统听音乐或者访问您的声卡。因此,您需要在""audio" 组中。在此,我们将用户加入到audio组中,当他们需要访问声卡的时候就不会有任何问题。我们需要以root的身份登录,运行<c>gpasswd</c>。 |
549 |
</p> |
550 |
|
551 |
<pre caption="将用户加入audio组"> |
552 |
<comment>(用您的用户替换 <username> )</comment> |
553 |
# <i>gpasswd -a <username> audio </i> |
554 |
将用户 <username> 加入audio组 |
555 |
</pre> |
556 |
|
557 |
</body> |
558 |
</section> |
559 |
<section> |
560 |
<title>音量检查!</title> |
561 |
<body> |
562 |
|
563 |
<p> |
564 |
我们完成了所有的设置和前期工作,让我们启动ALSA吧。如果您已经运行了<c>alsaconf</c>,您可以跳过这一步,因为<c>alsaconf</c>已经完成了下述工作。 |
565 |
</p> |
566 |
|
567 |
<pre caption="启动服务"> |
568 |
# <i>/etc/init.d/alsasound start</i> |
569 |
</pre> |
570 |
|
571 |
<p> |
572 |
所有的问题都得到了解决,我们要检查一下音量。多数情况下,系统是静音的。我们用<c>alsamixer</c>来调整音量。 |
573 |
</p> |
574 |
|
575 |
<pre caption="启动alsamixer"> |
576 |
<comment>(开启一个控制台程序。仅显示需要的配置)</comment> |
577 |
# <i>alsamixer</i> |
578 |
</pre> |
579 |
|
580 |
<impo> |
581 |
如果您无法启动<c>alsamixer</c>,且收到这样的错误alsamixer: function snd_ctl_open failed for default: No such file or directory,这通常是因为udev无法设置设备。运行<c>killall udevd; udevstart</c>来重新加载<path>/dev</path>下的相关设备文件,然后启动<c>alsamixer</c>。这应该能够解决问题。 |
582 |
</impo> |
583 |
|
584 |
<p> |
585 |
这<e>也许</e>是ALSA Mixer在您首次打开时的界面。请注意Master和PCM声道,它们下面都有MM的标记。这意味着它们都被静音了。如果在此状态下,您试图播放任何音频文件,您将无法从您的扬声器里听到任何声音。 |
586 |
</p> |
587 |
|
588 |
<figure link="/images/docs/alsa-mixermuted.png" short="AlsaMixer静音" caption="Alsa Mixer主窗口,静音"/> |
589 |
|
590 |
<p> |
591 |
现在,我们要禁止静音,并根据需要设置音量。 |
592 |
</p> |
593 |
|
594 |
<warn> |
595 |
如果您想从您的扬声器里听到任何声音,Master和PCM声道不能设置为静音模式,并且音量必须调整到听得见的水平。 |
596 |
</warn> |
597 |
|
598 |
<ul> |
599 |
<li> |
600 |
使用您的左右箭头键(<- & ->)来转换声道。 |
601 |
</li> |
602 |
<li> |
603 |
要静音/禁止静音,移动到该声道,比如说Master,按键盘上的m键。 |
604 |
</li> |
605 |
<li> |
606 |
用上下箭头键来增加/减小音量。 |
607 |
</li> |
608 |
</ul> |
609 |
|
610 |
<note> |
611 |
设置低音和颤音的时候请注意,50通常是一个合适的值。除非特制的低音音箱,过强的低音会导致扬声器发出刺耳的杂音。 |
612 |
</note> |
613 |
|
614 |
<p> |
615 |
作完了这些以后,您的ALSA Mixer应该看起来如下。请注意00标记,而非MM标记;而且音量也作了调整。 |
616 |
</p> |
617 |
|
618 |
<figure link="/images/docs/alsa-mixerunmuted.png" short="AlsaMixer禁止静音" caption="Alsa Mixer蓄势待发"/> |
619 |
|
620 |
</body> |
621 |
</section> |
622 |
<section> |
623 |
<title>声音测试!</title> |
624 |
<body> |
625 |
|
626 |
<p> |
627 |
终于可以来点音乐了。如果上述一切工作正常,您可以听些不错的音乐了。一个快捷的测试方法是运行像<c>media-sound/madplay</c>这样的命令行工具。您也可以用一些更有名的工具,比如<c>mpg123</c>。如果您青睐ogg, 您可以使用由<c>media-sound/vorbis-tools</c>提供的<c>ogg123</c>。选一个您用着舒服的程序。一直如此,emerge您想要的。 |
628 |
</p> |
629 |
|
630 |
<pre caption="获取软件"> |
631 |
<comment>(安装您所需的应用程序)</comment> |
632 |
# <i>emerge madplay mpg123</i> |
633 |
<comment>(播放.ogg文件)</comment> |
634 |
# <i>emerge vorbis-tools</i> |
635 |
</pre> |
636 |
|
637 |
<p> |
638 |
播放您喜爱的音乐…… |
639 |
</p> |
640 |
|
641 |
<pre caption="播放音乐"> |
642 |
# <i>madplay -v /mnt/shyam/Music/Paul\ Oakenfold\ -\ Dread\ Rock.mp3</i> |
643 |
MPEG Audio Decoder 0.15.2 (beta) - Copyright (C) 2000-2004 Robert Leslie et al. |
644 |
Title: Dread Rock |
645 |
Artist: Paul Oakenfold |
646 |
Album: Matrix Reloaded |
647 |
Year: 2003 |
648 |
Genre: Soundtrack |
649 |
Soundtrack |
650 |
00:04:19 Layer III, 160 kbps, 44100 Hz, joint stereo (MS), no CRC |
651 |
|
652 |
# <i>ogg123 Paul\ Oakenfold\ -\ Dread\ Rock.ogg</i> |
653 |
Audio Device: Advanced Linux Sound Architecture (ALSA) output |
654 |
|
655 |
Playing: Paul Oakenfold - Dread Rock.ogg |
656 |
Ogg Vorbis stream: 2 channel, 44100 Hz |
657 |
Genre: Soundtrack |
658 |
Transcoded: mp3;160 |
659 |
Title: Dread Rock |
660 |
Artist: Paul Oakenfold |
661 |
Date: 2003 |
662 |
Album: Matrix Reloaded |
663 |
Time: 00:11.31 [04:28.75] of 04:40.06 (200.6 kbps) Output Buffer 96.9% |
664 |
</pre> |
665 |
|
666 |
</body> |
667 |
</section> |
668 |
<section> |
669 |
<title>ALSA和USE标记</title> |
670 |
<body> |
671 |
|
672 |
<p> |
673 |
现在您可以把<c>alsa</c> use标记加入到<path>/etc/make.conf</path>使得您的应用程序如果支持ALSA,就在编译时加入这个特性。某些架构,比如x86和amd64默认加入了这个标记。 |
674 |
</p> |
675 |
|
676 |
</body> |
677 |
</section> |
678 |
<section> |
679 |
<title>问题?</title> |
680 |
<body> |
681 |
|
682 |
<p> |
683 |
如果由于某些原因,您无法听到声音,请您首先查看<uri link="#doc_chap3_pre6">alsamixer</uri> 设置,80%的问题源于声道被静音或者音量过低。您也可以查看您的窗口管理器的声音小程序以确保音量被调整到听得见的水平。 |
684 |
</p> |
685 |
|
686 |
<p> |
687 |
<path>/proc</path>是您的朋友。在此<path>/proc/asound</path>是您最好的朋友。我们将简单的看一下它能提供多少有用的信息。 |
688 |
</p> |
689 |
|
690 |
<pre caption="有趣的/proc/asound"> |
691 |
<comment>(首先,如果/proc/asound/cards显示了您的声卡,ALSA |
692 |
在所选的声卡上工作正常。)</comment> |
693 |
# <i>cat /proc/asound/cards</i> |
694 |
0 [Live ]: EMU10K1 - Sound Blaster Live! |
695 |
Sound Blaster Live! (rev.6, serial:0x80271102) at 0xb800, irq 11 |
696 |
|
697 |
<comment>(这显示了现在运行的ALSA的版本)</comment> |
698 |
# <i>cat /proc/asound/version</i> |
699 |
Advanced Linux Sound Architecture Driver Version 1.0.8 (Thu Jan 13 09:39:32 2005 UTC). |
700 |
|
701 |
<comment>(ALSA OSS模拟层详解)</comment> |
702 |
# <i>cat /proc/asound/oss/sndstat</i> |
703 |
Sound Driver:3.8.1a-980706 (ALSA v1.0.8 emulation code) |
704 |
Kernel: Linux airwolf.zion 2.6.11ac1 #2 Wed May 4 00:35:08 IST 2005 i686 |
705 |
Config options: 0 |
706 |
|
707 |
Installed drivers: |
708 |
Type 10: ALSA emulation |
709 |
|
710 |
Card config: |
711 |
Sound Blaster Live! (rev.6, serial:0x80271102) at 0xb800, irq 11 |
712 |
|
713 |
Audio devices: |
714 |
0: EMU10K1 (DUPLEX) |
715 |
|
716 |
Synth devices: NOT ENABLED IN CONFIG |
717 |
|
718 |
Midi devices: |
719 |
0: EMU10K1 MPU-401 (UART) |
720 |
|
721 |
Timers: |
722 |
7: system timer |
723 |
|
724 |
Mixers: |
725 |
0: SigmaTel STAC9721/23 |
726 |
</pre> |
727 |
|
728 |
<p> |
729 |
其他用户碰到的常见问题是可怖的"Unknown symbol in module"错误。举例如下。 |
730 |
</p> |
731 |
|
732 |
<pre caption="Unknown Symbol in module错误"> |
733 |
# <i>/etc/init.d/alsasound start</i> |
734 |
* Loading ALSA modules ... |
735 |
* Loading: snd-card-0 ... [ ok ] |
736 |
* Loading: snd-pcm-oss ... |
737 |
WARNING: Error inserting snd_mixer_oss |
738 |
(/lib/modules/2.6.12-gentoo-r6/kernel/sound/core/oss/snd-mixer-oss.ko): Unknown |
739 |
symbol in module, or unknown parameter (see dmesg) FATAL: Error inserting |
740 |
snd_pcm_oss |
741 |
(/lib/modules/2.6.12-gentoo-r6/kernel/sound/core/oss/snd-pcm-oss.ko): Unknown |
742 |
symbol in module, or unknown parameter (see dmesg) |
743 |
[ !! ] |
744 |
* Loading: snd-mixer-oss ... |
745 |
FATAL: Error inserting snd_mixer_oss |
746 |
(/lib/modules/2.6.12-gentoo-r6/kernel/sound/core/oss/snd-mixer-oss.ko): Unknown |
747 |
symbol in module, or unknown parameter (see dmesg) |
748 |
[ !! ] |
749 |
* Loading: snd-seq ... [ ok ] |
750 |
* Loading: snd-emu10k1-synth ... [ ok ] |
751 |
* Loading: snd-seq-midi ... [ ok ] |
752 |
* Restoring Mixer Levels ... [ ok ] |
753 |
</pre> |
754 |
|
755 |
<p> |
756 |
建议您看一下dmesg的输出,您很有可能会看到类似的结果: |
757 |
</p> |
758 |
|
759 |
<pre caption="dmesg输出"> |
760 |
<comment>(仅显示相关部分)</comment> |
761 |
# <i>dmesg | less</i> |
762 |
ACPI: PCI Interrupt 0000:02:06.0[A] -> Link [APC3] -> GSI 18 (level, low) -> IRQ 209 |
763 |
snd_mixer_oss: Unknown symbol snd_unregister_oss_device |
764 |
snd_mixer_oss: Unknown symbol snd_register_oss_device |
765 |
snd_mixer_oss: Unknown symbol snd_mixer_oss_notify_callback |
766 |
snd_mixer_oss: Unknown symbol snd_oss_info_register |
767 |
snd_pcm_oss: Unknown symbol snd_unregister_oss_device |
768 |
snd_pcm_oss: Unknown symbol snd_register_oss_device |
769 |
snd_pcm_oss: Unknown symbol snd_mixer_oss_ioctl_card |
770 |
snd_pcm_oss: Unknown symbol snd_oss_info_register |
771 |
snd_mixer_oss: Unknown symbol snd_unregister_oss_device |
772 |
snd_mixer_oss: Unknown symbol snd_register_oss_device |
773 |
snd_mixer_oss: Unknown symbol snd_mixer_oss_notify_callback |
774 |
snd_mixer_oss: Unknown symbol snd_oss_info_register |
775 |
</pre> |
776 |
|
777 |
<p> |
778 |
上述问题是由于您从<c>alsa-driver</c>转换到内核自带的ALSA而造成的, 在您卸载<c>alsa-driver</c>时,内核模块由于受保护而没有移除。所以当您使用内核自带的ALSA,运行<c>modprobe</c>时, <c>alsa-driver</c>和内核自带的驱动混在一起,造成了上述的错误。 |
779 |
</p> |
780 |
|
781 |
<p> |
782 |
解决方案相当简单。我们只需要在unmerge <c>alsa-driver</c>后手动删除出问题的目录。请确定您删除的是正确的内核版本而非当前的版本! |
783 |
</p> |
784 |
|
785 |
<pre caption="删除alsa-driver模块"> |
786 |
# <i>rm -rf /lib/modules/$(uname -r)/alsa-driver</i> |
787 |
</pre> |
788 |
|
789 |
<p> |
790 |
另一个引起类似错误的可能是在<path>/etc/modules.d</path>中的某个文件错误地输出了 <c>device_mode</c>参数。请确认这是问题所在,并且找出这个捣蛋鬼。 |
791 |
|
792 |
</p> |
793 |
|
794 |
<pre caption="确认并查找device_mode"> |
795 |
<comment>(查看dmesg以确认)</comment> |
796 |
# <i>dmesg | grep device_mode</i> |
797 |
snd: Unknown parameter `device_mode' |
798 |
<comment>(现在,找到问题的根源)</comment> |
799 |
# <i>grep device_mode /etc/modules.d/*</i> |
800 |
</pre> |
801 |
|
802 |
<p> |
803 |
通常是一个叫<path>alsa</path>的文件包含了一行: <c>options snd device_mode=0666</c>。删除此行,重启alsasound服务应该能够解决问题。 |
804 |
</p> |
805 |
|
806 |
</body> |
807 |
</section> |
808 |
</chapter> |
809 |
|
810 |
<chapter> |
811 |
<title>其他</title> |
812 |
<section id="midi"> |
813 |
<title>设置MIDI支持</title> |
814 |
<body> |
815 |
|
816 |
<p> |
817 |
首先请确定<path>/etc/make.conf</path>有<c>midi</c> USE标记。如果没有,请加上它。您需要重新emerge任何使用了<c>midi</c>标记的ALSA软件包,比如<c>alsa-lib</c>,<c>alsa-utils</c>和<c>alsa-driver</c>。 |
818 |
</p> |
819 |
|
820 |
<p> |
821 |
如果您的声卡有板载的MIDI合成器并且您希望听一些.mid文件,您需要安装<c>awesfx</c>,它基本上是一组实用工具来控制AWE32驱动。我们首先要安装它。如果没有硬件合成器,您可以使用虚拟合成器,更多信息,请查看<uri link="#vsynth">虚拟合成器</uri>一节。 |
822 |
</p> |
823 |
|
824 |
<pre caption="安装awesfx"> |
825 |
# <i>emerge awesfx</i> |
826 |
</pre> |
827 |
|
828 |
<note> |
829 |
然后您需要从声卡驱动光盘或者Windows安装文件中复制SoundFont (SF2)文件到<path>/usr/share/sounds/sf2/</path>。举例来说,SBLive!的SoundFont文件可以是8MBGMSFX.SF2. |
830 |
</note> |
831 |
|
832 |
<p> |
833 |
复制了Soundfont文件以后,我们可以如下所示播放midi文件。您也可以把<c>asfxload</c>命令加入到<path>/etc/conf.d/local.start</path>,从而在每次系统启动时加载SoundFont。 |
834 |
</p> |
835 |
|
836 |
<note> |
837 |
下述代码列表中的<path>/mnt</path>路径也许和您的机器上的路径<e>不同</e>。它们只是例子而已,您需要根据您的机器改变路径。 |
838 |
</note> |
839 |
|
840 |
<pre caption="加载Soundfonts"> |
841 |
<comment>(首先,复制Soundfont)</comment> |
842 |
# <i>cp /mnt/win2k/Program\ Files/CreativeSBLive2k/SFBank/8MBGMSFX.SF2 /usr/share/sounds/sf2/</i> |
843 |
<comment>(或者从SoundBlaster的光盘里复制文件)</comment> |
844 |
# <i>cp /mnt/cdrom/AUDIO/ENGLISH/SFBANK/8MBGMSFX.SF2 /usr/share/sounds/sf2/</i> |
845 |
<comment>(加载特定的Soundfont)</comment> |
846 |
# <i>asfxload /usr/share/sounds/sf2/8MBGMSFX.SF2</i> |
847 |
</pre> |
848 |
|
849 |
<p> |
850 |
您现在可以用<c>aplaymidi</c>这样的程序来播放midi文件。运行<c>aplaymidi -l</c>来获取端口列表,然后选择一个端口来播放。 |
851 |
</p> |
852 |
|
853 |
<pre caption="播放MIDI"> |
854 |
<comment>(查看可用的端口)</comment> |
855 |
# <i>aplaymidi -l</i> |
856 |
Port Client name Port name |
857 |
64:0 EMU10K1 MPU-401 (UART) EMU10K1 MPU-401 (UART) |
858 |
65:0 Emu10k1 WaveTable Emu10k1 Port 0 |
859 |
65:1 Emu10k1 WaveTable Emu10k1 Port 1 |
860 |
65:2 Emu10k1 WaveTable Emu10k1 Port 2 |
861 |
65:3 Emu10k1 WaveTable Emu10k1 Port 3 |
862 |
<comment>(选择一个端口,播放mid文件)</comment> |
863 |
# <i> aplaymidi --port=65:0 /mnt/shyam/music/midi/mi2.mid</i> |
864 |
</pre> |
865 |
|
866 |
</body> |
867 |
</section> |
868 |
<section id="vsynth"> |
869 |
<title>虚拟合成器</title> |
870 |
<body> |
871 |
|
872 |
<p> |
873 |
如果您的声卡不支持硬件合成器,您可以使用虚拟合成器,比如<c>timidity++</c>。安装是小菜一碟。 |
874 |
</p> |
875 |
|
876 |
<pre caption="安装timidity++"> |
877 |
# <i>emerge timidity++</i> |
878 |
</pre> |
879 |
|
880 |
<p> |
881 |
timidity需要一个SoundFont来播放声音。幸运的是ebuild会为您安装一些SoundFont。Portage里还有一些可用的SountFont包,比如<c>timidity-freepats</c>和<c>timidity-eawpatches</c>。您可以安装多个SountFont包,而且可以在<path>/usr/share/timidity/</path>安装您自己的SoundFont文件。要在多个timidity的配置中选择,您需要<c>eselect</c>。 |
882 |
</p> |
883 |
|
884 |
<pre caption="改变配置"> |
885 |
# <i>eselect timidity list</i> |
886 |
# <i>eselect timidity set eawpatches</i> |
887 |
</pre> |
888 |
|
889 |
<p> |
890 |
不要忘了把<c>timidity</c>加入默认运行级。 |
891 |
</p> |
892 |
|
893 |
<pre caption="把timidity加入默认运行级。"> |
894 |
# <i>rc-update add timidity default</i> |
895 |
# <i>/etc/init.d/timidity start</i> |
896 |
</pre> |
897 |
|
898 |
<p> |
899 |
您现在可以试着<uri link="#doc_chap4_pre3">播放MIDI</uri>文件。 |
900 |
</p> |
901 |
|
902 |
</body> |
903 |
</section> |
904 |
<section> |
905 |
<title>工具和固件</title> |
906 |
<body> |
907 |
|
908 |
<p> |
909 |
某些特定声卡可以从<c>alsa-tools</c>和<c>alsa-firmware</c>包中获得性能的提升。您只需要简单的<c>emerge</c>。 |
910 |
</p> |
911 |
|
912 |
<pre caption="安装ALSA工具"> |
913 |
# <i>emerge alsa-tools</i> |
914 |
</pre> |
915 |
|
916 |
</body> |
917 |
</section> |
918 |
<section> |
919 |
<title>多块声卡的支持</title> |
920 |
<body> |
921 |
|
922 |
<p> |
923 |
如果ALSA被编译为内核模块(或者您安装了<c>alsa-driver</c>),您可以同时在您的系统中使用多块声卡。您仅需要在<path>/etc/modules.d/alsa</path>里指定启动的顺序。此文件用驱动名来标记您的声卡。0是第一块卡,1是第二块卡,以此类推。这是一个有两块声卡系统的例子。 |
924 |
|
925 |
</p> |
926 |
|
927 |
<pre caption="两块声卡的/etc/modules.d/alsa配置"> |
928 |
options snd-emu10k1 index=0 |
929 |
options snd-via82xx index=1 |
930 |
</pre> |
931 |
|
932 |
<p> |
933 |
如果您有两块声卡使用相同的驱动,您在同一行里用逗号分隔的数字来配置它们。这是一个有三块声卡的系统,其中的两块是Intel高保真声卡。 |
934 |
</p> |
935 |
|
936 |
<pre caption="多块声卡的/etc/modules.d/alsa配置"> |
937 |
options snd-ymfpci index=0 |
938 |
options snd-hda-intel index=1,2 |
939 |
</pre> |
940 |
|
941 |
</body> |
942 |
</section> |
943 |
<section> |
944 |
<title>插件</title> |
945 |
<body> |
946 |
|
947 |
<p> |
948 |
您也许想安装一些插件来获得额外的功能。<c>alsa-plugins</c>打包提供了一些有用的插件,包括: PulseAudio输出,采样率转换器;jack(一个低延迟的音频服务器)和一个可以通过数字S/PDIF接口(光线或同轴电缆)输出6声道音频的编码器。您可以通过USE标记来选择安装什么插件 |
949 |
</p> |
950 |
|
951 |
<pre caption="安装alsa-plugins"> |
952 |
# <i>emerge -avt alsa-plugins</i> |
953 |
</pre> |
954 |
|
955 |
</body> |
956 |
</section> |
957 |
<section> |
958 |
<title>感谢</title> |
959 |
<body> |
960 |
|
961 |
<p> |
962 |
所有Gentoo ALSA指南的贡献者: Vincent Verleye, Grant Goodyear, Arcady Genkin, Jeremy Huddleston, John P. Davis, Sven Vermeulen, Benny Chuang, Tiemo Kieft and Erwin。 |
963 |
</p> |
964 |
|
965 |
</body> |
966 |
</section> |
967 |
<section> |
968 |
<title>资源</title> |
969 |
<body> |
970 |
|
971 |
<ul> |
972 |
<li><uri link="http://www.alsa-project.org/">The ALSA Project</uri></li> |
973 |
<li><uri link="http://linux-sound.org">Linux Sound/MIDI Software</uri></li> |
974 |
</ul> |
975 |
|
976 |
</body> |
977 |
</section> |
978 |
</chapter> |
979 |
</guide> |
980 |
|
981 |
|
982 |
|
983 |
1.1 xml/htdocs/doc/zh_cn/gentoo-x86-quickinstall.xml |
984 |
|
985 |
file : http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/doc/zh_cn/gentoo-x86-quickinstall.xml?rev=1.1&view=markup |
986 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/doc/zh_cn/gentoo-x86-quickinstall.xml?rev=1.1&content-type=text/plain |
987 |
|
988 |
Index: gentoo-x86-quickinstall.xml |
989 |
=================================================================== |
990 |
<?xml version='1.0' encoding="UTF-8"?> |
991 |
<!DOCTYPE guide SYSTEM "/dtd/guide.dtd"> |
992 |
|
993 |
<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/zh_cn/gentoo-x86-quickinstall.xml,v 1.1 2007/09/17 17:54:10 r0bertz Exp $ --> |
994 |
<!-- English CVS version: 1.78 --> |
995 |
|
996 |
<guide link="/doc/zh_cn/gentoo-x86-quickinstall.xml" lang="zh_cn"> |
997 |
<title>Gentoo Linux x86快速安装指南</title> |
998 |
|
999 |
<author title="作者"> |
1000 |
<mail link="neysx@g.o">Xavier Neys</mail> |
1001 |
</author> |
1002 |
<author title="作者"> |
1003 |
<mail link="swift@g.o">Sven Vermeulen</mail> |
1004 |
</author> |
1005 |
<author title="作者">Steven Wagner</author> |
1006 |
<author title="译者"> |
1007 |
<mail link="tysnoo@×××××.com">叶宝泰</mail> |
1008 |
</author> |
1009 |
|
1010 |
<abstract> |
1011 |
这篇快速安装指南以一种相对简略的方式介绍Gentoo安装过程。目的是让没有太多时间的用户完成基于stage3的安装。想遵循本指南的用户须已有安装Gentoo Linux的经验。 |
1012 |
</abstract> |
1013 |
|
1014 |
<!-- The content of this document is licensed under the CC-BY-SA license --> |
1015 |
<!-- See http://creativecommons.org/licenses/by-sa/2.5 --> |
1016 |
<license/> |
1017 |
|
1018 |
<version>19</version> |
1019 |
<date>2007-06-02</date> |
1020 |
|
1021 |
<chapter> |
1022 |
<title>介绍</title> |
1023 |
<section> |
1024 |
<body> |
1025 |
|
1026 |
<p> |
1027 |
本指南包含了完成一次从stage3开始安装Gentoo要用到的所有命令。你需要连接到Internet以下载stage3包和Portage快照。 |
1028 |
</p> |
1029 |
|
1030 |
<p> |
1031 |
所有费时超过两秒的命令都会跟随着在屏幕上打印时间输出。这些命令的耗时是在一台AMD 2000 1.66 Ghz的PC上测试的,拥有512 MB内存和两个SATA硬盘。 |
1032 |
</p> |
1033 |
|
1034 |
<pre caption="测试机器的规格"> |
1035 |
<comment>(下述配置和耗时情况帮你粗略估计完成整个安装过程大概需要的时间)</comment> |
1036 |
|
1037 |
# <i>grep bogo /proc/cpuinfo</i> |
1038 |
bogomips : 3337.81 |
1039 |
|
1040 |
# <i>hdparm -tT /dev/sda</i> |
1041 |
/dev/sda: |
1042 |
Timing cached reads: 1100 MB in 2.00 seconds = 549.97 MB/sec |
1043 |
Timing buffered disk reads: 224 MB in 3.01 seconds = 74.36 MB/sec |
1044 |
|
1045 |
# <i>grep MemTotal /proc/meminfo</i> |
1046 |
MemTotal: 509248 kB |
1047 |
</pre> |
1048 |
|
1049 |
</body> |
1050 |
</section> |
1051 |
</chapter> |
1052 |
|
1053 |
<chapter> |
1054 |
<title>快速安装指南</title> |
1055 |
<section> |
1056 |
<title>安装介质</title> |
1057 |
<body> |
1058 |
|
1059 |
<p> |
1060 |
从我们的<uri link="/main/en/mirrors.xml">镜像</uri>下载一张光盘。可以在<path>releases/x86/<release>/installcd</path>中找到minimal CD的ISO文件,或者在<path>releases/x86/<release>/livecd</path>中找到LiveCD的ISO文件。<e>minimal</e>安装盘只适用于有网络环境的安装。<e>LiveCD</e>适用于无网络环境的安装,参考文档<uri link="/doc/zh_cn/handbook/2007.0/handbook-x86.xml">2007.0 x86安装手册</uri>。本指南推荐使用minimal CD。 |
1061 |
</p> |
1062 |
|
1063 |
<p> |
1064 |
<uri link="/doc/en/faq.xml#isoburning">刻制</uri>光盘,用它引导机器。 |
1065 |
</p> |
1066 |
|
1067 |
</body> |
1068 |
</section> |
1069 |
<section> |
1070 |
<title>从光盘启动</title> |
1071 |
<body> |
1072 |
|
1073 |
<p> |
1074 |
启动时按下<c>F2</c>查看有哪些引导选项。你可以启动<c>gentoo</c>或者<c>gentoo-nofb</c>,后者禁用帧缓冲。如果你用LiveCD引导,别忘了添上<c>nox</c>选项以防止启动X图形环境。有好几个选项可用于启用或禁用一些特性。正常情况下会检测出你的硬件并装载所有模块。如果内核无法正确引导或是在引导过程中挂机,你可能不得不尝试不同的配置。最安全的办法大概是使用<c>nodetect</c>选项,然后显式地载入需要的模块。 |
1075 |
</p> |
1076 |
|
1077 |
<pre caption="从minimal CD启动"> |
1078 |
Gentoo Linux Installation LiveCD http://www.gentoo.org |
1079 |
Enter to Boot; F1 for kernels F2 for options. |
1080 |
boot: <i>gentoo-nofb</i> |
1081 |
<comment>(或在有问题的情况下)</comment> |
1082 |
boot: <i>gentoo-nofb nodetect</i> |
1083 |
</pre> |
1084 |
|
1085 |
</body> |
1086 |
</section> |
1087 |
<section> |
1088 |
<title>可选:装载模块</title> |
1089 |
<body> |
1090 |
|
1091 |
<p> |
1092 |
如果使用了<c>nodetect</c>选项,就要在启动后载入必要的模块。你还要配置好网络并拥有访问磁盘的权限。<c>lspci</c>命令能帮助你确认硬件信息。 |
1093 |
</p> |
1094 |
|
1095 |
<pre caption="载入必要的模块"> |
1096 |
livecd root # <i>lspci</i> |
1097 |
<comment>(根据lspci的输出查看需要哪些模块)</comment> |
1098 |
|
1099 |
<comment>(以下只是个例子,实际以具体硬件为准)</comment> |
1100 |
livecd root # <i>modprobe 3w-9xxx</i> |
1101 |
livecd root # <i>modprobe r8169</i> |
1102 |
</pre> |
1103 |
|
1104 |
</body> |
1105 |
</section> |
1106 |
<section> |
1107 |
<title>网络配置</title> |
1108 |
<body> |
1109 |
|
1110 |
<p> |
1111 |
如果还没开启网络,可以用<c>net-setup</c>来配置网络。配置之前可能要先用<c>modprobe</c>为网卡载入支持模块。如果你有ADSL,请使用<c>pppoe-setup</c>和<c>pppoe-start</c>。要支持PPTP,首先编辑<path>/etc/ppp/chap-secrets</path>和<path>/etc/ppp/options.pptp</path>,然后使用<c>pptp <server ip></c>。 |
1112 |
</p> |
1113 |
|
1114 |
<p> |
1115 |
如果是无线连接,用<c>iwconfig</c>设置无线连接参数,然后再次执行<c>net-setup</c>或者手动运行<c>ifconfig</c>、<c>dhcpcd</c>和/或<c>route</c>。 |
1116 |
</p> |
1117 |
|
1118 |
<p> |
1119 |
如果你用代理,不要忘了使用<c>export http_proxy</c>、<c>ftp_proxy</c>和<c>RSYNC_PROXY</c>初始化系统环境。 |
1120 |
</p> |
1121 |
|
1122 |
<pre caption="通过向导配置网络"> |
1123 |
livecd root # <i>net-setup eth0</i> |
1124 |
</pre> |
1125 |
|
1126 |
<p> |
1127 |
或者,你也可以手动打开网络。下面的例子把你电脑的IP地址配置为192.168.1.10,并把网关和域名服务器设为192.168.1.1。 |
1128 |
</p> |
1129 |
|
1130 |
<pre caption="手动配置网络"> |
1131 |
livecd root # <i>ifconfig eth0 192.168.1.10/24</i> |
1132 |
livecd root # <i>route add default gw 192.168.1.1</i> |
1133 |
livecd root # <i>echo nameserver 192.168.1.1 > /etc/resolv.conf</i> |
1134 |
</pre> |
1135 |
|
1136 |
<p> |
1137 |
安装盘允许你启动一个<c>sshd</c>服务,添加用户,运行<c>irssi</c>(一个命令行的客户端聊天工具),还可以使用<c>lynx</c>或<c>links</c>进行网上冲浪。 |
1138 |
</p> |
1139 |
|
1140 |
</body> |
1141 |
</section> |
1142 |
<section> |
1143 |
<title>可选:通过ssh连接到你的新机器</title> |
1144 |
<body> |
1145 |
|
1146 |
<p> |
1147 |
最有趣的功能当然是<c>sshd</c>。启动这个服务,从另一台机器连过来,然后从本指南复制/粘贴命令。 |
1148 |
</p> |
1149 |
|
1150 |
<pre caption="启动sshd"> |
1151 |
livecd root # <i>time /etc/init.d/sshd start</i> |
1152 |
* Generating hostkey ... |
1153 |
<comment>(sshd生成密钥并显示更多输出)</comment> |
1154 |
* starting sshd ... [ok] |
1155 |
|
1156 |
real 0m13.688s |
1157 |
user 0m9.420s |
1158 |
sys 0m0.090s |
1159 |
</pre> |
1160 |
|
1161 |
<p> |
1162 |
现在设置一下安装盘的root密码,使你能通过另一台电脑连接。请注意正常情况下不推荐你允许root通过ssh连接。如果你的本地网络不太可靠,请设一个又长又复杂的密码。它只能使用一次,因为机器重启后就没掉了。 |
1163 |
</p> |
1164 |
|
1165 |
<pre caption="设置root密码"> |
1166 |
livecd root # <i>passwd</i> |
1167 |
New UNIX password: <comment>输入密码</comment> |
1168 |
Retype new UNIX password: <comment>输入密码</comment> |
1169 |
passwd: password updated successfully |
1170 |
</pre> |
1171 |
|
1172 |
<p> |
1173 |
现在就可以在另一台电脑上打开一个终端并连接到你的新机器,在新的窗口中继续本指南接下去的内容,复制/粘贴文中的命令。 |
1174 |
</p> |
1175 |
|
1176 |
<pre caption="从另一台电脑连到你的新机器"> |
1177 |
<comment>#-#-#-#-# choice #-#-#-#-# |
1178 |
(用你新机器的IP地址) |
1179 |
#-#-#-#-# choice #-#-#-#-# |
1180 |
(使用你新机器的IP地址)</comment> |
1181 |
$ <i>ssh root@192.168.1.10</i> |
1182 |
The authenticity of host '192.168.1.10 (192.168.1.10)' can't be established. |
1183 |
RSA key fingerprint is 96:e7:2d:12:ac:9c:b0:94:90:9f:40:89:b0:45:26:8f. |
1184 |
Are you sure you want to continue connecting (yes/no)? <i>yes</i> |
1185 |
Warning: Permanently added '192.168.1.10' (RSA) to the list of known hosts. |
1186 |
Password: <comment>输入密码</comment> |
1187 |
</pre> |
1188 |
|
1189 |
</body> |
1190 |
</section> |
1191 |
<section> |
1192 |
<title>准备磁盘</title> |
1193 |
<body> |
1194 |
|
1195 |
<p> |
1196 |
使用<c>fdisk</c>或者<c>cfdisk</c>创建分区规划。至少需要一个交换分区(类别为82)和一个Linux分区(类别为83)。下面是我们的手册选用的方案,创建包括一个<path>/boot</path>分区,一个交换分区和一个主分区。设备名可能是<path>/dev/sda</path>或者<path>/dev/hda</path>,前者为SATA或SCSI硬盘,后者为IDE硬盘。 |
1197 |
</p> |
1198 |
|
1199 |
<pre caption="创建分区"> |
1200 |
livecd ~ # <i>fdisk /dev/sda</i> |
1201 |
|
1202 |
<comment>(本手册接下去使用以下分区规划)</comment> |
1203 |
livecd ~ # <i>fdisk -l /dev/sda</i> |
1204 |
|
1205 |
Disk /dev/sda: 599.9 GB, 599978409984 bytes |
1206 |
255 heads, 63 sectors/track, 72943 cylinders |
1207 |
Units = cylinders of 16065 * 512 = 8225280 bytes |
1208 |
|
1209 |
Device Boot Start End Blocks Id System |
1210 |
/dev/sda1 1 12 96358+ 83 Linux |
1211 |
/dev/sda2 13 110 787185 82 Linux swap / Solaris |
1212 |
/dev/sda3 111 72943 585031072+ 83 Linux |
1213 |
</pre> |
1214 |
|
1215 |
<p> |
1216 |
使用<c>mke2fs</c>,<c>mke2fs -j</c>,<c>mkreiserfs</c>,<c>mkfs.xfs</c>和<c>mkfs.jfs</c>建立Linux分区的文件系统。使用<c>mkswap</c>和<c>swapon</c>初始化交换分区。 |
1217 |
</p> |
1218 |
|
1219 |
<pre caption="创建文件系统并激活交换分区"> |
1220 |
<comment>(ext2完全满足/boot分区的需要)</comment> |
1221 |
livecd ~ # <i>mke2fs /dev/sda1</i> |
1222 |
|
1223 |
<comment>(主分区就用ext3吧)</comment> |
1224 |
livecd ~ # <i>mke2fs -j /dev/sda3</i> |
1225 |
|
1226 |
<comment>(创建并激活交换分区)</comment> |
1227 |
livecd ~ # <i>mkswap /dev/sda2 && swapon /dev/sda2</i> |
1228 |
</pre> |
1229 |
|
1230 |
<p> |
1231 |
把新建的文件系统挂载到<path>/mnt/gentoo</path>。如果需要其他挂载点(如<path>/mnt/gentoo/boot</path>),也要为它们创建目录并挂载好。 |
1232 |
</p> |
1233 |
|
1234 |
<pre caption="挂载文件系统"> |
1235 |
livecd ~ # <i>mount /dev/sda3 /mnt/gentoo</i> |
1236 |
livecd ~ # <i>mkdir /mnt/gentoo/boot</i> |
1237 |
livecd ~ # <i>mount /dev/sda1 /mnt/gentoo/boot</i> |
1238 |
</pre> |
1239 |
|
1240 |
</body> |
1241 |
</section> |
1242 |
<section> |
1243 |
<title>安装Stage</title> |
1244 |
<body> |
1245 |
|
1246 |
<p> |
1247 |
首先确保正确设置了日期和时间。执行<c>date MMDDhhmmYYYY</c>,使用UTC时间。 |
1248 |
</p> |
1249 |
|
1250 |
<pre caption="设定日期和UTC时间"> |
1251 |
<comment>(查看时钟)</comment> |
1252 |
livecd ~ # <i>date</i> |
1253 |
Mon Mar 6 00:14:13 UTC 2006 |
1254 |
|
1255 |
<comment>(设置当前日期和时间,如果需要的话)</comment> |
1256 |
livecd ~ # <i>date 030600162006</i> <comment>(格式为MMDDhhmmYYYY)</comment> |
1257 |
Mon Mar 6 00:16:00 UTC 2006 |
1258 |
</pre> |
1259 |
|
1260 |
<p> |
1261 |
接下来,从我们的<uri link="/main/en/mirrors.xml">镜像</uri>下载一份stage包。进入<path>/mnt/gentoo</path>,执行<c>tar xjpf <stage3 tarball></c>解压stage包。 |
1262 |
</p> |
1263 |
|
1264 |
<pre caption="下载一份stage3压缩包"> |
1265 |
livecd ~ # <i>cd /mnt/gentoo</i> |
1266 |
livecd gentoo # <i>links http://www.gentoo.org/main/en/mirrors.xml</i> |
1267 |
<comment>(选一个镜像,进入/x86/current/stages目录,高亮显示你需要的stage3包, |
1268 |
即i686 stage3,按下D键下载)</comment> |
1269 |
|
1270 |
<comment>(<b>Or</b> 不选择最近的镜像,直接用wget下载)</comment> |
1271 |
livecd ~ # <i>cd /mnt/gentoo</i> |
1272 |
livecd gentoo # <i>wget ftp://gentoo.osuosl.org/pub/gentoo/releases/x86/current/stages/stage3-i686*tar.bz2</i> |
1273 |
</pre> |
1274 |
|
1275 |
<pre caption="解开stage3压缩包"> |
1276 |
livecd gentoo # <i>time tar xjpf stage3*</i> |
1277 |
|
1278 |
real 1m13.157s |
1279 |
user 1m2.920s |
1280 |
sys 0m7.230s |
1281 |
</pre> |
1282 |
|
1283 |
<p> |
1284 |
安装最新的Portage快照。跟下载stage3压缩包一样:从我们的<uri link="/main/en/mirrors.xml">列表</uri>选择一个最近的镜像,下载最新的快照并解压。 |
1285 |
</p> |
1286 |
|
1287 |
<pre caption="下载最新的Portage快照"> |
1288 |
livecd gentoo # <i>cd /mnt/gentoo/usr</i> |
1289 |
livecd usr # <i>links http://www.gentoo.org/main/en/mirrors.xml</i> |
1290 |
<comment>(选一个镜像,进入snapshots/目录,高亮显示 <b>portage-latest.tar.bz2</b> ,按下D键下载)</comment> |
1291 |
|
1292 |
<comment>(<b>Or</b> 不选择最近的镜像,直接用wget下载)</comment> |
1293 |
livecd gentoo # <i>cd /mnt/gentoo/usr</i> |
1294 |
livecd usr # <i>wget http://gentoo.osuosl.org/snapshots/portage-latest.tar.bz2</i> |
1295 |
</pre> |
1296 |
|
1297 |
<pre caption="解开Portage快照"> |
1298 |
livecd usr # <i>time tar xjf portage*</i> |
1299 |
|
1300 |
real 0m51.523s |
1301 |
user 0m28.680s |
1302 |
sys 0m12.840s |
1303 |
</pre> |
1304 |
|
1305 |
</body> |
1306 |
</section> |
1307 |
<section> |
1308 |
<title>切换系统</title> |
1309 |
<body> |
1310 |
|
1311 |
<p> |
1312 |
挂载<path>/proc</path>文件系统,拷贝<path>/etc/resolv.conf</path>文件,然后chroot到你的Gentoo环境。 |
1313 |
</p> |
1314 |
|
1315 |
<pre caption="Chroot"> |
1316 |
livecd usr # <i>cd /</i> |
1317 |
livecd / # <i>mount -t proc proc /mnt/gentoo/proc</i> |
1318 |
livecd / # <i>cp -L /etc/resolv.conf /mnt/gentoo/etc/</i> |
1319 |
livecd / # <i>chroot /mnt/gentoo /bin/bash</i> |
1320 |
livecd / # <i>env-update && source /etc/profile</i> |
1321 |
>>> Regenerating /etc/ld.so.cache... |
1322 |
</pre> |
1323 |
|
1324 |
</body> |
1325 |
</section> |
1326 |
<section> |
1327 |
<title>设定时区</title> |
1328 |
<body> |
1329 |
|
1330 |
<p> |
1331 |
设置你的时区信息:使用<path>/usr/share/zoneinfo</path>中的正确条目。 |
1332 |
</p> |
1333 |
|
1334 |
<pre caption="设置时区"> |
1335 |
livecd / # <i>ls /usr/share/zoneinfo</i> |
1336 |
<comment>(以上海为例)</comment> |
1337 |
livecd / # <i>cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime</i> |
1338 |
livecd / # <i>date</i> |
1339 |
Thu Aug 30 11:03:16 CST 2007 |
1340 |
</pre> |
1341 |
|
1342 |
</body> |
1343 |
</section> |
1344 |
<section> |
1345 |
<title>设定主机名和域名</title> |
1346 |
<body> |
1347 |
|
1348 |
<p> |
1349 |
在<path>/etc/conf.d/hostname</path>和<path>/etc/hosts</path>中设置主机名。以下例子中我们用<c>mybox</c>作为主机名,用<c>at.myplace</c>作为域名。可以用nano编辑这些配置文件,或者使用下面的命令: |
1350 |
</p> |
1351 |
|
1352 |
<pre caption="设置主机名和域名"> |
1353 |
livecd / # <i>cd /etc</i> |
1354 |
livecd etc # <i>echo "127.0.0.1 mybox.at.myplace mybox localhost" > hosts</i> |
1355 |
livecd etc # <i>sed -i -e 's/HOSTNAME.*/HOSTNAME="mybox"/' conf.d/hostname</i> |
1356 |
<comment>(使用指定的主机名并检查)</comment> |
1357 |
livecd etc # <i>hostname mybox</i> |
1358 |
livecd etc # <i>hostname -f</i> |
1359 |
mybox.at.myplace |
1360 |
</pre> |
1361 |
|
1362 |
</body> |
1363 |
</section> |
1364 |
<section> |
1365 |
<title>内核配置</title> |
1366 |
<body> |
1367 |
|
1368 |
<p> |
1369 |
安装一个内核源码包(通常为<c>gentoo-sources</c>),配置、编译并拷贝<path>arch/i386/boot/bzImage</path>文件到<path>/boot</path>。 |
1370 |
</p> |
1371 |
|
1372 |
<pre caption="安装内核源码包,编译和安装内核"> |
1373 |
livecd etc # <i>time emerge gentoo-sources</i> |
1374 |
|
1375 |
real 2m51.435s |
1376 |
user 0m58.220s |
1377 |
sys 0m29.890s |
1378 |
livecd etc # <i>cd /usr/src/linux</i> |
1379 |
livecd linux # <i>make menuconfig</i> |
1380 |
<comment>(配置内核)</comment> |
1381 |
livecd linux # <i>time make -j2</i> |
1382 |
|
1383 |
<comment>(所花的时间很大程度上决定于你所选的选项)</comment> |
1384 |
real 3m51.962s |
1385 |
user 3m27.060s |
1386 |
sys 0m24.310s |
1387 |
|
1388 |
livecd linux # <i>make modules_install</i> |
1389 |
livecd linux # <i>cp arch/i386/boot/bzImage /boot/kernel</i> |
1390 |
</pre> |
1391 |
|
1392 |
</body> |
1393 |
</section> |
1394 |
<section> |
1395 |
<title>配置系统</title> |
1396 |
<body> |
1397 |
|
1398 |
<p> |
1399 |
编辑<path>/etc/fstab</path>,用实际的分区名代替<c>BOOT</c>,<c>ROOT</c>和<c>SWAP</c>。记得确认一下文件系统是否与所安装的相匹配。 |
1400 |
</p> |
1401 |
|
1402 |
<pre caption="fstab范例"> |
1403 |
livecd linux # <i>cd /etc</i> |
1404 |
livecd etc # <i>nano -w fstab</i> |
1405 |
/dev/<i>sda1</i> /boot ext2 noauto,noatime 1 2 |
1406 |
/dev/<i>sda3</i> / ext3 noatime 0 1 |
1407 |
/dev/<i>sda2</i> none swap sw 0 0 |
1408 |
</pre> |
1409 |
|
1410 |
<p> |
1411 |
在<path>/etc/conf.d/net</path>中配置网络。把<c>net.eth0</c>启动脚本添加到默认运行级别。如果有多张网卡,分别为它们建立符号链接到<c>net.eth0</c>启动脚本,并一起添加到默认运行级别。用<c>nano</c>编辑<path>/etc/conf.d/net</path>,或者使用如下命令: |
1412 |
</p> |
1413 |
|
1414 |
<pre caption="配置网络"> |
1415 |
livecd etc # <i>cd conf.d</i> |
1416 |
livecd conf.d # <i>echo 'config_eth0=( "192.168.1.10/24" )' >> net</i> |
1417 |
livecd conf.d # <i>echo 'routes_eth0=( "default via 192.168.1.1" )' >> net</i> |
1418 |
livecd conf.d # <i>rc-update add net.eth0 default</i> |
1419 |
<comment>(如果你把网卡驱动编译为模块, |
1420 |
需要将它添加到/etc/modules.autoload.d/kernel-2.6)</comment> |
1421 |
livecd conf.d # <i>echo r8169 >> /etc/modules.autoload.d/kernel-2.6</i> |
1422 |
<comment>(如果希望重启后通过ssh重新连接到新机器:)</comment> |
1423 |
livecd conf.d # <i>rc-update add sshd default</i> |
1424 |
</pre> |
1425 |
|
1426 |
<note> |
1427 |
如果需要支持PCMCIA卡,请emerge <c>pcmciautils</c>。 |
1428 |
</note> |
1429 |
|
1430 |
<p> |
1431 |
执行<c>passwd</c>设置root密码。 |
1432 |
</p> |
1433 |
|
1434 |
<pre caption="设置root密码"> |
1435 |
livecd conf.d # <i>passwd</i> |
1436 |
New UNIX password: <comment>输入密码</comment> |
1437 |
Retype new UNIX password: <comment>再输入密码</comment> |
1438 |
passwd: password updated successfully |
1439 |
</pre> |
1440 |
|
1441 |
<p> |
1442 |
编辑<path>/etc/conf.d/clock</path>以定义前面所使用的时区。 |
1443 |
</p> |
1444 |
|
1445 |
<pre caption="编辑/etc/conf.d/clock"> |
1446 |
livecd conf.d # <i>nano -w /etc/conf.d/clock</i> |
1447 |
TIMEZONE="Asia/Shanghai" |
1448 |
</pre> |
1449 |
|
1450 |
<p> |
1451 |
检查系统配置,查看并编辑这些配置文件:<path>/etc/rc.conf</path>, <path>/etc/conf.d/rc</path>,<path>/etc/conf.d/keymaps</path>。 |
1452 |
</p> |
1453 |
|
1454 |
<pre caption="可选:编辑一些配置文件"> |
1455 |
livecd conf.d # <i>nano -w /etc/rc.conf</i> |
1456 |
livecd conf.d # <i>nano -w /etc/conf.d/rc</i> |
1457 |
livecd conf.d # <i>nano -w /etc/conf.d/keymaps</i> |
1458 |
|
1459 |
</pre> |
1460 |
|
1461 |
</body> |
1462 |
</section> |
1463 |
<section> |
1464 |
<title>安装系统工具</title> |
1465 |
<body> |
1466 |
|
1467 |
<p> |
1468 |
安装一个系统日志如<c>syslog-ng</c>和一个cron守护进程如<c>vixie-cron</c>,并把它们添加到默认运行级别。 |
1469 |
</p> |
1470 |
|
1471 |
<note> |
1472 |
Cron守护进程依赖于MTA。<c>mail-mta/ssmtp</c>会因依赖性而被一起安装。如果你想使用一种更高级的MTA,可以现在安装它。要是现在没空,暂时先安装ssmtp,以后再卸载并安装你要的MTA。 |
1473 |
</note> |
1474 |
|
1475 |
<pre caption="安装系统日志和cron守护进程"> |
1476 |
livecd conf.d # <i>time emerge syslog-ng vixie-cron</i> |
1477 |
|
1478 |
real 1m52.699s |
1479 |
user 1m1.630s |
1480 |
sys 0m35.220s |
1481 |
livecd conf.d # <i>rc-update add syslog-ng default</i> |
1482 |
livecd conf.d # <i>rc-update add vixie-cron default</i> |
1483 |
</pre> |
1484 |
|
1485 |
<p> |
1486 |
安装必要的文件系统工具(<c>xfsprogs</c>,<c>reiserfsprogs</c>或<c>jfsutils</c>)和网络工具(<c>dhcpcd</c>或<c>ppp</c>)。 |
1487 |
</p> |
1488 |
|
1489 |
<pre caption="安装其它工具"> |
1490 |
livecd conf.d # <i>emerge xfsprogs</i> <comment>(如果使用XFS文件系统)</comment> |
1491 |
livecd conf.d # <i>emerge jfsutils</i> <comment>(如果使用JFS文件系统)</comment> |
1492 |
livecd conf.d # <i>emerge reiserfsprogs</i> <comment>(如果使用Reiser文件系统)</comment> |
1493 |
livecd conf.d # <i>emerge dhcpcd</i> <comment>(如果使用DHCP客户端)</comment> |
1494 |
livecd conf.d # <i>emerge ppp</i> <comment>(如果使用PPPoE ADSL连接)</comment> |
1495 |
</pre> |
1496 |
|
1497 |
</body> |
1498 |
</section> |
1499 |
<section> |
1500 |
<title>配置引导程序</title> |
1501 |
<body> |
1502 |
|
1503 |
<p> |
1504 |
Emerge <c>grub</c>或<c>lilo</c>。配置<path>/boot/grub/grub.conf</path>或<path>/etc/lilo.conf</path>并安装你emerge的引导程序。 |
1505 |
</p> |
1506 |
|
1507 |
<p> |
1508 |
<b>1. Using grub</b> |
1509 |
</p> |
1510 |
|
1511 |
<pre caption="Emerge grub并编辑它的配置文件"> |
1512 |
livecd conf.d # <i>time emerge grub</i> |
1513 |
|
1514 |
real 1m8.634s |
1515 |
user 0m39.460s |
1516 |
sys 0m15.280s |
1517 |
livecd conf.d # <i>nano -w /boot/grub/grub.conf</i> |
1518 |
</pre> |
1519 |
|
1520 |
<pre caption="grub.conf范例"> |
1521 |
default 0 |
1522 |
timeout 10 |
1523 |
|
1524 |
title=Gentoo |
1525 |
root (hd0,0) |
1526 |
kernel /boot/kernel root=/dev/sda3 |
1527 |
</pre> |
1528 |
|
1529 |
<pre caption="安装grub"> |
1530 |
livecd conf.d # <i>grub</i> |
1531 |
Probing devices to guess BIOS drives. This may take a long time. |
1532 |
|
1533 |
grub> <i>root (hd0,0)</i> |
1534 |
Filesystem type is ext2fs, partition type 0x83 |
1535 |
|
1536 |
grub> <i>setup (hd0)</i> |
1537 |
Checking if "/boot/grub/stage1" exists... yes |
1538 |
Checking if "/boot/grub/stage2" exists... yes |
1539 |
Checking if "/boot/grub/e2fs_stage1_5" exists... yes |
1540 |
Running "embed /boot/grub/e2fs_stage1_5 (hd0)"... 16 sectors are embedded. |
1541 |
succeeded |
1542 |
Running "install /boot/grub/stage1 (hd0) (hd0)1+16 p (hd0,0)/boot/grub/stage2 /boot/ |
1543 |
grub/menu.lst"... succeeded |
1544 |
Done. |
1545 |
|
1546 |
grub> <i>quit</i> |
1547 |
</pre> |
1548 |
|
1549 |
<p> |
1550 |
接着进入<uri link="#reboot">重启一节</uri>。 |
1551 |
</p> |
1552 |
|
1553 |
<p> |
1554 |
<b>2. Using lilo</b> |
1555 |
</p> |
1556 |
|
1557 |
<pre caption="Emerge lilo并编辑它的配置文件"> |
1558 |
livecd conf.d # <i>time emerge lilo</i> |
1559 |
|
1560 |
real 0m47.016s |
1561 |
user 0m22.770s |
1562 |
sys 0m5.980s |
1563 |
livecd conf.d # <i>nano -w /etc/lilo.conf</i> |
1564 |
</pre> |
1565 |
|
1566 |
<pre caption="lilo.conf范例"> |
1567 |
boot=/dev/sda |
1568 |
prompt |
1569 |
timeout=50 |
1570 |
default=gentoo |
1571 |
|
1572 |
image=/boot/kernel |
1573 |
label=Gentoo |
1574 |
read-only |
1575 |
root=/dev/sda3 |
1576 |
</pre> |
1577 |
|
1578 |
<pre caption="安装lilo"> |
1579 |
livecd conf.d # <i>lilo</i> |
1580 |
Added Gentoo * |
1581 |
</pre> |
1582 |
|
1583 |
</body> |
1584 |
</section> |
1585 |
<section id="reboot"> |
1586 |
<title>重启</title> |
1587 |
<body> |
1588 |
|
1589 |
<p> |
1590 |
退出chroot环境,卸载所有文件系统并重启: |
1591 |
</p> |
1592 |
|
1593 |
<pre caption="重启"> |
1594 |
livecd conf.d # <i>exit</i> |
1595 |
livecd / # <i>umount /mnt/gentoo/proc /mnt/gentoo/boot /mnt/gentoo</i> |
1596 |
livecd / # <i>reboot</i> |
1597 |
<comment>(别忘了取出光盘)</comment> |
1598 |
</pre> |
1599 |
|
1600 |
</body> |
1601 |
</section> |
1602 |
<section id="after-reboot"> |
1603 |
<title>完成安装</title> |
1604 |
<body> |
1605 |
|
1606 |
<note> |
1607 |
在我们这台测试机器上,从minimal CD启动显示boot提示符开始,到重启后显示登录提示符, <b>总用时</b>为<b>00:42:31</b> 。没错,不到一个小时!注意这个时间还包含了stage3包、Portage快照和一些软件包的下载时间,以及配置内核所花的时间。 |
1608 |
</note> |
1609 |
|
1610 |
<p> |
1611 |
以<c>root</c>身份登录,用<c>useradd</c>添加一个或多个用户,作为日常使用。 |
1612 |
</p> |
1613 |
|
1614 |
<pre caption="从另一台电脑连到你的新机器"> |
1615 |
<comment>(清理known_hosts文件中的内容,因为你的新机器已生成一个新的 |
1616 |
通用主机密钥)</comment> |
1617 |
$ <i>nano -w ~/.ssh/known_hosts</i> |
1618 |
<comment>(找出新机器的IP并删除那一行,保存并退出nano)</comment> |
1619 |
|
1620 |
<comment>#-#-#-#-# choice #-#-#-#-# |
1621 |
(用你新机器的IP地址) |
1622 |
#-#-#-#-# choice #-#-#-#-# |
1623 |
(使用你新机器的IP地址)</comment> |
1624 |
$ <i>ssh root@192.168.1.10</i> |
1625 |
The authenticity of host '192.168.1.10 (192.168.1.10)' can't be established. |
1626 |
RSA key fingerprint is 96:e7:2d:12:ac:9c:b0:94:90:9f:40:89:b0:45:26:8f. |
1627 |
Are you sure you want to continue connecting (yes/no)? <i>yes</i> |
1628 |
Warning: Permanently added '192.168.1.10' (RSA) to the list of known hosts. |
1629 |
Password: <comment>输入密码</comment> |
1630 |
</pre> |
1631 |
|
1632 |
<pre caption="添加一个新用户"> |
1633 |
mybox ~ # <i>adduser -g users -G lp,wheel,audio,cdrom,portage,cron -m john</i> |
1634 |
mybox ~ # <i>passwd john</i> |
1635 |
New UNIX password: <comment>设置John的密码</comment> |
1636 |
Retype new UNIX password: <comment>再次输入John的密码</comment> |
1637 |
passwd: password updated successfully |
1638 |
</pre> |
1639 |
|
1640 |
</body> |
1641 |
</section> |
1642 |
<section> |
1643 |
<title>最后涉及的配置</title> |
1644 |
<body> |
1645 |
|
1646 |
<p> |
1647 |
开始选择最近的镜像,在<path>/etc/make.conf</path>中定义<c>SYNC</c>变量和<c>GENTOO_MIRRORS</c>变量,或者也可以使用<c>mirrorselect</c>。此时你还可以定义并行编译的进程数。 |
1648 |
</p> |
1649 |
|
1650 |
<pre caption="使用mirrorselect并设置MAKEOPTS"> |
1651 |
mybox ~ # <i>emerge mirrorselect</i> |
1652 |
mybox ~ # <i>mirrorselect -i -o >> /etc/make.conf</i> |
1653 |
mybox ~ # <i>mirrorselect -i -r -o >> /etc/make.conf</i> |
1654 |
<comment>(通常,一个较好的值为处理器数加一)</comment> |
1655 |
mybox ~ # <i>echo 'MAKEOPTS="-j2"' >> /etc/make.conf</i> |
1656 |
</pre> |
1657 |
|
1658 |
<p> |
1659 |
现在是启用或禁用一些USE参数的好时机。运行<c>emerge -vpe world</c>,列出所有当前已安装的软件包以及它们被启用和禁用的USE参数。编辑<path>/etc/make.conf</path>或使用下列命令定义USE变量: |
1660 |
</p> |
1661 |
|
1662 |
<pre caption="查看当前使用的USE参数并启用或禁用其中的某些"> |
1663 |
mybox ~ # <i>emerge -vpe world</i> |
1664 |
<comment>(Portage列出软件包和它们的USE参数。作为例子,让我们禁用ipv6和fortran, |
1665 |
并启用unicode)</comment> |
1666 |
mybox ~ # <i>echo 'USE="nptl nptlonly -ipv6 -fortran unicode"' >> /etc/make.conf</i> |
1667 |
</pre> |
1668 |
|
1669 |
<p> |
1670 |
新版本的glibc使用<path>/etc/locale.gen</path>来定义语言环境。 |
1671 |
</p> |
1672 |
|
1673 |
<pre caption="定义语言环境"> |
1674 |
mybox ~ # <i>cd /etc</i> |
1675 |
mybox etc # <i>nano -w locale.gen</i> |
1676 |
</pre> |
1677 |
|
1678 |
<p> |
1679 |
最后但并非最轻松的,你可能想修改<path>/etc/make.conf</path>中的<c>CFLAGS</c>变量来优化编码,以满足你的特定需要。请注意极少需要一长串的参数列表,那样甚至可能导致系统崩溃。建议通过<c>march</c>选项指定处理器类型并赋上 |
1680 |
<c>-O2 -pipe</c>参数。 |
1681 |
</p> |
1682 |
|
1683 |
<p> |
1684 |
可能你还想转到 <b>~x86</b>。只有当你能够对付那些脆弱不良的ebuild和软件包时才能这么做。如果你倾向于保持系统的稳定性,请不要添加<c>ACCEPT_KEYWORDS</c>变量。添加<c>FEATURES="parallel-fetch ccache"</c>却是个好主意。 |
1685 |
</p> |
1686 |
|
1687 |
<pre caption="为make.conf作最后的修改"> |
1688 |
mybox etc # <i>nano -w make.conf</i> |
1689 |
<comment>(在CFLAGS中将-march设为你的CPU类型)</comment> |
1690 |
CFLAGS="-O2 -march=<i>athlon-xp</i> -pipe" |
1691 |
<comment>(添加下面一行)</comment> |
1692 |
FEATURES="parallel-fetch ccache" |
1693 |
<comment>(只有清楚自己在干什么才添加下面一行)</comment> |
1694 |
ACCEPT_KEYWORDS="~x86" |
1695 |
</pre> |
1696 |
|
1697 |
<p> |
1698 |
可能你会想重编译整个系统两次,以使你所作的最新配置完全生效。这要花很长的时间来完成,而只能得到微小的速度提升。你可以让系统自己随着以后新软件包的发布而逐步完成优化。不过,站在保持系统一致性的立场来看,重编译仍不失为一个好主意。请参考文档<uri link="/doc/zh_cn/gcc-upgrading.xml">Gentoo GCC升级指南</uri>,其中讨论了如何搭建一个具有良好一致性的system和world,以及这样做的好处。 |
1699 |
</p> |
1700 |
|
1701 |
<p> |
1702 |
只重编译那些因你应用了新的USE参数或受此影响而需要升级的软件包,也要花费不少时间。可能还必须卸载会阻止你升级的软件包。在<c>emerge -vpuD --newuse world</c>的输出中寻找“[blocks <brite>B</brite> ]”,用<c>emerge -C</c>卸载它们。 |
1703 |
</p> |
1704 |
|
1705 |
<pre caption="升级软件包"> |
1706 |
<comment>(安装ccache)</comment> |
1707 |
mybox etc # <i>emerge ccache</i> |
1708 |
|
1709 |
<comment>(请注意转到~x86会导致很多软件包要升级)</comment> |
1710 |
mybox etc # <i>emerge -vpuD --newuse world</i> |
1711 |
<comment>(好好看一看软件包列表和它们的USE参数, |
1712 |
有阻止的包就先卸载,然后启动漫长的过程)</comment> |
1713 |
mybox etc # <i>time emerge -vuD --newuse world</i> |
1714 |
<comment>((重)编译了79个软件包)</comment> |
1715 |
|
1716 |
real 180m13.276s |
1717 |
user 121m22.905s |
1718 |
sys 36m31.472s |
1719 |
|
1720 |
<comment>(重编译libtool以避免一些潜在的问题)</comment> |
1721 |
mybox etc # <i>emerge libtool</i> |
1722 |
|
1723 |
<comment>(更新配置文件,确保 <b>do not</b> 让etc-update更新你配置好的文件)</comment> |
1724 |
mybox etc # <i>etc-update</i> |
1725 |
|
1726 |
<comment>(如果升级了perl,应该执行perl-cleaner脚本)</comment> |
1727 |
mybox etc # <i>time perl-cleaner all</i> |
1728 |
real 1m6.495s |
1729 |
user 0m42.699s |
1730 |
sys 0m10.641s |
1731 |
|
1732 |
<comment>(如果升级了python的主要软件包,应该执行python-updater脚本)</comment> |
1733 |
mybox etc # <i>python-updater</i> |
1734 |
</pre> |
1735 |
|
1736 |
</body> |
1737 |
</section> |
1738 |
<section> |
1739 |
<title>接下来该做什么</title> |
1740 |
<body> |
1741 |
|
1742 |
<p> |
1743 |
想安装服务器应用程序还是一个桌面系统,取决于你打算让你的新Gentoo做什么。以下仅作为一个例子,统计了<c>emerge gnome</c>和<c>emerge kde</c>在~x86系统(按之前的描述安装的)上所花费的时间。两者是在同一起点开始安装的。 |
1744 |
</p> |
1745 |
|
1746 |
<p> |
1747 |
去看看我们的<uri link="/doc/zh_cn/">文档目录</uri>,研究一下如何安装和配置你挑选的软件。 |
1748 |
</p> |
1749 |
|
1750 |
<impo> |
1751 |
以下只是举个例子,并不意味着就作为推荐设置。 |
1752 |
</impo> |
1753 |
|
1754 |
<pre caption="Emerge GNOME"> |
1755 |
mybox etc # <i>emerge -vp gnome</i> |
1756 |
<comment>(查看软件包列表和它们的USE参数, |
1757 |
如果需要请编辑make.conf</comment> |
1758 |
mybox etc # <i>nano -w /etc/make.conf</i> |
1759 |
<comment>(定义了以下USE参数)</comment> |
1760 |
USE="nptl nptlonly -ipv6 -fortran unicode svg hal dbus \ |
1761 |
-kde -qt3 -qt4 -arts -eds -esd gnome gstreamer gtk firefox" |
1762 |
|
1763 |
mybox etc # <i>time emerge gnome</i> |
1764 |
<comment>(安装了326个软件包)</comment> |
1765 |
|
1766 |
real 520m44.532s |
1767 |
user 339m21.144s |
1768 |
sys 146m22.337s |
1769 |
</pre> |
1770 |
|
1771 |
<pre caption="Emerge KDE"> |
1772 |
mybox etc # <i>emerge -vp kde-meta</i> |
1773 |
<comment>(查看软件包列表和它们的USE参数, |
1774 |
如果需要请编辑make.conf</comment> |
1775 |
mybox etc # <i>nano -w /etc/make.conf</i> |
1776 |
<comment>定义了以下USE参数)</comment> |
1777 |
USE="nptl nptlonly -ipv6 -fortran unicode svg hal dbus \ |
1778 |
kde qt3 qt4 -arts -eds -esd -gnome -gstreamer -gtk -firefox" |
1779 |
|
1780 |
mybox etc # <i>time emerge kde-meta</i> |
1781 |
<comment>(安装了391个软件包)</comment> |
1782 |
|
1783 |
real 1171m25.318s |
1784 |
user 851m26.393s |
1785 |
sys 281m45.629s |
1786 |
</pre> |
1787 |
|
1788 |
</body> |
1789 |
</section> |
1790 |
</chapter> |
1791 |
</guide> |
1792 |
|
1793 |
|
1794 |
|
1795 |
1.1 xml/htdocs/doc/zh_cn/gnome-config.xml |
1796 |
|
1797 |
file : http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/doc/zh_cn/gnome-config.xml?rev=1.1&view=markup |
1798 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/doc/zh_cn/gnome-config.xml?rev=1.1&content-type=text/plain |
1799 |
|
1800 |
Index: gnome-config.xml |
1801 |
=================================================================== |
1802 |
<?xml version='1.0' encoding='UTF-8'?> |
1803 |
<!DOCTYPE guide SYSTEM "/dtd/guide.dtd"> |
1804 |
|
1805 |
<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/zh_cn/gnome-config.xml,v 1.1 2007/09/17 17:54:10 r0bertz Exp $ --> |
1806 |
<!-- English CVS version: 1.19 --> |
1807 |
|
1808 |
<guide link="/doc/zh_cn/gnome-config.xml" lang="zh_cn"> |
1809 |
|
1810 |
<title>GNOME配置指南</title> |
1811 |
|
1812 |
<author title="作者"> |
1813 |
<mail link="swift@g.o">Sven Vermeulen</mail> |
1814 |
</author> |
1815 |
<author title="编辑"> |
1816 |
<mail link="lars@×××××××.net">Lars Strojny</mail> |
1817 |
</author> |
1818 |
<author title="译者"> |
1819 |
<mail link="joanphan@×××××.com">Hans Joanphan</mail> |
1820 |
</author> |
1821 |
<author title="译者"> |
1822 |
<mail link="tysnoo@×××××.com">叶宝泰</mail> |
1823 |
</author> |
1824 |
|
1825 |
<abstract> |
1826 |
GNOME是一个常用的桌面环境。本指南尝试描述所有关于GNOME的方方面面,包括安装、配置、使用…… |
1827 |
</abstract> |
1828 |
|
1829 |
<!-- The content of this document is licensed under the CC-BY-SA license --> |
1830 |
<!-- See http://creativecommons.org/licenses/by-sa/2.5 --> |
1831 |
<license/> |
1832 |
|
1833 |
<version>1.16</version> |
1834 |
<date>2007-07-05</date> |
1835 |
|
1836 |
<chapter> |
1837 |
<title>GNOME是什么?</title> |
1838 |
<section> |
1839 |
<title>项目</title> |
1840 |
<body> |
1841 |
|
1842 |
<p> |
1843 |
<uri link="http://www.gnome.org">GNOME</uri>是一个Unix/Linux桌面套件及开发平台,GNOME项目是专注于GNOME开发的自由软件项目。<uri link="http://foundation.gnome.org">GNOME基金会</uri>负责协调GNOME项目开发和其他相关事务。 |
1844 |
</p> |
1845 |
|
1846 |
</body> |
1847 |
</section> |
1848 |
<section> |
1849 |
<title>软件</title> |
1850 |
<body> |
1851 |
|
1852 |
<p> |
1853 |
GNOME是一个桌面环境,也是一个开发平台。这份自由软件是众多行业领军者的首选桌面。他同时面向商业用户、家庭用户和开发人员。 |
1854 |
</p> |
1855 |
|
1856 |
</body> |
1857 |
</section> |
1858 |
<section> |
1859 |
<title>社区</title> |
1860 |
<body> |
1861 |
|
1862 |
<p> |
1863 |
与任何一款大型自由软件项目一样,GNOME拥有广泛的用户和开发群。<uri link="http://www.gnomedesktop.org">Footnotes</uri>中为用户提供GNOME桌面的新闻,<uri link="http://planet.gnome.org">GnomePlanet</uri>面向热心人/贡献者的,而<uri link="http://developer.gnome.org">Developer.Gnome.Org</uri>是面向GNOME开发人员的。 |
1864 |
</p> |
1865 |
|
1866 |
</body> |
1867 |
</section> |
1868 |
</chapter> |
1869 |
<chapter> |
1870 |
<title>安装GNOME</title> |
1871 |
<section> |
1872 |
<title>您需要什么?</title> |
1873 |
<body> |
1874 |
|
1875 |
<p> |
1876 |
开始安装GNOME之前,您可能要编辑一下USE变量。确保你的/etc/make.conf中列出的USE变量包含<c>gtk</c>和<c>gnome</c>。如果您想支持<c>hald</c>——硬件抽象层守护进程,请添加<c>hal</c>到你的USE标记中。USE变量<c>avahi</c>为GNOME提供DNS检测(类似Mac OS X下的Rendevouz)。如果您不想支持KDE(另一个大型桌面环境),去掉<c>qt*</c>、<c>arts</c>和<c>kde</c>变量。 |
1877 |
</p> |
1878 |
|
1879 |
<pre caption="/etc/make.conf中USE范例"> |
1880 |
USE="-qt3 -qt4 -arts -kde gtk gnome hal avahi" |
1881 |
</pre> |
1882 |
|
1883 |
<p> |
1884 |
您可以添加<c>branding</c>USE标记来获得一个可爱的“Gentoo牌”启动画面,取代默认的Gnome启动画面: |
1885 |
</p> |
1886 |
|
1887 |
<pre caption="启用Gentoo品牌"> |
1888 |
# <i>echo "gnome-base/gnome-session branding" >> /etc/portage/package.use</i> |
1889 |
</pre> |
1890 |
|
1891 |
<p> |
1892 |
完成之后,通过emerge <c>gnome</c>来开始安装GNOME: |
1893 |
</p> |
1894 |
|
1895 |
<pre caption="安装GNOME"> |
1896 |
# <i>emerge gnome</i> |
1897 |
</pre> |
1898 |
|
1899 |
<p> |
1900 |
您也可以选择使用<c>gnome-light</c>进行最小化的Gnome安装: |
1901 |
</p> |
1902 |
|
1903 |
<pre caption="安装一个最小化的GNOME环境"> |
1904 |
# <i>emerge gnome-light</i> |
1905 |
</pre> |
1906 |
|
1907 |
<p> |
1908 |
这将花费一点时间,因此您可以先读一读从前妈妈给你买的而你却从未翻过的那些书本。装完了?很好,现在更新你的环境变量: |
1909 |
</p> |
1910 |
|
1911 |
<pre caption="更新环境变量"> |
1912 |
# <i>env-update && source /etc/profile</i> |
1913 |
</pre> |
1914 |
|
1915 |
<p> |
1916 |
如果您认真观察前面<c>emerge</c>命令的输出,会注意到它建议使用<c>gamin</c>让nautilus和gnome-vfs监视文件的变动: |
1917 |
</p> |
1918 |
|
1919 |
<pre caption="安装gamin,一个文件变更监视器"> |
1920 |
# <i>emerge gamin</i> |
1921 |
</pre> |
1922 |
|
1923 |
<impo> |
1924 |
如果您是从<c>fam</c>(一个老旧过时的文件监视器)转换到<c>gamin</c>,那么您必须从所有的启动级别中删除<c>famd</c>然后将它卸载: |
1925 |
</impo> |
1926 |
|
1927 |
<pre caption="可选:从fam转换到gamin"> |
1928 |
# <i>rc-update del famd</i> |
1929 |
# <i>emerge --unmerge app-admin/fam</i> |
1930 |
</pre> |
1931 |
|
1932 |
<p> |
1933 |
接下来我们做完剩余的服务。 |
1934 |
</p> |
1935 |
|
1936 |
<pre caption="将hald和avahi-dnsconfd添加到默认启动级别"> |
1937 |
# <i>/etc/init.d/hald start</i> |
1938 |
# <i>rc-update add hald default</i> |
1939 |
|
1940 |
# <i>/etc/init.d/avahi-dnsconfd start</i> |
1941 |
# <i>rc-update add avahi-dnsconfd default</i> |
1942 |
</pre> |
1943 |
|
1944 |
</body> |
1945 |
</section> |
1946 |
<section> |
1947 |
<title>第一印象</title> |
1948 |
<body> |
1949 |
|
1950 |
<p> |
1951 |
让我们先看一看刚刚所安装的。退出root shell并以普通用户登录。我们将配置一下会话,然后发出<c>startx</c>命令启动GNOME(参考<uri link="/doc/zh_cn/xorg-config.xml">X服务器配置指南</uri>中的<uri link="/doc/zh_cn/xorg-config.xml#using_startx">使用startx</uri>): |
1952 |
</p> |
1953 |
|
1954 |
<pre caption="设定GNOME为默认桌面环境"> |
1955 |
$ <i>echo "exec gnome-session" > ~/.xinitrc</i> |
1956 |
</pre> |
1957 |
|
1958 |
<p> |
1959 |
现在请执行<c>startx</c>以启动图形环境: |
1960 |
</p> |
1961 |
|
1962 |
<pre caption="启动GNOME"> |
1963 |
$ <i>startx</i> |
1964 |
</pre> |
1965 |
|
1966 |
<p> |
1967 |
如果一切正常,您将受到GNOME的欢迎问候。祝贺你。现在让我们看看如何配置GNOME以迎合您的需求。 |
1968 |
</p> |
1969 |
|
1970 |
</body> |
1971 |
</section> |
1972 |
</chapter> |
1973 |
<chapter> |
1974 |
<title>配置GNOME</title> |
1975 |
<section> |
1976 |
<title>GNOME的图形登录管理器</title> |
1977 |
<body> |
1978 |
|
1979 |
<p> |
1980 |
如果您想让GNOME显示管理器(GDM)在开机时自动运行(那样就可以通过图形界面登录),必须将<c>xdm</c>启动脚本添加到默认的运行级别: |
1981 |
</p> |
1982 |
|
1983 |
<pre caption="将xdm添加到默认运行级别"> |
1984 |
# <i>rc-update add xdm default</i> |
1985 |
</pre> |
1986 |
|
1987 |
<p> |
1988 |
现在编辑<path>/etc/conf.d/xdm</path>并修改DISPLAYMANAGER变量。 |
1989 |
</p> |
1990 |
|
1991 |
<pre caption="编辑/etc/conf.d/xdm"> |
1992 |
DISPLAYMANAGER="gdm" |
1993 |
</pre> |
1994 |
|
1995 |
<p> |
1996 |
如果您现在重启,GNOME显示管理器就会提示您输入用户名和密码,并且将默认使用GNOME作为桌面环境(尽管肯定会有一个选项让您可以从<path>/usr/share/xsessions/</path>中选择另一个可用的)。这样的话,如果您使用GDM,就不需要编辑<path>~/.xinitrc</path>了。 |
1997 |
</p> |
1998 |
|
1999 |
<p> |
2000 |
要使用<c>hald</c>的功能,只需启动<c>gnome-volume-manager</c>然后编辑它的选项。并且,需要将您的用户添加到<c>plugdev</c>组。 |
2001 |
</p> |
2002 |
|
2003 |
</body> |
2004 |
</section> |
2005 |
</chapter> |
2006 |
</guide> |
2007 |
|
2008 |
|
2009 |
|
2010 |
1.1 xml/htdocs/doc/zh_cn/gpm.xml |
2011 |
|
2012 |
file : http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/doc/zh_cn/gpm.xml?rev=1.1&view=markup |
2013 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/doc/zh_cn/gpm.xml?rev=1.1&content-type=text/plain |
2014 |
|
2015 |
Index: gpm.xml |
2016 |
=================================================================== |
2017 |
<?xml version="1.0" encoding="utf-8"?> |
2018 |
<!DOCTYPE guide SYSTEM "/dtd/guide.dtd"> |
2019 |
|
2020 |
<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/zh_cn/gpm.xml,v 1.1 2007/09/17 17:54:10 r0bertz Exp $ --> |
2021 |
<!-- English CVS version: 1.4 --> |
2022 |
|
2023 |
<guide link="/doc/zh_cn/gpm.xml" lang="zh_cn"> |
2024 |
<title>在命令行下用鼠标</title> |
2025 |
|
2026 |
<author title="作者"> |
2027 |
<mail link="nightmorph@g.o">Joshua Saddler</mail> |
2028 |
</author> |
2029 |
<author title="译者"> |
2030 |
<mail link="jjj3112000@×××.com">Zezhou Jiang</mail> |
2031 |
</author> |
2032 |
|
2033 |
<abstract> |
2034 |
这个指南将给你展示如何在命令行界面下建立并使用GPM(the General Purpose Mouse server)。这个在你新安装Gentoo或者你的系统无法或不用X服务时是非常有用的。 |
2035 |
</abstract> |
2036 |
|
2037 |
<!-- The content of this document is licensed under the CC-BY-SA license --> |
2038 |
<!-- See http://creativecommons.org/licenses/by-sa/2.5 --> |
2039 |
<license/> |
2040 |
|
2041 |
<version>1.2</version> |
2042 |
<date>2006-02-17</date> |
2043 |
|
2044 |
<chapter> |
2045 |
<title>得到GPM</title> |
2046 |
<section> |
2047 |
<body> |
2048 |
|
2049 |
<p> |
2050 |
如果你刚装好Gentoo,你很可能还没有把你的鼠标设置成能在命令行界面下工作。或者可能你不用或不需要X服务,但是你仍需要使用鼠标。解决方法很简单:<c>gpm</c>,通用目的鼠标服务。 |
2051 |
</p> |
2052 |
|
2053 |
<p> |
2054 |
首先,你需要得到GPM: |
2055 |
</p> |
2056 |
|
2057 |
<pre caption="获得GPM"> |
2058 |
# <i>emerge gpm</i> |
2059 |
</pre> |
2060 |
|
2061 |
<p> |
2062 |
你可能在编译的时候会注意到几条有关配置服务的警告信息。你必须在启动GPM前进行配置。 |
2063 |
</p> |
2064 |
|
2065 |
</body> |
2066 |
</section> |
2067 |
</chapter> |
2068 |
|
2069 |
<chapter> |
2070 |
<title>配置GPM</title> |
2071 |
<section> |
2072 |
<body> |
2073 |
|
2074 |
<p> |
2075 |
在你能够使用GPM前,你必须取消几条有关你鼠标的位置和协议的内容的注释。你可以编辑GPM的配置文件来做这个: |
2076 |
</p> |
2077 |
|
2078 |
<pre caption="建立GPM"> |
2079 |
# <i>nano /etc/conf.d/gpm</i> |
2080 |
</pre> |
2081 |
|
2082 |
<p> |
2083 |
对于我来说,我有一个在<path>/dev/input/mouse0</path>的鼠标。所以,我解除了<path>/dev/input/mice</path>的注释,因为这是一个为系统中的所有鼠标准备的一个通用设备和协议。试着在使用<path>/dev/psaux</path>之前使用<path>/dev/input/mice</path>,因为前者在最新的2.6内核中已经不被推荐而且被禁用了。如果<path>/dev/input/mice</path>失败了,然后回去试试别的设备。这是我的例子<path>/etc/conf.d/gpm</path>: |
2084 |
</p> |
2085 |
|
2086 |
<pre caption="GPM配置实例"> |
2087 |
<comment>(请取消你的鼠标的类型和适当的MOUSEDEV的行的注释)</comment> |
2088 |
|
2089 |
#MOUSE=ps2 |
2090 |
MOUSE=imps2 |
2091 |
#MOUSEDEV=/dev/psaux |
2092 |
MOUSEDEV=/dev/input/mice |
2093 |
</pre> |
2094 |
|
2095 |
<p> |
2096 |
如果你有一个滚轮鼠标,你将会希望用imps2协议,所以取消那行的注释。如果imps2和ps2都无法为你工作,请参考GPM信息页(<c>info gpm</c>)来找到其他可尝试的协议。同时,如果你想要在终端中点击超链接去导航到一个网站,那么跟着<c>/etc/conf.d/gpm</c>里的提示是一个好主意: |
2097 |
</p> |
2098 |
|
2099 |
<pre caption="其他选项"> |
2100 |
<comment>(如果你希望GPM能理解URL中使用的字符集或里面含有~或者:字符的名字,请取消这一行的注释。把它开启将会是一个好主意!)</comment> |
2101 |
|
2102 |
APPEND="-l \"a-zA-Z0-9_.:~/\300-\326\330-\366\370-\377\"" |
2103 |
</pre> |
2104 |
|
2105 |
<p> |
2106 |
剩下的conf.d文件包含了一些你使用鼠标服务的其他建议;解除各种你所需要的选项的注释。请参见<c>man gpm</c>来得到更多的信息。 |
2107 |
</p> |
2108 |
|
2109 |
</body> |
2110 |
</section> |
2111 |
</chapter> |
2112 |
|
2113 |
<chapter> |
2114 |
<title>运行GPM</title> |
2115 |
<section> |
2116 |
<body> |
2117 |
|
2118 |
<p> |
2119 |
现在你的鼠标服务已经安装并配置好了,现在是时间来使用它了: |
2120 |
</p> |
2121 |
|
2122 |
<pre caption="GPM的init脚本"> |
2123 |
# <i>/etc/init.d/gpm start</i> |
2124 |
</pre> |
2125 |
|
2126 |
<p> |
2127 |
你应该能看见一个块状的指针出现。记住只有root才能运行GPM的init脚本。然而,要避免每次你启动一个新对话的时候都要运行<c>su</c>然后再运行脚本,为什么不在你每次开启你的电脑时都启动GPM呢? |
2128 |
</p> |
2129 |
|
2130 |
<pre caption="把GPM加入到默认运行程级"> |
2131 |
# <i>rc-update add gpm default</i> |
2132 |
</pre> |
2133 |
|
2134 |
<p> |
2135 |
现在,无论何时你启动你的电脑,每次你到登陆提示时都会被命令行鼠标迎接。即使你不用root用户登陆,鼠标服务仍然会继续运行。 |
2136 |
</p> |
2137 |
|
2138 |
</body> |
2139 |
</section> |
2140 |
</chapter> |
2141 |
|
2142 |
<chapter> |
2143 |
<title>使用GPM</title> |
2144 |
<section> |
2145 |
<title>复制和粘贴</title> |
2146 |
<body> |
2147 |
|
2148 |
<p> |
2149 |
用鼠标服务来复制和粘贴大块的文本会十分简单。只要简单地用鼠标左键把文本高亮标记起来(当你放开鼠标时它仍会保留高亮),如果你希望的话,切换到一个不同的终端,用鼠标指针定位,然后按下鼠标中键来在你的指针所指的位置粘贴文本。记住,你也可以在不离开你开启的终端时使用复制粘贴。这将使发送显示出的错误信息到<uri link="http://forums.gentoo.org">Gentoo Forums</uri>变得及其简单。 |
2150 |
</p> |
2151 |
|
2152 |
</body> |
2153 |
</section> |
2154 |
<section> |
2155 |
<title>文本模式浏览和GPM</title> |
2156 |
<body> |
2157 |
|
2158 |
<p> |
2159 |
如果你有一个信息在一个屏幕上,还有一个文本浏览器在另一个屏幕上,你可以高亮它然后复制那个错误信息,然后切换到另一个终端,左键点击适当的文本输入框来选择它,然后按下鼠标中键。啊,你的错误信息现在已经贴到论坛上了。 |
2160 |
</p> |
2161 |
|
2162 |
<p> |
2163 |
虽然讨论文本浏览器有些超出指南的范围,但是不可避免地用户会需要找一个兼容的命令行浏览器。虽然<c>lynx</c>可能是最老也是构建最好的浏览器,它的界面却没有鼠标支持和识别。相反,试试用<c>links</c>吧,它有出色的鼠标整合。 |
2164 |
</p> |
2165 |
|
2166 |
<pre caption="得到links"> |
2167 |
# <i>emerge links</i> |
2168 |
</pre> |
2169 |
|
2170 |
<p> |
2171 |
这个指南包括了如何在命令行使用鼠标的指导。祝你使用鼠标愉快! |
2172 |
</p> |
2173 |
|
2174 |
</body> |
2175 |
</section> |
2176 |
</chapter> |
2177 |
</guide> |
2178 |
|
2179 |
|
2180 |
|
2181 |
1.1 xml/htdocs/doc/zh_cn/grub-error-guide.xml |
2182 |
|
2183 |
file : http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/doc/zh_cn/grub-error-guide.xml?rev=1.1&view=markup |
2184 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/doc/zh_cn/grub-error-guide.xml?rev=1.1&content-type=text/plain |
2185 |
|
2186 |
Index: grub-error-guide.xml |
2187 |
=================================================================== |
2188 |
<?xml version="1.0" encoding="UTF-8"?> |
2189 |
<!DOCTYPE guide SYSTEM "/dtd/guide.dtd"> |
2190 |
|
2191 |
<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/zh_cn/grub-error-guide.xml,v 1.1 2007/09/17 17:54:10 r0bertz Exp $ --> |
2192 |
<!-- English CVS version: 1.14 --> |
2193 |
|
2194 |
<guide link="/doc/zh_cn/grub-error-guide.xml" lang="zh_cn"> |
2195 |
<title>Gentoo Grub错误集锦</title> |
2196 |
|
2197 |
<author title="审校">Hartwig Brandl</author> |
2198 |
<author title="编辑"> |
2199 |
<mail link="deathwing00@g.o">Ioannis Aslanidis</mail> |
2200 |
</author> |
2201 |
<author title="编辑"> |
2202 |
<mail link="swift@g.o">Sven Vermeulen</mail> |
2203 |
</author> |
2204 |
|
2205 |
<abstract> |
2206 |
这个错误集锦的目的在于列出人们可能会遇到的GRUB的问题和错误。所有这些解决方案是由很多Gentoo论坛中的使用者而获得的。 |
2207 |
</abstract> |
2208 |
|
2209 |
<!-- The content of this document is licensed under the CC-BY-SA license --> |
2210 |
<!-- See http://creativecommons.org/licenses/by-sa/2.5 --> |
2211 |
<license/> |
2212 |
|
2213 |
<version>1.8</version> |
2214 |
<date>2005-12-21</date> |
2215 |
|
2216 |
<chapter> |
2217 |
<title>篇首语</title> |
2218 |
|
2219 |
<section> |
2220 |
<title>致谢</title> |
2221 |
<body> |
2222 |
|
2223 |
<p> |
2224 |
感谢<uri link="http://forums.gentoo.org/profile.php?mode=viewprofile&u=18420">Earthwings</uri>,<uri link="http://forums.gentoo.org/profile.php?mode=viewprofile&u=39305">penetrode</uri>,<uri link="http://forums.gentoo.org/profile.php?mode=viewprofile&u=41638">loyaltonone</uri>,<uri link="http://forums.gentoo.org/profile.php?mode=viewprofile&u=4980">pilla</uri>,<uri link="http://forums.gentoo.org/profile.php?mode=viewprofile&u=3139">airhead</uri>,<uri link="http://forums.gentoo.org/profile.php?mode=viewprofile&u=13816">nephros</uri>,<uri link="http://forums.gentoo.org/profile.php?mode=viewprofile&u=25859">yamakawa</uri> 和其他所有人在原<uri link="http://forums.gentoo.org/viewtopic.php?t=122656">帖</uri>上发表的建议。 |
2225 |
</p> |
2226 |
|
2227 |
</body> |
2228 |
</section> |
2229 |
|
2230 |
<section> |
2231 |
<title>免责声明</title> |
2232 |
<body> |
2233 |
|
2234 |
<p> |
2235 |
示例中提供的仅是例子,请务必确保根据你的系统的实际情况改变分区号及类似信息。遵照本文档中所提供的解决方案须自己承担风险。 |
2236 |
</p> |
2237 |
|
2238 |
</body> |
2239 |
</section> |
2240 |
</chapter> |
2241 |
|
2242 |
<chapter> |
2243 |
<title>Grub loading, please wait..</title> |
2244 |
<section> |
2245 |
<title>状况</title> |
2246 |
<body> |
2247 |
|
2248 |
<pre caption="Grub输出"> |
2249 |
GRUB loading stage 1.5 |
2250 |
GRUB loading, please wait... |
2251 |
</pre> |
2252 |
|
2253 |
<p> |
2254 |
出现这段信息之后,系统停止。如果你试图用grub软盘引导系统,这种问题就会消失。 |
2255 |
</p> |
2256 |
|
2257 |
</body> |
2258 |
</section> |
2259 |
<section> |
2260 |
<title>解决方案</title> |
2261 |
<body> |
2262 |
|
2263 |
<p> |
2264 |
根据<uri link="http://forums.gentoo.org/profile.php?mode=viewprofile&u=3134">The_Bell</uri>你可以改变你BIOS中的引导命令。 |
2265 |
</p> |
2266 |
|
2267 |
<p> |
2268 |
调整你的BIOS使它不要首先从软盘启动。 |
2269 |
</p> |
2270 |
|
2271 |
<p> |
2272 |
<uri link="http://forums.gentoo.org/profile.php?mode=viewprofile&u=39305">penetrode</uri>上说这可能是由于错误的CFLAGS设定引起的。尽管现在的grub ebuild过滤掉了<c>-fstack-protector</c>,如果其他的不起作用运用干净的CFLAG重新编译grub也不会有问题。 |
2273 |
</p> |
2274 |
|
2275 |
<pre caption="使用干净的CFLAG重构GRUB"> |
2276 |
# <i>CFLAGS="-O2 -march=i686 -fomit-frame-pointer -pipe" emerge grub</i> |
2277 |
</pre> |
2278 |
|
2279 |
</body> |
2280 |
</section> |
2281 |
</chapter> |
2282 |
|
2283 |
<chapter> |
2284 |
<title>GRUB错误12</title> |
2285 |
<section> |
2286 |
<title>状况</title> |
2287 |
<body> |
2288 |
|
2289 |
<pre caption="Grub输出"> |
2290 |
12:无效设备请求 |
2291 |
</pre> |
2292 |
|
2293 |
<p> |
2294 |
如果设备字符串语法正确也会返回这个错误,另外这种错误的出现又不属于任何其它的错误。 |
2295 |
</p> |
2296 |
|
2297 |
</body> |
2298 |
</section> |
2299 |
<section> |
2300 |
<title>解决方案</title> |
2301 |
<body> |
2302 |
|
2303 |
<p> |
2304 |
当你通过交互命令在你的引导设备中安装grub时,你是否在grub命令提示符后执行下面两行呢? |
2305 |
</p> |
2306 |
|
2307 |
<pre caption="交互安装命令"> |
2308 |
grub> <i>root (hd0,0)</i> |
2309 |
grub> <i>setup (hd0)</i> |
2310 |
</pre> |
2311 |
|
2312 |
<p> |
2313 |
(hd0,0)应该用你的引导分区替换,而(hd0)用你选择的HDD替换。谨记(hd0)将安装引导管理器到你的第一块硬盘(即主引导盘)的主引导记录(MBR)中。 |
2314 |
</p> |
2315 |
|
2316 |
</body> |
2317 |
</section> |
2318 |
</chapter> |
2319 |
|
2320 |
<chapter> |
2321 |
<title>Grub错误15</title> |
2322 |
<section> |
2323 |
<title>状况</title> |
2324 |
<body> |
2325 |
|
2326 |
<p> |
2327 |
这个错误可能会发生在GRUB配置的两个不同阶段,或是在初始化配置期间(将GRUB安装在主引导记录中)抑或是在引导系统和试图连接Linux时(也或者是其它情况)。 |
2328 |
</p> |
2329 |
|
2330 |
<pre caption="Grub输出-初始化配置"> |
2331 |
grub> <i>root (hd0,0)</i> |
2332 |
Filesystem type is xfs, partition type 0x83 |
2333 |
|
2334 |
grub> <i>setup (hd0)</i> |
2335 |
Checking if "/boot/grub/stage1" exists... no |
2336 |
Checking if "/grub/stage1" exists... no |
2337 |
|
2338 |
Error 15: File not found |
2339 |
</pre> |
2340 |
|
2341 |
<pre caption="Grub输出──引导一条记录"> |
2342 |
Booting 'gentoo Linux' |
2343 |
|
2344 |
root (hd0,0) |
2345 |
Filesystem type is ext2fs, partition type 0x83 |
2346 |
kernel (hd0,0)/boot/kernel-2.4.20 root=/dev/hda3 vga=792 |
2347 |
|
2348 |
Error 15: File not found |
2349 |
Press any key to continue... |
2350 |
</pre> |
2351 |
|
2352 |
</body> |
2353 |
</section> |
2354 |
<section> |
2355 |
<title>解决方案──初始化配置</title> |
2356 |
<body> |
2357 |
|
2358 |
<p> |
2359 |
如果特定的文件名没有找到而其它的(诸如磁盘和分区信息)是正确的将返回这一错误。 |
2360 |
</p> |
2361 |
|
2362 |
<p> |
2363 |
幸运的是,这条错误标明了缺少一个内核映像文件。你要确保你的引导分区中存在以上提到的相关的文件。 |
2364 |
</p> |
2365 |
|
2366 |
<p> |
2367 |
为了找到你的内核的精确命名,从一个安装光盘中启动,挂载你的根分区和引导分区(如果可用的话)。然后,切换到你的Gentoo系统并列出所有可用的文件,看哪一个内核映像是你要启用的: |
2368 |
</p> |
2369 |
|
2370 |
<pre caption="调整存在的内核映像"> |
2371 |
# <i>cd /boot</i> |
2372 |
# <i>ls</i> |
2373 |
</pre> |
2374 |
|
2375 |
<p> |
2376 |
这将列出所有在你的引导分区所获得的内核。如果你的内核不存在,请确保你已经编译了一个内核(用<c>genkernel</c>或是手工编译): |
2377 |
</p> |
2378 |
|
2379 |
<pre caption="重新编译内核"> |
2380 |
# <i>cd /usr/src/linux/</i> |
2381 |
# <i>make menuconfig</i> |
2382 |
# <i>make</i> |
2383 |
</pre> |
2384 |
|
2385 |
<p> |
2386 |
并将它复制到你的引导分区: |
2387 |
</p> |
2388 |
|
2389 |
<pre caption="复制内核"> |
2390 |
# <i>cp /usr/src/linux/arch/i386/boot/bzImage /boot</i> |
2391 |
</pre> |
2392 |
|
2393 |
<p> |
2394 |
调整内核的名字使其和你的<path>grub.conf</path>文件中定义的相同。另外还要确保你的<path>grub.conf</path>文件中关于<c>内核</c>的行关联到那个分区(相对的或绝对的)。 |
2395 |
</p> |
2396 |
|
2397 |
<p> |
2398 |
另外一个报告的错误是BIOS忽略了内核或grub stages所在的盘。除此之外,grub保存它stages的分区不应使用RAID-5(或其它的剥离技术)设定。 |
2399 |
</p> |
2400 |
|
2401 |
</body> |
2402 |
</section> |
2403 |
<section> |
2404 |
<title>解决方案──引导一个选项</title> |
2405 |
<body> |
2406 |
|
2407 |
<p> |
2408 |
首先,调整你所用的<c>root</c>和<c>setup</c>行是正确的。 |
2409 |
</p> |
2410 |
|
2411 |
<p> |
2412 |
如果你确定它们是可用的,那么你<e>可能</e>用了有缺陷的GRUB版本(0.93.20031222)。请升级你的Portage树或是屏蔽此版的grub: |
2413 |
</p> |
2414 |
|
2415 |
<pre caption="屏蔽Grub"> |
2416 |
<comment>(在chrooted环境下执行这些)</comment> |
2417 |
# <i>echo "=sys-boot/grub-0.93.20031222" >> /etc/portage/package.mask</i> |
2418 |
# <i>emerge grub -p</i> |
2419 |
</pre> |
2420 |
|
2421 |
<p> |
2422 |
你同样可以用由GRUB作者所推荐的<c>grub-install</c>脚本: |
2423 |
</p> |
2424 |
|
2425 |
<pre caption="运用grub-install"> |
2426 |
<comment>(如果你使用一个单独的引导分区你则还需要--root-directory选项,否则就不用管它)</comment> |
2427 |
# <i>grub-install --root-directory=/boot /dev/hda</i> |
2428 |
</pre> |
2429 |
|
2430 |
<p> |
2431 |
如果这些都失败了,你的引导分区可能已经损坏。请检查分区错误: |
2432 |
</p> |
2433 |
|
2434 |
<pre caption="检查分区错误"> |
2435 |
<comment>(确保引导分区,在此处是/dev/hda1,</comment> |
2436 |
# <i>fsck -y /dev/hda1</i> |
2437 |
</pre> |
2438 |
|
2439 |
</body> |
2440 |
</section> |
2441 |
</chapter> |
2442 |
|
2443 |
<chapter> |
2444 |
<title>Grub错误17</title> |
2445 |
<section> |
2446 |
<title>状况</title> |
2447 |
<body> |
2448 |
|
2449 |
<pre caption="Grub输出"> |
2450 |
root (hd0,0) |
2451 |
filesystem type unknown partition type 0x7 |
2452 |
|
2453 |
Error 17 : Cannot mount selected partition |
2454 |
</pre> |
2455 |
|
2456 |
</body> |
2457 |
</section> |
2458 |
<section> |
2459 |
<title>解决方案</title> |
2460 |
<body> |
2461 |
|
2462 |
<p> |
2463 |
如果分区请求存在而文件系统类型不能被GRUB识别将返回此错误信息。 |
2464 |
</p> |
2465 |
|
2466 |
<p> |
2467 |
请一定检查你的root(x,y)在你的grub.conf中已经设置。 |
2468 |
</p> |
2469 |
|
2470 |
<p> |
2471 |
另外,如果你要引导Windows,请确保你的<path>grub.conf</path>文件中有<c>root (hdX,Y)</c>(或<c>rootnoverify (hdX,Y)</c>)和<c>chainloader (hdX,Y)+1</c>。 |
2472 |
</p> |
2473 |
|
2474 |
</body> |
2475 |
</section> |
2476 |
</chapter> |
2477 |
|
2478 |
<chapter> |
2479 |
<title>Grub错误18</title> |
2480 |
<section> |
2481 |
<title>状况</title> |
2482 |
<body> |
2483 |
|
2484 |
<pre caption="Grub输出"> |
2485 |
kernel (hd1,4)/bzImage root=/dev/hdb7 |
2486 |
|
2487 |
Error 18: Selected cylinder exceeds max supported by BIOS |
2488 |
</pre> |
2489 |
|
2490 |
</body> |
2491 |
</section> |
2492 |
<section> |
2493 |
<title>解决方案</title> |
2494 |
<body> |
2495 |
|
2496 |
<p> |
2497 |
当试图读取的线性块地址在BIOS可转换区之外时返回这个错误。这通常出现在如果你的硬盘大于BIOS可以控制(旧机器上(E)IDE硬盘的512MB和通常状况下高于8G)。 |
2498 |
</p> |
2499 |
|
2500 |
<p> |
2501 |
试试升级你的BIOS或将你的引导分区移动到前面(或至少到恰当的范围内)。 |
2502 |
</p> |
2503 |
|
2504 |
</body> |
2505 |
</section> |
2506 |
</chapter> |
2507 |
|
2508 |
<chapter> |
2509 |
<title>GRUB GRUB GRUB GRUB GRUB ...</title> |
2510 |
<section> |
2511 |
<title>状况</title> |
2512 |
<body> |
2513 |
|
2514 |
<pre caption="Grub输出"> |
2515 |
GRUB GRUB GRUB GRUB GRUB GRUB GRUB GRUB GRUB GRUB GRUB GRUB GRUB GRUB GRUB |
2516 |
GRUB GRUB GRUB GRUB GRUB GRUB GRUB GRUB GRUB GRUB GRUB GRUB GRUB GRUB GRUB |
2517 |
... |
2518 |
</pre> |
2519 |
|
2520 |
</body> |
2521 |
</section> |
2522 |
<section> |
2523 |
<title>解决方案</title> |
2524 |
<body> |
2525 |
|
2526 |
<p> |
2527 |
通过<uri link="http://forums.gentoo.org/profile.php?mode=viewprofile&u=3139">airhead</uri>可以知道这可能是由让你的bios自动检测你的硬盘引起的。试试将你的bios选项设定成User Type HDD。 |
2528 |
</p> |
2529 |
|
2530 |
<p> |
2531 |
另外一种可能是你将Grub装在主引导分区上和试图将它重新安装(例如是因为更换硬盘)但是运用了错误的<c>setup</c>和<c>root</c>命令。 |
2532 |
</p> |
2533 |
|
2534 |
</body> |
2535 |
</section> |
2536 |
</chapter> |
2537 |
|
2538 |
<chapter> |
2539 |
<title>检查设备推测BIOS驱动。这可能要花费很长时间。</title> |
2540 |
<section> |
2541 |
<title>状况</title> |
2542 |
<body> |
2543 |
|
2544 |
<p> |
2545 |
当你试图安装grub,它在显示下面几行后挂起: |
2546 |
</p> |
2547 |
|
2548 |
<pre caption="Grub输出"> |
2549 |
# <i>grub</i> |
2550 |
|
2551 |
Probing devices to guess BIOS drives. This may take a long time. |
2552 |
</pre> |
2553 |
|
2554 |
</body> |
2555 |
</section> |
2556 |
<section> |
2557 |
<title>解决方案</title> |
2558 |
<body> |
2559 |
|
2560 |
<p> |
2561 |
一个报告的原因是由外来的硬盘设备配置文件引起的,如在一条线上有多个ultra/non-ultra DMA硬盘。 |
2562 |
</p> |
2563 |
|
2564 |
</body> |
2565 |
</section> |
2566 |
</chapter> |
2567 |
|
2568 |
<chapter> |
2569 |
<title>安装Grub时,系统挂起</title> |
2570 |
<section> |
2571 |
<title>状况</title> |
2572 |
<body> |
2573 |
|
2574 |
<p> |
2575 |
安装Grub时,系统挂起 |
2576 |
</p> |
2577 |
|
2578 |
<pre caption="Grub输出"> |
2579 |
# <i>grub</i> |
2580 |
<comment>(在这一步,安装停止)</comment> |
2581 |
</pre> |
2582 |
|
2583 |
</body> |
2584 |
</section> |
2585 |
<section> |
2586 |
<title>解决方案</title> |
2587 |
<body> |
2588 |
|
2589 |
<p> |
2590 |
如果你没有软盘设备,你是否使用了--no-floppy开关? |
2591 |
</p> |
2592 |
|
2593 |
<pre caption="使用--no-floppy开关安装grub"> |
2594 |
# <i>grub --no-floppy</i> |
2595 |
</pre> |
2596 |
|
2597 |
</body> |
2598 |
</section> |
2599 |
</chapter> |
2600 |
|
2601 |
<chapter> |
2602 |
<title>Uncompressing Linux... Ok, booting the kernel.</title> |
2603 |
<section> |
2604 |
<title>状况</title> |
2605 |
<body> |
2606 |
|
2607 |
<p> |
2608 |
出现下面的行后系统挂起: |
2609 |
</p> |
2610 |
|
2611 |
<pre caption="Linux输出"> |
2612 |
Uncompressing Linux... Ok, booting the kernel. |
2613 |
</pre> |
2614 |
|
2615 |
</body> |
2616 |
</section> |
2617 |
<section> |
2618 |
<title>解决方案</title> |
2619 |
<body> |
2620 |
|
2621 |
<p> |
2622 |
严格来讲,这并不是grub错误。一种可能的原因是ACPI没有正常工作但是在内核中却已经将它启用。请尝试在bios中禁用它。 |
2623 |
</p> |
2624 |
|
2625 |
</body> |
2626 |
</section> |
2627 |
</chapter> |
2628 |
|
2629 |
<chapter> |
2630 |
<title>Grub只显示一个Grub提示符</title> |
2631 |
<section> |
2632 |
<title>状况</title> |
2633 |
<body> |
2634 |
|
2635 |
<p> |
2636 |
当引导系统时,返回一个grub命令提示符而非一个你在<path>grub.conf</path>文件中所定义的选单。 |
2637 |
</p> |
2638 |
|
2639 |
</body> |
2640 |
</section> |
2641 |
<section> |
2642 |
<title>解决方案</title> |
2643 |
<body> |
2644 |
|
2645 |
<p> |
2646 |
挂载你的引导分区并检查<path>grub/grub.conf</path>,如果它存在。 |
2647 |
</p> |
2648 |
|
2649 |
<pre caption="挂载和检查"> |
2650 |
# <i>mount /dev/hda1 /mnt/gentoo/boot</i> |
2651 |
# <i>cat /mnt/gentoo/boot/grub/grub.conf</i> |
2652 |
</pre> |
2653 |
|
2654 |
<p> |
2655 |
同时确定 <path>menu.lst</path> 的符号链接存在: |
2656 |
</p> |
2657 |
|
2658 |
<pre caption="检查符号链接"> |
2659 |
# <i>ls -l /mnt/gentoo/boot/grub/menu.lst</i> |
2660 |
lrwxrwxrwx 1 root root 9 Mar 7 14:00 /mnt/gentoo/boot/grub/menu.lst -> grub.conf |
2661 |
</pre> |
2662 |
|
2663 |
<p> |
2664 |
如果没有,请重新建立符号链接: |
2665 |
</p> |
2666 |
|
2667 |
<pre caption="重新建立menu.lst的符号链接"> |
2668 |
# <i>cd /mnt/gentoo/boot/grub</i> |
2669 |
# <i>ln -snf grub.conf menu.lst</i> |
2670 |
</pre> |
2671 |
|
2672 |
<p> |
2673 |
如果是这种情况,请重新安装grub: |
2674 |
</p> |
2675 |
|
2676 |
<pre caption="重新安装Grub"> |
2677 |
<comment>(在chrooted环境下运行)</comment> |
2678 |
# <i>grub-install --root-directory=/boot /dev/hda</i> |
2679 |
</pre> |
2680 |
|
2681 |
</body> |
2682 |
</section> |
2683 |
</chapter> |
2684 |
|
2685 |
<chapter> |
2686 |
<title>在/boot/boot找不到设备:找不到或没有块设备</title> |
2687 |
<section> |
2688 |
<title>状况</title> |
2689 |
<body> |
2690 |
|
2691 |
<p> |
2692 |
当运行<c>grub-install</c>安装GRUB时,获得以下错误: |
2693 |
</p> |
2694 |
|
2695 |
<pre caption="Grub输出"> |
2696 |
# <i>grub-install --root-directory=/boot /dev/hda</i> |
2697 |
在/boot/boot找不到设备:找不到或没有块设备 |
2698 |
</pre> |
2699 |
|
2700 |
</body> |
2701 |
</section> |
2702 |
<section> |
2703 |
<title>解决方案</title> |
2704 |
<body> |
2705 |
|
2706 |
<p> |
2707 |
检查你是否忘记了以下的: |
2708 |
</p> |
2709 |
|
2710 |
<pre caption="更新mtab文件"> |
2711 |
# <i>cp /proc/mounts /etc/mtab</i> |
2712 |
</pre> |
2713 |
|
2714 |
</body> |
2715 |
</section> |
2716 |
</chapter> |
2717 |
|
2718 |
<chapter> |
2719 |
<title>在Grub菜单中点击回车后系统重新启动</title> |
2720 |
<section> |
2721 |
<title>状况</title> |
2722 |
<body> |
2723 |
|
2724 |
<p> |
2725 |
系统启动时在Grub菜单中点击回车,系统重新启动。 |
2726 |
</p> |
2727 |
|
2728 |
</body> |
2729 |
</section> |
2730 |
<section> |
2731 |
<title>解决方案</title> |
2732 |
<body> |
2733 |
|
2734 |
<p> |
2735 |
请尝试禁用内核中的帧缓冲支持。如果这样做不起作用,禁用APM和ACPI。 |
2736 |
</p> |
2737 |
|
2738 |
</body> |
2739 |
</section> |
2740 |
</chapter> |
2741 |
|
2742 |
<chapter> |
2743 |
<title>在Grub菜单中点击回车,出现黑屏</title> |
2744 |
<section> |
2745 |
<title>状况</title> |
2746 |
<body> |
2747 |
|
2748 |
<p> |
2749 |
系统引导过程中,在Grub菜单中点击回车,出现黑屏,但是系统却仍有响应(例如,你的numlock指示灯还可切换)。 |
2750 |
</p> |
2751 |
|
2752 |
</body> |
2753 |
</section> |
2754 |
<section> |
2755 |
<title>解决方案</title> |
2756 |
<body> |
2757 |
|
2758 |
<p> |
2759 |
禁用帧缓冲(通常是从你的<path>grub.conf</path>中移除<c>vga=XYZ</c>)并检查你的内核配置中的处理器架构。 |
2760 |
</p> |
2761 |
|
2762 |
</body> |
2763 |
</section> |
2764 |
</chapter> |
2765 |
|
2766 |
<chapter> |
2767 |
<title>Grub Image缺失</title> |
2768 |
<section> |
2769 |
<title>状况</title> |
2770 |
<body> |
2771 |
|
2772 |
<p> |
2773 |
系统启动时看不到Gentoo闪屏。 |
2774 |
</p> |
2775 |
|
2776 |
</body> |
2777 |
</section> |
2778 |
<section> |
2779 |
<title>解决方案</title> |
2780 |
<body> |
2781 |
|
2782 |
<p> |
2783 |
首先检查<path>grub.conf</path>中的闪屏文件确实存在。如果存在,再检查grub ebuild。可能是你所用的版本的闪屏图像的补丁被注释掉了。 |
2784 |
</p> |
2785 |
|
2786 |
</body> |
2787 |
</section> |
2788 |
</chapter> |
2789 |
|
2790 |
<chapter> |
2791 |
<title>选择Windows选项后,系统从第二个硬盘中启动Windows失败,</title> |
2792 |
<section> |
2793 |
<title>状况</title> |
2794 |
<body> |
2795 |
|
2796 |
<p> |
2797 |
选择了Windows选项以后,系统拒绝引导而且没有明显的原因。 |
2798 |
</p> |
2799 |
|
2800 |
</body> |
2801 |
</section> |
2802 |
<section> |
2803 |
<title>解决方案</title> |
2804 |
<body> |
2805 |
|
2806 |
<p> |
2807 |
<uri link="http://forums.gentoo.org/profile.php?mode=viewprofile&u=14595">cyrillic</uri>提示我们你可以用不同的命令"映射"你的硬盘像下面一样改变<path>grub.conf</path>中的Windows选项: |
2808 |
</p> |
2809 |
|
2810 |
<pre caption="硬盘映射"> |
2811 |
title Windows XP |
2812 |
map (hd0) (hd1) |
2813 |
map (hd1) (hd0) |
2814 |
chainloader (hd1,0)+1 |
2815 |
</pre> |
2816 |
|
2817 |
</body> |
2818 |
</section> |
2819 |
</chapter> |
2820 |
|
2821 |
<chapter> |
2822 |
<title>Grub segfaults when trying to install</title> |
2823 |
<section> |
2824 |
<title>状况</title> |
2825 |
<body> |
2826 |
|
2827 |
<p> |
2828 |
这种状况经下面的解释说是只与现在将grub安装到引导分区的grub-0.95.x相关联的。 |
2829 |
</p> |
2830 |
|
2831 |
<pre caption="安装Grub"> |
2832 |
grub> root (hd0,0) |
2833 |
|
2834 |
grub> setup (hd0) |
2835 |
|
2836 |
Segmentation fault |
2837 |
</pre> |
2838 |
|
2839 |
</body> |
2840 |
</section> |
2841 |
<section> |
2842 |
<title>解决方案</title> |
2843 |
<body> |
2844 |
|
2845 |
<p> |
2846 |
与此相关的是一个知名bug而且在grub 0.96中已经确定。同时grub 0.94 r1和grub 0.94 r2应该能正常工作。如果它同样失败了,你可以试着emerge已经在amd64下稳定和在x86下还不稳定(~x86)的grub-static。要获得附加信息请参考bug <uri link="http://bugs.gentoo.org/show_bug.cgi?id=79378">#79378</uri>。 |
2847 |
</p> |
2848 |
|
2849 |
</body> |
2850 |
</section> |
2851 |
</chapter> |
2852 |
|
2853 |
</guide> |
2854 |
|
2855 |
|
2856 |
|
2857 |
1.1 xml/htdocs/doc/zh_cn/lvm2.xml |
2858 |
|
2859 |
file : http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/doc/zh_cn/lvm2.xml?rev=1.1&view=markup |
2860 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/doc/zh_cn/lvm2.xml?rev=1.1&content-type=text/plain |
2861 |
|
2862 |
Index: lvm2.xml |
2863 |
=================================================================== |
2864 |
<?xml version='1.0' encoding="utf-8"?> |
2865 |
<!DOCTYPE guide SYSTEM "/dtd/guide.dtd"> |
2866 |
|
2867 |
<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/zh_cn/lvm2.xml,v 1.1 2007/09/17 17:54:10 r0bertz Exp $ --> |
2868 |
<!-- English CVS version: 1.22 --> |
2869 |
|
2870 |
<guide link="/doc/zh_cn/lvm2.xml" lang="zh_cn"> |
2871 |
<title>Gentoo LVM2安装指南</title> |
2872 |
|
2873 |
<author title="作者"> |
2874 |
<mail link="avi@×××××××××××××××.com">Avi Schwartz</mail> |
2875 |
</author> |
2876 |
<author title="Contributor"> |
2877 |
<mail link="rajiv@g.o">Rajiv Manglani</mail> |
2878 |
</author> |
2879 |
<author title="编辑"> |
2880 |
<mail link="neysx@g.o">Xavier Neys</mail> |
2881 |
</author> |
2882 |
<author title="译者"> |
2883 |
<mail link="palatis@××××××.tw">Victor Tseng</mail> |
2884 |
</author> |
2885 |
<author title="译者"> |
2886 |
<mail link="zm3345@×××××.com">Zhou Mi</mail> |
2887 |
</author> |
2888 |
|
2889 |
<abstract> |
2890 |
该指南讲述该如何在你的Gentoo系统中使用逻辑卷管理器第二版(LVM2) |
2891 |
</abstract> |
2892 |
|
2893 |
<!-- The content of this document is licensed under the CC-BY-SA license --> |
2894 |
<!-- See http://creativecommons.org/licenses/by-sa/2.5 --> |
2895 |
<license/> |
2896 |
|
2897 |
<version>2.5</version> |
2898 |
<date>2007-02-26</date> |
2899 |
|
2900 |
<chapter> |
2901 |
<title>简介</title> |
2902 |
<section> |
2903 |
<body> |
2904 |
|
2905 |
<p> |
2906 |
本指南使用两个IDE硬盘做范例。这表示你极可能需要根据自己的需求,对磁盘、分区名以及分区大小等信息做些更改。 |
2907 |
</p> |
2908 |
|
2909 |
<warn> |
2910 |
本文并不想成为一篇LVM2学习指南。它只是一个小笔记,作为<uri link="/doc/zh_cn/handbook/handbook-x86.xml?part=1">Gentoo安装手册(第一部分)</uri>的补充。请<e>务必</e>在你动手安装之前<e>阅读</e>Gentoo安装手册。 |
2911 |
</warn> |
2912 |
|
2913 |
<note> |
2914 |
完整的LVM HOWTO在这里:<uri>http://tldp.org/HOWTO/LVM-HOWTO</uri> |
2915 |
</note> |
2916 |
|
2917 |
</body> |
2918 |
</section> |
2919 |
<section> |
2920 |
<title>系统需求</title> |
2921 |
<body> |
2922 |
|
2923 |
<p> |
2924 |
如果你是全新安装gentoo系统,你需要有一张带LVM2支持的启动光盘,如Gentoo安装光盘。你可以在我们<uri link="/main/en/mirrors.xml">镜像站</uri>的<path>/releases/x86/current/installcd</path>下找到x86架构的Gentoo安装光盘。在其他的架构下也应该会有很好的支持。 |
2925 |
</p> |
2926 |
|
2927 |
<p> |
2928 |
如果你在一个有着空闲硬盘空间、正在运行着的系统上安装LVM2,你需要启用LVM2模块(<path>dm-mod</path>)。这个模块已内置于<path>gentoo-sources</path>。如何编译你的内核以便LVM2能正常工作,会在稍后提及。 |
2929 |
</p> |
2930 |
|
2931 |
<p> |
2932 |
并非所有Gentoo提供的2.4内核都支持LVM2! |
2933 |
</p> |
2934 |
|
2935 |
<warn> |
2936 |
在2005.0安装光盘中的LVM2被错误地动态链接到一个函数库(libgpm),而这个函数库位于<path>/usr</path>。这表示,你不能将<path>/usr</path>放在LVM环境中。请更新到最新版本,或安装2.0.33(沒有-r1),它们都是静态链接的版本。 |
2937 |
</warn> |
2938 |
|
2939 |
</body> |
2940 |
</section> |
2941 |
<section> |
2942 |
<title>分区</title> |
2943 |
<body> |
2944 |
|
2945 |
<p> |
2946 |
在我们的范例系统中有两个IDE硬盘,它们的分区是这样的: |
2947 |
</p> |
2948 |
|
2949 |
<ul> |
2950 |
<li>/dev/hda1 -- /boot</li> |
2951 |
<li>/dev/hda2 -- (交换分区)</li> |
2952 |
<li>/dev/hda3 -- /</li> |
2953 |
<li>将被用作LVM2</li> |
2954 |
<li>将被用作LVM2</li> |
2955 |
</ul> |
2956 |
|
2957 |
<impo> |
2958 |
请特别注意分区名字,毕竟a和b常常被看错,那些数字也很容易被混淆。一个小失误将导致某个分区被错误地覆盖掉。我们警告过你了! |
2959 |
</impo> |
2960 |
|
2961 |
<p> |
2962 |
ok,开始吧…… |
2963 |
</p> |
2964 |
|
2965 |
</body> |
2966 |
</section> |
2967 |
</chapter> |
2968 |
|
2969 |
<chapter> |
2970 |
<title>安装</title> |
2971 |
<section> |
2972 |
<body> |
2973 |
|
2974 |
<p> |
2975 |
先照着安装手册做,直到<e>第4章──准备磁盘</e> |
2976 |
</p> |
2977 |
|
2978 |
<p> |
2979 |
使用安装手册上提及的<c>fdisk</c>,不过将分区划分成上面范例中的那样。它<e>只是个范例</e>,请调整它以符合自己的需求。 |
2980 |
</p> |
2981 |
|
2982 |
<p> |
2983 |
创建建一个小小的<path>/boot</path>分区(hda1)。在这个例子中,<path>/boot</path>不会被LVM2管理。这个分区里存放着内核和引导程序。相信一个64M的分区够存放不少内核的了。 |
2984 |
</p> |
2985 |
|
2986 |
<p> |
2987 |
创建一个交换分区(hda2)。 |
2988 |
</p> |
2989 |
|
2990 |
<p> |
2991 |
创建根(root)分区(hda3)。如果你有兴趣尝试把根分区到LVM下管理(虽然我们不建议这样做),你可以参考本文末尾列出的资源。那里有一个mini-howto会告诉该如何做。如果将<path>/opt /usr /home /var</path>和<path>/tmp</path>都放在LVM2卷组(vg)中的话,根分区也不用太大。在我们的例子中,1GB就足够了。 |
2992 |
</p> |
2993 |
|
2994 |
<note> |
2995 |
我们<b>不建议</b>将下列目录放在LVM2分区上:<path>/etc /lib /mnt /proc /bin /sbin /dev /root</path>。这样做的好处是,当有什么糟糕的事情(系统严重受损,但是对root来说还有点用)发生的时候,你还可以登入系统。 |
2996 |
</note> |
2997 |
|
2998 |
<p> |
2999 |
假如<path>/boot</path>,交换分区和根分区还没能用完整个硬盘,可以创建第四个分区,并把它的类型设为8e(Linux LVM)。如果你还有其他供LVM使用的硬盘,请在每个硬盘上都创建一个分区,并把分区类型设为8e。 |
3000 |
</p> |
3001 |
|
3002 |
<note> |
3003 |
由于现在的硬盘都非常大,你也许想将你的硬盘分成几个小分区,而不是一个大的,然后全部添加到LVM2卷组。LVM2让分区扩充容量变得很简单,所以你可以留下一些未配置的分区,天知道你以后会不会在LVM2以外的地方用到它们。简而言之,在还没有确定拿分区做什么用之前,别先把它们用光了。举例来说吧,我们的一位投稿者就将他的160GB硬盘分成了8个20GB的分区来用。 |
3004 |
</note> |
3005 |
|
3006 |
<p> |
3007 |
按照安装手册的步骤,建立分区<path>/dev/hda1</path>和<path>/dev/hda3</path>的文件系统,并建立且激活交换分区<path>/dev/hda2</path>。 |
3008 |
</p> |
3009 |
|
3010 |
<p> |
3011 |
加载LVM2模块<path>dm-mod</path>。 |
3012 |
</p> |
3013 |
|
3014 |
<pre caption="加载LVM2模块"> |
3015 |
# <i>modprobe dm-mod</i> |
3016 |
</pre> |
3017 |
|
3018 |
<p> |
3019 |
|
3020 |
你可能要在扫描并激活LVM之前先编辑<path>/etc/lvm/lvm.conf</path>文件,把一些设备排除在外。因为默认情况下,LVM2会扫描所有的设备,包括会产生错误信息的光驱。在下面的例子中,我们替换掉了允许扫描所有设备的那行,改为除两个IDE硬盘外,不扫描其他任何设备。 |
3021 |
</p> |
3022 |
|
3023 |
<pre caption="起用LVM"> |
3024 |
<comment>(避免扫描除硬盘外的所有设备)</comment> |
3025 |
# <i>nano -w /etc/lvm/lvm.conf</i> |
3026 |
<comment>(查找下面的行)</comment> |
3027 |
filter = [ "a/.*/" ] |
3028 |
<comment>(用下面内容来替换,保证只扫描 |
3029 |
/dev/hda和/dev/hdb)</comment> |
3030 |
filter = [ "a|/dev/hd[ab]|", "r/.*/" ] |
3031 |
<comment>(保存文件并退出nano)</comment> |
3032 |
# <i>vgscan</i> |
3033 |
Reading all physical volumes. This may take a while... |
3034 |
No volume groups found |
3035 |
<comment>(启用之前创建的卷组)</comment> |
3036 |
# <i>vgchange -a y</i> |
3037 |
</pre> |
3038 |
|
3039 |
<p> |
3040 |
准备磁盘分区 |
3041 |
</p> |
3042 |
|
3043 |
<pre caption="准备磁盘分区"> |
3044 |
# <i>pvcreate /dev/hda4 /dev/hdb1</i> |
3045 |
No physical volume label read from /dev/hda4 |
3046 |
Physical volume "/dev/hda4" successfully created |
3047 |
No physical volume label read from /dev/hdb1 |
3048 |
Physical volume "/dev/hdb1" successfully created |
3049 |
</pre> |
3050 |
|
3051 |
<p> |
3052 |
创建一个卷组。卷组是一些物理单元的逻辑集合。 |
3053 |
</p> |
3054 |
|
3055 |
<p> |
3056 |
范例中<path>/dev/hda1</path>,<path>/dev/hda2</path>和<path>/dev/hda3</path>分别是<path>/boot</path>,交换分区和根分区。所以我们需要合并的是<path>/dev/hda4</path>和<path>/dev/hdb1</path>。尽管这用一个命令就可以完成,作为示范,我们还是先创建一个卷组,然后再扩充它。 |
3057 |
</p> |
3058 |
|
3059 |
<pre caption="创建和扩充卷组"> |
3060 |
<comment>(创建一个名为vg的卷组)</comment> |
3061 |
# <i>vgcreate vg /dev/hda4</i> |
3062 |
/etc/lvm/backup: fsync failed: Invalid argument <comment>(忽略此警告)</comment> |
3063 |
Volume group "vg" successfully created |
3064 |
<comment>(扩充已有的卷组)</comment> |
3065 |
# <i>vgextend vg /dev/hdb1</i> |
3066 |
/etc/lvm/backup: fsync failed: Invalid argument <comment>(再次忽略这个警告,以后也请继续忽略)</comment> |
3067 |
Volume group "vg" successfully extended |
3068 |
</pre> |
3069 |
|
3070 |
<p> |
3071 |
创建逻辑卷。逻辑卷类似于在非LVM2环境中用fdisk创建的磁盘分区。在这个例子中,我们创建了如下分区: |
3072 |
</p> |
3073 |
|
3074 |
<table> |
3075 |
<tr> |
3076 |
<th>目录</th> |
3077 |
<th>大小</th> |
3078 |
</tr> |
3079 |
<tr> |
3080 |
<ti>/usr</ti> |
3081 |
<ti>10 GB</ti> |
3082 |
</tr> |
3083 |
<tr> |
3084 |
<ti>/home</ti> |
3085 |
<ti>5 GB</ti> |
3086 |
</tr> |
3087 |
<tr> |
3088 |
<ti>/opt</ti> |
3089 |
<ti>5 GB</ti> |
3090 |
</tr> |
3091 |
<tr> |
3092 |
<ti>/var</ti> |
3093 |
<ti>10 GB</ti> |
3094 |
</tr> |
3095 |
<tr> |
3096 |
<ti>/tmp</ti> |
3097 |
<ti>2 GB</ti> |
3098 |
</tr> |
3099 |
</table> |
3100 |
|
3101 |
<p> |
3102 |
由于我们正要使用的是LVM2,所以不必太在意分区的大小,因为扩充容量很容易。 |
3103 |
</p> |
3104 |
|
3105 |
<note> |
3106 |
正如Terje Kvernes所评述的,增加分区的大小要比缩小它容易得多。我想你可能会想要从小分区开始,然后在需要的时候才扩充它们。 |
3107 |
</note> |
3108 |
|
3109 |
<pre caption="创建和扩充逻辑卷"> |
3110 |
# <i>lvcreate -L10G -nusr vg</i> |
3111 |
Logical volume "usr" created <comment>(以后的类似信息就不显示了)</comment> |
3112 |
# <i>lvcreate -L5G -nhome vg</i> |
3113 |
# <i>lvcreate -L5G -nopt vg</i> |
3114 |
# <i>lvcreate -L10G -nvar vg</i> |
3115 |
# <i>lvcreate -L2G -ntmp vg</i> |
3116 |
<comment>(作为范例,让我们增加一个额外的5GB逻辑卷)</comment> |
3117 |
# <i>lvextend -L+5G /dev/vg/home</i> |
3118 |
</pre> |
3119 |
|
3120 |
<p> |
3121 |
在逻辑卷中创建文件系统的步骤和在普通分区中相同。我们以使用ext3为例,当然你选用其他文件系统也行: |
3122 |
</p> |
3123 |
|
3124 |
<pre caption="创建文件系统"> |
3125 |
# <i>mke2fs -j /dev/vg/usr</i> |
3126 |
# <i>mke2fs -j /dev/vg/home</i> |
3127 |
# <i>mke2fs -j /dev/vg/opt</i> |
3128 |
# <i>mke2fs -j /dev/vg/var</i> |
3129 |
# <i>mke2fs -j /dev/vg/tmp</i> |
3130 |
</pre> |
3131 |
|
3132 |
<p> |
3133 |
按照安装手册中挂载分区的方法挂载你创建的LVM2逻辑卷,但请将<path>/dev/hdxx</path>替换为<path>/dev/vg/逻辑卷名</path>。 |
3134 |
</p> |
3135 |
|
3136 |
<pre caption="挂载逻辑卷"> |
3137 |
<comment>(请如安装手册所述,先挂载根分区)</comment> |
3138 |
# <i>mkdir /mnt/gentoo/usr</i> |
3139 |
# <i>mount /dev/vg/usr /mnt/gentoo/usr</i> |
3140 |
# <i>mkdir /mnt/gentoo/home</i> |
3141 |
# <i>mount /dev/vg/home /mnt/gentoo/home</i> |
3142 |
# <i>mkdir /mnt/gentoo/opt</i> |
3143 |
# <i>mount /dev/vg/opt /mnt/gentoo/opt</i> |
3144 |
# <i>mkdir /mnt/gentoo/var</i> |
3145 |
# <i>mount /dev/vg/var /mnt/gentoo/var</i> |
3146 |
# <i>mkdir /mnt/gentoo/tmp</i> |
3147 |
# <i>mount /dev/vg/tmp /mnt/gentoo/tmp</i> |
3148 |
</pre> |
3149 |
|
3150 |
<note> |
3151 |
接下来的步骤跟安装手册中提到的差不多,在这里我们只列出一些有差异的地方。 |
3152 |
</note> |
3153 |
|
3154 |
<p> |
3155 |
请在配置内核时确认已启用了LVM2支持(并非所以2.4内核都支持)。选择下列LVM2模块: |
3156 |
</p> |
3157 |
|
3158 |
<pre caption="在2.4.x内核中选择LVM2模块"> |
3159 |
Multi-device support (RAID and LVM) ---> |
3160 |
[*] Multiple devices driver support (RAID and LVM) |
3161 |
< > RAID support |
3162 |
<comment>(注意我们故意不选LVM,这是给LVM1用的)</comment> |
3163 |
< > Logical volume manager (LVM) support |
3164 |
<M> Device-mapper support |
3165 |
< > Mirror (RAID-1) support |
3166 |
</pre> |
3167 |
|
3168 |
<pre caption="在2.6.x内核中选择LVM2模块"> |
3169 |
Device Drivers ---> |
3170 |
Multi-device support (RAID and LVM) ---> |
3171 |
[*] Multiple devices driver support (RAID and LVM) |
3172 |
< > RAID support |
3173 |
<M> Device mapper support |
3174 |
</pre> |
3175 |
|
3176 |
<p> |
3177 |
编译好的模块叫做<path>dm-mod.ko</path> |
3178 |
</p> |
3179 |
|
3180 |
<p> |
3181 |
在编译好内核并安装完模块之后,将下面这行加入你的<path>/etc/modules.autoload.d/kernel-{KV}</path>中,其中{KV}表示你的内核版本(2.4或2.6),以便在开机时自动加载LVM2: |
3182 |
</p> |
3183 |
|
3184 |
<pre caption="在/etc/modules.autoload.d/kernel-2.6中添加LVM2模块"> |
3185 |
# <i>nano -w /etc/modules.autoload.d/kernel-2.6</i> |
3186 |
<comment>(增加底下这行)</comment> |
3187 |
dm-mod |
3188 |
</pre> |
3189 |
|
3190 |
<p> |
3191 |
现在,安装lvm2包。 |
3192 |
</p> |
3193 |
|
3194 |
<impo> |
3195 |
请确定已将你的<path>/usr/src/linux</path>链接到了你现在使用的内核源代码,因为lvm2 ebuild所依赖的device-mapper ebuild会用到<path>/usr/src/linux/include/linux</path>下的源文件。 |
3196 |
</impo> |
3197 |
|
3198 |
<pre caption="emerging lvm2 软件包"> |
3199 |
# <i>emerge lvm2</i> |
3200 |
</pre> |
3201 |
|
3202 |
<p> |
3203 |
按照<uri link="#doc_chap2_pre2">前面</uri>的方法编辑文件<path>/etc/lvm/lvm.conf</path>。你先前修改过的那个配置文件是宿主系统中的文件,重启之后就不存在了。你得在新安装的Gentoo系统中再重新编辑一次。 |
3204 |
</p> |
3205 |
|
3206 |
<p> |
3207 |
在编辑<path>/etc/fstab</path>文件时,照着安装手册上说的,加入你的LVM2逻辑卷。重申一下,以下内容是我们范例中所必需的: |
3208 |
</p> |
3209 |
|
3210 |
<pre caption="/etc/fstab的部分内容"> |
3211 |
/dev/hda1 /boot ext3 noauto,noatime 1 2 |
3212 |
/dev/hda2 none swap sw 0 0 |
3213 |
/dev/hda3 / ext3 noatime 0 1 |
3214 |
# Logical volumes |
3215 |
/dev/vg/usr /usr ext3 noatime 0 2 |
3216 |
/dev/vg/home /home ext3 noatime 0 2 |
3217 |
/dev/vg/opt /opt ext3 noatime 0 2 |
3218 |
/dev/vg/var /var ext3 noatime 0 2 |
3219 |
/dev/vg/tmp /tmp ext3 noatime 0 2 |
3220 |
</pre> |
3221 |
|
3222 |
<p> |
3223 |
当你来到安装手册中最后的安装步骤时,最好不要忘了卸载你所有的LVM2逻辑卷,并在重启前执行以下命令: |
3224 |
</p> |
3225 |
|
3226 |
<pre caption="关闭LVM2"> |
3227 |
# <i>vgchange -a n</i> |
3228 |
</pre> |
3229 |
|
3230 |
<p> |
3231 |
重新开机,所有的分区都应该被挂载好了。 |
3232 |
</p> |
3233 |
|
3234 |
</body> |
3235 |
</section> |
3236 |
</chapter> |
3237 |
|
3238 |
<chapter> |
3239 |
<title>重启后如何继续</title> |
3240 |
<section> |
3241 |
<body> |
3242 |
|
3243 |
<p> |
3244 |
如果你在某处中断了Gentoo的安装又想继续的话,你需要先创建分区节点: |
3245 |
</p> |
3246 |
|
3247 |
<pre caption="重新启用分区"> |
3248 |
# <i>vgscan --mknodes</i> |
3249 |
</pre> |
3250 |
|
3251 |
<p> |
3252 |
在缺少最新工具的安装光盘中,很可能需要用如下方法来重新启用分区: |
3253 |
</p> |
3254 |
|
3255 |
<pre caption="重新启用分区"> |
3256 |
<comment>(先将所有分区复位)</comment> |
3257 |
# <i>vgchange -a n</i> |
3258 |
<comment>(导出所有分区)</comment> |
3259 |
# <i>vgexport -a vg</i> |
3260 |
<comment>(导入所有分区)</comment> |
3261 |
# <i>vgimport -a vg</i> |
3262 |
<comment>(重新启用所有分区)</comment> |
3263 |
# <i>vgchange -a y</i> |
3264 |
</pre> |
3265 |
|
3266 |
</body> |
3267 |
</section> |
3268 |
</chapter> |
3269 |
|
3270 |
<chapter> |
3271 |
<title>相关资源</title> |
3272 |
<section> |
3273 |
<body> |
3274 |
|
3275 |
<ul> |
3276 |
<li> |
3277 |
官方网页<uri link="http://sources.redhat.com/lvm2">LVM2 home page</uri> |
3278 |
</li> |
3279 |
<li> |
3280 |
<uri link="http://tldp.org/HOWTO/LVM-HOWTO">LVM Howto</uri> |
3281 |
</li> |
3282 |
<li> |
3283 |
Daniel Robbins写在IBM DeveloperWorks上的关于LVM的文章:<uri link="/doc/zh_cn/articles/lvm-p1.xml">第一部分</uri>以及<uri link="http://doc/zh_cn/articles/lvm-p2.xml">第二部分</uri> |
3284 |
</li> |
3285 |
<li> |
3286 |
如何启动你在LVM1上的根分区:<uri>http://www.the-infinite.org/archive/docs/lvm/howto-boot-off-root-lv.txt</uri> |
3287 |
</li> |
3288 |
</ul> |
3289 |
|
3290 |
</body> |
3291 |
</section> |
3292 |
</chapter> |
3293 |
|
3294 |
<chapter> |
3295 |
<title>特别感谢</title> |
3296 |
<section> |
3297 |
<body> |
3298 |
|
3299 |
<p> |
3300 |
感谢<mail link="bangert@g.o">Thilo Bangert</mail>以及<mail link="terjekv@××××××××.no">Terje Kvernes</mail>为本文提供的帮助和建议。 |
3301 |
</p> |
3302 |
|
3303 |
</body> |
3304 |
</section> |
3305 |
</chapter> |
3306 |
</guide> |
3307 |
|
3308 |
|
3309 |
|
3310 |
1.1 xml/htdocs/doc/zh_cn/mysql-upgrading.xml |
3311 |
|
3312 |
file : http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/doc/zh_cn/mysql-upgrading.xml?rev=1.1&view=markup |
3313 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/doc/zh_cn/mysql-upgrading.xml?rev=1.1&content-type=text/plain |
3314 |
|
3315 |
Index: mysql-upgrading.xml |
3316 |
=================================================================== |
3317 |
<?xml version='1.0' encoding="utf-8"?> |
3318 |
<!DOCTYPE guide SYSTEM "/dtd/guide.dtd"> |
3319 |
|
3320 |
<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/zh_cn/mysql-upgrading.xml,v 1.1 2007/09/17 17:54:10 r0bertz Exp $ --> |
3321 |
<!-- English CVS version: 1.21 --> |
3322 |
|
3323 |
<guide link="/doc/zh_cn/mysql-upgrading.xml" lang="zh_cn"> |
3324 |
<title>MySQL 4.*或5.0.*的升级指南</title> |
3325 |
|
3326 |
<author title="作者"> |
3327 |
<mail link="citizen428@g.o">Michael Kohl</mail> |
3328 |
</author> |
3329 |
<author title="作者"> |
3330 |
<mail link="vivo@g.o">Francesco Riosa</mail> |
3331 |
</author> |
3332 |
<author title="译者"> |
3333 |
<mail link="jjj3112000@×××.com">Zezhou Jiang</mail> |
3334 |
</author> |
3335 |
|
3336 |
<abstract> |
3337 |
MySQL团队很荣幸地宣布MySQL 5.0很快就要出现在Gentoo稳定的软件包树里了。这个指南描述了如何升级到MySQL 4.*或5.0.*。 |
3338 |
</abstract> |
3339 |
|
3340 |
<!-- The content of this document is licensed under the CC-BY-SA license --> |
3341 |
<!-- See http://creativecommons.org/licenses/by-sa/2.5 --> |
3342 |
<license/> |
3343 |
|
3344 |
<version>1.17</version> |
3345 |
<date>2007-06-04</date> |
3346 |
|
3347 |
<chapter> |
3348 |
<title>直接升级,建议从4.1 => 5.0移动</title> |
3349 |
<section> |
3350 |
<body> |
3351 |
|
3352 |
<p> |
3353 |
4.1的myisam存储引擎已经足够成熟了,它允许直接升级到下一个MySQL的主版本。 |
3354 |
</p> |
3355 |
|
3356 |
<note> |
3357 |
对于MERGE表来说不是这样。如果你尝试直接升级这种很少用的表类型你可能会陷入麻烦。你应该清除并重建这些表,并且在升级过程中把他们的内容储存起来。如果你不太确定,你应该从<uri link="#doc_chap2">Upgrading from old versions of MySQL</uri> 开始。 |
3358 |
</note> |
3359 |
|
3360 |
<p> |
3361 |
在这一步需要两个命令行,因为lock属于mysql会话。 |
3362 |
</p> |
3363 |
|
3364 |
<pre caption="直接从4.1升级至5.0.*"> |
3365 |
# <i>quickpkg dev-db/mysql</i> |
3366 |
# <i>alias MYSQL="mysql --user=root --password=</i><comment>'your_password'</comment><i>"</i> |
3367 |
# <i>DATADIR=$(MYSQL --batch --raw --silent --skip-column-names \</i> |
3368 |
<i>--execute='SHOW variables LIKE "datadir";' \</i> |
3369 |
<i>| sed -e 's|datadir[ \t]||')</i> |
3370 |
|
3371 |
<comment>(下一步应该在第二个命令行下做)</comment> |
3372 |
# <i>mysql --user=root --password=</i><comment>'your_password'</comment> |
3373 |
mysql> <i>FLUSH TABLES WITH READ LOCK;</i> |
3374 |
|
3375 |
<comment>(回到第一个命令行来运行这个命令)</comment> |
3376 |
# <i>tar -cjpvf ~/mysql.$(date +%F"T"%H-%M).tar.bz2 \</i> |
3377 |
<i>/etc/conf.d/mysql /etc/mysql/my.cnf "${DATADIR}"</i> |
3378 |
|
3379 |
<comment>(接下来的命令应该在第二个命令行下做)</comment> |
3380 |
mysql> <i>UNLOCK TABLES;</i> |
3381 |
mysql> <i>quit</i> |
3382 |
|
3383 |
<comment>(回到第一个命令行来完成接下来的升级)</comment> |
3384 |
# <i>tar -tjvf ~/mysql.*.tar.bz2</i> |
3385 |
# <i>emerge -av ">dev-db/mysql-5.0"</i> |
3386 |
# <i>dispatch-conf</i> |
3387 |
# <i>revdep-rebuild</i> |
3388 |
# <i>/etc/init.d/mysql restart</i> |
3389 |
# <i>mysql_upgrade_shell --user=root --password=</i><comment>'your_password'</comment><i> \</i> |
3390 |
<i>--protocol=tcp --datadir="${DATADIR}"</i> |
3391 |
# <i>/etc/init.d/mysql restart</i> |
3392 |
# <i>unset DATADIR</i> |
3393 |
# <i>unalias MYSQL</i> |
3394 |
</pre> |
3395 |
|
3396 |
</body> |
3397 |
</section> |
3398 |
</chapter> |
3399 |
|
3400 |
<chapter> |
3401 |
<title>从旧的MySQL版本升级</title> |
3402 |
<section> |
3403 |
<body> |
3404 |
|
3405 |
<p> |
3406 |
用户从老的MySQL版本(<4.0.24)升级需要现安装MySQL 4.0.25。如果你已有一个更新的版本,你可以跳过这一区域,并从<uri link="#backup">next one</uri>继续。 |
3407 |
</p> |
3408 |
|
3409 |
<pre caption="简单升级"> |
3410 |
# <i>emerge -av --buildpkg "<mysql-4.1"</i> |
3411 |
</pre> |
3412 |
|
3413 |
</body> |
3414 |
</section> |
3415 |
</chapter> |
3416 |
|
3417 |
<chapter id="backup"> |
3418 |
<title>为你当前的数据做备份</title> |
3419 |
<section> |
3420 |
<body> |
3421 |
|
3422 |
<impo> |
3423 |
在不同的MySQl版本中主键的值的处理方式是不一样的,请参见<uri link="http://bugs.gentoo.org/108502">bug #108502</uri>来得到更多信息,极其推荐你扫描“0”(zero)或更小的值,并且升级它们到一个大于等于“1”的值。 |
3424 |
</impo> |
3425 |
|
3426 |
<p> |
3427 |
所有数据库管理员必须做的最重要的任务之一就是备份数据,那我们就开始吧: |
3428 |
</p> |
3429 |
|
3430 |
<pre caption="所有数据库的dump"> |
3431 |
# <i>mysqldump \</i> |
3432 |
<i>-uroot \</i> |
3433 |
<i>--password=</i><comment>'your_password'</comment><i> \</i> |
3434 |
<i>-hlocalhost \</i> |
3435 |
<i>--all-databases \</i> |
3436 |
<i>--opt \</i> |
3437 |
<i>--allow-keywords \</i> |
3438 |
<i>--flush-logs \</i> |
3439 |
<i>--hex-blob \</i> |
3440 |
<i>--master-data \</i> |
3441 |
<i>--max_allowed_packet=16M \</i> |
3442 |
<i>--quote-names \</i> |
3443 |
<i>--result-file=BACKUP_MYSQL_4.0.SQL</i> |
3444 |
</pre> |
3445 |
|
3446 |
<p> |
3447 |
现在一个叫做<path>BACKUP_MYSQL_4.0.SQL</path>的文件应该存在,它可以在后面你重建数据时起到作用。数据是被SQL的MySQL语言描述的,它是一种结构化查询语言。 |
3448 |
</p> |
3449 |
|
3450 |
<p> |
3451 |
现在是检查你的备份是否正常工作的好时间了。 |
3452 |
</p> |
3453 |
|
3454 |
</body> |
3455 |
</section> |
3456 |
</chapter> |
3457 |
|
3458 |
<chapter> |
3459 |
<title>从最近的MySQL版本升级</title> |
3460 |
<section> |
3461 |
<body> |
3462 |
|
3463 |
<p> |
3464 |
如果你跳过了step #1,你现在必须创建一个最近安装的版本的备份包(是数据服务的,不是数据的): |
3465 |
</p> |
3466 |
|
3467 |
<pre caption="二进制包备份"> |
3468 |
# <i>quickpkg dev-db/mysql</i> |
3469 |
</pre> |
3470 |
|
3471 |
<p> |
3472 |
现在是时间吧最近的版本和它所有的数据清理干净了: |
3473 |
</p> |
3474 |
|
3475 |
<pre caption="卸载MySQL"> |
3476 |
# <i>/etc/init.d/mysql stop</i> |
3477 |
# <i>emerge -C mysql</i> |
3478 |
# <i>tar cjpvf ~/mysql.$(date +%F"T"%H-%M).tar.bz2 /etc/mysql/my.cnf /var/lib/mysql/</i> |
3479 |
# <i>ls -l ~/mysql.*</i> |
3480 |
# <i>rm -rf /var/lib/mysql/ /var/log/mysql</i> |
3481 |
</pre> |
3482 |
|
3483 |
<note> |
3484 |
现在两个不同的备份应该存在:SQL的一个,这个在不同版本间是轻便的,另一个允许你快速恢复你的数据库。更多的细节将会在后面提到。 |
3485 |
</note> |
3486 |
|
3487 |
<p> |
3488 |
当你摆脱了旧的MySQl安装后,你现在可以安装新的版本了。记住必须用<c>revdep-rebuild</c>来rebuild与MySQL有联系的包。 |
3489 |
</p> |
3490 |
|
3491 |
<pre caption="升级二进制包"> |
3492 |
# <i>emerge -av ">mysql-4.1"</i> |
3493 |
<comment>(你也可以用dispatch-conf来升级你的配置文件)</comment> |
3494 |
# <i>etc-update</i> |
3495 |
# <i>revdep-rebuild</i> |
3496 |
</pre> |
3497 |
|
3498 |
<p> |
3499 |
现在配置新安装的MySQl版本并重启实例: |
3500 |
</p> |
3501 |
|
3502 |
<pre caption="配置MySQL4.1的基本安装"> |
3503 |
# <i>emerge --config =mysql-4.1.<comment><micro_version></comment></i> |
3504 |
# <i>/etc/init.d/mysql start</i> |
3505 |
</pre> |
3506 |
|
3507 |
<p> |
3508 |
最后你可以导入在step #2所创建的备份。 |
3509 |
</p> |
3510 |
|
3511 |
<impo> |
3512 |
默认的<path>/etc/mysql/my.cnf</path>文件默认设置了二进制的登陆(<c>log-bin</c>)。它会记录每一个对数据的修改操作。如果你运行一个非常大的数据库(大于等于1GB),它会创建极大的文件,并且迅速地用掉磁盘空间。如果你空间不够,禁用二进制登陆会是个好主意。 |
3513 |
</impo> |
3514 |
|
3515 |
<impo> |
3516 |
在MySQL4.1和之前的版本默认的编码是<c>utf8</c>。如果数据包含了<e>non</e>-ASCII编码,你可能想要保持数据库默认的编码设置,通过使用在<path>/etc/mysql/my.cnf</path>文件里的<c>latin1</c>替换所有的<c>utf8</c>的东西。在<uri link="#On_charset_conversion">Charset conversion</uri>这一章可以找到更多的信息。 |
3517 |
</impo> |
3518 |
|
3519 |
<impo> |
3520 |
管理的<c>mysql</c>数据库包括用户名、密码之间的其它东西<b>must</b>被编码为utf8。 |
3521 |
</impo> |
3522 |
|
3523 |
<p> |
3524 |
当一个未知的键被包含时,较老的mysqldump组件可能会使用错误的指令来导出表。为了解决这个问题,用一下声明来包住SQL: |
3525 |
</p> |
3526 |
|
3527 |
<pre caption="修复foreign key checks"> |
3528 |
SET FOREIGN_KEY_CHECKS=0 |
3529 |
SET FOREIGN_KEY_CHECKS=1 |
3530 |
</pre> |
3531 |
|
3532 |
<p> |
3533 |
接下来,导入备份 |
3534 |
</p> |
3535 |
|
3536 |
<pre caption="导入MySQL备份"> |
3537 |
# <i>cat BACKUP_MYSQL_4.0.SQL \</i> |
3538 |
<i>| mysql \</i> |
3539 |
<i>-uroot \</i> |
3540 |
<i>--password=</i><comment>'your_password'</comment><i> \</i> |
3541 |
<i>-hlocalhost \</i> |
3542 |
<i>--max_allowed_packet=16M</i> |
3543 |
|
3544 |
# <i>mysql_fix_privilege_tables \</i> |
3545 |
<i>--defaults-file=/etc/mysql/my.cnf \</i> |
3546 |
<i>--user=root \</i> |
3547 |
<i>--password=</i><comment>'your_password'</comment><i></i> |
3548 |
</pre> |
3549 |
|
3550 |
<p> |
3551 |
如果你现在重启MySQL服务并且所有的事都按预料进行,你就有了一个完全运行的4.1.x的MySQL版本。 |
3552 |
</p> |
3553 |
|
3554 |
<pre caption="重启MySQL实例"> |
3555 |
# <i>/etc/init.d/mysql restart</i> |
3556 |
</pre> |
3557 |
|
3558 |
<p> |
3559 |
如果当你在升级时遇到任何问题,请把它们报告到<uri link="http://bugs.gentoo.org">Bugzilla</uri> 。 |
3560 |
</p> |
3561 |
|
3562 |
</body> |
3563 |
</section> |
3564 |
</chapter> |
3565 |
|
3566 |
<chapter> |
3567 |
<title>恢复旧的MySQL 4.0安装</title> |
3568 |
<section> |
3569 |
<body> |
3570 |
|
3571 |
<p> |
3572 |
如果你不喜欢MySQL 4.1,你可以回到MySQL 4.0。 |
3573 |
</p> |
3574 |
|
3575 |
<pre caption="恢复到上一个版本"> |
3576 |
# <i>/etc/init.d/mysql stop</i> |
3577 |
# <i>emerge -C mysql</i> |
3578 |
# <i>rm -rf /var/lib/mysql/ /var/log/mysql</i> |
3579 |
# <i>emerge --usepkgonly "<mysql-4.1"</i> |
3580 |
<comment>(使用创建备份时的那个来代替 <timestamp>。)</comment> |
3581 |
# <i>tar -xjpvf mysql.<timestamp>.tar.bz2 -C /</i> |
3582 |
# <i>/etc/init.d/mysql start</i> |
3583 |
</pre> |
3584 |
|
3585 |
<impo> |
3586 |
如果依据这个指南<c>dev-db/mysql</c>以外的包被编译安装了,你必须运行<c>revdep-rebuild</c>来确保每一个客户端使用了正确的mysql客户端共享组件。 |
3587 |
</impo> |
3588 |
|
3589 |
</body> |
3590 |
</section> |
3591 |
</chapter> |
3592 |
|
3593 |
<chapter id="On_charset_conversion"> |
3594 |
<title>字符转换:</title> |
3595 |
<section> |
3596 |
<title>介绍</title> |
3597 |
<body> |
3598 |
|
3599 |
<p> |
3600 |
这一章并不打算成为一个如何做这样的转换的详尽的指南,反倒要成为一个读者可以推敲的短小的提示列表。 |
3601 |
</p> |
3602 |
|
3603 |
<p> |
3604 |
转换一个数据库可能是一个复杂的任务,并且难度随着数据的不同而增加。像serialized object和blobs是一个例子来说明把碎片弄在一起是很难的。 |
3605 |
</p> |
3606 |
|
3607 |
</body> |
3608 |
</section> |
3609 |
<section> |
3610 |
<title>索引</title> |
3611 |
<body> |
3612 |
|
3613 |
<p> |
3614 |
每个utf-8字符连索引在内一共占3Byte。MySQL里的索引可以达到1000Byte那么长(767Byte是InnoDB表)。请记住限制使用Byte来衡量的,然而卷的长度是用字符的数量来解释的。 |
3615 |
</p> |
3616 |
|
3617 |
<p> |
3618 |
MySQL也可以在column的一部分创建索引,这可能有些帮助。下面是一些例子: |
3619 |
</p> |
3620 |
|
3621 |
<pre caption="使用prefixes索引"> |
3622 |
$ <i>mysql -uroot -p'<comment>your_password</comment>' test</i> |
3623 |
|
3624 |
mysql> <i>SHOW variables LIKE "version" \G</i> |
3625 |
*************************** 1. row *************************** |
3626 |
Variable_name: version |
3627 |
Value: <comment>5.0.24-log</comment> |
3628 |
1 row in set (0.00 sec) |
3629 |
|
3630 |
mysql> <i>CREATE TABLE t1 (</i> |
3631 |
-> <i>c1 varchar(255) NOT NULL default '',</i> |
3632 |
-> <i>c2 varchar(255) NOT NULL default ''</i> |
3633 |
-> <i>) ENGINE=MyISAM DEFAULT CHARSET=utf8;</i> |
3634 |
Query OK, 0 rows affected (0.01 sec) |
3635 |
|
3636 |
mysql> <i>ALTER TABLE t1</i> |
3637 |
-> <i>ADD INDEX idx1 ( c1 , c2 );</i> |
3638 |
<comment>ERROR 1071 (42000): Specified key was too long; max key length is 1000 bytes</comment> |
3639 |
|
3640 |
mysql> <i>ALTER TABLE t1</i> |
3641 |
-> <i>ADD INDEX idx1 ( c1(165) , c2(165) );</i> |
3642 |
Query OK, 0 rows affected (0.01 sec) |
3643 |
Records: 0 Duplicates: 0 Warnings: 0 |
3644 |
|
3645 |
mysql> <i>CREATE TABLE t2 (</i> |
3646 |
-> <i>c1 varchar(255) NOT NULL default '',</i> |
3647 |
-> <i>c2 varchar(255) NOT NULL default ''</i> |
3648 |
-> <i>) ENGINE=MyISAM DEFAULT CHARSET=sjis;</i> |
3649 |
Query OK, 0 rows affected (0.00 sec) |
3650 |
|
3651 |
mysql> <i>ALTER TABLE t2</i> |
3652 |
-> <i>ADD INDEX idx1 ( c1(250) , c2(250) );</i> |
3653 |
Query OK, 0 rows affected (0.03 sec) |
3654 |
Records: 0 Duplicates: 0 Warnings: 0 |
3655 |
|
3656 |
mysql> <i>CREATE TABLE t3 (</i> |
3657 |
-> <i>c1 varchar(255) NOT NULL default '',</i> |
3658 |
-> <i>c2 varchar(255) NOT NULL default ''</i> |
3659 |
-> <i>) ENGINE=MyISAM DEFAULT CHARSET=latin1;</i> |
3660 |
Query OK, 0 rows affected (0.00 sec) |
3661 |
|
3662 |
mysql> <i>ALTER TABLE t3</i> |
3663 |
-> <i>ADD INDEX idx1 ( c1 , c2 );</i> |
3664 |
Query OK, 0 rows affected (0.03 sec) |
3665 |
Records: 0 Duplicates: 0 Warnings: 0 |
3666 |
</pre> |
3667 |
|
3668 |
</body> |
3669 |
</section> |
3670 |
<section> |
3671 |
<title>环境</title> |
3672 |
<body> |
3673 |
|
3674 |
<p> |
3675 |
系统必须配置成支持UTF-8编码。你会在我们的<uri link="/doc/en/utf-8.xml">Using UTF-8 with Gentoo</uri>和<uri link="/doc/en/guide-localization.xml">Localization Guide</uri>文档里发现更多信息。 |
3676 |
</p> |
3677 |
|
3678 |
<p> |
3679 |
在这个例子里,我们设置一些在<path>/etc/env.d/02locale</path>文件里的环境变量来利用英文的UTF-8编码: |
3680 |
</p> |
3681 |
|
3682 |
<pre caption="/etc/env.d/02locale"> |
3683 |
LC_ALL=en_US.UTF-8 |
3684 |
LANG=en_US.UTF-8 |
3685 |
</pre> |
3686 |
|
3687 |
<p> |
3688 |
接下来请确定运行<c>env-update && source /etc/profile</c>。 |
3689 |
</p> |
3690 |
|
3691 |
</body> |
3692 |
</section> |
3693 |
<section> |
3694 |
<title>iconv</title> |
3695 |
<body> |
3696 |
|
3697 |
<p> |
3698 |
由<c>sys-libs/glibc</c>提供的<c>iconv</c>是用来将文本文件从一个编码转换到另一个编码的工具。你也可以使用<c>app-text/recode</c>。 |
3699 |
</p> |
3700 |
|
3701 |
<pre caption="使用iconv"> |
3702 |
<comment>(从latin1到utf8)</comment> |
3703 |
$ <i>iconv -f ISO-8859-15 -t UTF-8 file1.sql > file2.sql</i> |
3704 |
|
3705 |
<comment>(从日语到utf8)</comment> |
3706 |
$ <i>iconv -f ISO2022JP -t UTF-8 file1.sql > file2.sql</i> |
3707 |
</pre> |
3708 |
|
3709 |
<p> |
3710 |
<c>iconv</c>可以在环境不是设置成utf8时记录一个sql的dump。 |
3711 |
</p> |
3712 |
|
3713 |
</body> |
3714 |
</section> |
3715 |
<section> |
3716 |
<title>SQL矫正</title> |
3717 |
<body> |
3718 |
|
3719 |
<p> |
3720 |
你可以使用<c>CONVERT()</c>和<c>CAST()</c>这两个MySQL函数来转换在你的SQL脚本中的数据。 |
3721 |
</p> |
3722 |
|
3723 |
</body> |
3724 |
</section> |
3725 |
<section> |
3726 |
<title>Apache(web服务器)</title> |
3727 |
<body> |
3728 |
|
3729 |
<p> |
3730 |
为了apache使用utf8,你必须调节以下在<path>httpd.conf</path>文件里的变量:AddDefaultCharset,CharsetDefault和CharsetSourceEnc。如果你的html文件源码没有用utf8编码,那它们必须<b>must</b>被<c>iconv</c>或者<c>recode</c>转换。 |
3731 |
</p> |
3732 |
|
3733 |
</body> |
3734 |
</section> |
3735 |
</chapter> |
3736 |
</guide> |
3737 |
|
3738 |
|
3739 |
|
3740 |
1.1 xml/htdocs/doc/zh_cn/nano-basics-guide.xml |
3741 |
|
3742 |
file : http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/doc/zh_cn/nano-basics-guide.xml?rev=1.1&view=markup |
3743 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/doc/zh_cn/nano-basics-guide.xml?rev=1.1&content-type=text/plain |
3744 |
|
3745 |
Index: nano-basics-guide.xml |
3746 |
=================================================================== |
3747 |
<?xml version='1.0' encoding="UTF-8"?> |
3748 |
<!DOCTYPE guide SYSTEM "/dtd/guide.dtd"> |
3749 |
|
3750 |
<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/zh_cn/nano-basics-guide.xml,v 1.1 2007/09/17 17:54:10 r0bertz Exp $ --> |
3751 |
<!-- English CVS version: 1.25 --> |
3752 |
|
3753 |
<guide link="/doc/zh_cn/nano-basics-guide.xml" lang="zh_cn"> |
3754 |
|
3755 |
<title>Nano基础指南</title> |
3756 |
|
3757 |
<author title="Gentoo Doc Editor"> |
3758 |
<!-- meekrob@g.o --> |
3759 |
Sherman Boyd |
3760 |
</author> |
3761 |
<author title="Editor"> |
3762 |
<mail link="swift@g.o">Sven Vermeulen</mail> |
3763 |
</author> |
3764 |
<author title="Translator"> |
3765 |
<mail link="zm3345@×××××.com">Zhou Mi</mail> |
3766 |
</author> |
3767 |
|
3768 |
<abstract> |
3769 |
这是篇nano简明使用指南,能帮助你尽快了解nano的基本用法。 |
3770 |
</abstract> |
3771 |
|
3772 |
<version>1.6</version> |
3773 |
<date>2006-01-05</date> |
3774 |
|
3775 |
<chapter> |
3776 |
<title>Nano基础</title> |
3777 |
<section> |
3778 |
<title>目的</title> |
3779 |
<body> |
3780 |
|
3781 |
<p> |
3782 |
这是篇nano简明使用指南,帮助你快速了解nano的基本用法。如想获取更多的帮助信息,请参阅: |
3783 |
</p> |
3784 |
|
3785 |
<p> |
3786 |
<uri>http://www.nano-editor.org</uri> |
3787 |
</p> |
3788 |
|
3789 |
</body> |
3790 |
</section> |
3791 |
<section> |
3792 |
<title>打开文件与新建文件</title> |
3793 |
<body> |
3794 |
|
3795 |
<p> |
3796 |
使用nano打开或新建文件,只需键入: |
3797 |
</p> |
3798 |
|
3799 |
<pre caption="打开或新建文件"> |
3800 |
# <i>nano 文件名</i> |
3801 |
</pre> |
3802 |
|
3803 |
<p> |
3804 |
Nano是一种单模式编辑器,你可以直接输入文字。如果你要编辑一个像<path>/etc/fstab</path>一样的配置文件,请使用<c>-w</c>参数,例如: |
3805 |
</p> |
3806 |
|
3807 |
<pre caption="禁用自动换行"> |
3808 |
# <i>nano -w /etc/fstab</i> |
3809 |
</pre> |
3810 |
|
3811 |
<warn> |
3812 |
这非常重要。如果在编辑配置文件时忘了加<c>-w</c>参数,可能会导致你的系统无法起动或产生别的异常。 |
3813 |
</warn> |
3814 |
|
3815 |
</body> |
3816 |
</section> |
3817 |
<section> |
3818 |
<title>保存和退出</title> |
3819 |
<body> |
3820 |
|
3821 |
<p> |
3822 |
如果你要保存所做的修改,按下<c>Ctrl+O</c>。想要退出,按下<c>Ctrl+X</c>。如果你退出前没有保存所做的修改,它会提示你是否要保存。如果不要,请按<c>N</c>,反之,则按<c>Y</c>。然后它会让你确认要保存的文件名,确认或修改后按<c>Enter</c>即可。 |
3823 |
</p> |
3824 |
|
3825 |
<p> |
3826 |
如果你没有修改好而不小心按了保存键,您可以在请求确认文件名时按<c>Ctrl+C</c>来取消。 |
3827 |
</p> |
3828 |
|
3829 |
</body> |
3830 |
</section> |
3831 |
<section> |
3832 |
<title>剪切和粘贴</title> |
3833 |
<body> |
3834 |
|
3835 |
<p> |
3836 |
要剪切一整行,请用<c>Ctrl+K</c>(按住<c>Ctrl</c>不放,再按下<c>K</c>键)。光标所在的行便消失了。要粘贴它,只需把光标移动到您所要粘贴的位置,然后按<c>Ctrl+U</c>即可。要移动多行,只需多按几次<c>Ctrl+K</c>把需要移动内容都剪切下来,然后按一次<c>Ctrl+U</c>就可以把刚剪切的内容全部粘贴上来。 |
3837 |
</p> |
3838 |
|
3839 |
<p> |
3840 |
如果你想使用更精确的剪切控制,则需要给文本做标记。移动光标到需要剪切文本的开头,按下<c>Ctrl+6</c>(或者<c>Alt+A</c>)。然后移动光标到待剪切文本的末尾:被做了标记的文本便会反白。要撤消文本标记,只需再按一次<c>Ctrl+6</c>。用<c>Ctrl+K</c>来剪切被标记的文本,用<c>Ctrl+U</c>来粘贴。 |
3841 |
</p> |
3842 |
|
3843 |
</body> |
3844 |
</section> |
3845 |
<section> |
3846 |
<title>搜索特定文字</title> |
3847 |
<body> |
3848 |
|
3849 |
<p> |
3850 |
当你想搜索某特定文字时,只要想成<e>"WhereIs"</e>而不是<e>"Search"</e>,事情就简单了。只要按下<c>Ctrl+W</c>,键入你要搜索的字符串,再按<c>Enter</c>就可以了。想再次搜索相同的字符串,可以直接按<c>Alt+W</c>。 |
3851 |
</p> |
3852 |
|
3853 |
<note> |
3854 |
在nano帮助文档里,Ctrl-键被表示为一个脱字符(<c>^</c>),因此<c>Ctrl+W</c>被写成了<c>^W</c>,等等。Alt-键被表示为一个<c>M</c>(从"Meta"而来),因此<c>Alt+W</c>被写成了<c>M-W</c>。 |
3855 |
</note> |
3856 |
|
3857 |
</body> |
3858 |
</section> |
3859 |
<section> |
3860 |
<title>更多选项</title> |
3861 |
<body> |
3862 |
|
3863 |
<p> |
3864 |
如果你有兴趣调整nano设置,一定去看看<path>/etc/nanorc</path>。 |
3865 |
</p> |
3866 |
|
3867 |
</body> |
3868 |
</section> |
3869 |
<section> |
3870 |
<title>最后</title> |
3871 |
<body> |
3872 |
|
3873 |
<p> |
3874 |
就这样子吧!感谢#gentoo频道里的kiyose和quazion。再次提醒你,要了解更多的nano信息,请参阅:</p> |
3875 |
|
3876 |
<p> |
3877 |
<uri>http://www.nano-editor.org</uri> |
3878 |
</p> |
3879 |
|
3880 |
</body> |
3881 |
</section> |
3882 |
</chapter> |
3883 |
</guide> |
3884 |
|
3885 |
|
3886 |
|
3887 |
1.1 xml/htdocs/doc/zh_cn/portage-utils.xml |
3888 |
|
3889 |
file : http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/doc/zh_cn/portage-utils.xml?rev=1.1&view=markup |
3890 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/doc/zh_cn/portage-utils.xml?rev=1.1&content-type=text/plain |
3891 |
|
3892 |
Index: portage-utils.xml |
3893 |
=================================================================== |
3894 |
<?xml version="1.0" encoding="utf-8"?> |
3895 |
<!DOCTYPE guide SYSTEM "/dtd/guide.dtd"> |
3896 |
|
3897 |
<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/zh_cn/portage-utils.xml,v 1.1 2007/09/17 17:54:10 r0bertz Exp $ --> |
3898 |
<!-- English CVS version: 1.5 --> |
3899 |
|
3900 |
<guide link="/doc/zh_cn/portage-utils.xml" lang="zh_cn"> |
3901 |
|
3902 |
<title>Portage-utils</title> |
3903 |
|
3904 |
<author title="作者"> |
3905 |
<mail link="rane@g.o">Łukasz Damentko</mail> |
3906 |
</author> |
3907 |
<author title="编辑"> |
3908 |
<mail link="nightmorph@g.o">Joshua Saddler</mail> |
3909 |
</author> |
3910 |
<author title="编辑"> |
3911 |
<mail link="vanquirius@g.o">Marcelo Góes</mail> |
3912 |
</author> |
3913 |
<author title="译者"> |
3914 |
<mail link="jjj3112000@×××.com">Zezhou Jiang</mail> |
3915 |
</author> |
3916 |
|
3917 |
<abstract> |
3918 |
这个指南涵盖了一些普通的portage-utils用法,portage-utils是一套用C写的快速Portage帮助程序。 |
3919 |
</abstract> |
3920 |
|
3921 |
<!-- The content of this document is licensed under the CC-BY-SA license --> |
3922 |
<!-- See http://creativecommons.org/licenses/by-sa/2.5 --> |
3923 |
<license/> |
3924 |
|
3925 |
<version>1.3</version> |
3926 |
<date>2007-05-23</date> |
3927 |
|
3928 |
<chapter> |
3929 |
<title>介绍</title> |
3930 |
<section> |
3931 |
<body> |
3932 |
|
3933 |
<p> |
3934 |
<c>portage-utils</c>是一套使用C写的非常快速的程序集,对于<c>gentoolkit</c>来说,它是意在提供一个快速但选择有限的副本。请记住<c>portage-utils</c>不是打算代替<c>gentoolkit</c>。虽然它的组件比同等的<c>gentoolkit</c>的组件更有效率,而且也许在需要重复地调用Portage时更适于用于脚本,但是<c>portage-utils</c>不提供同样的函数。它重来不考虑eclass,并且不提供像<c>revdep-rebuild</c>和<c>glsa-check</c>之类的工具。 |
3935 |
</p> |
3936 |
|
3937 |
<p> |
3938 |
你可以在<uri link="/doc/en/gentoolkit.xml">Gentoolkit</uri>指南里找到更多有关<c>gentoolkit</c>的信息。 |
3939 |
</p> |
3940 |
|
3941 |
<p> |
3942 |
你可以键入<c>man q</c> or <c>q --help</c>来得到<c>portage-utils</c>里的所有程序的列表。请阅读提到的所有的软件的man页,因为这个指南只是对这些最有用的函数进行一个简要的介绍,并且不包括每一个程序的所有信息。 |
3943 |
</p> |
3944 |
|
3945 |
<p> |
3946 |
使用<c>portage-utils</c>的第一步是安装包文件: |
3947 |
</p> |
3948 |
|
3949 |
<pre caption="安装portage-utils"> |
3950 |
# <i>emerge portage-utils</i> |
3951 |
</pre> |
3952 |
|
3953 |
</body> |
3954 |
</section> |
3955 |
</chapter> |
3956 |
|
3957 |
<chapter> |
3958 |
<title>使用</title> |
3959 |
<section> |
3960 |
<title>如何找到一个文件属于的包</title> |
3961 |
<body> |
3962 |
|
3963 |
<p> |
3964 |
用<c>qfile</c>找一个文件属于的包: |
3965 |
</p> |
3966 |
|
3967 |
<pre caption="找到一个文件属于的包"> |
3968 |
$ <i>qfile /etc/fonts/fonts.conf</i> |
3969 |
media-libs/fontconfig (/etc/fonts/fonts.conf) |
3970 |
$ <i>qfile /usr/share/keymaps/atari/atari-uk-falcon.map.gz</i> |
3971 |
sys-apps/kbd (/usr/share/keymaps/atari/atari-uk-falcon.map.gz) |
3972 |
</pre> |
3973 |
|
3974 |
</body> |
3975 |
</section> |
3976 |
<section> |
3977 |
<title>验证包的完整性</title> |
3978 |
<body> |
3979 |
|
3980 |
<p> |
3981 |
如果你想要检查被某些包安装的文件的MD5或者是mtimes,你可以使用<c>qcheck</c>应用程序: |
3982 |
</p> |
3983 |
|
3984 |
<pre caption="检查包的完整性"> |
3985 |
$ <i>qcheck portage-utils</i> |
3986 |
Checking app-portage/portage-utils-0.1.13 ... |
3987 |
* 36 out of 36 files are good |
3988 |
</pre> |
3989 |
|
3990 |
<p> |
3991 |
当然,所有的安装后改变的文件都会在这里被报告。如果某个程序报告你必须在安装完后手动编辑配置文件,那其实没有什么可担心的。 |
3992 |
</p> |
3993 |
|
3994 |
</body> |
3995 |
</section> |
3996 |
<section> |
3997 |
<title>列出依赖于某些包的包文件</title> |
3998 |
<body> |
3999 |
|
4000 |
<p> |
4001 |
当然那里也有能让你列出某些包依赖的所有的包。这你可以使用<c>qdepends</c>来达到。使用<c>-a</c>选项来显示某个包所有的DEPEND,RDEPEND和PDEPEND信息。 |
4002 |
</p> |
4003 |
|
4004 |
<pre caption="列出依赖于某些包的包文件"> |
4005 |
$ <i>qdepends -a pygtk</i> |
4006 |
* DEPEND |
4007 |
dev-python/pygtk-2.8.2: >=dev-lang/python-2.3 >=x11-libs/gtk+-2.8.0 |
4008 |
>=dev-libs/glib-2.8.0 >=x11-libs/pango-1.10.0 >=dev-libs/atk-1.8.0 |
4009 |
>=gnome-base/libglade-2.5.0 >=dev-python/pycairo-0.9.0 dev-python/numeric |
4010 |
virtual/opengl dev-python/pyopengl >=x11-libs/gtkglarea-1.99 |
4011 |
>=dev-util/pkgconfig-0.9 sys-devel/patch |
4012 |
* RDEPEND |
4013 |
dev-python/pygtk-2.8.2: >=dev-lang/python-2.3 >=x11-libs/gtk+-2.8.0 |
4014 |
>=dev-libs/glib-2.8.0 >=x11-libs/pango-1.10.0 >=dev-libs/atk-1.8.0 |
4015 |
>=gnome-base/libglade-2.5.0 >=dev-python/pycairo-0.9.0 dev-python/numeric |
4016 |
virtual/opengl dev-python/pyopengl >=x11-libs/gtkglarea-1.99 |
4017 |
* PDEPEND |
4018 |
</pre> |
4019 |
|
4020 |
</body> |
4021 |
</section> |
4022 |
<section> |
4023 |
<title>列出属于一个ebuild文件的文件</title> |
4024 |
<body> |
4025 |
|
4026 |
<p> |
4027 |
<c>qlist</c>给你属于一个ebuild的所有文件的列表 |
4028 |
</p> |
4029 |
|
4030 |
<pre caption="列出属于一个ebuild文件的文件"> |
4031 |
$ <i>qlist vim</i> |
4032 |
/usr/bin/gvim |
4033 |
/usr/bin/gvimdiff |
4034 |
/usr/bin/evim |
4035 |
/usr/bin/eview |
4036 |
/usr/bin/gview |
4037 |
/usr/bin/rgvim |
4038 |
[...] |
4039 |
</pre> |
4040 |
|
4041 |
</body> |
4042 |
</section> |
4043 |
<section> |
4044 |
<title>搜索使用某些USE标记的包</title> |
4045 |
<body> |
4046 |
|
4047 |
<p> |
4048 |
使用<c>quse</c>来做这事,它必须使用root用户来运行。当第一次建立/更新ebuild缓存时可能需要一些时间。 |
4049 |
</p> |
4050 |
|
4051 |
<pre caption="寻找带有“firefox”USE标记的包"> |
4052 |
# <i>quse firefox</i> |
4053 |
app-office/openoffice/openoffice-2.0.2_rc1.ebuild binfilter curl eds firefox gnome gtk java kde ldap xml2 |
4054 |
dev-haskell/gtk2hs/gtk2hs-0.9.10.ebuild doc glade gnome firefox |
4055 |
dev-java/swt/swt-3.1-r1.ebuild accessibility cairo firefox gnome |
4056 |
[...] |
4057 |
</pre> |
4058 |
|
4059 |
</body> |
4060 |
</section> |
4061 |
<section> |
4062 |
<title>找到包的大小</title> |
4063 |
<body> |
4064 |
|
4065 |
<p> |
4066 |
使用<c>qsize</c>程序来做这件事是想要多简单就有多简单: |
4067 |
</p> |
4068 |
|
4069 |
<pre caption="找到包的大小"> |
4070 |
$ <i>qsize vim</i> |
4071 |
app-editors/gvim-6.4: 10 files, 7 non-files, 2327.516 KB |
4072 |
app-editors/vim-6.4: 6 files, 2 non-files, 2058.14 KB |
4073 |
app-editors/vim-core-6.4: 1024 files, 68 non-files, 10950.984 KB |
4074 |
[...] |
4075 |
</pre> |
4076 |
|
4077 |
</body> |
4078 |
</section> |
4079 |
<section> |
4080 |
<title>搜索Portage树</title> |
4081 |
<body> |
4082 |
|
4083 |
<p> |
4084 |
<c>portage-utils</c>的最强大的工具之一是<c>qsearch</c>。这个工具允许你比默认的<c>emerge -s</c>更快地搜索Portage树。 |
4085 |
</p> |
4086 |
|
4087 |
<p> |
4088 |
这里是一些关于它的用法的示例: |
4089 |
</p> |
4090 |
|
4091 |
<pre caption="使用qsearch来搜索软件包树"> |
4092 |
<comment>(我忘记了我最喜欢的字体的包的名字)</comment> |
4093 |
$ <i>qsearch terminus</i> |
4094 |
media-fonts/terminus-font A clean fixed font for the console and X11 |
4095 |
|
4096 |
<comment>(我想谢谢制作了它们的那个家伙。他的主页是什么?)</comment> |
4097 |
$ <i>qsearch -H terminus</i> |
4098 |
media-fonts/terminus-font http://www.is-vn.bg/hamster/jimmy-en.html |
4099 |
|
4100 |
<comment>(我现在要一个聊天客户端)</comment> |
4101 |
$ <i>qsearch -S "jabber client"</i> |
4102 |
app-emacs/emacs-jabber A Jabber client for Emacs. |
4103 |
net-im/gajim Jabber client written in PyGTK |
4104 |
net-im/gnome-jabber Gnome Jabber Client |
4105 |
net-im/gossip Lightweight Jabber client for GNOME |
4106 |
net-im/imcom Python commandline Jabber Client |
4107 |
net-im/psi QT 3.x Jabber Client, with Licq-like interface |
4108 |
net-im/tkabber Featureful Jabber client for tcl/tk. |
4109 |
x11-themes/psi-themes Iconsets for Psi, a QT 3.x Jabber Client |
4110 |
</pre> |
4111 |
|
4112 |
</body> |
4113 |
</section> |
4114 |
<section> |
4115 |
<title>从emerge的log文件里提取信息</title> |
4116 |
<body> |
4117 |
|
4118 |
<p> |
4119 |
那里也有一个允许你从你的<path>emerge.log</path>文件里提取有用信息的工具。它叫做<c>qlop</c>,并且当你想要评估包的编译时间或者和你的朋友比较谁的电脑比较快时它会很有用。它也能让你现在正在编译什么和要多长时间,这当你在命令行下并打算检查它时很方便。 |
4120 |
</p> |
4121 |
|
4122 |
<pre caption="用qlop阅读emerge的log文件"> |
4123 |
<comment>(我现在开始编译安装perl,并且我想要一个它一般要安装多长的预测)</comment> |
4124 |
$ <i>qlop -tH perl</i> |
4125 |
perl: 7 minutes, 52 seconds for 4 merges |
4126 |
<comment>(现在让我们看看正在编译安装什么)</comment> |
4127 |
$ <i>qlop -c</i> |
4128 |
* perl-5.8.8-r23 |
4129 |
started: Mon May 21 12:41:11 2007 |
4130 |
elapsed: 19 seconds |
4131 |
</pre> |
4132 |
|
4133 |
</body> |
4134 |
</section> |
4135 |
</chapter> |
4136 |
</guide> |
4137 |
|
4138 |
|
4139 |
|
4140 |
1.1 xml/htdocs/doc/zh_cn/vdr-guide.xml |
4141 |
|
4142 |
file : http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/doc/zh_cn/vdr-guide.xml?rev=1.1&view=markup |
4143 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/doc/zh_cn/vdr-guide.xml?rev=1.1&content-type=text/plain |
4144 |
|
4145 |
Index: vdr-guide.xml |
4146 |
=================================================================== |
4147 |
<?xml version="1.0" encoding="utf-8"?> |
4148 |
<!DOCTYPE guide SYSTEM "/dtd/guide.dtd"> |
4149 |
|
4150 |
<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/zh_cn/vdr-guide.xml,v 1.1 2007/09/17 17:54:10 r0bertz Exp $ --> |
4151 |
<!-- English CVS version: 1.7 --> |
4152 |
|
4153 |
<guide link="/doc/zh_cn/vdr-guide.xml" lang="zh_cn"> |
4154 |
<title>Gentoo Linux VDR指南</title> |
4155 |
|
4156 |
<author title="作者"> |
4157 |
<mail link="ng@××××.de">Norman Golisz</mail> |
4158 |
</author> |
4159 |
<author title="作者"> |
4160 |
<mail link="diox@g.o">Dimitry Bradt</mail> |
4161 |
</author> |
4162 |
<author title="作者"> |
4163 |
<mail link="zzam@g.o">Matthias Schwarzott</mail> |
4164 |
</author> |
4165 |
<author title="编辑"> |
4166 |
<mail link="nightmorph@g.o">Joshua Saddler</mail> |
4167 |
</author> |
4168 |
<author title="译者"> |
4169 |
<mail link="kunxi@×××××.org">奚焜</mail> |
4170 |
</author> |
4171 |
|
4172 |
<abstract> |
4173 |
本指南向您展示如何配置Gentoo Linux来支持DVB和VDR。 |
4174 |
</abstract> |
4175 |
|
4176 |
<!-- The content of this document is licensed under the CC-BY-SA license --> |
4177 |
<!-- See http://creativecommons.org/licenses/by-sa/2.5 --> |
4178 |
<license/> |
4179 |
|
4180 |
<version>1.4</version> |
4181 |
<date>2007-01-02</date> |
4182 |
|
4183 |
<chapter> |
4184 |
<title>DVB简介</title> |
4185 |
<section> |
4186 |
<title>什么是DVB?</title> |
4187 |
<body> |
4188 |
|
4189 |
<p> |
4190 |
<e>DVB</e>是<e>Digital Video Broadcasting,数字视频广播</e>的简称。DVB描述了如何传播电视,广播和交互服务,比如MHP(多媒体家庭平台),EPG(数字节目向导)和teletext。采用MPEG-2数据压缩技术(HDTV采用H.264),使得在同一个频带上传输多路电视信号成为可能。数据压缩率越高,能够传输的频道越多,同时图像质量的损失也越大。</p> |
4191 |
|
4192 |
<p> |
4193 |
DVB可以通过多种方法传播。末尾的字母标志了传播的方式,比如DVB-<e>T</e>是陆基传播。此外还有其他的传播方式: |
4194 |
</p> |
4195 |
|
4196 |
<ul> |
4197 |
<li>DVB-S是通过卫星传播</li> |
4198 |
<li>DVB-C是通过光纤传播</li> |
4199 |
<li>DVB-H是面向移动设备的传播(陆基)</li> |
4200 |
<li>DVB-IPI是通过基于IP网络的传播,比如互联网</li> |
4201 |
<li> |
4202 |
DVB-RC(S/C/T)指定了用于传输数据服务的回馈频道,比如宽带互联网 |
4203 |
</li> |
4204 |
</ul> |
4205 |
|
4206 |
</body> |
4207 |
</section> |
4208 |
|
4209 |
<section> |
4210 |
<title>DVB卡的种类和要求</title> |
4211 |
<body> |
4212 |
|
4213 |
<p> |
4214 |
除了根据DVB流的接收方式外,DVB卡还根据输出分为两类。第一类卡内置了解码器,可以通过<path>/dev/video</path>直接访问视频流,我们称其为<e>全功能卡</e>。另外一类卡没有解码器,需要主机提供软件解码,即<e>简装版卡</e>。这通常意味着较高的系统需求。您的计算机至少要配备600MHz主频以上的CPU,256MB以上的内存。<uri link="http://linuxtv.org/wiki/index.php/DVB_Card_Vendors">此表</uri>可以帮助您找到您的板卡。 |
4215 |
</p> |
4216 |
|
4217 |
</body> |
4218 |
</section> |
4219 |
</chapter> |
4220 |
|
4221 |
<chapter> |
4222 |
<title>准备系统</title> |
4223 |
<section> |
4224 |
<title>配置内核</title> |
4225 |
<body> |
4226 |
|
4227 |
<p> |
4228 |
首先,我们必须保证您的内核支持DVB以及您的DVB设备。自2.6系列内核起,所需的驱动已经包含在内核源代码中。检查您的内核配置,保证下列的选项被编译进内核或者模块。 |
4229 |
</p> |
4230 |
|
4231 |
<pre caption="需要的内核选项"> |
4232 |
Input Device Support ---> |
4233 |
* Event Interface |
4234 |
Device Drivers ---> |
4235 |
Multimedia Devices ---> |
4236 |
Digital Video Broadcasting Devices ---> |
4237 |
[*] DVB For Linux |
4238 |
* DVB Core Support |
4239 |
M [您的驱动] |
4240 |
</pre> |
4241 |
|
4242 |
<p> |
4243 |
此外,我们还需要为您的硬件选择合适的驱动。为了找出您的卡的正确驱动,我们将所有的驱动都编译成模块。如果您使用的是PCI设备,请安装<c>pciutils</c>。如果您希望将驱动编入内核或者您没有PCI卡,您可以跳过这个步骤,前进至<uri link="#kernel_output">检查内核输出</uri>。 |
4244 |
</p> |
4245 |
|
4246 |
<pre caption="安装pciutils"> |
4247 |
# <i>emerge pciutils</i> |
4248 |
</pre> |
4249 |
|
4250 |
<p> |
4251 |
在启动了新内核后,我们运行<c>pcimodules</c>来列出所需的驱动。 |
4252 |
</p> |
4253 |
|
4254 |
<pre caption="列出所需的模块"> |
4255 |
# <i>pcimodules</i> |
4256 |
ohci-hcd |
4257 |
ehci-hcd |
4258 |
sis900 |
4259 |
snd-emu10k1 |
4260 |
b2c2-flexcop-pci |
4261 |
nvidia |
4262 |
nvidiafb |
4263 |
</pre> |
4264 |
|
4265 |
<p> |
4266 |
在这种情况下,我们需要加载内核模块<c>b2c2-flexcop-pci</c>。我们在<path>/etc/modules.autoload.d/kernel-2.6</path>里加入这个驱动模块名。 |
4267 |
</p> |
4268 |
|
4269 |
<pre caption="加入驱动模块名"> |
4270 |
# <i>echo b2c2-flexcop-pci >> /etc/modules.autoload.d/kernel-2.6</i> |
4271 |
</pre> |
4272 |
|
4273 |
</body> |
4274 |
</section> |
4275 |
|
4276 |
<section id="kernel_output"> |
4277 |
<title>检查内核输出</title> |
4278 |
<body> |
4279 |
|
4280 |
<p> |
4281 |
推荐将所有的驱动都编译成模块,这样您就以动态地加载所需的模块,这在您不清楚所需模块名的时候特别有用。如果您已经知道了模块名,您可以将这个驱动编译进内核。编译内核,安装模块,重启系统。您可以用<c>dmesg</c>来检查是否您的内核成功地探测到您的板卡。 |
4282 |
</p> |
4283 |
|
4284 |
<pre caption="检查内核输出"> |
4285 |
# <i>dmesg | grep DVB</i> |
4286 |
<comment>(如果您的系统配备了TerraTec Ciergy T2,您的输出可能是这样:)</comment> |
4287 |
DVB: registering new adaptor (TerraTec/qanu USB2.0 Highspeed DVB-T Receiver). |
4288 |
input: TerraTec/qanu USB2.0 Highspeed DVB-T Receiver remote control as /class/input/input2 |
4289 |
</pre> |
4290 |
|
4291 |
</body> |
4292 |
</section> |
4293 |
</chapter> |
4294 |
|
4295 |
<chapter id="inst_vdr"> |
4296 |
<title>安装VDR</title> |
4297 |
<section> |
4298 |
<body> |
4299 |
|
4300 |
<p> |
4301 |
要安装VDR,我们只需要emerge它。 |
4302 |
</p> |
4303 |
|
4304 |
<pre caption="安装VDR"> |
4305 |
# <i>emerge vdr</i> |
4306 |
</pre> |
4307 |
|
4308 |
<p> |
4309 |
我们现在继续<uri link="#inst_ir_remote">安装遥控</uri>。 |
4310 |
</p> |
4311 |
|
4312 |
</body> |
4313 |
</section> |
4314 |
</chapter> |
4315 |
|
4316 |
<chapter id="inst_ir_remote"> |
4317 |
<title>安装遥控</title> |
4318 |
<section> |
4319 |
<body> |
4320 |
|
4321 |
<p> |
4322 |
有两种方法可以通过红外遥控您的VDR。如果您的电视卡内置支持红外接收器,您可以用<c>vdr-remote</c>。否则,您很有可能需要LIRC。 |
4323 |
</p> |
4324 |
|
4325 |
</body> |
4326 |
</section> |
4327 |
<section> |
4328 |
<title>安装vdr-remote</title> |
4329 |
<body> |
4330 |
|
4331 |
<p> |
4332 |
我们首先通过emerge来安装插件: |
4333 |
</p> |
4334 |
|
4335 |
<pre caption="安装vdr-remote"> |
4336 |
# <i>emerge vdr-remote</i> |
4337 |
# <i>emerge --config vdr-remote</i> |
4338 |
</pre> |
4339 |
|
4340 |
<p> |
4341 |
当使用遥控插件来管理您DVB卡上的红外端口,默认的配置应该工作正常。它将自动使用包含"dvb"的输入设备。高级用户可以看一下<path>/etc/conf.d/vdr.remote</path>配置文件。 |
4342 |
</p> |
4343 |
|
4344 |
<p> |
4345 |
现在继续<uri link="#video-out">视频输出方案</uri>。 |
4346 |
</p> |
4347 |
|
4348 |
</body> |
4349 |
</section> |
4350 |
<section> |
4351 |
<title>其他方法:安装LIRC</title> |
4352 |
<body> |
4353 |
|
4354 |
<p> |
4355 |
如果您的卡支持遥控(但是您无法或者不愿意使用<c>vdr-remote</c>),您也许希望配置LIRC。LIRC会分析按下的键,为每一个键返回一个名字。支持LIRC的程序会等待键盘信息,然后运行配置文件中指定的动作,配置文件大多保存在可执行文件的配置目录中(比如,<c>mplayer</c>加载<path>~/.mplayer/lircrc</path>)。安装LIRC之前,您先要把<c>lirc</c>加入到您的USE标记中,并在<path>/etc/make.conf</path>加入一个新的条目:<c>LIRC_DEVICES</c>。用<uri link="http://www.lirc.org/html/table.html">下表</uri>来找到这个选项的合适参数。 |
4356 |
</p> |
4357 |
|
4358 |
<pre caption="安装LIRC"> |
4359 |
# <i>nano -w /etc/make.conf</i> |
4360 |
<comment>(用合适的驱动替代"devinput")</comment> |
4361 |
LIRC_DEVICES="devinput" |
4362 |
USE="lirc" |
4363 |
# <i>emerge lirc</i> |
4364 |
</pre> |
4365 |
|
4366 |
<p> |
4367 |
首先,我们要为每个键值定义一个名字。大多数支持的遥控器已经正确的配置了。请参考<uri link="http://lirc.sourceforge.net/remotes/">遥控器列表</uri>,下载所需的文件,保存为<path>/etc/lircd.conf</path>。然后,我们要找出用什么设备来访问我们的遥控器。运行下述命令来获得当前的输入设备列表(请确保您的设备在运行中)。</p> |
4368 |
|
4369 |
<pre caption="当前的输入设备列表"> |
4370 |
# <i>cat /proc/bus/input/devices</i> |
4371 |
I: Bus=0000 Vendor=0000 Product=0000 Version=0000 |
4372 |
N: Name="TerraTec/qanu USB2.0 Highspeed DVB-T Receiver remote control" |
4373 |
P: Phys=usb-0000:00:1d.7-1/input0 |
4374 |
S: Sysfs=/class/input/input2 |
4375 |
H: Handlers=kbd event1 |
4376 |
B: EV=100003 |
4377 |
B: KEY=108fc210 2043 0 0 0 0 8000 2080 1 9e1680 0 0 ffc |
4378 |
</pre> |
4379 |
|
4380 |
<p> |
4381 |
本例中的设备是Terratec Cinergy T2,所以我们可以通过<path>/dev/input/event1</path>来访问设备。用您的输出中相应的设备来替换<c>event1</c>。 |
4382 |
</p> |
4383 |
|
4384 |
<p> |
4385 |
<c>lircd</c>需要知道设备名。加入此行到<path>/etc/conf.d/lirc.conf</path>。请用您的实际驱动名和设备名替换<c>devinput</c>和<c>event1</c>。 |
4386 |
</p> |
4387 |
|
4388 |
<pre caption="加入lircd选项"> |
4389 |
LIRCD_OPTS="-H devinput -d /dev/input/event1" |
4390 |
</pre> |
4391 |
|
4392 |
<p> |
4393 |
是时候启动<c>lircd</c>了: |
4394 |
</p> |
4395 |
|
4396 |
<pre caption="启动lircd"> |
4397 |
# <i>/etc/init.d/lircd start</i> |
4398 |
</pre> |
4399 |
|
4400 |
<p> |
4401 |
现在您应该可以看到<c>lircd</c>捕捉,解码按键了。运行<c>irw</c>,查看完毕后用Ctrl+C来结束应用程序。 |
4402 |
</p> |
4403 |
|
4404 |
<pre caption="测试LIRC"> |
4405 |
# <i>irw</i> |
4406 |
0000000000001aa2 00 Exit Technisat_TTS35AI.conf |
4407 |
0000000000001a8d 00 Mute Technisat_TTS35AI.conf |
4408 |
0000000000000a97 00 OK Technisat_TTS35AI.conf |
4409 |
0000000000000a97 01 OK Technisat_TTS35AI.conf |
4410 |
0000000000000a92 00 Menu Technisat_TTS35AI.conf |
4411 |
</pre> |
4412 |
|
4413 |
<p> |
4414 |
下一步,将它加入到默认运行级,以便在启动时自动运行。 |
4415 |
</p> |
4416 |
|
4417 |
<pre caption="将lircd加入到默认运行级"> |
4418 |
# <i>rc-update add lircd default</i> |
4419 |
</pre> |
4420 |
|
4421 |
<p> |
4422 |
要使用您的遥控器,您必须启用VDR的LIRC支持。把此行加入到<path>/etc/conf.d/vdr</path>: |
4423 |
</p> |
4424 |
|
4425 |
<pre caption="启用LIRC支持"> |
4426 |
# <i>nano -w /etc/conf.d/vdr</i> |
4427 |
IR_CTRL="lirc" |
4428 |
</pre> |
4429 |
|
4430 |
</body> |
4431 |
</section> |
4432 |
</chapter> |
4433 |
|
4434 |
<chapter id="video-out"> |
4435 |
<title>视频输出方案</title> |
4436 |
<section> |
4437 |
<body> |
4438 |
|
4439 |
<p> |
4440 |
您需要决定在下列视频输出设备中选择一种(仅仅一种!)输出图像和屏幕显示(OSD)。 |
4441 |
</p> |
4442 |
|
4443 |
</body> |
4444 |
</section> |
4445 |
<section id="vdr-dxr3"> |
4446 |
<title>硬解压:全功能DVB卡</title> |
4447 |
<body> |
4448 |
|
4449 |
<p> |
4450 |
使用这些昂贵的高档卡的用户不需要额外安装任何软件,您可以前进至<uri link="#channel_list">配置您的频道列表</uri>。 |
4451 |
</p> |
4452 |
|
4453 |
</body> |
4454 |
</section> |
4455 |
<section id="vdr-dxr3"> |
4456 |
<title>硬解压:DXR3/Hollywood+ 卡</title> |
4457 |
<body> |
4458 |
|
4459 |
<p> |
4460 |
使用DXR3卡,我们需要<c>vdr-dxr3</c>插件。 |
4461 |
</p> |
4462 |
|
4463 |
<pre caption="安装插件"> |
4464 |
# <i>emerge vdr-dxr3</i> |
4465 |
# <i>echo em8300 >> /etc/modules.autoload.d/kernel-2.6</i> |
4466 |
</pre> |
4467 |
|
4468 |
<p> |
4469 |
em8300模块需要根据卡的版本号作一些配置。 |
4470 |
</p> |
4471 |
|
4472 |
<p> |
4473 |
继续 <uri link="#channel_list">配置您的频道列表</uri>。 |
4474 |
</p> |
4475 |
|
4476 |
</body> |
4477 |
</section> |
4478 |
<section id="vdr-pvr350"> |
4479 |
<title>硬解压:PVR350卡</title> |
4480 |
<body> |
4481 |
|
4482 |
<p> |
4483 |
既然PVR350卡配备了板载的MPEG解码芯片,我们当然希望用到它。我们需要安装<c>vdr-prv350</c>插件。如果<c>ivtv-driver</c>还没有安装,emerge会自动为您安装它。我们把ivtv加入到<path>/etc/modules.autoload.d/kernel-2.6</path>使得它在每次启动时自动加载: |
4484 |
</p> |
4485 |
|
4486 |
<pre caption="安装PVR350插件"> |
4487 |
# <i>emerge vdr-pvr350</i> |
4488 |
# <i>echo ivtv >> /etc/modules.autoload.d/kernel-2.6</i> |
4489 |
</pre> |
4490 |
|
4491 |
<p> |
4492 |
继续 <uri link="#channel_list">配置您的频道列表</uri>。 |
4493 |
</p> |
4494 |
|
4495 |
</body> |
4496 |
</section> |
4497 |
<section id="vdr-xineliboutput"> |
4498 |
<title>软解压: vdr-softdevice</title> |
4499 |
<body> |
4500 |
|
4501 |
<p> |
4502 |
要安装它,我们需要emerge<c>vdr-softdevice</c>。不要忘了启用这个插件。 |
4503 |
</p> |
4504 |
|
4505 |
<pre caption="安装软解压插件"> |
4506 |
# <i>emerge vdr-softdevice</i> |
4507 |
# <i>emerge --config vdr-softdevice</i> |
4508 |
</pre> |
4509 |
|
4510 |
<p> |
4511 |
要选择正确的音频/视频输出,请编辑<path>/etc/conf.d/vdr.softdevice</path>。 |
4512 |
</p> |
4513 |
|
4514 |
<p> |
4515 |
到此为止,我们只介绍了shm("shared memory",共享内存)的方案。安装的配置文件(设置SOFTDEVICE_VIDEO_OUT)已经启用此选项。稍后您需要启动<c>ShmClient</c>打开观看窗口。 |
4516 |
</p> |
4517 |
|
4518 |
<note> |
4519 |
如果您不希望采用一个独立的键盘布局来控制softdevice/shm的VDR,您可以用Matthias Schwarzott的<uri link="http://dev.gentoo.org/~zzam/remote.softdevice-shm.conf">devspace</uri>。复制上述文件到<path>/etc/vdr/remote.conf</path>,对其运行<c>chown vdr:vdr</c>使其能正常工作。</note> |
4520 |
|
4521 |
<p> |
4522 |
继续<uri link="#channel_list">配置您的频道列表</uri>。 |
4523 |
</p> |
4524 |
|
4525 |
</body> |
4526 |
</section> |
4527 |
<section id="vdr-xineliboutput"> |
4528 |
<title>软解压: vdr-xineliboutput</title> |
4529 |
<body> |
4530 |
|
4531 |
<p> |
4532 |
一些用户青睐<c>vdr-xineliboutput</c>,因为它支持远程访问。我们现在就教您如何在主机和客户机上配置<c>vdr-xineliboutput</c>。首先,主机的设置: |
4533 |
</p> |
4534 |
|
4535 |
<pre caption="安装vdr-xineliboutput"> |
4536 |
# <i>emerge vdr-xineliboutput</i> |
4537 |
# <i>emerge --config vdr-xineliboutput</i> |
4538 |
</pre> |
4539 |
|
4540 |
<p> |
4541 |
加入下列命令行参数对于xinliboutput的运行至关重要。更多的选项清参考<c>vdr --help</c>。 |
4542 |
</p> |
4543 |
|
4544 |
<pre caption="加入命令行参数到/etc/conf.d/vdr.xineliboutput"> |
4545 |
_EXTRAOPTS="--local=none --remote=37890" |
4546 |
</pre> |
4547 |
|
4548 |
<p> |
4549 |
下一步是编辑<path>/etc/vdr/svdrphosts.conf</path>。这个文件描述了哪些客户端允许访问主机系统上运行的VDR的SVDRP端口。 |
4550 |
</p> |
4551 |
|
4552 |
<pre caption="编辑/etc/vdr/svdrphosts.conf"> |
4553 |
<comment>(正确地语法是:IP地址[/子网掩码])</comment> |
4554 |
127.0.0.1 <comment>(localhost永远是被支持的)</comment> |
4555 |
192.168.1.0/24 <comment>(本地网的任何主机)</comment> |
4556 |
#204.152.189.113 <comment>(一个特定的主机)</comment> |
4557 |
#0.0.0.0/0 <comment>(任何网络的任何主机 - 请谨慎使用此选项!)</comment> |
4558 |
</pre> |
4559 |
|
4560 |
<p> |
4561 |
如果您只需要在运行VDR的计算机上用<c>vdr-xineliboutput</c>观看,您可以继续<uri link="#channel_list">配置您的频道列表</uri>。 |
4562 |
</p> |
4563 |
|
4564 |
<p> |
4565 |
否则,您只需要在您的客户端<c>emerge media-plugins/vdr-xineliboutput</c>: |
4566 |
</p> |
4567 |
|
4568 |
<pre caption="客户端设置"> |
4569 |
# <i>emerge vdr-xineliboutput</i> |
4570 |
</pre> |
4571 |
|
4572 |
<p> |
4573 |
在启动VDR后,您可以用<c>vdr-sxfe xvdr://hostname</c>命令来连接VDR,观看图像和屏幕显示。 |
4574 |
</p> |
4575 |
|
4576 |
<p> |
4577 |
继续<uri link="#channel_list">配置您的频道列表</uri>。 |
4578 |
</p> |
4579 |
|
4580 |
<note> |
4581 |
还有一个插件<c>vdr-dummydevice</c>可以模拟真实的输出设备,用于特殊的场合,比如专用的视频录制服务器,这些高级的应用并非常见的VDR设定。 |
4582 |
</note> |
4583 |
|
4584 |
</body> |
4585 |
</section> |
4586 |
</chapter> |
4587 |
|
4588 |
<chapter id="channel_list"> |
4589 |
<title>创建频道列表</title> |
4590 |
<section> |
4591 |
<body> |
4592 |
|
4593 |
<p> |
4594 |
要使得VDR真正有用,您还需要创建合适的频道列表。除了下载以外,还有多种方法来获得一个可用的频道列表。默认的安装包含了Astra 19.2°E的DVB-S频道列表。 |
4595 |
</p> |
4596 |
|
4597 |
</body> |
4598 |
</section> |
4599 |
<section> |
4600 |
<title>用linuxtv-dvb-apps的dvbscan</title> |
4601 |
<body> |
4602 |
|
4603 |
<pre caption="安装linuxtv-dvb-apps"> |
4604 |
# <i>emerge linuxtv-dvb-apps</i> |
4605 |
</pre> |
4606 |
|
4607 |
<p> |
4608 |
为您所在区域设定正确的频率以及接收类型。这些文件在<path>/usr/share/dvb/scan</path>。比如在德国纽伦堡地区接受DVB-T,您需要用<path>/usr/share/dvb/scan/dvb-t/de-Nuernberg</path>。 |
4609 |
</p> |
4610 |
|
4611 |
<pre caption="用dvbscan来扫描频道"> |
4612 |
$ <i>dvbscan -o vdr /usr/share/dvb/scan/dvb-t/de-Nuernberg > /etc/vdr/channels.conf</i> |
4613 |
</pre> |
4614 |
|
4615 |
</body> |
4616 |
</section> |
4617 |
<section> |
4618 |
<title>使用vdr-reelchannelscan</title> |
4619 |
<body> |
4620 |
|
4621 |
<p> |
4622 |
首先,删除已有的频道列表。 |
4623 |
</p> |
4624 |
|
4625 |
<pre caption="清除旧的频道列表"> |
4626 |
# <i>rm /etc/vdr/channels.conf</i> |
4627 |
</pre> |
4628 |
|
4629 |
<pre caption="安装并激活vdr-reelchannelscan"> |
4630 |
# <i>emerge vdr-reelchannelscan</i> |
4631 |
# <i>emerge --config vdr-reelchannelscan</i> |
4632 |
</pre> |
4633 |
|
4634 |
</body> |
4635 |
</section> |
4636 |
<section> |
4637 |
<title>采用vdr-analogtv系统的频道</title> |
4638 |
<body> |
4639 |
|
4640 |
<p> |
4641 |
您也许在此要设置您的频道列表。如果您安装了>=<c>media-plugins/vdr-analogtv-1.0.00-r1</c>,VDR项目在<path>/usr/share/doc/vdr-analogtv-$version/examples/</path>提供了一些例子。 |
4642 |
</p> |
4643 |
|
4644 |
</body> |
4645 |
</section> |
4646 |
</chapter> |
4647 |
|
4648 |
<chapter> |
4649 |
<title>启动VDR</title> |
4650 |
<section> |
4651 |
<body> |
4652 |
|
4653 |
<p> |
4654 |
完成了所有基础的软件部分,您还需要配置VDR的屏幕输出(OSD)。 |
4655 |
</p> |
4656 |
|
4657 |
<p> |
4658 |
如果你使用硬件解码器,您现在可以切换到连着的电视了。如果您使用软件解码器,客户端必须在VDR启动后运行。 |
4659 |
</p> |
4660 |
|
4661 |
<p> |
4662 |
首先,您必须学习键盘定义;即把按键和VDR内部命令联系起来。 |
4663 |
</p> |
4664 |
|
4665 |
<note> |
4666 |
考虑到您也许需要编辑键盘配置,或者更有可能的是删除配置,回到键盘学习的状态,友情提醒:VDR在<path>/etc/vdr/remote.conf</path>保存按键定义。 |
4667 |
</note> |
4668 |
|
4669 |
<p> |
4670 |
我们首先启动VDR: |
4671 |
</p> |
4672 |
|
4673 |
<pre caption="启动VDR"> |
4674 |
# <i>/etc/init.d/vdr start</i> |
4675 |
* Preparing start of vdr: |
4676 |
* config files ... [ ok ] |
4677 |
* Waiting for prerequisites (devices nodes etc.) ... [ ok ] |
4678 |
* Starting vdr ... [ ok ] |
4679 |
* First start of vdr: No check for running vdr possible |
4680 |
* until control device (remote/keyboard) keys are learnt! |
4681 |
</pre> |
4682 |
|
4683 |
<note> |
4684 |
使用软件解码器的用户可以开启客户端程序,它会打开一个窗口显示电视画面和OSD |
4685 |
</note> |
4686 |
|
4687 |
<pre caption="激活客户端的软件解码器"> |
4688 |
<comment>(使用vdr-softdevice的用户)</comment> |
4689 |
# <i>ShmClient</i> |
4690 |
<comment>(使用vdr-xineliboutput的用户)</comment> |
4691 |
# <i>vdr-sxfe xvdr://hostname</i> |
4692 |
</pre> |
4693 |
|
4694 |
<p> |
4695 |
VDR最有用的键是: |
4696 |
</p> |
4697 |
<ul> |
4698 |
<li>方向键(左/右/上/下)</li> |
4699 |
<li>菜单/退出/选择</li> |
4700 |
<li>颜色设置(红/绿/黄/蓝)</li> |
4701 |
<li>数字键(0-9)</li> |
4702 |
</ul> |
4703 |
|
4704 |
<impo> |
4705 |
如果您没有很多键备选,保证分配这些键。(某些遥控器的播放/暂停等键和颜色设置共用同样的键,用它们设置颜色。) |
4706 |
</impo> |
4707 |
|
4708 |
<p> |
4709 |
基本的安装已经结束,您还需要配置VDR。切换到输出屏幕,按照屏幕上的指令配置操作。VDR会要求您按下遥控器上的键来学习正确的键值。如果您没有遥控器,您也可以使用您的键盘。 |
4710 |
</p> |
4711 |
|
4712 |
|
4713 |
|
4714 |
<p> |
4715 |
现在您可以把VDR启动脚本加入到默认运行级,在您的计算机启动的时候自动运行。 |
4716 |
</p> |
4717 |
|
4718 |
<pre caption="将vdr加入默认运行级"> |
4719 |
# <i>rc-update add vdr default</i> |
4720 |
</pre> |
4721 |
|
4722 |
</body> |
4723 |
</section> |
4724 |
</chapter> |
4725 |
|
4726 |
<chapter> |
4727 |
<title>排错</title> |
4728 |
<section> |
4729 |
<body> |
4730 |
|
4731 |
<note> |
4732 |
如果您需要任何帮助,您可以在<uri link="irc://irc.freenode.org/gentoo-vdr">#gentoo-vdr</uri>发问,或者查看我们的<uri link="http://forums.gentoo.org/">论坛</uri>。 |
4733 |
</note> |
4734 |
|
4735 |
</body> |
4736 |
</section> |
4737 |
</chapter> |
4738 |
</guide> |
4739 |
|
4740 |
|
4741 |
|
4742 |
1.1 xml/htdocs/doc/zh_cn/xfce-config.xml |
4743 |
|
4744 |
file : http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/doc/zh_cn/xfce-config.xml?rev=1.1&view=markup |
4745 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/doc/zh_cn/xfce-config.xml?rev=1.1&content-type=text/plain |
4746 |
|
4747 |
Index: xfce-config.xml |
4748 |
=================================================================== |
4749 |
<?xml version='1.0' encoding='UTF-8'?> |
4750 |
<!DOCTYPE guide SYSTEM "/dtd/guide.dtd"> |
4751 |
|
4752 |
<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/zh_cn/xfce-config.xml,v 1.1 2007/09/17 17:54:10 r0bertz Exp $ --> |
4753 |
<!-- English CVS version: 1.8 --> |
4754 |
|
4755 |
<guide link="/doc/zh_cn/xfce-config.xml" lang="zh_cn"> |
4756 |
|
4757 |
<title>Xfce配置指南</title> |
4758 |
|
4759 |
<author title="作者"> |
4760 |
<mail link="nightmorph@g.o">Joshua Saddler</mail> |
4761 |
</author> |
4762 |
|
4763 |
<author title="译者"> |
4764 |
<mail link="wcw8410@×××××.com">吴传文</mail> |
4765 |
</author> |
4766 |
|
4767 |
<abstract> |
4768 |
本指南对Xfce进行了广泛的介绍。Xfce是一个快捷的、轻量级的,功能齐全的桌面环境。 |
4769 |
</abstract> |
4770 |
|
4771 |
<!-- The content of this document is licensed under the CC-BY-SA license --> |
4772 |
<!-- See http://creativecommons.org/licenses/by-sa/2.5 --> |
4773 |
<license/> |
4774 |
|
4775 |
<version>1.6</version> |
4776 |
<date>2007-07-21</date> |
4777 |
|
4778 |
<chapter> |
4779 |
<title>介绍</title> |
4780 |
<section> |
4781 |
<title>Xfce桌面环境</title> |
4782 |
<body> |
4783 |
|
4784 |
<p> |
4785 |
<uri link="http://www.xfce.org">Xfce</uri>是类Unix操作系统上的一个快捷、轻量级的桌面环境。它是为生产力而设计的,并且具备很好的可配置性,同时还符合<uri link="http://www.freedesktop.org">Freedesktop</uri>的规范。 |
4786 |
</p> |
4787 |
|
4788 |
<p> |
4789 |
不像Gnome和KDE等这些比较臃肿的桌面环境,Xfce占用的系统资源要少得多。另外,它拥有更好的模块性和更少的依赖性;它将占用你更少的磁盘空间和更少的安装时间。 |
4790 |
</p> |
4791 |
|
4792 |
<p> |
4793 |
这篇指南将不仅向你说明如何安装和配置一个最小化的Xfce环境,并且还将探索一些可用方案来创建一个功能齐全的桌面环境,保持与Xfce设计思想的一致:轻巧,快速和模块化。 |
4794 |
</p> |
4795 |
|
4796 |
<p> |
4797 |
另外,本指南还将向你说明如何从4.2版本<uri link="#upgrade">升级</uri>到4.4版本。 |
4798 |
</p> |
4799 |
|
4800 |
</body> |
4801 |
</section> |
4802 |
</chapter> |
4803 |
|
4804 |
<chapter> |
4805 |
<title>安装Xfce</title> |
4806 |
<section> |
4807 |
<title>基础</title> |
4808 |
<body> |
4809 |
|
4810 |
<p> |
4811 |
首先,确定你已经按照<uri link="/doc/zh_cn/xorg-config.xml">如何配置X服务器</uri>所说的安装好了Xorg。 |
4812 |
</p> |
4813 |
|
4814 |
<p> |
4815 |
在我们安装功能齐全的最小化桌面之前,让我们花点时间来回顾一下我们将要安装的基本软件包。 |
4816 |
</p> |
4817 |
|
4818 |
<table> |
4819 |
<tr> |
4820 |
<th>名称</th> |
4821 |
<th>描述</th> |
4822 |
</tr> |
4823 |
<tr> |
4824 |
<ti>xfce4</ti> |
4825 |
<ti>基本的Xfce桌面环境</ti> |
4826 |
</tr> |
4827 |
<tr> |
4828 |
<ti>xscreensaver</ti> |
4829 |
<ti> |
4830 |
带省电功能的屏保,并能够锁定屏幕安全 |
4831 |
</ti> |
4832 |
</tr> |
4833 |
</table> |
4834 |
|
4835 |
<p> |
4836 |
你可以自由地装上任何其它你想要软件包,但从现在开始,我们将坚持建议你安装一个快捷最小化的工作环境。请反复检查<path>/etc/make.conf</path>中的USE标记;你可能至少需要<c>USE="dbus -gnome hal startup-notification"</c>。 |
4837 |
</p> |
4838 |
|
4839 |
<p> |
4840 |
现在,让我们开始安装Xfce。 |
4841 |
</p> |
4842 |
|
4843 |
<pre caption="安装Xfce"> |
4844 |
# <i>emerge -avt xfce4 xscreensaver</i> |
4845 |
</pre> |
4846 |
|
4847 |
<p> |
4848 |
然后,把你系统上的一般用户加到<c>plugdev</c>,<c>cdrom</c>,<c>cdrw</c>和<c>usb</c>组里,这样他/她们便能充分使用<c>hal</c>来挂载和使用照相机、光驱和U盘等之类的设备。 |
4849 |
</p> |
4850 |
|
4851 |
<pre caption="把用户加入硬件组"> |
4852 |
<comment>(用你真实的用户名来代替username)</comment> |
4853 |
# <i>for x in plugdev cdrom cdrw usb ; do gpasswd -a username $x ; done</i> |
4854 |
</pre> |
4855 |
|
4856 |
<p> |
4857 |
接着,更新你的环境变量: |
4858 |
</p> |
4859 |
|
4860 |
<pre caption="更新环境变量"> |
4861 |
# <i>env-update && source /etc/profile</i> |
4862 |
</pre> |
4863 |
|
4864 |
<p> |
4865 |
现在启动<c>hald</c>并且把它加到default运行级别: |
4866 |
</p> |
4867 |
|
4868 |
<pre caption="启动hald"> |
4869 |
# <i>/etc/init.d/hald start</i> |
4870 |
# <i>rc-update add hald default</i> |
4871 |
</pre> |
4872 |
|
4873 |
</body> |
4874 |
</section> |
4875 |
</chapter> |
4876 |
|
4877 |
<chapter> |
4878 |
<title>配置Xfce</title> |
4879 |
<section> |
4880 |
<title>启动Xfce</title> |
4881 |
<body> |
4882 |
|
4883 |
<p> |
4884 |
现在Xfce已经安装完毕了,接着我们将把它设置成我们默认的桌面环境,一旦我们执行<c>startx</c>便可进入。将你的root用户退出然后以普通用户的身份登录。 |
4885 |
</p> |
4886 |
|
4887 |
<pre caption="设置Xfce作为默认的桌面环境"> |
4888 |
$ <i>echo "exec startxfce4" > ~/.xinitrc</i> |
4889 |
</pre> |
4890 |
|
4891 |
<p> |
4892 |
现在敲入<c>startx</c>来启动你的图形环境: |
4893 |
</p> |
4894 |
|
4895 |
<pre caption="启动Xfce"> |
4896 |
$ <i>startx</i> |
4897 |
</pre> |
4898 |
|
4899 |
<p> |
4900 |
恭喜!欢迎你进入Xfce桌面环境。继续看下去,再扩展一点。接下去的部分将教你如何根据自己的要求来配置Xfce。 |
4901 |
</p> |
4902 |
|
4903 |
</body> |
4904 |
</section> |
4905 |
<section> |
4906 |
<title>程序启动</title> |
4907 |
<body> |
4908 |
|
4909 |
<p> |
4910 |
你可能注意到在桌面上点击鼠标右键将弹出一个菜单,上面有你所有的应用程序。这是非常有用的,但是一旦你打开了多个窗口,你的桌面将很容易被完全掩盖住,这样启动一个新的程序便变得很不方便了。所以,你所希望的第一件事就是在你的面板上添加一个便捷的应用程序菜单。右击面板,然后选择"Add New Item"。滚动选项列表,选择"Xfce Menu"。你可以自己指定它在面板上的位置。当你点击它时,它会显示应用/选择菜单,上面给出了一个很好的分类清单,清单里包含了你已安装的程序。 |
4911 |
</p> |
4912 |
|
4913 |
</body> |
4914 |
</section> |
4915 |
<section> |
4916 |
<title>Sessions & startup</title> |
4917 |
<body> |
4918 |
|
4919 |
<p> |
4920 |
如果你已经(或者打算)安装一些流行的Gnome或KDE软件,比如<c>k3b</c>、<c>nautilus</c>、<c>kmail</c>、<c>evolution</c>等等,那么你要确定Xfce在启动时为这些程序启动了相应的服务。依次点击Menu --> Settings --> Sessions & Startup。在"Advanced"标签里面,选择相应的复选框。这样可能会稍微增加Xfce启动的时间,但是会减少加载KDE和Gnome应用程序的时间。 |
4921 |
</p> |
4922 |
|
4923 |
<p> |
4924 |
Xfce能够保存你每次会话所做设置和运行的程序,这根据你在Sessions & Startup菜单的"General"标签页的设置而定。当你退出登录时,既可以让Xfce自动保存也可以让Xfce每次都提示你是否要保存。当你想撤销错误的设置时这项功能尤其有用。意外关闭了面板该怎么办?只要在被问到是否要保存当前会话时选择否,那么下次你启动Xfce时,你原来的桌面就又回来了。想要在下次登录时自动加载你打开的浏览器、终端和邮件客户端吗?只要在退出时保存你的会话。 |
4925 |
</p> |
4926 |
|
4927 |
<p> |
4928 |
你已经安装并配置了一个基本的工作环境。但如果你还有兴趣动手做更多的事情,请接着下去! |
4929 |
</p> |
4930 |
|
4931 |
</body> |
4932 |
</section> |
4933 |
</chapter> |
4934 |
|
4935 |
<chapter> |
4936 |
<title>附加的应用程序</title> |
4937 |
<section> |
4938 |
<title>面板插件</title> |
4939 |
<body> |
4940 |
|
4941 |
<p> |
4942 |
在这一小节里面,我们将讨论一些在Xfce里面每天都会用到的有用插件和应用软件。 |
4943 |
</p> |
4944 |
|
4945 |
<p> |
4946 |
Portage里面已经有许多可用的面板插件了;你用<c>emerge --search xfce</c>自己看看。尽管这些插件的名字中大部分都是带有自我解释含义的,但是有一些插件还是值得引起我们注意的,因为它们非常有用。要使用它们,只要简单的<c>emerge</c>它们。当你右击面板时便能看到它们已经被加到“Add New Item”菜单里的“Available Items”列表里面。 |
4947 |
</p> |
4948 |
|
4949 |
<ul> |
4950 |
<li> |
4951 |
<c>xfce4-mount</c>让你可以通过点击鼠标,便能方便地获得<path>/etc/fstab</path>中已挂载的设备的列表。 |
4952 |
</li> |
4953 |
<li> |
4954 |
<c>xfce4-battery</c>对于笔记本用户来说,是非常完美的。它可以显示电池的使用率、剩余时间、电源(交流电还是电池)、风扇状态、警告,甚至可以被配置在一定的电能水平下执行命令。当电池快耗尽时,这个功能可以让笔记本进入休眠状态。 |
4955 |
</li> |
4956 |
<li> |
4957 |
<c>verve</c>是嵌在面板上的一个小命令行。当你想运行一个命令时,用它会比另外打开一个终端还快。 |
4958 |
</li> |
4959 |
<li> |
4960 |
<c>xfce4-mixer</c>是音量控制器。它能控制ALSA和OSS声音程序。 |
4961 |
</li> |
4962 |
</ul> |
4963 |
|
4964 |
<p> |
4965 |
如果在这些为Xfce定做的插件里找不到你想要的,那么尝试在Gnome面板插件的列表里寻找!是的,先安装<c>xfce4-xfapplet</c>,然后你就可以安装和运行Gnome里的插件。 |
4966 |
</p> |
4967 |
|
4968 |
</body> |
4969 |
</section> |
4970 |
<section> |
4971 |
<title>有用的程序</title> |
4972 |
<body> |
4973 |
|
4974 |
<p> |
4975 |
Xfce绑定了一些有用的应用程序,包括<c>thunar</c>、<c>terminal</c>、<c>orage</c>和<c>mousepad</c>。注意:如果你安装<c>xfce4</c> 时用了<c>minimal</c>这个USE标记,那后3个程序将不会安装。然而,这些都是很小但却非常棒的程序,它们都很值得装上试试。 |
4976 |
</p> |
4977 |
|
4978 |
<p> |
4979 |
<c>orage</c>是一个简便易用的日历。<c>mousepad</c>是一个十分精简的文本编辑器,它的启动速度非常快。<c>terminal</c>则远比xterm更好配置更好用,它支持Unicode文本和伪透明,并通过Xfce内建的混色工具加快了透明化的速度,达到了即开即透明的效果。只是有一点你要确定下,你面板上的终端启动器默认运行的命令是<path>/usr/bin/Terminal</path>而不是xterm。右击该终端启动器然后选择"Properties"来改变它的命令。 |
4980 |
</p> |
4981 |
|
4982 |
<p> |
4983 |
<c>thunar</c>是Xfce内建的一个图形化文件管理器。它更快但功能却更强大,能通过插件来实现更多的功能;只需通过<c>emerge</c>来安装。让我们来看一看: |
4984 |
</p> |
4985 |
|
4986 |
<ul> |
4987 |
<li> |
4988 |
<c>thunar-archive</c>让你可以通过右击菜单来创建和解开归档(压缩)文件。如果它与<c>xarchiver</c>结合,则更加好用。<c>xarchiver</c>是一个为刚刚为Xfce开发的图形化归档<uri link="http://www.foo-projects.org/~benny/projects/thunar-archive-plugin/">工具</uri>。 |
4989 |
</li> |
4990 |
<li> |
4991 |
<c>thunar-media-tags</c>让你可以一次性智能地对多个媒体文件进行重命名,并且让你能<uri link="http://thunar.xfce.org/pwiki/projects/thunar-media-tags-plugin">编辑</uri>这些文件的标签(tags)信息,例如id3标签。 |
4992 |
</li> |
4993 |
<li> |
4994 |
<c>thunar-thumbnailers</c>让你可以在Thunar里面<uri link="http://goodies.xfce.org/projects/thunar-plugins/thunar-thumbnailers">预览</uri>某些类型的文件,像图片和字体。 |
4995 |
</li> |
4996 |
<li> |
4997 |
<c>thunar-volman</c>自动<uri link="http://foo-projects.org/~benny/projects/thunar-volman/">管理</uri>即插即用的媒体设备和驱动器。 |
4998 |
</li> |
4999 |
</ul> |
5000 |
|
5001 |
<p> |
5002 |
接着,我们加进一些有用的轻量级桌面应用程序,来与Xfce的设计思想保持一致。 |
5003 |
</p> |
5004 |
|
5005 |
<p> |
5006 |
尽管<c>mousepad</c>已经是相当好了,但如果你需要一个功能齐全的文字处理器,同时又不想要臃肿的OpenOffice,那么装上<c>abiword</c>试试。<uri link="http://www.abisource.com">AbiWord</uri>是一个更加轻快,并且与业界标准文档类型完全互通的文字处理工具。 |
5007 |
</p> |
5008 |
|
5009 |
<pre caption="加入一个文档处理器"> |
5010 |
# <i>emerge -avt abiword</i> |
5011 |
</pre> |
5012 |
|
5013 |
<p> |
5014 |
你想要一个好用的电子邮件客户端/新闻广播员,但又不要求要像<c>mozilla-thunderbird</c>或者<c>evolution</c>,有什么好办法呢?装上<c>sylpheed-claws</c>或者<c>claws-mail</c>试试。 |
5015 |
</p> |
5016 |
|
5017 |
<p> |
5018 |
在网上聊天方面,<c>irssi</c>是一个优秀的IRC客户端,它运行于终端里,小巧并且配置性极好。如果你更倾向于想要一个包含了所有聊天协议的客户端,那么你可能想要<c>emerge gaim</c>。 |
5019 |
</p> |
5020 |
|
5021 |
<p> |
5022 |
如果你需要电影和音乐播放器,那没有比<c>mplayer</c>和<c>audacious</c>更好的了。几乎所有格式的多媒体文件它们都能很好地播放,它们还有很多现成的插件可以用来扩展更多的功能。 |
5023 |
</p> |
5024 |
|
5025 |
<p> |
5026 |
最后,你还需要一个网页浏览器。几乎所有的图形化网页浏览器都要比你大多数的桌面应用程序占用更多的资源。尽管如此,<c>mozilla-firefox</c>(或者 <c>mozilla-firefox-bin</c>)依然是一个很好的选择。除此之外,你可能发现<c>opera</c>速度也是相当快的。但是<c>opera</c>并不像<c>mozilla-firefox</c>一样可用于这么多种架构的处理器,并且它有更多的依赖关系,除非你用USE标记忽略它们。 |
5027 |
</p> |
5028 |
|
5029 |
<pre caption="添加一个网页浏览器"> |
5030 |
<comment>(安装Mozilla Firefox)</comment> |
5031 |
# <i>emerge mozilla-firefox</i> |
5032 |
<comment>(安装Opera)</comment> |
5033 |
# <i>echo "www-client/opera qt-static" >> /etc/portage/package.use</i> |
5034 |
# <i>emerge opera</i> |
5035 |
</pre> |
5036 |
|
5037 |
<p> |
5038 |
到这里,我们已经提出一些很好的建议来丰富你的桌面应用,接着,看看我们还可以做些什么来提升你的Xfce体验。 |
5039 |
</p> |
5040 |
|
5041 |
</body> |
5042 |
</section> |
5043 |
<section> |
5044 |
<title>图形界面登录</title> |
5045 |
<body> |
5046 |
|
5047 |
<p> |
5048 |
还记得我们添加<c>startxfce4</c>到<path>~/.xinitrc</path>文件中吗?要进入你的桌面,你所需要做的就是在登录以后敲入<c>startx</c>。这种方法是很好的,如果你喜欢完全基于文本启动和登录的话。否则,让我们使用一个显示管理器,它会在你系统引导后自动启动Xfce(这样你就能用图形化界面登录)。 |
5049 |
</p> |
5050 |
|
5051 |
<p> |
5052 |
首先,让我们确定下系统启动后加载了Xfce: |
5053 |
</p> |
5054 |
|
5055 |
<pre caption="添加xdm到default运行级别"> |
5056 |
# <i>rc-update add xdm default</i> |
5057 |
</pre> |
5058 |
|
5059 |
<p> |
5060 |
这还远没有结束。我们还要挑选一个显示管理器然后设置一些合适的变量。尽管在Portage中有若干显示管理器可以选择,但在这篇指南中,我们将坚持两个选择:<c>xdm</c>和<c>gdm</c>。 |
5061 |
</p> |
5062 |
|
5063 |
<p> |
5064 |
<c>xdm</c>速度很快而且是轻量级的,但是它不够美观,并且定制性不好。如果你想要使用它,那先<c>emerge</c>它: |
5065 |
</p> |
5066 |
|
5067 |
<pre caption="安装XDM"> |
5068 |
# <i>emerge -avt xdm</i> |
5069 |
</pre> |
5070 |
|
5071 |
<p> |
5072 |
然后在<path>/etc/conf.d/xdm</path>中编辑DISPLAYMANAGER变量: |
5073 |
</p> |
5074 |
|
5075 |
<pre caption="编辑/etc/conf.d/xdm"> |
5076 |
DISPLAYMANAGER="xdm" |
5077 |
</pre> |
5078 |
|
5079 |
<p> |
5080 |
把XSESSION="Xfce4"添加到<path>/etc/rc.conf</path>,这样<c>xdm</c>就能自动启动你的Xfce了。 |
5081 |
</p> |
5082 |
|
5083 |
<p> |
5084 |
在你选择坚持用(相当难看的)<c>xdm</c>的同时,为什么不试一下<c>gdm</c>呢?配置它要容易得多,并且它要远远漂亮得多。首先,<c>emerge</c>它。注意到虽然它依赖一些软件,但这些软件都很很小,而且数量也比其它显示管理器所依赖的软件数量少。 |
5085 |
</p> |
5086 |
|
5087 |
<pre caption="安装GDM"> |
5088 |
# <i>emerge -avt gdm</i> |
5089 |
</pre> |
5090 |
|
5091 |
<p> |
5092 |
接着,把DISPLAYMANAGER变量的值改为<c>gdm</c>而不是<c>xdm</c>: |
5093 |
</p> |
5094 |
|
5095 |
<pre caption="编辑/etc/conf.d/xdm"> |
5096 |
DISPLAYMANAGER="gdm" |
5097 |
</pre> |
5098 |
|
5099 |
</body> |
5100 |
</section> |
5101 |
<section> |
5102 |
<title>美化你的桌面</title> |
5103 |
<body> |
5104 |
|
5105 |
<p> |
5106 |
对桌面外观稍微设置下是大有裨益的。Xfce拥有所有你期望从现代桌面系统得到的设置选项,字体反锯齿设置、颜色模板、大量的窗体装饰物、主题,等等还有很多。如果这还不够,那安装第三方的主题、图标集、鼠标光标主题还有壁纸也很容易。 |
5107 |
</p> |
5108 |
|
5109 |
<p> |
5110 |
<uri link="/main/en/graphics.xml">Gentoo website</uri>上面已收集了一批包含了各种分辨率的漂亮的Gentoo壁纸。如果你在寻找图标集和完整的Xfce主题,那到<uri link="http://www.xfce-look.org/">Xfce-Look</uri>这里来,这上面有很多。还有件重要的事情要记住,对于你下载的任何第三方美化包,通常需要先解压,然后再安装到合适的目录里。如果你想让你系统上所有的用户都能使用这些主题和图标集,那么把图标集安装到<path>/usr/share/icons/</path>,主题安装到<path>/usr/share/themes/</path>。如果仅供当前用户使用,那么把主题和图标集分别安装到<path>~/.themes/</path>和<path>~/.icons/</path>。 |
5111 |
</p> |
5112 |
|
5113 |
<p> |
5114 |
如果你安装了GDM作为你的显示管理器,那看一下<uri link="http://www.gnome-look.org">Gnome-Look</uri>这上面的许多GDM主题。安装它们,你既可以在命令行下把它们解压到<path>/usr/share/gdm/themes/</path>,也可以以<b>root</b>身份运行<c>gdmsetup</c>,然后把归档文件(压缩包)拖放到GDM窗口。这里还有一些<uri link="http://gnome-look.org/content/show.php?content=45575">非常好的</uri>Gentoo<uri link="http://gnome-look.org/content/show.php?content=20071">主题</uri>。 |
5115 |
</p> |
5116 |
|
5117 |
<p> |
5118 |
最后,Xfce还拥有自己内建的混色工具来管理窗口的透明化。你可以在Menu --> Settings --> Window Manager这里找到这个选项。为了达到最好的效果,你需要让你的显卡使用支持硬件加速渲染的驱动。确认你安装<c>xfwm4</c>时加入了<c>xcomposite</c>USE标记。接着,你需要在<path>/etc/X11/xorg.conf</path>中打开混色开关,加入一下片断: |
5119 |
</p> |
5120 |
|
5121 |
<pre caption="打开xorg.conf中的混色开关"> |
5122 |
Section "Extensions" |
5123 |
Option "Composite" "Enable" |
5124 |
EndSection |
5125 |
</pre> |
5126 |
|
5127 |
<p> |
5128 |
这仅仅是Xfce和Xorg-X11所要求的最低限度配置。但是,对硬件加速的设置则取决于你自己的显卡,这已经超出本文讨论的范围了。请阅读<uri link="/doc/zh_cn/index.xml?catid=desktop">桌面文档资源</uri>列表中的其它指南,来学会如何配置让你的显卡实现硬件加速。 |
5129 |
</p> |
5130 |
|
5131 |
</body> |
5132 |
</section> |
5133 |
</chapter> |
5134 |
|
5135 |
<chapter id="upgrade"> |
5136 |
<title>升级</title> |
5137 |
<section> |
5138 |
<title>从4.2升级到4.4</title> |
5139 |
<body> |
5140 |
|
5141 |
<p> |
5142 |
把Xfce从4.2升级到4.4并不麻烦,它就跟大多数的升级一样简单。在4.4版本里面,许多过时的软件包不是被淘汰就是它们的功能已经以其它方式被包含进桌面了。 |
5143 |
</p> |
5144 |
|
5145 |
<p> |
5146 |
首先,更新你的Portage树(<c>emerge --sync</c>),然后看看Xfce有哪些组件可以升级(<c>emerge -pvtuD world</c>)。 |
5147 |
</p> |
5148 |
|
5149 |
<p> |
5150 |
你会注意到有一些包阻止了你的升级,因为大多数4.2的包是不能与4.4的包共存的。这里有个直截了当的办法:只要像<uri link="/doc/zh_cn/handbook/handbook-x86.xml?part=2&chap=1">Portage手册</uri>和<c>man emerge</c>所说的那样卸载掉这些阻挡你的包,然后级就能继续了。 |
5151 |
</p> |
5152 |
|
5153 |
<p> |
5154 |
接着,你可能需要重建某些包,如跟<c>dbus</c>挂钩的应用程序。首先你需要安装<c>gentoolkit</c>。一旦<c>gentoolkit</c>安装好了,运行: |
5155 |
</p> |
5156 |
|
5157 |
<pre caption="重建包"> |
5158 |
# <i>revdep-rebuild -p</i> |
5159 |
<comment>(如果你在输出看到了任何关于有包被破坏的信息,那么运行下一条命令)</comment> |
5160 |
# <i>revdep-rebuild</i> |
5161 |
</pre> |
5162 |
|
5163 |
<note> |
5164 |
更多的信息,请参考<c>man revdep-rebuild</c>和<uri link="/doc/zh_cn/gentoolkit.xml">Gentoolkit指南</uri>。 |
5165 |
</note> |
5166 |
|
5167 |
<p> |
5168 |
一旦重建完成,再一次运行<c>revdep-rebuild -p</c>,这一次只是确定你已经有了一个干净可靠的系统。如果还出现任何出错信息,继续<c>revdep-rebuild -p</c>和<c>revdep-rebuild</c>直到再也没有关于有包被损坏的消息出现。由于Xfce相当广泛地使用了<c>dbus</c>,所以大多数的升级问题都源于<c>dbus</c>。 |
5169 |
</p> |
5170 |
|
5171 |
<p> |
5172 |
接着,重启<c>dbus</c>和/或<c>hal</c>。 |
5173 |
</p> |
5174 |
|
5175 |
<pre caption="重启dbus和hal"> |
5176 |
# <i>/etc/init.d/dbus restart</i> |
5177 |
# <i>/etc/init.d/hald restart</i> |
5178 |
</pre> |
5179 |
|
5180 |
<p> |
5181 |
最后,给你自己一个全新的环境。 |
5182 |
</p> |
5183 |
|
5184 |
<pre caption="更新环境变量"> |
5185 |
# <i>env-update && source /etc/profile</i> |
5186 |
</pre> |
5187 |
|
5188 |
</body> |
5189 |
</section> |
5190 |
<section> |
5191 |
<title>设置</title> |
5192 |
<body> |
5193 |
|
5194 |
<p> |
5195 |
确定你熟悉了新Settings Manager里面所有的新选项。在桌面屏幕上进行操作是我们感兴趣的地方;Xfce现在可以管理你的桌面并且在上面安放图标了。 |
5196 |
</p> |
5197 |
|
5198 |
<p> |
5199 |
还有一个Window Manager Tweaks窗口,在那里你可以调整窗口、工作区间还有透明化(如果支持的话)的属性值。Xfce4.4稍微改变了工作区间与焦点活动窗口之间的默认行为。如果你发现在一个工作区间里点击一个超链接,却把你在另外一个区间里的浏览器调了过来(或者类似烦人的窗口聚焦行为),那么设置Settings --> Window Manager Tweaks --> Focus --> Activate Focus Stealing Prevention试试。 |
5200 |
</p> |
5201 |
|
5202 |
<p> |
5203 |
确定你阅读了<uri link="http://www.xfce.org/documentation/">Xfce文档</uri>并且通过<uri link="http://www.xfce.org/about/tour">Xfce历程</uri>了解了更多关于4.4的信息和学到了更多配置它的方法。 |
5204 |
</p> |
5205 |
|
5206 |
</body> |
5207 |
</section> |
5208 |
</chapter> |
5209 |
|
5210 |
<chapter> |
5211 |
<title>总结</title> |
5212 |
<section> |
5213 |
<body> |
5214 |
|
5215 |
<p> |
5216 |
祝贺你已经走到这么远了!你已经为你的计算需要安装配置了快捷的桌面环境和可靠的应用套件。 |
5217 |
</p> |
5218 |
|
5219 |
</body> |
5220 |
</section> |
5221 |
<section> |
5222 |
<title>资源</title> |
5223 |
<body> |
5224 |
|
5225 |
<p> |
5226 |
对于配置和使用Xfce你还需要其它的帮助吗?还想得到更多轻量级应用程序的建议?试试到这里找找: |
5227 |
</p> |
5228 |
|
5229 |
<ul> |
5230 |
<li><uri link="http://forums.gentoo.org">The Gentoo forums</uri></li> |
5231 |
<li>#irc.freenode.net上的xfce频道</li> |
5232 |
<li> |
5233 |
<path>/usr/share/xfce4/doc/C/index.html</path>这里提供了Xfce的安装帮助文档和其它文档。把你的浏览器对准这里开始阅读。甚至还有许多配置选项的细节“隐藏”在这些帮助文档里面。 |
5234 |
</li> |
5235 |
<li><uri link="http://www.xfce.org">Xfce's home page</uri></li> |
5236 |
</ul> |
5237 |
|
5238 |
</body> |
5239 |
</section> |
5240 |
</chapter> |
5241 |
</guide> |
5242 |
|
5243 |
|
5244 |
|
5245 |
-- |
5246 |
gentoo-commits@g.o mailing list |