Handbuch:X86/Installation/Stage

From Gentoo Wiki
Jump to: navigation, search
This page is a translated version of the page Handbook:X86/Installation/Stage and the translation is 100% complete.

Other languages:
Deutsch • ‎English • ‎Türkçe • ‎español • ‎français • ‎polski • ‎português do Brasil • ‎русский • ‎українська • ‎中文(中国大陆)‎ • ‎日本語 • ‎한국어
X86 Handbook
Installation
About the installation
Choosing the media
Configuring the network
Preparing the disks
Installing stage3
Installing base system
Configuring the kernel
Configuring the system
Installing tools
Configuring the bootloader
Finalizing
Working with Gentoo
Portage introduction
USE flags
Portage features
Initscript system
Environment variables
Working with Portage
Files and directories
Variables
Mixing software branches
Additional tools
Custom package repository
Advanced features
Network configuration
Getting started
Advanced configuration
Modular networking
Wireless
Adding functionality
Dynamic management


Installation eines Stage-Tarballs

Datum und Uhrzeit einstellen

Before installing Gentoo, it is a good idea to be sure the date and time are set correctly. A mis-configured clock may lead to strange results: base system files should be extracted with accurate time stamps. In fact, due to several websites and services using encrypted communications (SSL/TLS), it might not be possible to download the installation files at all if the system clock is too far skewed!

Verify the current date and time by running the date command:

root #date
Mon Oct  3 13:16:22 PDT 2016

If the date/time displayed is wrong, update it using one of the methods below.

Notiz
Motherboards that do not include a Real-Time Clock (RTC) should be configured to automatically sync the system clock with a time server. This is also true for systems that do include a RTC, but have a failed battery.

Automatic

Official Gentoo installation media includes the ntpd command (available through the net-misc/ntp package). Official media includes a configuration file pointing to ntp.org time servers. It can be used to automatically sync the system clock to UTC time using a time server. Using this method requires a working network configuration and may not be available on all architectures.

Warnung
Automatic time sync comes at a price. It will reveal the system's IP address and related network information to a time server (in the case of the example below ntp.org). Users with privacy concerns should be aware of this before setting the system clock using the below method.
root #ntpd -q -g

Manual

The date command can also be used to perform a manual set on the system clock. Use the MMDDhhmmYYYY syntax (Month, Day, hour, minute and Year).

UTC time is recommended for all Linux systems. Later on during the installation a timezone will be defined. This will modify the display of the clock to local time.

Um beispielsweise die Zeit auf den 29. März 2014, 16:21 Uhr einzustellen, geben Sie folgendes ein:

root #date 032916212014

Choosing a stage tarball

Multilib (32 and 64-bit)

Choosing a base tarball for the system can save a considerable amount of time later on in the installation process, specifically when it is time to choose a system profile. The selection of a stage tarball will directly impact future system configuration and can save a headache or two later on down the line. The multilib tarball uses 64-bit libraries when possible, and only falls back to the 32-bit versions when necessary for compatibility. This is an excellent option for the majority of installations because it provides a great amount of flexibility for customization in the future. Those who desire their systems to be capable of easily switching profiles should download the multilib tarball option for their respective processor architecture.

Most users should not use the 'advanced' tarballs options; they are for specific software or hardware configurations.

No-multilib (pure 64-bit)

Selecting a no-multilib tarball to be the base of the system provides a complete 64-bit operating system environment. This effectively renders the ability to switch to multilib profiles improbable, but possible. Those who are just starting out with Gentoo should not choose a no-multilib tarball unless it is absolutely necessary.

Warnung
Be aware, migrating from a no-multilib to a multilib system requires an extremely well-working knowledge of Gentoo and the lower-level toolchain (it may even cause our Toolchain developers to shudder a little). It is not for the faint of heart and is beyond the scope of this guide.

Stage-Tarball herunterladen

Gehen Sie zum Gentoo Einhängepunkt, wo das Root-Dateisystem eingebunden ist (wahrscheinlich /mnt/gentoo):

root #cd /mnt/gentoo

Abhängig vom Installationsmedium stehen mehrere Tools zum Download der Stage-Datei zur Verfügung. Eines dieser Werkzeuge ist links, ein nicht-grafischer, menügesteuerter Browser. Um eine Stage-Datei herunterzuladen surfen Sie wie folgt zur Gentoo Spiegelserverliste:

Graphical browsers

