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

Handbuch:PPC64/Installation/Basis

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


Chrooten

Optional: Spiegelserver wählen

Distributionsdateien

Um den Quellcode zügig herunterzuladen wird empfohlen einen schnellen Spiegel auszuwählen. Portage schaut in die Datei make.conf nach der Variable GENTOO_MIRRORS und verwendet darin aufgelistete Spiegel. Es ist möglich zur Gentoo Mirror Liste zu surfen und nach einem Spiegel (oder mehreren Spiegeln) zu suchen, die nahe dem Systemstandort liegen (da diese meistens die schnellsten sind). Allerdings bieten wir ein nettes Tool namens mirrorselect, das den Benutzern ein schönes Interface zur Auswahl der benötigten Spiegel bietet. Gehen Sie einfach zu den Spiegeln der Wahl und drücken Sie die Leertaste um einen oder mehrere Spiegel auszuwählen.

root #mirrorselect -i -o >> /mnt/gentoo/etc/portage/make.conf

Gentoo ebuild repository

A second important step in selecting mirrors is to configure the Gentoo ebuild repository via the /etc/portage/repos.conf/gentoo.conf file. This file contains the sync information needed to update the package repository (the collection of ebuilds and related files containing all the information Portage needs to download and install software packages).

Configuring the repository can be done in a few simple steps. First, if it does not exist, create the repos.conf directory:

root #mkdir /mnt/gentoo/etc/portage/repos.conf

Dann kopieren Sie die von Portage bereitgestellte Gentoo-Repository-Konfigurationsdatei in das (neu erstellte) Verzeichnis repos.conf:

root #cp /mnt/gentoo/usr/share/portage/config/repos.conf /mnt/gentoo/etc/portage/repos.conf/gentoo.conf

Schauen Sie sich ruhig die Datei mit einem Texteditor oder mit dem cat-Befehl an. Die Datei sollte ein .ini-Format haben und ungefähr so aussehen:

DATEI /mnt/gentoo/etc/portage/repos.conf/gentoo.conf
[gentoo]
location = /usr/portage
sync-type = rsync
sync-uri = rsync://rsync.gentoo.org/gentoo-portage
auto-sync = yes

[gentoo] location = /usr/portage sync-type = rsync sync-uri = rsync://rsync.gentoo.org/gentoo-portage auto-sync = yes sync-rsync-verify-jobs = 1 sync-rsync-verify-metamanifest = yes sync-rsync-verify-max-age = 24 sync-openpgp-key-path = /usr/share/openpgp-keys/gentoo-release.asc sync-openpgp-key-refresh-retry-count = 40 sync-openpgp-key-refresh-retry-overall-timeout = 1200 sync-openpgp-key-refresh-retry-delay-exp-base = 2 sync-openpgp-key-refresh-retry-delay-max = 60 sync-openpgp-key-refresh-retry-delay-mult = 4

  1. for daily squashfs snapshots
  2. sync-type = squashdelta
  3. sync-uri = mirror://gentoo/../snapshots/squashfs

}}

The default sync-uri variable value listed above will determine a mirror location based on a rotation. This will aid in easing bandwidth stress on Gentoo's infrastructure and will provide a fail-safe in case a specific mirror is offline. It is recommended the default URI is retained unless a local, private Portage mirror will be used.

Tip
Falls Sie an Details interessiert sind, finden Sie die offizielle Spezifikation der Portage Sync-Plugin-API in einem Artikel des Portage-Projekts.

DNS-Info kopieren

Eine Sache bleibt noch zu tun bevor Sie die neue Umgebung betreten und das ist das Kopieren der DNS-Informationen in die Datei /etc/resolv.conf. Dies ist notwendig um sicherzustellen, dass das Netzwerk auch nach dem Betreten der neuen Umgebung immer noch funktioniert. /etc/resolv.conf beinhaltet die Namensserver des Netzwerks.

Zum Kopieren dieser Information ist es empfehlenswert beim Befehl cp die Option -L zu verwenden. Wenn /etc/resolv.conf ein symbolischer Link ist stellt dies sicher, dass die Zieldatei anstelle des symbolischen Links selbst kopiert wird. Andernfalls würde der symbolische Link auf eine nicht existierende Datei zeigen (weil das Link-Ziel höchstwahrscheinlich in der neuen Umgebung nicht verfügbar ist).

