Kernel/Configuration/ru

Эта статья описывает ручную конфигурацию и настройку ядра Linux. Автоматический метод описан в статье genkernel.

Установка символьной ссылки
Символьная ссылка должна всегда указывать на исходные коды используемого в настоящий момент ядра. Это может быть сделано одним из трех способов:


 * 1. Установка исходных кодов ядра с активным USE-флагом "symlink"
 * Это заставит указывать на исходный код заново устанавливаемого ядра. Если необходимо, символьная ссылка может быть изменена позже двумя следующими методами:


 * 2. Настройка символьной ссылки с помощью eselect:




 * Эта команда выводит доступные исходные коды ядра. Звездочкой отмечены выбранные исходные коды. Для того чтобы изменить исходные коды ядра, например выбрать вторую запись, сделайте следующее:




 * 3. Установка символьной ссылки вручную:



Инструменты конфигурации
Ядро предлагает несколько инструментов для собственной конфигурации:


 * make config
 * Конфигурация с помощью текстовых инструментов. Параметры запрашиваются один за другим. Необходимо отметить все параметры, доступ к предыдущим параметрам вне очереди невозможен.


 * make menuconfig
 * Graphical menu (only text input). You can navigate through the menu and change the options you want.


 * make nconfig
 * Graphical menu based on ncurses. Requires to be installed.


 * make xconfig
 * Graphical menu using Qt4. Requires to be installed.


 * make gconfig
 * Graphical menu using GTK+. Requires, and  to be installed.


 * make oldconfig
 * Review changes between kernel versions and update to create new .config for kernel.

There are also several scripts to create miscellaneous default configurations. See:

Configuration
This article describes the configuration using make menuconfig, but the procedure is similar for the other menus.

Usage
In the shown menu the blue bar indicates your position. With the arrow keys and  you can change the position. The arrow keys and  traverse the menu bar in the bottom and define, what happens, when you hit the  key. Select switches to a sub menu - the menu entries ending with ---> -, while Exit exits a sub menu. Alternative you can hit the key twice.

Menu entries, which start with brackets, are drivers or features which can be activated:


 * [ ], [*]
 * Options in square brackets can be activated or deactivated. The asterisk marks the menu entry as activated. You change the value with the key or press  (Yes) to activate or  (No) to deactivate the entry.
 * Is the option is activated, the chosen driver will be built into the kernel and will always be available at boot time.


 * < >, , <*>
 * Options in angle brackets can be activated or deactivated, but also activated as module (indicated by a M). You change the value as before and press key for activate as module.
 * See the Kernel Modules article for differentiation.


 * {M}, {*}
 * Options in curly brackets can be activated or activated as module but not be deactivated, because another driver needs this activated in either way.


 * -M-, -*-
 * Options between hyphens are activated in the shown way by another driver. There is no choice.

Furthermore some menu entries have a tag at the end:


 * (NEW)
 * This driver is new in the kernel and is maybe not stable enough.


 * (EXPERIMENTAL)
 * This driver is experimental and most likely not stable enough.


 * (DEPRECATED)
 * This driver is deprecated and not needed for most systems.


 * (OBSOLETE)
 * This driver is obsolete and should not be activated.

Most options have a description, which get by pressing the key or choose in the menu bar Help.

Driver selection
See the hardware detection article and the articles in the Hardware category.

Search modules
Within menuconfig, you can use to search modules by keyboards.

Build
After configuring the kernel you have to compile the kernel:

If you have a processor with multiple cores, you can let all the cores do the work. For this add the parameter -j(NUMBER_CORES +1). For a dual core processor:

Setup
If activated drivers as modules, you have to install them:

The modules will be copied to a sub directory of.

To install the actual kernel:

This command executes /sbin/installkernel, which is part of the package. ''The new kernel is installed into. If a symbolic link already exists, it is refreshed by making a link from  to the new kernel, and the previously installed kernel is available as . (installkernel'' man page). The same for and  files. These symlinks are handy, because they point always to the newest kernel without changing the file path (e.g. you can use them in the bootloader configuration).

Bootloader
Change your bootloader configuration to pick up at boot the new kernel.

Finally restart your system with the new kernel.