Those using environments with fully graphical web browsers will have no problem copying a stage file URL from the main website's download section. Simply select the appropriate tab, right click the link to the stage file, then Copy link address (Firefox) or Copy link location (Chromium) to copy the link to the clipboard, then paste the link to the wget utility on the command-line to download the stage tarball:

root #wget <PASTED_STAGE_URL>

Command-line browsers

More traditional readers or 'old timer' Gentoo users, working exclusively from command-line may prefer using links, a non-graphical, menu-driven browser. To download a stage, surf to the Gentoo mirror list like so:

Um einen HTTP-Proxy mit links zu verwenden, übergeben Sie die URL mit der -http-proxy Option:

root #links -http-proxy proxy.server.com:8080 http://www.gentoo.org/main/de/mirrors.xml

Neben links gibt es auch den Browser lynx. Wie links ist es ein nicht-grafischer Browser, aber er ist nicht menügesteuert.

Wenn ein Proxy definiert werden muss, exportieren Sie die http_proxy und/ oder ftp_proxy Variablen:

root #export http_proxy="http://proxy.server.com:port"
root #export ftp_proxy="http://proxy.server.com:port"

In der Spiegel-Liste wählen Sie einen Spiegel in der Nähe. Für gewöhnlich genügen HTTP Spiegel, andere Protokolle stehen aber auch zur Verfügung. Gehen Sie in das Verzeichnis releases/x86/autobuilds/. Dort werden alle verfügbaren Stage-Dateien angezeigt (sie können in Unterverzeichnissen gespeichert sein, benannt nach den einzelnen Sub-Architekturen). Wählen Sie eine aus und drücken Sie D zum Download.

After the stage file download completes, it is possible to verify the integrity and validate the contents of the stage tarball. Those interested should proceed to the next section.

Wenn Sie fertig sind, drücken Sie Q um den Browser zu beenden.

Verifying and validating

Notiz
Some tarballs are being delivered via xz compression. When downloading a tarball ending in .tar.xz, be sure to adjust the tarball filename from .tar.bz2 in the following commands.

Wie bei der minimalen Installations-CDs stehen zusätzliche Downloads zur Verfügung:

  • Eine Datei .CONTENTS, die eine Liste aller Dateien im Stage Tarball enthält.
  • Eine Datei .DIGESTS, die Prüfsummen der Stage Datei unter verschiedenen Algorithmen beinhaltet.
  • Eine Datei .DIGESTS.asc, die wie die Datei .DIGESTS Prüfsummen der Stage unter verschiedenen Algorithmen beinhaltet, allerdings zusätzlich kryptographisch signiert um sicherzustellen, dass es durch das Gentoo-Projekt zur Verfügung gestellt wurde.
  • A .CONTENTS file that contains a list of all files inside the stage tarball.
  • A .DIGESTS file that contains checksums of the stage file in different algorithms.
  • A .DIGESTS.asc file that, like the .DIGESTS file, contains checksums of the stage file in different algorithms, but is also cryptographically signed to ensure it is provided by the Gentoo project.

Nach dem Herunterladen der Stage-Datei ist es möglich die Integrität des heruntergeladenen Stage-Tarballs zu überprüfen. Verwenden Sie openssl und vergleichen Sie die Ausgabe mit den Prüfsummen die durch die Dateie .DIGESTS oder .DIGESTS.asc zur Verfügung gestellt wird.

Zur Überprüfung der SHA512 Prüfsumme zum Beispiel:

root #openssl dgst -r -sha512 stage3-x86-<release>.tar.bz2

Eine weitere Möglichkeit ist die Verwendung des Befehls sha512sum:

root #sha512sum stage3-x86-<release>.tar.bz2

Zur Validierung der Whirlpool Prüfsumme:

root #openssl dgst -r -whirlpool stage3-x86-<release>.tar.bz2

Vergleichen Sie die Ausgabe dieser Befehle mit dem Wert der in den .DIGESTS(.asc) Dateien eingetragen ist. Die Werte müssen übereinstimmen, andernfalls ist möglicherweise die heruntergeladene Datei beschädigt (oder die DIGEST-Datei ist es).

Genau wie bei der ISO-Datei ist es ebenfalls möglich die kryptographische Signatur der Datei .DIGESTS.asc mit gpg zu überprüfen, um sicherzustellen dass die Prüfsummen nicht manipuliert wurden:

root #gpg --verify stage3-x86-<release>.tar.bz2.DIGESTS.asc

