| 1 |
<?xml version='1.0' encoding='UTF-8'?>
|
| 2 |
<!DOCTYPE sections SYSTEM "/dtd/book.dtd">
|
| 3 |
|
| 4 |
<!-- 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 |
<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-install-system.xml,v 1.69 2005/01/04 18:11:21 swift Exp $ -->
|
| 8 |
|
| 9 |
<sections>
|
| 10 |
|
| 11 |
<version>1.65</version>
|
| 12 |
<date>2005-02-25</date>
|
| 13 |
|
| 14 |
<section>
|
| 15 |
<title>Chrooting</title>
|
| 16 |
<subsection>
|
| 17 |
<title>Optional: Selecting Mirrors</title>
|
| 18 |
<body>
|
| 19 |
|
| 20 |
<p>
|
| 21 |
In order to download source code quickly it is recommended to select a fast
|
| 22 |
mirror. Portage will look in your <path>make.conf</path> file for the
|
| 23 |
GENTOO_MIRRORS variable and use the mirrors listed therein. You can surf to
|
| 24 |
our <uri link="/main/en/mirrors.xml">mirror list</uri> and search
|
| 25 |
for a mirror (or mirrors) close to you (as those are most frequently the
|
| 26 |
fastest ones), but we provide a nice tool called <c>mirrorselect</c> which
|
| 27 |
provides you with a nice interface to select the mirrors you want.
|
| 28 |
</p>
|
| 29 |
|
| 30 |
<pre caption="Using mirrorselect for the GENTOO_MIRRORS variable">
|
| 31 |
# <i>mirrorselect -i -o >> /mnt/gentoo/etc/make.conf</i>
|
| 32 |
</pre>
|
| 33 |
|
| 34 |
<p>
|
| 35 |
A second important setting is the SYNC setting in <path>make.conf</path>. This
|
| 36 |
variable contains the rsync server you want to use when updating your Portage
|
| 37 |
tree (the collection of ebuilds, scripts containing all the information Portage
|
| 38 |
needs to download and install software). Although you can manually enter a SYNC
|
| 39 |
server for yourself, <c>mirrorselect</c> can ease that operation for you:
|
| 40 |
</p>
|
| 41 |
|
| 42 |
<pre caption="Selecting an rsync mirror using mirrorselect">
|
| 43 |
# <i>mirrorselect -i -r -o >> /mnt/gentoo/etc/make.conf</i>
|
| 44 |
</pre>
|
| 45 |
|
| 46 |
<p>
|
| 47 |
After running <c>mirrorselect</c> it is adviseable to double-check the settings
|
| 48 |
in <path>/mnt/gentoo/etc/make.conf</path> !
|
| 49 |
</p>
|
| 50 |
|
| 51 |
</body>
|
| 52 |
</subsection>
|
| 53 |
<subsection>
|
| 54 |
<title>Copy DNS Info</title>
|
| 55 |
<body>
|
| 56 |
|
| 57 |
<p>
|
| 58 |
One thing still remains to be done before we enter the new environment and that
|
| 59 |
is copying over the DNS information in <path>/etc/resolv.conf</path>. You need
|
| 60 |
to do this to ensure that networking still works even after entering the new
|
| 61 |
environment. <path>/etc/resolv.conf</path> contains the nameservers for your
|
| 62 |
network.
|
| 63 |
</p>
|
| 64 |
|
| 65 |
<pre caption="Copy over DNS information">
|
| 66 |
<comment>(The "-L" option is needed to make sure we don't copy a symbolic link)</comment>
|
| 67 |
# <i>cp -L /etc/resolv.conf /mnt/gentoo/etc/resolv.conf</i>
|
| 68 |
</pre>
|
| 69 |
|
| 70 |
</body>
|
| 71 |
</subsection>
|
| 72 |
<subsection>
|
| 73 |
<title>Mounting the proc Filesystem</title>
|
| 74 |
<body>
|
| 75 |
|
| 76 |
<p>
|
| 77 |
Mount the <path>/proc</path> filesystem on <path>/mnt/gentoo/proc</path> to
|
| 78 |
allow the installation to use the kernel-provided information even within the
|
| 79 |
chrooted environment.
|
| 80 |
</p>
|
| 81 |
|
| 82 |
<pre caption="Mounting /proc">
|
| 83 |
# <i>mount -t proc none /mnt/gentoo/proc</i>
|
| 84 |
</pre>
|
| 85 |
|
| 86 |
</body>
|
| 87 |
</subsection>
|
| 88 |
<subsection>
|
| 89 |
<title>Entering the new Environment</title>
|
| 90 |
<body>
|
| 91 |
|
| 92 |
<p>
|
| 93 |
Now that all partitions are initialized and the base environment
|
| 94 |
installed, it is time to enter our new installation environment by
|
| 95 |
<e>chrooting</e> into it. This means that we change from the current
|
| 96 |
installation environment (LiveCD or other installation medium) to your
|
| 97 |
installation system (namely the initialized partitions).
|
| 98 |
</p>
|
| 99 |
|
| 100 |
<p>
|
| 101 |
This chrooting is done in three steps. First we will change the root
|
| 102 |
from <path>/</path> (on the installation medium) to <path>/mnt/gentoo</path>
|
| 103 |
(on your partitions) using <c>chroot</c>. Then we will create a new environment
|
| 104 |
using <c>env-update</c>, which essentially creates environment variables.
|
| 105 |
Finally, we load those variables into memory using <c>source</c>.
|
| 106 |
</p>
|
| 107 |
|
| 108 |
<pre caption = "Chrooting into the new environment">
|
| 109 |
# <i>chroot /mnt/gentoo /bin/bash</i>
|
| 110 |
# <i>env-update</i>
|
| 111 |
* Caching service dependencies...
|
| 112 |
# <i>source /etc/profile</i>
|
| 113 |
</pre>
|
| 114 |
|
| 115 |
<p>
|
| 116 |
Congratulations! You are now inside your own Gentoo Linux environment.
|
| 117 |
Of course it is far from finished, which is why the installation still
|
| 118 |
has some sections left :-)
|
| 119 |
</p>
|
| 120 |
|
| 121 |
</body>
|
| 122 |
</subsection>
|
| 123 |
<subsection>
|
| 124 |
<title>Updating the Portage tree</title>
|
| 125 |
<body>
|
| 126 |
|
| 127 |
<p>
|
| 128 |
You should now update your Portage tree to the latest version. <c>emerge
|
| 129 |
--sync</c> does this for you.
|
| 130 |
</p>
|
| 131 |
|
| 132 |
<pre caption="Updating the Portage tree">
|
| 133 |
# <i>emerge --sync</i>
|
| 134 |
</pre>
|
| 135 |
|
| 136 |
<p>
|
| 137 |
If you are warned that a new Portage version is available and that you should
|
| 138 |
update Portage, you should ignore it. Portage will be updated for you later
|
| 139 |
on during the installation.
|
| 140 |
</p>
|
| 141 |
|
| 142 |
</body>
|
| 143 |
</subsection>
|
| 144 |
<subsection id="configure_USE">
|
| 145 |
<title>Configuring the USE variable</title>
|
| 146 |
<body>
|
| 147 |
|
| 148 |
<p>
|
| 149 |
<c>USE</c> is one of the most powerful variables Gentoo provides to its users.
|
| 150 |
Several programs can be compiled with or without optional support for certain
|
| 151 |
items. For instance, some programs can be compiled with gtk-support, or with
|
| 152 |
qt-support. Others can be compiled with or without SSL support. Some programs
|
| 153 |
can even be compiled with framebuffer support (svgalib) instead of X11 support
|
| 154 |
(X-server).
|
| 155 |
</p>
|
| 156 |
|
| 157 |
<p>
|
| 158 |
Most distributions compile their packages with support for as much as possible,
|
| 159 |
increasing the size of the programs and startup time, not to mention an enormous
|
| 160 |
amount of dependencies. With Gentoo you can define what options a package
|
| 161 |
should be compiled with. This is where <c>USE</c> comes into play.
|
| 162 |
</p>
|
| 163 |
|
| 164 |
<p>
|
| 165 |
In the <c>USE</c> variable you define keywords which are mapped onto
|
| 166 |
compile-options. For instance, <e>ssl</e> will compile ssl-support in the
|
| 167 |
programs that support it. <e>-X</e> will remove X-server support (note the minus
|
| 168 |
sign in front). <e>gnome gtk -kde -qt</e> will compile your programs with gnome
|
| 169 |
(and gtk) support, and not with kde (and qt) support, making your system fully
|
| 170 |
tweaked for GNOME.
|
| 171 |
</p>
|
| 172 |
|
| 173 |
<p>
|
| 174 |
The default <c>USE</c> settings are placed in the <path>make.defaults</path>
|
| 175 |
files of your profile. You will find <path>make.defaults</path> files in the
|
| 176 |
directory which <path>/etc/make.profile</path> points to and all parent
|
| 177 |
directories as well. The default <c>USE</c> setting is the sum of all <c>USE</c>
|
| 178 |
settings in all <path>make.defaults</path> files. 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 |
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 |
<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 |
<comment>(You can scroll using your arrow keys, exit by pressing 'q')</comment>
|
| 197 |
</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 |
</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 |
</body>
|
| 213 |
</subsection>
|
| 214 |
<subsection>
|
| 215 |
<title>Optional: GLIBC Locales</title>
|
| 216 |
<body>
|
| 217 |
|
| 218 |
<p>
|
| 219 |
You will probably only use one or maybe two locales on your system. Up until now
|
| 220 |
after compiling <c>glibc</c> a full set of all available locales will be
|
| 221 |
created. As of now you can activate the <c>userlocales</c> USE flag and specify
|
| 222 |
only the locales you will need in <path>/etc/locales.build</path>. Only do this
|
| 223 |
if you know what locales to choose.
|
| 224 |
</p>
|
| 225 |
|
| 226 |
<pre caption="Activate the userlocales USE flag especially for glibc">
|
| 227 |
# <i>mkdir /etc/portage</i>
|
| 228 |
# <i>echo "sys-libs/glibc userlocales" >> /etc/portage/package.use</i>
|
| 229 |
</pre>
|
| 230 |
|
| 231 |
<p>
|
| 232 |
Now specify the locales you want to be able to use:
|
| 233 |
</p>
|
| 234 |
|
| 235 |
<pre caption="Opening /etc/locales.build">
|
| 236 |
# <i>nano -w /etc/locales.build</i>
|
| 237 |
</pre>
|
| 238 |
|
| 239 |
<p>
|
| 240 |
The following locales are an example to get both English (United States) and
|
| 241 |
German (Germany) with the accompanying character formats (like UTF-8).
|
| 242 |
</p>
|
| 243 |
|
| 244 |
<pre caption="Specify your locales">
|
| 245 |
en_US/ISO-8859-1
|
| 246 |
en_US.UTF-8/UTF-8
|
| 247 |
de_DE/ISO-8859-1
|
| 248 |
de_DE@euro/ISO-8859-15
|
| 249 |
</pre>
|
| 250 |
|
| 251 |
</body>
|
| 252 |
</subsection>
|
| 253 |
</section>
|
| 254 |
<section>
|
| 255 |
<title>Differences between Stage1, Stage2 and Stage3</title>
|
| 256 |
<body>
|
| 257 |
|
| 258 |
<p>
|
| 259 |
Now take a seat and think of your previous steps. We asked you to
|
| 260 |
select a <e>stage1</e>, <e>stage2</e> or <e>stage3</e> and warned you
|
| 261 |
that your choice is important for further installation steps. Well, this
|
| 262 |
is the first place where your choice defines the subsequent steps.
|
| 263 |
</p>
|
| 264 |
|
| 265 |
<ul>
|
| 266 |
<li>
|
| 267 |
If you chose <e>stage1</e>, then you have to follow <e>both</e> steps in
|
| 268 |
this chapter (starting with <uri link="#doc_chap3">Progressing from Stage1
|
| 269 |
to Stage2</uri>)
|
| 270 |
</li>
|
| 271 |
<li>
|
| 272 |
If you chose <e>stage2</e> you only can skip the first step
|
| 273 |
and immediately start with the second one (<uri link="#doc_chap4">Progressing
|
| 274 |
from Stage2 to Stage3</uri>)
|
| 275 |
</li>
|
| 276 |
<li>
|
| 277 |
If you chose <e>stage3</e> then you can skip both
|
| 278 |
steps and continue with <uri link="?part=1&chap=7">Configuring the
|
| 279 |
Kernel</uri>
|
| 280 |
</li>
|
| 281 |
</ul>
|
| 282 |
|
| 283 |
</body>
|
| 284 |
</section>
|
| 285 |
<section>
|
| 286 |
<title>Progressing from Stage1 to Stage2</title>
|
| 287 |
<subsection>
|
| 288 |
<title>Introduction to Bootstrapping</title>
|
| 289 |
<body>
|
| 290 |
|
| 291 |
<p>
|
| 292 |
So, you want to compile everything from scratch? Okay then :-)
|
| 293 |
</p>
|
| 294 |
|
| 295 |
<p>
|
| 296 |
In this step, we will <e>bootstrap</e> your Gentoo system. This takes a
|
| 297 |
long time, but the result is a system that has been optimized from the
|
| 298 |
ground up for your specific machine and needs.
|
| 299 |
</p>
|
| 300 |
|
| 301 |
<p>
|
| 302 |
<e>Bootstrapping</e> means building the GNU C Library, GNU Compiler
|
| 303 |
Collection and several other key system programs.
|
| 304 |
</p>
|
| 305 |
|
| 306 |
<p>
|
| 307 |
Before starting the bootstrap, you might want to download all necessary
|
| 308 |
sourcecode first. If you do not want to do this, continue
|
| 309 |
with <uri link="#bootstrap">Bootstrapping the System</uri>.
|
| 310 |
</p>
|
| 311 |
|
| 312 |
</body>
|
| 313 |
</subsection>
|
| 314 |
<subsection>
|
| 315 |
<title>Optional: Downloading the Sources First</title>
|
| 316 |
<body>
|
| 317 |
|
| 318 |
<p>
|
| 319 |
If you haven't copied over all source code before, then the bootstrap
|
| 320 |
script will download all necessary files. If you want to
|
| 321 |
download the source code first and later bootstrap the system (for instance
|
| 322 |
because you don't want to have your internet connection open during the
|
| 323 |
compilation) use the <e>-f</e> option of the bootstrap script, which will
|
| 324 |
fetch (hence the letter <e>f</e>) all source code for you.
|
| 325 |
</p>
|
| 326 |
|
| 327 |
<pre caption = "Downloading the necessary sources">
|
| 328 |
# <i>cd /usr/portage</i>
|
| 329 |
# <i>scripts/bootstrap.sh -f</i>
|
| 330 |
</pre>
|
| 331 |
|
| 332 |
</body>
|
| 333 |
</subsection>
|
| 334 |
<subsection id="bootstrap">
|
| 335 |
<title>Bootstrapping the System</title>
|
| 336 |
<body>
|
| 337 |
|
| 338 |
<p>
|
| 339 |
Okay then, take your keyboard and punch in the next commands to start
|
| 340 |
the bootstrap. Then go amuse yourself with something else because this step
|
| 341 |
takes quite some time to finish.
|
| 342 |
</p>
|
| 343 |
|
| 344 |
<pre caption = "Bootstrapping the system">
|
| 345 |
# <i>cd /usr/portage</i>
|
| 346 |
# <i>scripts/bootstrap.sh</i>
|
| 347 |
</pre>
|
| 348 |
|
| 349 |
<p>
|
| 350 |
When you have set the <c>nptl</c> USE flag, rerunning <c>bootstrap.sh</c> might
|
| 351 |
fail with a message that <c>linux-headers</c> blocks <c>linux26-headers</c>.
|
| 352 |
When you receive this error, remove <c>linux-headers</c> and retry:
|
| 353 |
</p>
|
| 354 |
|
| 355 |
<pre caption="Removing linux-headers from your system">
|
| 356 |
# <i>emerge -C linux-headers</i>
|
| 357 |
# <i>emerge --oneshot --nodeps linux26-headers</i>
|
| 358 |
# <i>scripts/bootstrap.sh</i>
|
| 359 |
</pre>
|
| 360 |
|
| 361 |
<p>
|
| 362 |
Now continue with the next step, <uri link="#doc_chap4">Progressing from Stage2
|
| 363 |
to Stage3</uri>.
|
| 364 |
</p>
|
| 365 |
|
| 366 |
</body>
|
| 367 |
</subsection>
|
| 368 |
</section>
|
| 369 |
<section>
|
| 370 |
<title>Progressing from Stage2 to Stage3</title>
|
| 371 |
<subsection>
|
| 372 |
<title>Introduction</title>
|
| 373 |
<body>
|
| 374 |
|
| 375 |
<p>
|
| 376 |
If you are reading this section, then you have a bootstrapped system
|
| 377 |
(either because you bootstrapped it previously, or you are using a
|
| 378 |
<e>stage2</e>). Then it is now time to build all system packages.
|
| 379 |
</p>
|
| 380 |
|
| 381 |
<p>
|
| 382 |
<e>All</e> system packages? No, not really. In this step, you will build
|
| 383 |
the system packages of which there are no alternatives to use.
|
| 384 |
Some system packages have several alternatives (such as system loggers)
|
| 385 |
and as Gentoo is all about choices, we don't want to force one upon you.
|
| 386 |
</p>
|
| 387 |
|
| 388 |
</body>
|
| 389 |
</subsection>
|
| 390 |
<subsection>
|
| 391 |
<title>Optional: Viewing what will be done</title>
|
| 392 |
<body>
|
| 393 |
|
| 394 |
<p>
|
| 395 |
If you want to know what packages will be installed, execute <c>emerge
|
| 396 |
--pretend system</c>. This will list all packages that will be built. As this
|
| 397 |
list is pretty big, you should also use a pager like <c>less</c> or
|
| 398 |
<c>more</c> to go up and down the list.
|
| 399 |
</p>
|
| 400 |
|
| 401 |
<pre caption = "View what 'emerge system' will do">
|
| 402 |
# <i>emerge --pretend system | less</i>
|
| 403 |
</pre>
|
| 404 |
|
| 405 |
</body>
|
| 406 |
</subsection>
|
| 407 |
<subsection>
|
| 408 |
<title>Optional: Downloading the Sources</title>
|
| 409 |
<body>
|
| 410 |
|
| 411 |
<p>
|
| 412 |
If you want <c>emerge</c> to download the sources before you continue
|
| 413 |
(for instance because you don't want the internet connection to be left
|
| 414 |
open while you are building all packages) you can use the <e>--fetchonly</e>
|
| 415 |
option of <c>emerge</c> which will fetch all sources for you.
|
| 416 |
</p>
|
| 417 |
|
| 418 |
<pre caption = "Fetching the sources">
|
| 419 |
# <i>emerge --fetchonly system</i>
|
| 420 |
</pre>
|
| 421 |
|
| 422 |
</body>
|
| 423 |
</subsection>
|
| 424 |
<subsection>
|
| 425 |
<title>Building the System</title>
|
| 426 |
<body>
|
| 427 |
|
| 428 |
<p>
|
| 429 |
To start building the system, execute <c>emerge system</c>. Then go do
|
| 430 |
something to keep your mind busy, because this step takes a long time to
|
| 431 |
complete.
|
| 432 |
</p>
|
| 433 |
|
| 434 |
<pre caption = "Building the System">
|
| 435 |
# <i>emerge system</i>
|
| 436 |
</pre>
|
| 437 |
|
| 438 |
<p>
|
| 439 |
You can for now safely ignore any warnings about updated configuration files
|
| 440 |
(and running <c>etc-update</c>). When your Gentoo system is fully installed and
|
| 441 |
booted, do read our documentation on <uri
|
| 442 |
link="?part=3&chap=2#doc_chap3">Configuration File Protection</uri>.
|
| 443 |
</p>
|
| 444 |
|
| 445 |
<p>
|
| 446 |
When the build process has completed, continue with <uri
|
| 447 |
link="?part=1&chap=7">Configuring the Kernel</uri>.
|
| 448 |
</p>
|
| 449 |
|
| 450 |
</body>
|
| 451 |
</subsection>
|
| 452 |
</section>
|
| 453 |
|
| 454 |
</sections>
|