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:IA64/Installation/Kernel

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

Der Kern um den herum alle Distributionen gebaut sind ist der Linux Kernel. Er ist die Schicht zwischen den Benutzerprogrammen und der Systemhardware. Gentoo bietet seinen Benutzern verschiedene mögliche Kernel-Quellen. Eine komplette Liste mit Beschreibung finden Sie auf der Kernel Übersichtsseite.

For ia64-based systems Gentoo recommends the sys-kernel/gentoo-sources package.

Choose an appropriate kernel source and install it using emerge:

root #emerge --ask sys-kernel/gentoo-sources

Dies installiert die Quellen des Linux Kernel im Verzeichnis /usr/src/, in welchem der symbolischer Link namens linux auf die installierten Kernel-Quellen zeigt:

root #ls -l /usr/src/linux
lrwxrwxrwx    1 root   root    12 Oct 13 11:04 /usr/src/linux -> linux-3.16.5-gentoo

Now it is time to configure and compile the kernel sources. There are two approaches for this:

  1. The kernel is manually configured and built.
  2. A tool called genkernel is used to automatically build and install the Linux kernel.

Wir erklären hier die manuelle Konfiguration als Standardwahl, weil dies der beste Weg ist die Umgebung zu optimieren.

Standard: Manuelle Konfiguration

Einleitung

Manually configuring a kernel is often seen as the most difficult procedure a Linux user ever has to perform. Nothing is less true - after configuring a couple of kernels no-one even remembers that it was difficult ;)

However, one thing is true: it is vital to know the system when a kernel is configured manually. Most information can be gathered by emerging sys-apps/pciutils which contains the lspci command:

root #emerge --ask sys-apps/pciutils
Notiz
Inside the chroot, it is safe to ignore any pcilib warnings (like pcilib: cannot open /sys/bus/pci/devices) that lspci might throw out.

Another source of system information is to run lsmod to see what kernel modules the installation CD uses as it might provide a nice hint on what to enable.

Now go to the kernel source directory and execute make menuconfig. This will fire up menu-driven configuration screen.

root #cd /usr/src/linux
root #make menuconfig

Die Linux Kernel-Konfiguration hat viele, viele Abschnitte. Wir listen zunächst einige Optionen auf, die aktiviert werden müssen (ansonsten wird Gentoo nicht funktionieren, oder ohne zusätzliche Veränderungen nicht richtig funktionieren). Wir haben im Gentoo Wiki auch einen Gentoo Kernel-Konfigurationsleitfaden, der weiterhelfen könnte.

Aktivieren der benötigten Optionen

Make sure that every driver that is vital to the booting of the system (such as SCSI controller, etc.) is compiled in the kernel and not as a module, otherwise the system will not be able to boot completely.

Next select the exact processor type. It is also recommended to enable MCE features (if available) so that users are able to be notified of any hardware problems. On some architectures (such as x86_64), these errors are not printed to dmesg, but to /dev/mcelog. This requires the app-admin/mcelog package.

Also select Maintain a devtmpfs file system to mount at /dev so that critical device files are already available early in the boot process (CONFIG_DEVTMPFS and CONFIG_DEVTMPFS_MOUNT):

KERNEL Enabling devtmpfs support
Device Drivers --->
  Generic Driver Options --->
    [*] Maintain a devtmpfs filesystem to mount at /dev
    [ ]   Automount devtmpfs at /dev, after the kernel mounted the rootfs

Verify SCSI disk support has been activated (CONFIG_BLK_DEV_SD):

KERNEL Enabling SCSI disk support
Device Drivers --->
   SCSI device support  --->
      <*> SCSI disk support

Now go to File Systems and select support for the filesystems you use. Don't compile the file system that is used for the root filesystem as module, otherwise the Gentoo system will not be able to mount the partition. Also select Virtual memory and /proc file system. Select one or more of the following options as needed by the system (CONFIG_EXT2_FS, CONFIG_EXT3_FS, CONFIG_EXT4_FS, CONFIG_MSDOS_FS, CONFIG_VFAT_FS, CONFIG_PROC_FS, and CONFIG_TMPFS):

KERNEL Selecting necessary file systems
File systems --->
  <*> Second extended fs support
  <*> The Extended 3 (ext3) filesystem
  <*> The Extended 4 (ext4) filesystem
  <*> Reiserfs support
  <*> JFS filesystem support
  <*> XFS filesystem support
  <*> Btrfs filesystem support
  DOS/FAT/NT Filesystems  --->
    <*> MSDOS fs support
    <*> VFAT (Windows-95) fs support
 