root #cp -L /etc/resolv.conf /mnt/gentoo/etc/

Notwendige Dateisysteme einhängen

In wenigen Augenblicken wird Linux root (/) auf den neuen Ort geändert werden. Um Sicherzustellen dass die neue Umgebung richtig arbeitet, müssen bestimmte Dateisysteme dort ebenfalls verfügbar gemacht werden.

Die Dateisysteme, die verfügbar gemacht werden müssen, sind:

  • /proc/ ist ein ein Pseudo-Dateisystem (Die beinhalteten Dateien sehen aus wie gewöhnliche Dateien, sie werden jedoch im laufenden Betrieb generiert). Der Kernel stellt hier der Umgebung Informationen zur Verfügung.
  • /sys/ ist ein Pseudo-Dateisystem wie /proc/ ist. Einst war es dafür gedacht, dieses zu ersetzen, und es ist besser strukturiert als /proc/.
  • /dev/ ist ein gewöhnliches Dateisystem, teilweise vom Linux Device Manager (normalerweise udev) verwaltet, das alle Gerätedateien enthält.

/proc/ wird an /mnt/gentoo/proc/ eingehängt (mount), wohingegen die anderen zwei über mount --rbind eingebunden werden. Das letztere bedeutet beispielsweise dass /mnt/gentoo/sys/ in Wirklichkeit /sys/ ist (es ist lediglich ein zweiter Einstiegspunkt zum selben Dateisystem), wohingegen /mnt/gentoo/proc/ ein neuer Einhängepunkt (sozusagen eine neue Instanz) des Dateisystems ist.

root #mount --types proc /proc /mnt/gentoo/proc
root #mount --rbind /sys /mnt/gentoo/sys
root #mount --make-rslave /mnt/gentoo/sys
root #mount --rbind /dev /mnt/gentoo/dev
root #mount --make-rslave /mnt/gentoo/dev
Notiz
Die --make-rslave Operationen werden für die spätere systemd Unterstützung bei der Installation benötigt.
Warnung
When using non-Gentoo installation media, this might not be sufficient. Some distributions make /dev/shm a symbolic link to /run/shm/ which, after the chroot, becomes invalid. Making /dev/shm/ a proper tmpfs mount up front can fix this:
root #test -L /dev/shm && rm /dev/shm && mkdir /dev/shm
root #mount --types tmpfs --options nosuid,nodev,noexec shm /dev/shm

Also ensure that mode 1777 is set:

root # chmod 1777 /dev/shm

Betreten der neuen Umgebung

Nun da alle Partitionen initialisiert sind und die Basis-Umgebung installiert ist, wird es Zeit die neue Installationsumgebung durch chroot zu betreten. Das bedeutet, dass die Sitzung ihr Wurzelverzeichnis (/) von der aktuellen Installationsumgebung (Installations-CD oder anderes Installationsmedium) zum Installationssystem (nämlich die initialisierten Partitionen) ändert. Daher der Name change root oder chroot.

Dieses Chrooten erfolgt in drei Schritten:

  1. Das Wurzelverzeichnis wird mit Hilfe von chroot von / (auf dem Installationsmedium) auf /mnt/gentoo/ (auf den Partitionen) geändert.
  2. Einige Einstellungen (jene in /etc/profile) werden über den Befehl source neu in den Speicher geladen.
  3. Die primäre Eingabeaufforderung wird geändert, damit wir nicht vergessen, dass diese Sitzung innerhalb einer chroot-Umgebung läuft.
root #chroot /mnt/gentoo /bin/bash
root #source /etc/profile
root #export PS1="(chroot) $PS1"

From this point, all actions performed are immediately on the new Gentoo Linux environment. Of course it is far from finished, which is why the installation still has some sections left!

Tip
If the Gentoo installation is interrupted anywhere after this point, it should be possible to 'resume' the installation at this step. There is no need to repartition the disks again! Simply mount the root partition and run the steps above starting with copying the DNS info to re-enter the working environment. This is also useful for fixing bootloader issues. More information can be found in the chroot article.

