1 |
swift |
1.26 |
<?xml version='1.0' encoding='UTF-8'?> |
2 |
|
|
<!DOCTYPE sections SYSTEM "/dtd/book.dtd"> |
3 |
|
|
|
4 |
swift |
1.6 |
<!-- The content of this document is licensed under the CC-BY-SA license --> |
5 |
|
|
<!-- See http://creativecommons.org/licenses/by-sa/1.0 --> |
6 |
|
|
|
7 |
swift |
1.56 |
<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-install-system.xml,v 1.55 2004/11/06 15:07:49 swift Exp $ --> |
8 |
swift |
1.11 |
|
9 |
swift |
1.3 |
<sections> |
10 |
swift |
1.56 |
|
11 |
|
|
<version>1.55</version> |
12 |
|
|
<date>November 6, 2004</date> |
13 |
|
|
|
14 |
swift |
1.1 |
<section> |
15 |
swift |
1.3 |
<title>Chrooting</title> |
16 |
swift |
1.1 |
<subsection> |
17 |
swift |
1.2 |
<title>Optional: Selecting Mirrors</title> |
18 |
|
|
<body> |
19 |
|
|
|
20 |
|
|
<p> |
21 |
swift |
1.24 |
If you have booted from a Gentoo LiveCD, you are able to use <c>mirrorselect</c> |
22 |
swift |
1.2 |
to update <path>/etc/make.conf</path> so fast mirrors are used for both Portage |
23 |
swift |
1.28 |
and source code (of course in case you have a working network connection): |
24 |
swift |
1.2 |
</p> |
25 |
|
|
|
26 |
swift |
1.49 |
<warn> |
27 |
|
|
An error within mirrorselect might make it output garbage after the |
28 |
|
|
GENTOO_MIRRORS statement. Please open <path>/mnt/gentoo/etc/make.conf</path> |
29 |
|
|
and remove the garbage at the end of the GENTOO_MIRRORS statement if applicable. |
30 |
|
|
</warn> |
31 |
|
|
|
32 |
swift |
1.2 |
<pre caption="Selecting fast mirrors"> |
33 |
neysx |
1.44 |
# <i>mirrorselect -a -s4 -o | grep 'GENTOO_MIRRORS=' >> /mnt/gentoo/etc/make.conf</i> |
34 |
swift |
1.2 |
</pre> |
35 |
|
|
|
36 |
|
|
<p> |
37 |
|
|
If for some reason <c>mirrorselect</c> fails, don't panic. This step is |
38 |
swift |
1.33 |
completely optional, the default values suffice. |
39 |
swift |
1.2 |
</p> |
40 |
|
|
|
41 |
|
|
</body> |
42 |
swift |
1.3 |
</subsection> |
43 |
|
|
<subsection> |
44 |
swift |
1.5 |
<title>Copy DNS Info</title> |
45 |
|
|
<body> |
46 |
|
|
|
47 |
|
|
<p> |
48 |
swift |
1.24 |
One thing still remains to be done before we enter the new environment and that |
49 |
|
|
is copying over the DNS information in <path>/etc/resolv.conf</path>. You need |
50 |
swift |
1.5 |
to do this to ensure that networking still works even after entering the new |
51 |
|
|
environment. <path>/etc/resolv.conf</path> contains the nameservers for your |
52 |
|
|
network. |
53 |
|
|
</p> |
54 |
|
|
|
55 |
|
|
<pre caption="Copy over DNS information"> |
56 |
swift |
1.35 |
<comment>(The "-L" option is needed to make sure we don't copy a symbolic link)</comment> |
57 |
|
|
# <i>cp -L /etc/resolv.conf /mnt/gentoo/etc/resolv.conf</i> |
58 |
swift |
1.18 |
</pre> |
59 |
|
|
|
60 |
|
|
</body> |
61 |
|
|
</subsection> |
62 |
|
|
<subsection> |
63 |
swift |
1.43 |
<title>Mounting the proc Filesystem</title> |
64 |
|
|
<body> |
65 |
|
|
|
66 |
|
|
<p> |
67 |
|
|
Mount the <path>/proc</path> filesystem on <path>/mnt/gentoo/proc</path> to |
68 |
|
|
allow the installation to use the kernel-provided information even within the |
69 |
|
|
chrooted environment. |
70 |
|
|
</p> |
71 |
|
|
|
72 |
|
|
<pre caption="Mounting /proc"> |
73 |
|
|
# <i>mount -t proc none /mnt/gentoo/proc</i> |
74 |
|
|
</pre> |
75 |
|
|
|
76 |
|
|
</body> |
77 |
|
|
</subsection> |
78 |
|
|
<subsection> |
79 |
swift |
1.2 |
<title>Entering the new Environment</title> |
80 |
swift |
1.1 |
<body> |
81 |
|
|
|
82 |
|
|
<p> |
83 |
swift |
1.19 |
Now that all partitions are initialized and the base environment |
84 |
swift |
1.1 |
installed, it is time to enter our new installation environment by |
85 |
swift |
1.9 |
<e>chrooting</e> into it. This means that we change from the current |
86 |
swift |
1.2 |
installation environment (LiveCD or other installation medium) to your |
87 |
swift |
1.19 |
installation system (namely the initialized partitions). |
88 |
swift |
1.1 |
</p> |
89 |
|
|
|
90 |
|
|
<p> |
91 |
|
|
This chrooting is done in three steps. First we will change the root |
92 |
swift |
1.2 |
from <path>/</path> (on the installation medium) to <path>/mnt/gentoo</path> |
93 |
|
|
(on your partitions) using <c>chroot</c>. Then we will create a new environment |
94 |
|
|
using <c>env-update</c>, which essentially creates environment variables. |
95 |
swift |
1.1 |
Finally, we load those variables into memory using <c>source</c>. |
96 |
|
|
</p> |
97 |
|
|
|
98 |
|
|
<pre caption = "Chrooting into the new environment"> |
99 |
|
|
# <i>chroot /mnt/gentoo /bin/bash</i> |
100 |
|
|
# <i>env-update</i> |
101 |
neysx |
1.39 |
* Caching service dependencies... |
102 |
swift |
1.1 |
# <i>source /etc/profile</i> |
103 |
|
|
</pre> |
104 |
|
|
|
105 |
|
|
<p> |
106 |
|
|
Congratulations! You are now inside your own Gentoo Linux environment. |
107 |
swift |
1.10 |
Of course it is far from finished, which is why the installation still |
108 |
swift |
1.1 |
has some sections left :-) |
109 |
|
|
</p> |
110 |
|
|
|
111 |
|
|
</body> |
112 |
swift |
1.3 |
</subsection> |
113 |
|
|
<subsection> |
114 |
dertobi123 |
1.40 |
<title>Optional: Updating the Portage tree</title> |
115 |
swift |
1.2 |
<body> |
116 |
|
|
|
117 |
|
|
<p> |
118 |
cam |
1.50 |
If you haven't installed a Portage snapshot in the previous chapter, you must |
119 |
|
|
download a recent Portage tree from the Internet. <c>emerge --sync</c> does this |
120 |
|
|
for you. Other users should skip this and continue with <uri |
121 |
swift |
1.28 |
link="#configure_USE">Configuring the USE variable</uri>. |
122 |
swift |
1.2 |
</p> |
123 |
|
|
|
124 |
dertobi123 |
1.40 |
<pre caption="Updating the Portage tree"> |
125 |
cam |
1.50 |
# <i>emerge --sync</i> |
126 |
swift |
1.38 |
</pre> |
127 |
|
|
|
128 |
|
|
<p> |
129 |
|
|
Portage uses the RSYNC protocol for updating the Portage tree. If the above |
130 |
|
|
command fails due to your firewall, use <c>emerge-webrsync</c> which |
131 |
swift |
1.51 |
downloads and installs a Portage snapshot for you using the regular HTTP |
132 |
swift |
1.38 |
protocol. |
133 |
|
|
</p> |
134 |
|
|
|
135 |
dertobi123 |
1.40 |
<pre caption="Updating the Portage tree with emerge-webrsync"> |
136 |
swift |
1.27 |
# <i>emerge-webrsync</i> |
137 |
swift |
1.13 |
</pre> |
138 |
|
|
|
139 |
|
|
<p> |
140 |
|
|
If you are warned that a new Portage version is available and that you should |
141 |
swift |
1.34 |
update Portage, you should ignore it. Portage will be updated for you later |
142 |
bennyc |
1.16 |
on during the installation. |
143 |
swift |
1.13 |
</p> |
144 |
swift |
1.8 |
|
145 |
|
|
</body> |
146 |
|
|
</subsection> |
147 |
swift |
1.28 |
<subsection id="configure_USE"> |
148 |
swift |
1.21 |
<title>Configuring the USE variable</title> |
149 |
|
|
<body> |
150 |
|
|
|
151 |
|
|
<p> |
152 |
|
|
<c>USE</c> is one of the most powerful variables Gentoo provides to its users. |
153 |
|
|
Several programs can be compiled with or without optional support for certain |
154 |
|
|
items. For instance, some programs can be compiled with gtk-support, or with |
155 |
|
|
qt-support. Others can be compiled with or without SSL support. Some programs |
156 |
|
|
can even be compiled with framebuffer support (svgalib) instead of X11 support |
157 |
|
|
(X-server). |
158 |
|
|
</p> |
159 |
|
|
|
160 |
|
|
<p> |
161 |
|
|
Most distributions compile their packages with support for as much as possible, |
162 |
|
|
increasing the size of the programs and startup time, not to mention an enormous |
163 |
swift |
1.24 |
amount of dependencies. With Gentoo you can define what options a package |
164 |
swift |
1.21 |
should be compiled with. This is where <c>USE</c> comes into play. |
165 |
|
|
</p> |
166 |
|
|
|
167 |
|
|
<p> |
168 |
|
|
In the <c>USE</c> variable you define keywords which are mapped onto |
169 |
|
|
compile-options. For instance, <e>ssl</e> will compile ssl-support in the |
170 |
|
|
programs that support it. <e>-X</e> will remove X-server support (note the minus |
171 |
|
|
sign in front). <e>gnome gtk -kde -qt</e> will compile your programs with gnome |
172 |
|
|
(and gtk) support, and not with kde (and qt) support, making your system fully |
173 |
|
|
tweaked for GNOME. |
174 |
|
|
</p> |
175 |
|
|
|
176 |
|
|
<p> |
177 |
|
|
The default <c>USE</c> settings are placed in |
178 |
|
|
<path>/etc/make.profile/make.defaults</path>. What you place in |
179 |
|
|
<path>/etc/make.conf</path> is calculated against these defaults settings. If |
180 |
|
|
you add something to the <c>USE</c> setting, it is added to the default list. If |
181 |
|
|
you remove something from the <c>USE</c> setting (by placing a minus sign in |
182 |
|
|
front of it) it is removed from the default list (if it was in the default list |
183 |
|
|
at all). <e>Never</e> alter anything inside the <path>/etc/make.profile</path> |
184 |
|
|
directory; it gets overwritten when you update Portage! |
185 |
|
|
</p> |
186 |
|
|
|
187 |
|
|
<p> |
188 |
|
|
A full description on <c>USE</c> can be found in the second part of the Gentoo |
189 |
neysx |
1.52 |
Handbook, <uri link="?part=2&chap=2">USE flags</uri>. A full description on |
190 |
|
|
the available USE flags can be found on your system in |
191 |
swift |
1.23 |
<path>/usr/portage/profiles/use.desc</path>. |
192 |
|
|
</p> |
193 |
|
|
|
194 |
|
|
<pre caption="Viewing available USE flags"> |
195 |
|
|
# <i>less /usr/portage/profiles/use.desc</i> |
196 |
swift |
1.45 |
<comment>(You can scroll using your arrow keys, exit by pressing 'q')</comment> |
197 |
swift |
1.23 |
</pre> |
198 |
|
|
|
199 |
|
|
<p> |
200 |
|
|
As an example we show a <c>USE</c> setting for a KDE-based system with DVD, ALSA |
201 |
|
|
and CD Recording support: |
202 |
swift |
1.21 |
</p> |
203 |
|
|
|
204 |
|
|
<pre caption="Opening /etc/make.conf"> |
205 |
|
|
# <i>nano -w /etc/make.conf</i> |
206 |
|
|
</pre> |
207 |
|
|
|
208 |
|
|
<pre caption="USE setting"> |
209 |
|
|
USE="-gtk -gnome qt kde dvd alsa cdr" |
210 |
|
|
</pre> |
211 |
|
|
|
212 |
dertobi123 |
1.53 |
<p> |
213 |
|
|
You will probably only use one or maybe two locales on your system. Up until now |
214 |
swift |
1.55 |
after compiling <c>glibc</c> a full set of all available locales will be |
215 |
|
|
created. As of now you can activate the <c>userlocales</c> USE flag and specify |
216 |
dertobi123 |
1.53 |
only the locales you will need in <path>/etc/locales.build</path>. |
217 |
|
|
</p> |
218 |
|
|
|
219 |
|
|
<pre caption="Activate the userlocales USE flag especially for glibc"> |
220 |
swift |
1.54 |
# <i>mkdir /etc/portage</i> |
221 |
|
|
# <i>echo "sys-libs/glibc userlocales" >> /etc/portage/package.use</i> |
222 |
dertobi123 |
1.53 |
</pre> |
223 |
|
|
|
224 |
|
|
<p> |
225 |
|
|
Now specify the locales you want to be able to use: |
226 |
|
|
</p> |
227 |
|
|
|
228 |
|
|
<pre caption="nano -w /etc/locales.build"> |
229 |
|
|
en_US/ISO-8859-1 |
230 |
|
|
en_US.UTF-8/UTF-8 |
231 |
|
|
de_DE/ISO-8859-1 |
232 |
|
|
de_DE@euro/ISO-8859-15 |
233 |
|
|
</pre> |
234 |
|
|
|
235 |
swift |
1.21 |
</body> |
236 |
|
|
</subsection> |
237 |
|
|
<subsection> |
238 |
swift |
1.8 |
<title>Optional: Using Distributed Compiling</title> |
239 |
|
|
<body> |
240 |
|
|
|
241 |
|
|
<p> |
242 |
|
|
If you are interested in using a collection of systems to help in compiling your |
243 |
|
|
system you might want to take a look at our <uri |
244 |
|
|
link="/doc/en/distcc.xml">DistCC Guide</uri>. By using <c>distcc</c> you can use |
245 |
|
|
the processing power of several systems to aid you with the installation. |
246 |
|
|
</p> |
247 |
swift |
1.2 |
|
248 |
|
|
</body> |
249 |
swift |
1.1 |
</subsection> |
250 |
swift |
1.3 |
</section> |
251 |
|
|
<section> |
252 |
swift |
1.1 |
<title>Differences between Stage1, Stage2 and Stage3</title> |
253 |
|
|
<body> |
254 |
|
|
|
255 |
|
|
<p> |
256 |
|
|
Now take a seat and think of your previous steps. We asked you to |
257 |
|
|
select a <e>stage1</e>, <e>stage2</e> or <e>stage3</e> and warned you |
258 |
|
|
that your choice is important for further installation steps. Well, this |
259 |
neysx |
1.48 |
is the first place where your choice defines the subsequent steps. |
260 |
swift |
1.1 |
</p> |
261 |
|
|
|
262 |
|
|
<ul> |
263 |
|
|
<li> |
264 |
swift |
1.4 |
If you chose <e>stage1</e>, then you have to follow <e>both</e> steps in |
265 |
|
|
this chapter (starting with <uri link="#doc_chap3">Progressing from Stage1 |
266 |
|
|
to Stage2</uri>) |
267 |
swift |
1.1 |
</li> |
268 |
|
|
<li> |
269 |
swift |
1.4 |
If you chose <e>stage2</e> you only can skip the first step |
270 |
|
|
and immediately start with the second one (<uri link="#doc_chap4">Progressing |
271 |
|
|
from Stage2 to Stage3</uri>) |
272 |
swift |
1.1 |
</li> |
273 |
|
|
<li> |
274 |
swift |
1.4 |
If you chose <e>stage3</e> (either with or without GRP) then you can skip both |
275 |
swift |
1.31 |
steps and continue with <uri link="?part=1&chap=7">Configuring the |
276 |
|
|
Kernel</uri> |
277 |
swift |
1.1 |
</li> |
278 |
|
|
</ul> |
279 |
|
|
|
280 |
|
|
</body> |
281 |
swift |
1.3 |
</section> |
282 |
|
|
<section> |
283 |
|
|
<title>Progressing from Stage1 to Stage2</title> |
284 |
swift |
1.1 |
<subsection> |
285 |
|
|
<title>Introduction to Bootstrapping</title> |
286 |
|
|
<body> |
287 |
|
|
|
288 |
|
|
<p> |
289 |
|
|
So, you want to compile everything from scratch? Okay then :-) |
290 |
|
|
</p> |
291 |
|
|
|
292 |
|
|
<p> |
293 |
|
|
In this step, we will <e>bootstrap</e> your Gentoo system. This takes a |
294 |
|
|
long time, but the result is a system that has been optimized from the |
295 |
|
|
ground up for your specific machine and needs. |
296 |
|
|
</p> |
297 |
|
|
|
298 |
|
|
<p> |
299 |
|
|
<e>Bootstrapping</e> means building the GNU C Library, GNU Compiler |
300 |
swift |
1.32 |
Collection and several other key system programs. |
301 |
swift |
1.1 |
</p> |
302 |
|
|
|
303 |
|
|
<p> |
304 |
|
|
Before starting the bootstrap, we list a couple of options you might or |
305 |
swift |
1.4 |
might not want. If you do not want to read those, continue with <uri |
306 |
swift |
1.41 |
link="#bootstrap">Bootstrapping the System</uri>. |
307 |
swift |
1.1 |
</p> |
308 |
|
|
|
309 |
|
|
</body> |
310 |
swift |
1.3 |
</subsection> |
311 |
|
|
<subsection> |
312 |
swift |
1.1 |
<title>Optional: Downloading the Sources First</title> |
313 |
|
|
<body> |
314 |
|
|
|
315 |
|
|
<p> |
316 |
swift |
1.25 |
If you haven't copied over all source code before, then the bootstrap |
317 |
swift |
1.1 |
script will download all necessary files. It goes without saying that |
318 |
|
|
this only works if you have a working network connnection :-) If you want to |
319 |
swift |
1.25 |
download the source code first and later bootstrap the system (for instance |
320 |
swift |
1.1 |
because you don't want to have your internet connection open during the |
321 |
|
|
compilation) use the <e>-f</e> option of the bootstrap script, which will |
322 |
swift |
1.25 |
fetch (hence the letter <e>f</e>) all source code for you. |
323 |
swift |
1.1 |
</p> |
324 |
|
|
|
325 |
|
|
<pre caption = "Downloading the necessary sources"> |
326 |
|
|
# <i>cd /usr/portage</i> |
327 |
swift |
1.47 |
# <i>scripts/bootstrap.sh -f</i> |
328 |
swift |
1.1 |
</pre> |
329 |
|
|
|
330 |
|
|
</body> |
331 |
swift |
1.3 |
</subsection> |
332 |
swift |
1.41 |
<subsection id="bootstrap"> |
333 |
swift |
1.1 |
<title>Bootstrapping the System</title> |
334 |
|
|
<body> |
335 |
|
|
|
336 |
|
|
<p> |
337 |
|
|
Okay then, take your keyboard and punch in the next commands to start |
338 |
swift |
1.36 |
the bootstrap. Then go amuse yourself with something else because this step |
339 |
|
|
takes quite some time to finish. |
340 |
swift |
1.1 |
</p> |
341 |
|
|
|
342 |
|
|
<pre caption = "Bootstrapping the system"> |
343 |
|
|
# <i>cd /usr/portage</i> |
344 |
swift |
1.47 |
# <i>scripts/bootstrap.sh</i> |
345 |
swift |
1.12 |
</pre> |
346 |
|
|
|
347 |
|
|
<p> |
348 |
swift |
1.4 |
Now continue with the next step, <uri link="#doc_chap4">Progressing from Stage2 |
349 |
|
|
to Stage3</uri>. |
350 |
|
|
</p> |
351 |
|
|
|
352 |
swift |
1.1 |
</body> |
353 |
|
|
</subsection> |
354 |
swift |
1.3 |
</section> |
355 |
|
|
<section> |
356 |
|
|
<title>Progressing from Stage2 to Stage3</title> |
357 |
swift |
1.1 |
<subsection> |
358 |
|
|
<title>Introduction</title> |
359 |
|
|
<body> |
360 |
|
|
|
361 |
|
|
<p> |
362 |
|
|
If you are reading this section, then you have a bootstrapped system |
363 |
|
|
(either because you bootstrapped it previously, or you are using a |
364 |
|
|
<e>stage2</e>). Then it is now time to build all system packages. |
365 |
|
|
</p> |
366 |
|
|
|
367 |
|
|
<p> |
368 |
|
|
<e>All</e> system packages? No, not really. In this step, you will build |
369 |
swift |
1.19 |
the system packages of which there are no alternatives to use. |
370 |
|
|
Some system packages have several alternatives (such as system loggers) |
371 |
swift |
1.1 |
and as Gentoo is all about choices, we don't want to force one upon you. |
372 |
|
|
</p> |
373 |
|
|
|
374 |
|
|
</body> |
375 |
swift |
1.3 |
</subsection> |
376 |
|
|
<subsection> |
377 |
swift |
1.1 |
<title>Optional: Viewing what will be done</title> |
378 |
|
|
<body> |
379 |
|
|
|
380 |
|
|
<p> |
381 |
|
|
If you want to know what packages will be installed, execute <c>emerge |
382 |
swift |
1.14 |
--pretend system</c>. This will list all packages that will be built. As this |
383 |
swift |
1.1 |
list is pretty big, you should also use a pager like <c>less</c> or |
384 |
|
|
<c>more</c> to go up and down the list. |
385 |
|
|
</p> |
386 |
|
|
|
387 |
|
|
<pre caption = "View what 'emerge system' will do"> |
388 |
swift |
1.14 |
# <i>emerge --pretend system | less</i> |
389 |
swift |
1.1 |
</pre> |
390 |
|
|
|
391 |
|
|
</body> |
392 |
swift |
1.3 |
</subsection> |
393 |
|
|
<subsection> |
394 |
swift |
1.4 |
<title>Optional: Downloading the Sources</title> |
395 |
swift |
1.1 |
<body> |
396 |
|
|
|
397 |
|
|
<p> |
398 |
|
|
If you want <c>emerge</c> to download the sources before you continue |
399 |
|
|
(for instance because you don't want the internet connection to be left |
400 |
swift |
1.20 |
open while you are building all packages) you can use the <e>--fetchonly</e> |
401 |
swift |
1.1 |
option of <c>emerge</c> which will fetch all sources for you. |
402 |
|
|
</p> |
403 |
|
|
|
404 |
|
|
<pre caption = "Fetching the sources"> |
405 |
swift |
1.14 |
# <i>emerge --fetchonly system</i> |
406 |
swift |
1.1 |
</pre> |
407 |
|
|
|
408 |
|
|
</body> |
409 |
swift |
1.3 |
</subsection> |
410 |
|
|
<subsection> |
411 |
swift |
1.1 |
<title>Building the System</title> |
412 |
|
|
<body> |
413 |
|
|
|
414 |
|
|
<p> |
415 |
|
|
To start building the system, execute <c>emerge system</c>. Then go do |
416 |
swift |
1.4 |
something to keep your mind busy, because this step takes a long time to |
417 |
|
|
complete. |
418 |
swift |
1.1 |
</p> |
419 |
|
|
|
420 |
|
|
<pre caption = "Building the System"> |
421 |
|
|
# <i>emerge system</i> |
422 |
|
|
</pre> |
423 |
|
|
|
424 |
|
|
<p> |
425 |
swift |
1.30 |
You can for now safely ignore any warnings about updated configuration files |
426 |
|
|
(and running <c>etc-update</c>). When your Gentoo system is fully installed and |
427 |
|
|
booted, do read our documentation on <uri |
428 |
neysx |
1.52 |
link="?part=3&chap=2#doc_chap3">Configuration File Protection</uri>. |
429 |
swift |
1.28 |
</p> |
430 |
|
|
|
431 |
|
|
<p> |
432 |
swift |
1.31 |
When the build process has completed, continue with <uri |
433 |
|
|
link="?part=1&chap=7">Configuring the Kernel</uri>. |
434 |
swift |
1.28 |
</p> |
435 |
|
|
|
436 |
|
|
</body> |
437 |
|
|
</subsection> |
438 |
|
|
</section> |
439 |
|
|
|
440 |
swift |
1.3 |
</sections> |