Pseudo Filesystems --->
    [*] /proc file system support
    [*] Tmpfs virtual memory file system support (former shm fs)

If PPPoE is used to connect to the Internet, or a dial-up modem, then enable the following options (CONFIG_PPP, CONFIG_PPP_ASYNC, and CONFIG_PPP_SYNC_TTY):

KERNEL Selecting PPPoE necessary drivers
Device Drivers --->
  Network device support --->
    <*> PPP (point-to-point protocol) support
    <*>   PPP support for async serial ports
    <*>   PPP support for sync tty ports

Die beiden Komprimierungsoptionen schaden nicht, aber werden definitiv nicht benötigt. Ebenso wie die PPP over Ethernet Option, die vielleicht nur PPP verwendet, wenn Kernel-Mode PPPoE verwendet wird.

Vergessen Sie nicht die Unterstützung von Netzwerkkarten (Ethernet oder Wireless-LAN) im Kernel.

Most systems also have multiple cores at their disposal, so it is important to activate Symmetric multi-processing support (CONFIG_SMP):

KERNEL Activating SMP support
Processor type and features  --->
  [*] Symmetric multi-processing support
Notiz
In Mehrkernsystemen zählt jeder Kern als ein Prozessor.

If USB input devices (like keyboard or mouse) or other USB devices will be used, do not forget to enable those as well (CONFIG_HID_GENERIC and CONFIG_USB_HID, CONFIG_USB_SUPPORT, CONFIG_USB_XHCI_HCD, CONFIG_USB_EHCI_HCD, CONFIG_USB_OHCI_HCD):

KERNEL Activating USB support for input devices
Device Drivers --->
  HID support  --->
    -*- HID bus support
    <*>   Generic HID driver
    [*]   Battery level reporting for HID devices
      USB HID support  --->
        <*> USB HID transport layer
  [*] USB support  --->
    <*>     xHCI HCD (USB 3.0) support
    <*>     EHCI HCD (USB 2.0) support
    <*>     OHCI HCD (USB 1.1) support


Architekturspezifische Kernel-Konfiguration

Wählen Sie den richtigen System- und Prozessortyp. DIG-kompatibel ist eine gute Standardwahl. Bei der Installation auf einem SGI System, stellen Sie bitte sicher den SGI Systemtyp auszuwählen. Andernfalls kann es sein, dass der Kernel einfriert und das Booten verweigert.

KERNEL Richtige IA64 Prozessorauswahl
System type --->
  (Ändern Sie dies abhängig von Ihrem System)
  DIG-compliant
Processor type --->
  (Ändern Sie dies abhängig von Ihrem System)
  Itanium 2

Kompilieren und installieren

Sobald der Kernel konfiguriert ist, ist es Zeit zu kompilieren und zu installieren. Schließen Sie die Konfiguration und starten Sie den Kompiliervorgang:

root #make && make modules_install
Notiz
Es ist möglich parallele Builds durch make -jX zu aktivieren. Wobei X die Anzahl der Tasks ist, die der Build-Prozess parallel starten darf. Dies ist ähnlich wie die Anleitung zu /etc/portage/make.conf, mit der MAKEOPTS Variable.

Wenn der Kernel mit dem Kompilieren fertig ist, kopieren Sie das Kernel-Abbild ihn nach /. Verwenden Sie einen passenden Namen für Ihre Kernelwahl und merken Sie ihn sich, da später bei der Konfiguration des Bootoaders Bezug auf ihn genommen wird. Denken Sie daran vmlinuz mit dem Namen und der Version des installierten Kernels zu ersetzten.

root #cp vmlinux.gz /boot/vmlinuz



Optional: initramfs bauen

In bestimmten Fällen ist es notwendig ein initramfs (Ausgangsdateisystem im Arbeitsspeicher) zu bauen. Der häufigste Grund dafür ist wenn wichtige Dateisystemorte (wie /usr/ oder /var/) auf separaten Partitionen liegen. Mit einem initramfs können diese Partition, mit Hilfe der Werkzeuge die im initramfs Verfügbar sind, eingehängt werden.

Ohne initramfs besteht ein großes Risiko, dass das System nicht richtig bootet, da die Werkzeuge die für das Einhängen der Dateisysteme verantwortlich sind Informationen benötigen, die sich auf diesen Dateisystemen befinden. Ein initramfs zieht die notwendigen Dateien in ein Archiv, welches direkt nachdem der Kernel bootet genutzt wird, aber noch bevor die Kontrolle an das init Tool übergeben wird. Skripte auf dem initramfs stellen dann sicher, dass die Partitionen richtig eingehängt sind, bevor das System mit dem Booten fortfährt.