Stage-Tarball entpacken

Entpacken Sie das heruntergeladene Stage auf dem System. Wir verwenden tar um fortzufahren:

root #tar xvjpf stage3-*.tar.bz2

Stellen Sie sicher, dass die gleichen Optionen (xvjpf) verwendet werden. Das x steht für Extrahieren, das v für Verbose (wortreich) um zu sehen was beim Extraktionsprozess vor sich geht (optional), das j für Entpacken mit bzip2, das p (Perserve) für den Erhalt der Dateirechte und das f (File) gibt an, dass wir eine Datei und nicht die Standardeingabe extrahieren wollen.

Jetzt da das Stage installiert ist, fahren Sie mit dem konfigurieren der Compiler-Optionen fort.

Compiler-Optionen konfigurieren

Einleitung

To optimize Gentoo, it is possible to set a couple of variables which impacts the behavior of Portage, Gentoo's officially supported package manager. All those variables can be set as environment variables (using export) but that isn't permanent. To keep the settings, Portage reads in the /etc/portage/make.conf file, a configuration file for Portage.

Notiz
A commented listing of all possible variables can be found in /mnt/gentoo/usr/share/portage/config/make.conf.example. For a successful Gentoo installation only the variables that are mentioned below need to be set.

Fire up an editor (in this guide we use nano) to alter the optimization variables we will discuss hereafter.

root #nano -w /mnt/gentoo/etc/portage/make.conf

From the make.conf.example file it is obvious how the file should be structured: commented lines start with "#", other lines define variables using the VARIABLE="content" syntax. Several of those variables are discussed next.

CFLAGS und CXXFLAGS

The CFLAGS and CXXFLAGS variables define the optimization flags for GCC C and C++ compilers respectively. Although those are defined generally here, for maximum performance one would need to optimize these flags for each program separately. The reason for this is because every program is different. However, this is not manageable, hence the definition of these flags in the make.conf file.

In make.conf one should define the optimization flags that will make the system the most responsive generally. Don't place experimental settings in this variable; too much optimization can make programs behave bad (crash, or even worse, malfunction).

We will not explain all possible optimization options. To understand them all, read the GNU Online Manual(s) or the gcc info page (info gcc - only works on a working Linux system). The make.conf.example file itself also contains lots of examples and information; don't forget to read it too.

A first setting is the -march= or -mtune= flag, which specifies the name of the target architecture. Possible options are described in the make.conf.example file (as comments). A commonly used value is native as that tells the compiler to select the target architecture of the current system (the one users are installing Gentoo on).

A second one is the -O flag (that is a capital O, not a zero), which specifies the gcc optimization class flag. Possible classes are s (for size-optimized), 0 (zero - for no optimizations), 1, 2 or even 3 for more speed-optimization flags (every class has the same flags as the one before, plus some extras). -O2 is the recommended default. -O3 is known to cause problems when used system-wide, so we recommend to stick to -O2.

Another popular optimization flag is -pipe (use pipes rather than temporary files for communication between the various stages of compilation). It has no impact on the generated code, but uses more memory. On systems with low memory, gcc might get killed. In that case, do not use this flag.

Using -fomit-frame-pointer (which doesn't keep the frame pointer in a register for functions that don't need one) might have serious repercussions on the debugging of applications.

When the CFLAGS and CXXFLAGS variables are defined, combine the several optimization flags in one string. The default values contained in the stage3 archive that is unpacked should be good enough. The following one is just an example:

CODE Example CFLAGS and CXXFLAGS variables
# Compiler flags to set for all languages
COMMON_FLAGS="-O2 -march=i686 -pipe"
# Use the same settings for both variables
CFLAGS="${COMMON_FLAGS}"
CXXFLAGS="${COMMON_FLAGS}"
Tip
Although the GCC optimization article has more information on how the various compilation options can affect a system, the Safe CFLAGS article may be a more practical place for beginners to start optimizing their systems.

MAKEOPTS

The MAKEOPTS variable defines how many parallel compilations should occur when installing a package. A good choice is the number of CPUs (or CPU cores) in the system plus one, but this guideline isn't always perfect.

CODE Example MAKEOPTS declaration in make.conf
MAKEOPTS="-j2"

Auf die Plätze, fertig, los!

Update the /mnt/gentoo/etc/portage/make.conf file to match personal preference and save (nano users would hit Ctrl+X).

Then continue with Installing the Gentoo base system.