This is Gentoo's testing wiki. It is a non-operational environment and its textual content is outdated.

Please visit our production wiki at https://wiki.gentoo.org

Instalace instalačních souborů Gentoo

From Gentoo Wiki (test)
Jump to:navigation Jump to:search
This page is a translated version of the page Handbook:AMD64/Installation/Stage and the translation is 100% complete.
AMD64 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


Instalace stage balíku

Nastavení data a času

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.

Note
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.

Warning
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.

For instance, to set the date to October 3rd, 13:16 in the year 2016:

root #date 100313162016

Výběr balíku stage

Multilib (32 and 64bitový)

Výběr základního stage balíku může později ušetřit spoustu čas během procesu instalace, zvláště ve chvíli, kdy budete vybírat profil systému. Vyběr stage balíku má přímý dopad na budoucí konfiguraci systému a může vám později ušetřit muka. Balík multilib obsahuje, je-li to možné, 64bitové knihovny a jako zálohu volí 32bitové verze pouze tehdy, je-li to potřeba z pohledu kompatibility. Jde o vynikající volbu pro většinu instalací, jelikož poskytuje vysokou míru flexibility a přizpůsobení v budoucnosti. Ti, kteří touží po tom, aby byl jejich systém schopen snadno měnit profily, by měli stáhnout balík multilib pro svoji procesorovou architekturu.

Většina uživatelů nemusí používat nabízené "pokročilé" balíky; jsou určeny pro specifické konfigurace softwaru a hardwaru.

Ne-multilib (čistě 64bitový)

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.

Warning
Vemte na vědomí, že přechod z ne-multilib na multilib systém vyžaduje extrémní znalosti fungování Gentoo a nízkoúrovňových nástrojů (dokonce i našim vyvojářům základních nástrojů by proběhl mráz po zádech). Není to nic pro slabé povahy a jedná se o záležitost, která je mimo záběr tohoto průvodce.

Stažení stage balíku

Přejděte do přípojného bodu, kam byl připojen kořenový systém souborů (nejspíše /mnt/gentoo):

root #cd /mnt/gentoo

Depending on the installation medium, the only tool necessary to download a stage tarball is a web browser.

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:

root #links https://www.gentoo.org/downloads/mirrors/

HTTP proxy s prohlížečem links použijete tak, že mu předáte volbu -http-proxy:

root #links -http-proxy proxy.server.com:8080 https://www.gentoo.org/downloads/mirrors/

Vedle links můžete použít také prohlížeč lynx. Stejně jako links se jedná o negrafický prohlížeč, který však nemá menu.

root #lynx https://www.gentoo.org/downloads/mirrors/

Pokud potřebujete definovat proxy, exportujte proměnné http_proxy a/nebo ftp_proxy.

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

On the mirror list, select a mirror close by. Usually HTTP mirrors suffice, but other protocols are available as well. Move to the releases/amd64/autobuilds/ directory. There all available stage files are displayed (they might be stored within subdirectories named after the individual sub-architectures). Select one and press d to 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.

Those not interested in verifying and validating the stage file can close the command-line browser by pressing q and can move directly to the Unpacking the stage tarball section.

Verifying and validating

Note
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.

Like with the minimal installation CDs, additional downloads to verify and validate the stage file are available. Although these steps may be skipped, these files are provided for users who care about the legitimacy of the file(s) they just downloaded.

  • 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.

Use openssl and compare the output with the checksums provided by the .DIGESTS or .DIGESTS.asc files.

Například ověření kontrolního součtu SHA512 provedete takto:

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

Jiným cestou je použití příkazu sha512sum:

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

Ověření kontrolního součtu Whirpool:

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

Porovnejte výstupy těchto příkazů s hodnotami zapsanými v souborech .DIGESTS(.asc). Hodnoty se musí shodovat, v opačném případě mohlo dojít k porušení staženého souboru (nebo souboru se součty).

Stejně jako u souboru ISO je možné ověřit kryptografický podpis souboru .DIGESTS.asc pomocí příkazu gpg a ověřit tak, že kontrolní součty nebyly měněny:

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

Rozbalení souboru stage

Nyní stažený stage soubor rozbalte do systému. K tomu použijeme příkaz tar:

root #tar xpvf stage3-*.tar.bz2 --xattrs-include='*.*' --numeric-owner