Mounting the boot partition

Now that the new environment has been entered, it is necessary to create and mount the /boot partition. This will be important when it is time to compile the kernel and install the bootloader:

root #mkdir /boot
root #mount /dev/sda1 /boot

Portage konfigurieren

Installing an ebuild repository snapshot from the web

Next step is to install a snapshot of the main ebuild repository. This snapshot contains a collection of files that informs Portage about available software titles (for installation), which profiles the system administrator can select, package or profile specific news items, etc.

The use of emerge-webrsync is recommended for those who are behind restrictive firewalls (because it uses HTTP/FTP protocols for downloading the snapshot) and saves network bandwidth. Readers who have no network or bandwidth restrictions can happily skip down to the next section.

This will fetch the latest snapshot (which is released on a daily basis) from one of Gentoo's mirrors and install it onto the system:

root #emerge-webrsync
Notiz
Während dieser Operation könnte sich emerge-webrsync über das Fehlen von /usr/portage/ beschweren. Dies ist zu erwarten und kein Grund zur Sorge - das Tool wird das Verzeichnis anlegen.

From this point onward, Portage might mention that certain updates are recommended to be executed. This is because system packages installed through the stage file might have newer versions available; Portage is now aware of new packages because of the repository snapshot. Package updates can be safely ignored for now; updates can be delayed after the Gentoo installation has finished.

Optional: Updating the Gentoo ebuild repository

It is possible to update the Gentoo ebuild repository to the latest version. The previous emerge-webrsync command will have installed a very recent snapshot (usually recent up to 24h) so this step is definitely optional.

Suppose there is a need for the last package updates (up to 1 hour), then use emerge --sync. This command will use the rsync protocol to update the Gentoo ebuild repository (which was fetched earlier on through emerge-webrsync) to the latest state.

root #emerge --sync

Auf langsamen Terminals, wie einigen Framebuffer- oder seriellen Konsolen, ist es empfehlenswert die Option --quiet zu nutzen, um den Vorgang zu beschleunigen:

root #emerge --sync --quiet

News Einträge lesen

When the Gentoo ebuild repository is synchronized to the system, Portage may warn the user with messages similar to the following:

CODE Portage informiert den Benutzer über Neuigkeiten
 * IMPORTANT: 2 news items need reading for repository 'gentoo'.
 * Use eselect news to read news items.

News items were created to provide a communication medium to push critical messages to users via the rsync tree. To manage them, use eselect news. The eselect application is a Gentoo application that allows for a common management interface towards system changes and operations. In this case, eselect is asked to use its news module.

Im Modul news werden drei Operationen am meisten genutzt:

  • Mit list wird eine Übersicht der verfügbaren News-Einträge angezeigt.
  • Mit read können die News-Einträge gelesen werden.
  • Mit purge lassen sich News-Einträge löschen, sobald sie gelesen wurden. Ein erneutes Einlesen erfolgt nicht.
root #eselect news list
root #eselect news read

Mehr Informationen zum Newsreader sind über seine Manpage verfügbar:

root #man news.eselect

Auswahl des richtigen Profils

Warnung
Do not select any of the the 17.1 profiles until reading the corresponding 17.1 news item. This profile is experimental and requires special migration instructions.

A profile is a building block for any Gentoo system. Not only does it specify default values for USE, CFLAGS, and other important variables, it also locks the system to a certain range of package versions. These settings are all maintained by Gentoo's Portage developers.

Mit eselect können Sie sich anschauen, welches Profil das System momentan nutzt, diesmal mit dem Modul profile:

root #eselect profile list
Available profile symlink targets:
  [1]   default/linux/ppc64/13.0 *
  [2]   default/linux/ppc64/13.0/desktop
  [3]   default/linux/ppc64/13.0/desktop/gnome
  [4]   default/linux/ppc64/13.0/desktop/kde
Notiz
Die Ausgabe des Befehls ist nur ein Beispiel und kann sich im Laufe der Zeit ändern.

Wie Sie sehen können stehen ebenfalls Desktop-Unterprofile für einige Architekturen zur Verfügung.

