Ядро

From Gentoo Wiki
Jump to:navigation Jump to:search
This page is a translated version of the page Kernel and the translation is 42% complete.
Outdated translations are marked like this.

Ядро является основным компонентом операционной системы. Ядро содержит в себе большую часть драйверов, что позволяет программам взаимодействовать с системным оборудованием, таких, как память, видеокарты и блочные устройства.

Эта статья относится только к ядру Linux.

См. также
See also the handbook on installing and setting up a kernel.

Какое ядро установить?

Gentoo provides a choice of methods to get a kernel up and running, from a standard binary kernel as would be supplied by most distributions to a custom configured and compiled kernel.

Совет
When starting out, the gentoo-kernel-bin provides a quick and easy way to get a kernel up and running, while still providing a light, high performance kernel (just like any modern distribution would). Once a system is installed and functioning correctly, a different kernel may be selected if needed. The sys-kernel/gentoo-kernel-bin can be kept around in case of issues booting a custom kernel.

gentoo-sources

Gentoo рекомендует sys-kernel/gentoo-sources для большинства пользователей. Стабильные версии этого пакета совпадают с версиями ядра долгосрочной стабильности (LTS) от kernel.org.

Distribution kernels

The distribution kernel project provides packages to install and manage kernels through Portage. These kernels are compiled (if needed) and installed with just an emerge command like any other package, which can lessen the administrative burden. Kernel updates are performed when updating the system (i.e., emerge -avuDN @world), and the only manual step is to have the bootloader use the new kernel.

These kernels come with a default configuration that should "just work" for most systems. For users not interested in configuring their own kernel from scratch, these kernels can get things up and running quicker:

gentoo-kernel

The sys-kernel/gentoo-kernel package provides a kernel that will be compiled and installed when the package is emerged. This comes with a default configuration that should work out of the box on most systems, but allows customization if desired.

gentoo-kernel-bin

The sys-kernel/gentoo-kernel-bin is a binary package containing a precompiled kernel, allowing for faster installation. This package is a precompiled version of the gentoo-kernel package with a default configuration.

Важно
Since the gentoo-kernel* packages automate the configuration and compilation process - independently from the usual, manual way of compiling and installing kernels - the rest of this article concerns installation using the sys-kernel/gentoo-sources package. See the distribution kernel project for further information on distribution kernels

Установка

To obtain a kernel, it is necessary to install the kernel source code. The recommended kernel sources for a Gentoo desktop system are sys-kernel/gentoo-sources. These are maintained by the Gentoo developers, and patched when necessary to fix security vulnerabilities and functional problems, as well as to improve compatibility with rare system architectures.

USE-флаги

USE flags for sys-kernel/gentoo-sources Full sources including the Gentoo patchset for the 6.5 kernel tree

build !!internal use only!! DO NOT SET THIS FLAG YOURSELF!, used for creating build images and the first half of bootstrapping [make stage1]
experimental Apply experimental patches; for more information, see "https://wiki.gentoo.org/wiki/Project:Kernel/Experimental".
symlink Force kernel ebuilds to automatically update the /usr/src/linux symlink

Emerge

Теперь установите sys-kernel/gentoo-sources:

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

Альтернативные ядра

There are many other kernel packages in the Portage tree. For details on many of these, see the Kernel sources overview article. Further help on choosing a kernel can be found in developer Greg Kroah-Hartman's article What Stable Kernel Should I Use?.

Поиск всех альтернатив

  • Полный список исходных кодов ядра с кратким описанием может быть получен при поиске в emerge:
root #emerge --search "%@^sys-kernel/.*sources"

Настройка ядра

Конфигурация

Автоматическая настройка
genkernel — утилита для автоматизации процесса сборки ядра и образа initramfs. Задача genkernel заключается в помощи пользователю во время сборки ядра.
Ручная настройка
Ручная настройка позволяет, с некоторыми усилиями, создать собственную, более подходящую, конфигурацию ядра.
Статья по конфигурации ядра в Gentoo
Статья по настройке ядра в Gentoo.
Kernel security
Инструкции по повышению безопасности ядра.
Modules
Modules are object files that contain code to extend the kernel.
Optimization
Descriptions of various optimizations for the kernel.
Command-line parameters
Descriptions of some commonly useful command-line parameters which can be passed to the kernel at boot time for troubleshooting.

Обновление

Обновление
Инструкции по обновлению ядра с использованием существующей конфигурации.

Удаление

Удаление
Инструкции для полного удаления старых ядер.

Устранение проблем

In-kernel configuration support

See the IKCONFIG support sub-article.

Параметры командной строки ядра

When booting from a bootloader, the Linux kernel can accept command-line parameters to change its behavior. This can aid in troubleshooting the kernel at boot time, to blacklist a certain module that should not loading, etc. See Gentoo's Kernel/Command-line parameters article for more details.

См. также

  • Linux firmware — пакет, распространяемый вместе ядром Linux и содержащий в себе различные прошивки в двоичном коде , которые могут понадобиться для полноценного функционирования некоторых устройств.
  • LVFS — a daemon that provides a safe, reliable way of applying firmware updates on Linux.
  • Kernel/IKCONFIG support — Enabling In-kernel Config (IKCONFIG) support for the Linux kernel enables the inspection of kernel configuration for running kernels.
  • The kernel category - все статьи о ядре на wiki.
  • The hardware category - список категорий аппаратного обеспечения с сопутствующими настройками ядра.

Ссылки

  • planet.kernel.org - Блоги, связанные с ядром Linux.
  • kernelnewbies.org - "Сообщество для начинающих разработчиков ядра Linux, которые работают над тем, чтобы улучшить свои ядра, а так же более опытных разработчиков, желающих поделиться своими знаниями о ядре."
  • kernel.org/doc/ - Официальная понятная документация для ядра Linux.
  • What Stable Kernel Should I Use?, статья авторства Greg Kroah-Hartman.
  • Building the kernel as root can be harmful

Ссылки