Zur Installation eines initramfs installieren Sie zunächst das Paket sys-kernel/genkernel. Im Anschluss daran lassen Sie dem Tool ein initramfs erzeugen:

root #emerge --ask sys-kernel/genkernel
root #genkernel --install initramfs

In order to enable specific support in the initramfs, such as LVM or RAID, add in the appropriate options to genkernel. See genkernel --help for more information. In the next example support is enabled for LVM and software RAID (mdadm):

root #genkernel --lvm --mdadm --install initramfs

Das initramfs wird in /boot/ gespeichert. Die resultierende Datei kann einfach durch Auflisten der mit initramfs beginnenden Dateien gefunden werden:

root #ls /boot/initramfs*

Fahren Sie nun beim Abschnitt Kernel-Module fort.

Alternative: genkernel verwenden

If a manual configuration looks too daunting, then using genkernel is recommended. It will configure and build the kernel automatically.

genkernel works by configuring a kernel nearly identically to the way the installation CD kernel is configured. This means that when genkernel is used to build the kernel, the system will generally detect all hardware at boot-time, just like the installation CD does. Because genkernel doesn't require any manual kernel configuration, it is an ideal solution for those users who may not be comfortable compiling their own kernels.

Schauen wir uns nun an, wie man genkernel verwendet. Installieren Sie als erstes das Pakel sys-kernel/genkernel:

root #emerge --ask sys-kernel/genkernel

Next, edit the /etc/fstab file so that the line containing /boot/ as second field has the first field pointing to the right device. If the partitioning example from the handbook is followed, then this device is most likely with the ext2 file system. This would make the entry in the file look like so:

root #nano -w /etc/fstab
DATEI /etc/fstabConfiguring the /boot mountpoint
/boot	ext2	defaults	0 2
Notiz
Further in the Gentoo installation, /etc/fstab will be configured again. The /boot setting is needed right now as the genkernel application reads in this configuration.

Now, compile the kernel sources by running genkernel all. Be aware though, as genkernel compiles a kernel that supports almost all hardware, this compilation will take quite a while to finish!

Notiz
If the boot partition doesn't use ext2 or ext3 as filesystem it might be necessary to manually configure the kernel using genkernel --menuconfig all and add support for this particular filesystem in the kernel (i.e. not as a module). Users of LVM2 will probably want to add --lvm as an argument as well.
root #genkernel all

Sobald genkernel beendet ist, wird ein Kernel, ein voller Satz Module und ein initial ram filesystem (initramfs) erstellt werden. Wir verwenden den Kernel und die initrd bei der Konfiguration des Boot-Loader später in dieser Anleitung. Schreiben Sie sich die Namen des Kernels und der initrd auf, da Sie diese Information benötigen, wenn die Boot-Loader Konfigurationsdatei bearbeitet wird. Die initrd wird sofort nach dem Booten gestartet um die automatische Hardware-Erkennung durchzuführen (wie bei der Installations-CD) bevor das "richtige" System startet.

root #ls /boot/kernel* /boot/initramfs*

Kernel-Module

Konfiguration der Module

Notiz
Hardware modules are optional to be listed manually. udev will normally load all hardware modules that are detected to be connected in most cases. However, it is not harmful for automatically detected modules to be listed. Sometimes exotic hardware requires help to load their drivers.

Listen Sie die Module, die automatisch geladen werden sollen, in der Datei /etc/conf.d/modules auf. Zusätzliche Optionen können Sie den Modulen ebenfalls hinzufügen, wenn nötig.

To view all available modules, run the following find command. Don't forget to substitute "<kernel version>" with the version of the kernel just compiled:

root #find /lib/modules/<Kernelversion>/ -type f -iname '*.o' -or -iname '*.ko' | less

Um beispielsweise automatisch das Modul 3c59x.ko zu laden (das der Treiber für eine bestimmte 3Com Netzwerkkartenfamilie ist), bearbeiten Sie die Datei /etc/conf.d/modules und geben den Modulnamen ein.

root #mkdir -p /etc/modules-load.d
root #nano -w /etc/modules-load.d/network.conf
DATEI /etc/modules-load.d/network.confForce loading 3c59x module
3c59x

Setzten Sie die Installation mit der Konfiguration des Systems fort.

Optional: Firmware installieren

Einige Treiber benötigen die Installation von zusätzlicher Firmware auf dem System, bevor sie funktionieren. Dies ist häufig bei Netzwerkkarten, im Besonderen bei WLAN Netzwerkkarten der Fall. Die meiste Firmware befindet sich im Paket sys-kernel/linux-firmware:

root #emerge --ask sys-kernel/linux-firmware