Make sure that the same options (xpf and --xattrs-include='*.*') are used. The x stands for extract, the p for preserve permissions and the f to denote that we want to extract a file (not standard input). --xattrs-include='*.*' is to include preservation of the the extended attributes in all namespaces stored in the archive. Finally, --numeric-owner is used to ensure that the user and group IDs of the files being extracted from the tarball will remain the same as Gentoo's release engineering team intended (even if adventurous users are not using official Gentoo installation media).

Now that the stage file is unpacked, proceed with Configuring the compile options.

Konfigurace kompilačních voleb

Úvod

Gentoo je možné vyladit nastavením několika proměnných, které mají dopad na chování Portage, oficiálního správce balíčků Gentoo. Všechny proměnné mohou být nastaveny jako proměnné prostředí (pomocí příkazu export), nicméně to není trvalé řešení. Nastavení se uchovává v konfiguračním souboru /etc/portage/make.conf, odkud je Portage načítá.

Note
Komentovaný výpis všech možných proměnných lze najít v souboru /mnt/gentoo/usr/share/portage/make.conf.example. K úspěšnému nainstalování Gentoo je třeba nastavit pouze proměnné uvedené níže.

Spusťte editor (v tomto průvodci používáme nano) a upravte optimalizační proměnné, které nyní probereme.

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

Ze souboru make.conf.example je zjevné, jak má být uspořádán: komentované řádky začínají "#", ostatní řádky definují proměnné prostřednictvím syntaxe PROMENNA="obsah". Nyní se podíváme na několik z těchto proměnných.

CFLAGS a 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.

V souboru make.conf by měly být obecně nastaveny takové optimalizační přepínače, jejichž použití povede k co nejlepší odezvě systému. Do této proměnné neumisťujte experimentální nastavení; příliš mnoho optimalizací může způsobit špatné chování programů (pády nebo hůře, závadné chování).

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.

Prvním nastavením je hodnota parametru -march= nebo -mtune=, který stanoví jméno cílové architektury. Možné volby jsou popsány v souborumake.conf.example (jako komentáře). Běžně používanou hodnotou je "native", která kompiléru říká, aby používal cílovou architekturu daného systému (toho, na nějž uživatel instaluje Gentoo).

Druhým je parametr -O (jedná se o velké O, nikoli o nulu), který určuje třídu optimalizací gcc. Možné třídy jsou s (pro optimalizaci velikosti), 0 (nula - žádné optimalizace), 1, 2 nebo dokonce 3 pro více urychlujících optimalizací (každá třída obsahuje stejné parametry, jako ta přechozí a k tomu nějaké další). -O2 je doporučenou výchozí hodnotou. O -O3 je známo, že při plošném použití v celém systému způsobuje problémy, tudíž doporučujeme držet se -O2.

Dalším oblíbeným optimalizačním parametrem je -pipe (použije roury namísto dočasných souborů ke komunikaci mezi různými fázemi kompilace). Ten nemá dopad na generovaný kód, ale používá více paměti. V systémech s nízkým množstvím paměti může kvůli tomu dojít k zabití gcc. V takovém případě tento parametr nepoužívejte.

Použití -fomit-frame-pointer (který nezachová frame pointer v registru pro funkce, které jej nepotřebují) může mít závažné dopady na debugging aplikací.

Jakmile jsou proměnné CFLAGS a CXXFLAGS definovány, složte optimalizační přepínače do jednoho řetězce. Výchozí hodnoty obsažené ve stage3 archivu by měly být dostatečné. Následující zápis je pouze příkladem:

CODE Example CFLAGS and CXXFLAGS variables
CFLAGS="-march=native -O2 -pipe"
# Use the same settings for both variables
CXXFLAGS="${CFLAGS}"
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

Proměnná MAKEOPTS určuje, kolik paralelních kompilací může být prováděno při instalaci balíku. Dobrou volbou je počet CPU (nebo jader CPU) v systému plus jedna, ale toto vodítko není vždy dokonalé.

CODE Příklad deklarace MAKEOPTS v make.conf
MAKEOPTS="-j2"

Ready, set, go!

Upravte soubor /mnt/gentoo/etc/portage/make.conf tak, aby odpovídal vašim osobním preferencím a uložte jej (uživatelé nano stisknou Ctrl+X).

Pak pokračujte na Instalace základu systému Gentoo.