Warnung
Profile upgrades are not to be taken lightly. When selecting the initial profile, make sure to use profile corresponding to the same version as the one initially used by stage3 (e.g. 13.0). Each new profile version is announced through a news item containing migration instructions. Make sure to read it and follow them before switching to a newer profile.

After viewing the available profiles for the ppc64 architecture, users can select a different profile for the system:

root #eselect profile set 2



Notiz
The developer subprofile is specifically for Gentoo Linux development and is not meant to be used by casual users.

Updating the @world set

At this point, it is wise to update the system's @world set so that a base can be established.

This following step is necessary so the system can apply any updates or USE flag changes which have appeared since the stage3 was built and from any profile selection:

root #emerge --ask --verbose --update --deep --newuse @world
Tip
If a full scale desktop environment profile has been selected this process could greatly extend the amount of time necessary for the install process. Those in a time crunch can work by this 'rule of thumb': the shorter the profile name, the less specific the system's @world set; the less specific the @world set, the fewer packages the system will require. In other words:
  • selecting default/linux/amd64/13.0 will require very few packages to be updated, whereas
  • selecting default/linux/amd64/13.0/desktop/gnome/systemd will require many packages to be installed since the init system is changing from OpenRC to systemd, and the GNOME desktop environment framework will be installed.

USE Variable konfigurieren

USE is one of the most powerful variables Gentoo provides to its users. Several programs can be compiled with or without optional support for certain items. For instance, some programs can be compiled with support for GTK+ or with support for Qt. Others can be compiled with or without SSL support. Some programs can even be compiled with framebuffer support (svgalib) instead of X11 support (X-server).

Die meisten Distributionen kompilieren ihre Pakete mit Unterstützung für möglichst viel. Dies erhöht die Größe der Programme und verlängert die Programmstartzeit, nicht zu erwähnen die enorme Menge von Abhängigkeiten. Mit Gentoo können die Benutzer definieren mit welchen Optionen ein Paket kompiliert werden soll. Hier kommt USE ins Spiel.

In the USE variable users define keywords which are mapped onto compile-options. For instance, ssl will compile SSL support in the programs that support it. -X will remove X-server support (note the minus sign in front). gnome gtk -kde -qt4 -qt5 will compile programs with GNOME (and GTK+) support, and not with KDE (and Qt) support, making the system fully tweaked for GNOME (if the architecture supports it).

Die Standard-USE-Einstellungen befinden sich in den make.defaults Dateien des Gentoo-Profils, das das System verwendet. Gentoo benutzt ein (komplexes) Vererbungssystem für seine Profile, in das wir in dieser Phase nicht eintauchen wollen. Der einfachste Weg die momentan aktiven USE Einstellungen zu überprüfen ist emerge --info auszuführen und die Zeile auszuwählen, die mit USE beginnt:

root #emerge --info | grep ^USE
USE="X acl alsa amd64 berkdb bindist bzip2 cli cracklib crypt cxx dri ..."
Notiz
Das obige Beispiel ist verkürzt, die tatsächliche Liste der USE-Werte ist viel viel länger.

Eine vollständige Beschreibung der verfügbaren USE-Flags finden Sie auf dem System in der Datei /usr/portage/profiles/use.desc.

root #less /usr/portage/profiles/use.desc

Innerhalb des Befehls less können Sie mit Hilfe der Tasten und scrollen. Zum Beenden drücken Sie q.

As an example we show a USE setting for a KDE-based system with DVD, ALSA, and CD recording support:

root #nano -w /etc/portage/make.conf
DATEI /etc/portage/make.confEnabling USE for a KDE-based system with DVD, ALSA and CD recording support
USE="-gtk -gnome qt4 qt5 kde dvd alsa cdr"

Wenn USE in /etc/portage/make.conf definiert ist, dann wird ein bestimmtes USE-Flag zur Standard Liste hinzugefügt (oder davon entfernt, wenn das USE-Flag mit dem Zeichen - beginnt). Benutzer die alle Standard-USE-Einstellungen ignorieren wollen und sie komplett selbst verwalten möchten, sollten die USE-Definition in make.conf mit -* beginnen:

