| 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/2.5 -->
|
| 6 |
|
| 7 |
<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-install-system.xml,v 1.100 2006/10/08 19:38:11 nightmorph Exp $ -->
|
| 8 |
|
| 9 |
<sections>
|
| 10 |
|
| 11 |
<abstract>
|
| 12 |
After installing and configuring a stage3, the eventual result is that you
|
| 13 |
have a Gentoo base system at your disposal. This chapter describes how
|
| 14 |
to progress to that state.
|
| 15 |
</abstract>
|
| 16 |
|
| 17 |
<version>7.2</version>
|
| 18 |
<date>2006-10-08</date>
|
| 19 |
|
| 20 |
<section>
|
| 21 |
<title>Chrooting</title>
|
| 22 |
<subsection>
|
| 23 |
<title>Optional: Selecting Mirrors</title>
|
| 24 |
<body>
|
| 25 |
|
| 26 |
<p>
|
| 27 |
In order to download source code quickly it is recommended to select a fast
|
| 28 |
mirror. Portage will look in your <path>make.conf</path> file for the
|
| 29 |
GENTOO_MIRRORS variable and use the mirrors listed therein. You can surf to
|
| 30 |
our <uri link="/main/en/mirrors.xml">mirror list</uri> and search
|
| 31 |
for a mirror (or mirrors) close to you (as those are most frequently the
|
| 32 |
fastest ones), but we provide a nice tool called <c>mirrorselect</c> which
|
| 33 |
provides you with a nice interface to select the mirrors you want.
|
| 34 |
</p>
|
| 35 |
|
| 36 |
<pre caption="Using mirrorselect for the GENTOO_MIRRORS variable">
|
| 37 |
# <i>mirrorselect -i -o >> /mnt/gentoo/etc/make.conf</i>
|
| 38 |
</pre>
|
| 39 |
|
| 40 |
<warn>
|
| 41 |
Do not select any IPv6 mirrors. Our stages currently do not support IPv6.
|
| 42 |
</warn>
|
| 43 |
|
| 44 |
<p>
|
| 45 |
A second important setting is the SYNC setting in <path>make.conf</path>. This
|
| 46 |
variable contains the rsync server you want to use when updating your Portage
|
| 47 |
tree (the collection of ebuilds, scripts containing all the information Portage
|
| 48 |
needs to download and install software). Although you can manually enter a SYNC
|
| 49 |
server for yourself, <c>mirrorselect</c> can ease that operation for you:
|
| 50 |
</p>
|
| 51 |
|
| 52 |
<pre caption="Selecting an rsync mirror using mirrorselect">
|
| 53 |
# <i>mirrorselect -i -r -o >> /mnt/gentoo/etc/make.conf</i>
|
| 54 |
</pre>
|
| 55 |
|
| 56 |
<p>
|
| 57 |
After running <c>mirrorselect</c> it is adviseable to double-check the settings
|
| 58 |
in <path>/mnt/gentoo/etc/make.conf</path> !
|
| 59 |
</p>
|
| 60 |
|
| 61 |
</body>
|
| 62 |
</subsection>
|
| 63 |
<subsection>
|
| 64 |
<title>Copy DNS Info</title>
|
| 65 |
<body>
|
| 66 |
|
| 67 |
<p>
|
| 68 |
One thing still remains to be done before we enter the new environment and that
|
| 69 |
is copying over the DNS information in <path>/etc/resolv.conf</path>. You need
|
| 70 |
to do this to ensure that networking still works even after entering the new
|
| 71 |
environment. <path>/etc/resolv.conf</path> contains the nameservers for your
|
| 72 |
network.
|
| 73 |
</p>
|
| 74 |
|
| 75 |
<pre caption="Copy over DNS information">
|
| 76 |
<comment>(The "-L" option is needed to make sure we don't copy a symbolic link)</comment>
|
| 77 |
# <i>cp -L /etc/resolv.conf /mnt/gentoo/etc/resolv.conf</i>
|
| 78 |
</pre>
|
| 79 |
|
| 80 |
</body>
|
| 81 |
</subsection>
|
| 82 |
<subsection>
|
| 83 |
<title>Mounting the /proc and /dev Filesystems</title>
|
| 84 |
<body>
|
| 85 |
|
| 86 |
<p>
|
| 87 |
Mount the <path>/proc</path> filesystem on <path>/mnt/gentoo/proc</path> to
|
| 88 |
allow the installation to use the kernel-provided information within the
|
| 89 |
chrooted environment, and then mount-bind the <path>/dev</path> filesystem.
|
| 90 |
</p>
|
| 91 |
|
| 92 |
<pre caption="Mounting /proc and /dev">
|
| 93 |
# <i>mount -t proc none /mnt/gentoo/proc</i>
|
| 94 |
# <i>mount -o bind /dev /mnt/gentoo/dev</i>
|
| 95 |
</pre>
|
| 96 |
|
| 97 |
</body>
|
| 98 |
</subsection>
|
| 99 |
<subsection>
|
| 100 |
<title>Entering the new Environment</title>
|
| 101 |
<body>
|
| 102 |
|
| 103 |
<p>
|
| 104 |
Now that all partitions are initialized and the base environment
|
| 105 |
installed, it is time to enter our new installation environment by
|
| 106 |
<e>chrooting</e> into it. This means that we change from the current
|
| 107 |
installation environment (Installation CD or other installation medium) to your
|
| 108 |
installation system (namely the initialized partitions).
|
| 109 |
</p>
|
| 110 |
|
| 111 |
<p>
|
| 112 |
This chrooting is done in three steps. First we will change the root
|
| 113 |
from <path>/</path> (on the installation medium) to <path>/mnt/gentoo</path>
|
| 114 |
(on your partitions) using <c>chroot</c>. Then we will create a new environment
|
| 115 |
using <c>env-update</c>, which essentially creates environment variables.
|
| 116 |
Finally, we load those variables into memory using <c>source</c>.
|
| 117 |
</p>
|
| 118 |
|
| 119 |
<pre caption = "Chrooting into the new environment">
|
| 120 |
# <i>chroot /mnt/gentoo /bin/bash</i>
|
| 121 |
# <i>env-update</i>
|
| 122 |
>> Regenerating /etc/ld.so.cache...
|
| 123 |
# <i>source /etc/profile</i>
|
| 124 |
# <i>export PS1="(chroot) $PS1"</i>
|
| 125 |
</pre>
|
| 126 |
|
| 127 |
<p>
|
| 128 |
Congratulations! You are now inside your own Gentoo Linux environment.
|
| 129 |
Of course it is far from finished, which is why the installation still
|
| 130 |
has some sections left :-)
|
| 131 |
</p>
|
| 132 |
|
| 133 |
</body>
|
| 134 |
</subsection>
|
| 135 |
</section>
|
| 136 |
|
| 137 |
<section>
|
| 138 |
<title>Configuring Portage</title>
|
| 139 |
<subsection>
|
| 140 |
<title>Updating the Portage tree</title>
|
| 141 |
<body>
|
| 142 |
|
| 143 |
<p>
|
| 144 |
You should now update your Portage tree to the latest version. <c>emerge
|
| 145 |
--sync</c> does this for you.
|
| 146 |
</p>
|
| 147 |
|
| 148 |
<pre caption="Updating the Portage tree">
|
| 149 |
# <i>emerge --sync</i>
|
| 150 |
<comment>(If you're using a slow terminal like some framebuffers or a serial
|
| 151 |
console, you can add the --quiet option to speed up this process:)</comment>
|
| 152 |
# <i>emerge --sync --quiet</i>
|
| 153 |
</pre>
|
| 154 |
|
| 155 |
<p>
|
| 156 |
If you are behind a firewall that blocks rsync traffic, you can use
|
| 157 |
<c>emerge-webrsync</c> which will download and install a portage snapshot for
|
| 158 |
you.
|
| 159 |
</p>
|
| 160 |
|
| 161 |
<p>
|
| 162 |
If you are warned that a new Portage version is available and that you should
|
| 163 |
update Portage, you should do it now using <c>emerge portage</c> command.
|
| 164 |
</p>
|
| 165 |
|
| 166 |
</body>
|
| 167 |
</subsection>
|
| 168 |
<subsection>
|
| 169 |
<title>Choosing the Right Profile</title>
|
| 170 |
<body>
|
| 171 |
|
| 172 |
<p>
|
| 173 |
First, a small definition is in place.
|
| 174 |
</p>
|
| 175 |
|
| 176 |
<p>
|
| 177 |
A profile is a building block for any Gentoo system. Not only does it specify
|
| 178 |
default values for CHOST, CFLAGS and other important variables, it also locks
|
| 179 |
the system to a certain range of package versions. This is all maintained by the
|
| 180 |
Gentoo developers.
|
| 181 |
</p>
|
| 182 |
|
| 183 |
<p>
|
| 184 |
Previously, such a profile was barely touched by the user. However, x86, hppa
|
| 185 |
and alpha users can choose between two profiles, one for a 2.4 kernel and one
|
| 186 |
for a 2.6 kernel. This requirement has been imposed to improve the integration
|
| 187 |
of the 2.6 kernels. The ppc and ppc64 architectures have several profiles
|
| 188 |
available as well. We will talk about those later.
|
| 189 |
</p>
|
| 190 |
|
| 191 |
<p>
|
| 192 |
You can see what profile you are currently using with the following command:
|
| 193 |
</p>
|
| 194 |
|
| 195 |
<pre caption="Verifying system profile">
|
| 196 |
# <i>ls -FGg /etc/make.profile</i>
|
| 197 |
lrwxrwxrwx 1 48 Apr 8 18:51 /etc/make.profile -> ../usr/portage/profiles/default-linux/x86/2006.1/
|
| 198 |
</pre>
|
| 199 |
|
| 200 |
<p>
|
| 201 |
If you are using one of the aforementioned three architectures, the default
|
| 202 |
profile will provide you with a Linux 2.6-based system. This is the recommended
|
| 203 |
default, but you have the option of choosing another profile too.
|
| 204 |
</p>
|
| 205 |
|
| 206 |
<p>
|
| 207 |
There are also <c>desktop</c> and <c>server</c> subprofiles available for some
|
| 208 |
architectures. Look inside the <path>2006.1/</path> profile to see if there is
|
| 209 |
one available for your architecture. You may wish to view the <c>desktop</c>
|
| 210 |
profile's <path>make.defaults</path> to determine if it fits your needs.
|
| 211 |
</p>
|
| 212 |
|
| 213 |
<p>
|
| 214 |
Some users may wish to install a system based on the older Linux 2.4 profile.
|
| 215 |
If you have good reason to do this, then you should first check that an
|
| 216 |
additional profile exists. On x86, we can do this with the following command:
|
| 217 |
</p>
|
| 218 |
|
| 219 |
<pre caption="Finding out if an additional profile exists">
|
| 220 |
# <i>ls -d /usr/portage/profiles/default-linux/x86/no-nptl/2.4</i>
|
| 221 |
/usr/portage/profiles/default-linux/x86/no-nptl/2.4
|
| 222 |
</pre>
|
| 223 |
|
| 224 |
<p>
|
| 225 |
The above example shows that the additional 2.4 profile exists (i.e. it didn't
|
| 226 |
complain about missing file or directory). It is recommended that you stay with
|
| 227 |
the default, but if you wish to switch, you can do so with as follows:
|
| 228 |
</p>
|
| 229 |
|
| 230 |
<pre caption="Switching to a 2.4 profile">
|
| 231 |
<comment>(Make sure you use the right architecture, the example below is for x86)</comment>
|
| 232 |
# <i>ln -snf /usr/portage/profiles/default-linux/x86/no-nptl/2.4 /etc/make.profile</i>
|
| 233 |
<comment>(List the files in the 2.4 profile)</comment>
|
| 234 |
# <i>ls -FGg /etc/make.profile/</i>
|
| 235 |
total 12
|
| 236 |
-rw-r--r-- 1 939 Dec 10 14:06 packages
|
| 237 |
-rw-r--r-- 1 347 Dec 3 2004 parent
|
| 238 |
-rw-r--r-- 1 573 Dec 3 2004 virtuals
|
| 239 |
</pre>
|
| 240 |
|
| 241 |
<p>
|
| 242 |
For ppc, there are a number of new profiles provided with 2006.1:
|
| 243 |
</p>
|
| 244 |
|
| 245 |
<pre caption="PPC Profiles">
|
| 246 |
<comment>(Generic PPC profile, for all PPC machines, minimal)</comment>
|
| 247 |
# <i>ln -snf /usr/portage/profiles/default-linux/ppc/ppc32/2006.1 /etc/make.profile</i>
|
| 248 |
<comment>(G3 profile)</comment>
|
| 249 |
# <i>ln -snf /usr/portage/profiles/default-linux/ppc/ppc32/2006.1/G3 /etc/make.profile</i>
|
| 250 |
<comment>(G3 Pegasos profile)</comment>
|
| 251 |
# <i>ln -snf /usr/portage/profiles/default-linux/ppc/ppc32/2006.1/G3/Pegasos/ /etc/make.profile</i>
|
| 252 |
<comment>(G4 (Altivec) profile)</comment>
|
| 253 |
# <i>ln -snf /usr/portage/profiles/default-linux/ppc/ppc32/2006.1/G4 /etc/make.profile</i>
|
| 254 |
<comment>(G4 (Altivec) Pegasos profile)</comment>
|
| 255 |
# <i>ln -snf /usr/portage/profiles/default-linux/ppc/ppc32/2006.1/G4/Pegasos/ /etc/make.profile</i>
|
| 256 |
</pre>
|
| 257 |
|
| 258 |
<p>
|
| 259 |
For ppc64, there are a number of new profiles provided with 2006.1:
|
| 260 |
</p>
|
| 261 |
|
| 262 |
<pre caption="PPC64 Profiles">
|
| 263 |
<comment>(Generic 64bit userland PPC64 profile, for all PPC64 machines)</comment>
|
| 264 |
# <i>ln -snf /usr/portage/profiles/default-linux/ppc/ppc64/2006.1/64bit-userland /etc/make.profile</i>
|
| 265 |
<comment>(Generic 32bit userland PPC64 profile, for all PPC64 machines)</comment>
|
| 266 |
# <i>ln -snf /usr/portage/profiles/default-linux/ppc/ppc64/2006.1/32bit-userland /etc/make.profile</i>
|
| 267 |
<comment>(Each type of userland has sub profiles as follows, with (userland) replaced with the chosen userland from above)</comment>
|
| 268 |
<comment>(970 profile for JS20)</comment>
|
| 269 |
# <i>ln -snf /usr/portage/profiles/default-linux/ppc/ppc64/2006.1/(userland)/970 /etc/make.profile</i>
|
| 270 |
<comment>(G5 profile)</comment>
|
| 271 |
# <i>ln -snf /usr/portage/profiles/default-linux/ppc/ppc64/2006.1/(userland)/970/pmac /etc/make.profile</i>
|
| 272 |
<comment>(POWER3 profile)</comment>
|
| 273 |
# <i>ln -snf /usr/portage/profiles/default-linux/ppc/ppc64/2006.1/(userland)/power3 /etc/make.profile</i>
|
| 274 |
<comment>(POWER4 profile)</comment>
|
| 275 |
# <i>ln -snf /usr/portage/profiles/default-linux/ppc/ppc64/2006.1/(userland)/power4 /etc/make.profile</i>
|
| 276 |
<comment>(POWER5 profile)</comment>
|
| 277 |
# <i>ln -snf /usr/portage/profiles/default-linux/ppc/ppc64/2006.1/(userland)/power5 /etc/make.profile</i>
|
| 278 |
<comment>(The multilib profile is not stable as of this release.)</comment>
|
| 279 |
</pre>
|
| 280 |
|
| 281 |
</body>
|
| 282 |
</subsection>
|
| 283 |
<subsection id="configure_USE">
|
| 284 |
<title>Configuring the USE variable</title>
|
| 285 |
<body>
|
| 286 |
|
| 287 |
<p>
|
| 288 |
<c>USE</c> is one of the most powerful variables Gentoo provides to its users.
|
| 289 |
Several programs can be compiled with or without optional support for certain
|
| 290 |
items. For instance, some programs can be compiled with gtk-support, or with
|
| 291 |
qt-support. Others can be compiled with or without SSL support. Some programs
|
| 292 |
can even be compiled with framebuffer support (svgalib) instead of X11 support
|
| 293 |
(X-server).
|
| 294 |
</p>
|
| 295 |
|
| 296 |
<p>
|
| 297 |
Most distributions compile their packages with support for as much as possible,
|
| 298 |
increasing the size of the programs and startup time, not to mention an enormous
|
| 299 |
amount of dependencies. With Gentoo you can define what options a package
|
| 300 |
should be compiled with. This is where <c>USE</c> comes into play.
|
| 301 |
</p>
|
| 302 |
|
| 303 |
<p>
|
| 304 |
In the <c>USE</c> variable you define keywords which are mapped onto
|
| 305 |
compile-options. For instance, <e>ssl</e> will compile ssl-support in the
|
| 306 |
programs that support it. <e>-X</e> will remove X-server support (note the
|
| 307 |
minus sign in front). <e>gnome gtk -kde -qt3 -qt4</e> will compile your
|
| 308 |
programs with gnome (and gtk) support, and not with kde (and qt) support,
|
| 309 |
making your system fully tweaked for GNOME.
|
| 310 |
</p>
|
| 311 |
|
| 312 |
<p>
|
| 313 |
The default <c>USE</c> settings are placed in the <path>make.defaults</path>
|
| 314 |
files of your profile. You will find <path>make.defaults</path> files in the
|
| 315 |
directory which <path>/etc/make.profile</path> points to and all parent
|
| 316 |
directories as well. The default <c>USE</c> setting is the sum of all <c>USE</c>
|
| 317 |
settings in all <path>make.defaults</path> files. What you place in
|
| 318 |
<path>/etc/make.conf</path> is calculated against these defaults settings. If
|
| 319 |
you add something to the <c>USE</c> setting, it is added to the default list. If
|
| 320 |
you remove something from the <c>USE</c> setting (by placing a minus sign in
|
| 321 |
front of it) it is removed from the default list (if it was in the default list
|
| 322 |
at all). <e>Never</e> alter anything inside the <path>/etc/make.profile</path>
|
| 323 |
directory; it gets overwritten when you update Portage!
|
| 324 |
</p>
|
| 325 |
|
| 326 |
<p>
|
| 327 |
A full description on <c>USE</c> can be found in the second part of the Gentoo
|
| 328 |
Handbook, <uri link="?part=2&chap=2">USE flags</uri>. A full description on
|
| 329 |
the available USE flags can be found on your system in
|
| 330 |
<path>/usr/portage/profiles/use.desc</path>.
|
| 331 |
</p>
|
| 332 |
|
| 333 |
<pre caption="Viewing available USE flags">
|
| 334 |
# <i>less /usr/portage/profiles/use.desc</i>
|
| 335 |
<comment>(You can scroll using your arrow keys, exit by pressing 'q')</comment>
|
| 336 |
</pre>
|
| 337 |
|
| 338 |
<p>
|
| 339 |
As an example we show a <c>USE</c> setting for a KDE-based system with DVD, ALSA
|
| 340 |
and CD Recording support:
|
| 341 |
</p>
|
| 342 |
|
| 343 |
<pre caption="Opening /etc/make.conf">
|
| 344 |
# <i>nano -w /etc/make.conf</i>
|
| 345 |
</pre>
|
| 346 |
|
| 347 |
<pre caption="USE setting">
|
| 348 |
USE="-gtk -gnome qt3 qt4 kde dvd alsa cdr"
|
| 349 |
</pre>
|
| 350 |
|
| 351 |
</body>
|
| 352 |
</subsection>
|
| 353 |
<subsection>
|
| 354 |
<title>Optional: GLIBC Locales</title>
|
| 355 |
<body>
|
| 356 |
|
| 357 |
<p>
|
| 358 |
You will probably only use one or maybe two locales on your system. You can
|
| 359 |
specify locales you will need in <path>/etc/locale.gen</path>.
|
| 360 |
</p>
|
| 361 |
|
| 362 |
<pre caption="Opening /etc/locale.gen">
|
| 363 |
# <i>nano -w /etc/locale.gen</i>
|
| 364 |
</pre>
|
| 365 |
|
| 366 |
<p>
|
| 367 |
The following locales are an example to get both English (United States) and
|
| 368 |
German (Germany) with the accompanying character formats (like UTF-8).
|
| 369 |
</p>
|
| 370 |
|
| 371 |
<pre caption="Specify your locales">
|
| 372 |
en_US ISO-8859-1
|
| 373 |
en_US.UTF-8 UTF-8
|
| 374 |
de_DE ISO-8859-1
|
| 375 |
de_DE@euro ISO-8859-15
|
| 376 |
</pre>
|
| 377 |
|
| 378 |
<p>
|
| 379 |
The next step is to run <c>locale-gen</c>. It will generate all the locales you
|
| 380 |
have specified in the <path>/etc/locale.gen</path> file.
|
| 381 |
</p>
|
| 382 |
|
| 383 |
<note>
|
| 384 |
<c>locale-gen</c> is available in <c>glibc-2.3.6-r4</c> and newer. If you have
|
| 385 |
an older version of glibc, you should update it now.
|
| 386 |
</note>
|
| 387 |
|
| 388 |
<p>
|
| 389 |
Now continue with <uri link="?part=1&chap=7">Configuring the Kernel</uri>.
|
| 390 |
</p>
|
| 391 |
|
| 392 |
</body>
|
| 393 |
</subsection>
|
| 394 |
</section>
|
| 395 |
</sections>
|