DATEI /etc/portage/make.confIgnoring default USE flags
USE="-* X acl alsa"
Warnung
Although possible, setting -* (as seen in the example above) is discouraged as carefully chosen USE flag defaults may be configured in some ebuilds to prevent conflicts and other errors.


Zeitzone

Wählen Sie die Zeitzone für das System. Schauen Sie nach den verfügbaren Zeitzonen in /usr/share/zoneinfo/ und schreiben Sie die die zu verwendende in die Datei /etc/timezone.

root #ls /usr/share/zoneinfo

Angenommen die Zeitzone der Wahl ist Europe/Brussels:

root #echo "Europe/Brussels" > /etc/timezone

Bitte vermeiden Sie die /usr/share/zoneinfo/Etc/GMT* Zeitzonen, da deren Namen nicht die erwarteten Zonen anzeigen. Beispielsweise ist GMT-8 in der Tat GMT+8.

Als Nächstes konfigurieren Sie das Paket sys-libs/timezone-data neu. Dies wird für uns abhängig vom Eintrag in der Datei /etc/timezone die Datei /etc/localtime aktualisieren. Die Datei /etc/localtime wird von der System C Bibliothek verwendet um zu erfassen in welcher Zeitzone sich das System befindet.

root #emerge --config sys-libs/timezone-data

Konfiguration der Locale

Die meisten Benutzer werden nur ein oder zwei Locale auf ihrem System verwenden.

Locales specify not only the language that the user should use to interact with the system, but also what the rules are for sorting strings, displaying dates and times, etc.

Die Locale, die ein System unterstützen soll, sollten in der Datei /etc/locale.gen aufgeführt sein.

root #nano -w /etc/locale.gen

Die folgenden Locale sind ein Beispiel um Englisch (Vereinigte Staaten) und Deutsch (Deutschland) mit den zugehörigen Zeichenformaten (wie UTF-8) zu bekommen.

DATEI /etc/locale.genEnabling US and DE locales with the appropriate character formats
en_US ISO-8859-1
en_US.UTF-8 UTF-8
de_DE ISO-8859-1
de_DE.UTF-8 UTF-8
Warnung
Wir empfehlen die Verwendung von mindestens einem UTF-8 Locale weil einige Anwendungen dies möglicherweise erfordern.

Der nächste Schritt ist locale-gen auszuführen. Dies wird alle Locales erzeugen, die in der Datei /etc/locale.gen angegeben sind.

root #locale-gen

Um zu überprüfen, dass die ausgewählten Locales jetzt verfügbar sind, führen Sie locale -a aus.

Sobald Sie das erledigt haben, ist es Zeit, die systemweiten Locale-Einstellungen vorzunehmen. Wir verwenden wieder eselect dafür, diesmal mit dem Modul locale.

Mit eselect locale list werden die verfügbaren Ziele angezeigt:

root #eselect locale list
Available targets for the LANG variable:
  [1] C
  [2] POSIX
  [3] en_US
  [4] en_US.iso88591
  [5] en_US.utf8
  [6] de_DE
  [7] de_DE.iso88591
  [8] de_DE.iso885915
  [9] de_DE.utf8
  [ ] (free form)

Mit eselect locale set WERT kann die richtige Locale eingestellt werden:

root #eselect locale set 9

Manuell kann dies auch durch die Datei /etc/env.d/02locale erreicht werden:

DATEI /etc/env.d/02localeSystem Locale Definitionen manuell einstellen
LANG="de_DE.UTF-8"
LC_COLLATE="C"

Stellen Sie sicher dass ein Locale eingestellt ist, da das System andernfalls Warnungen und Fehler während des Bau des Kernels und bei anderem Softwareeinsatz später bei der Installation ausgibt.

Laden Sie jetzt die Umgebung erneut:

root #env-update && source /etc/profile && export PS1="(chroot) $PS1"

Wir haben einen vollständigen Lokalisierungs-Leitfaden erstellt, um die Benutzer durch diesen Prozess zu leiten. Ein weiterer interessanter Artikel ist der UTF-8-Leitfaden für sehr spezifische Informationen zum Aktivieren von UTF-8 auf dem System.