Kernel/Configuration/zh-cn

这篇文章Linux 内核的手动配置和设置. ]] 有关设置 'safe defaults' 的方法，请参阅 genkernel 文章.

设置符号链接
符号链接应始终指向当前正在使用的内核源代码. 这可以通过以下三种方式之一完成：

1. 在 USE flag  激活的情况下安装内核源代码. 这将使 指向新安装的内核源代码. 如有需要，后期仍可通过以下两种方式进行修改：

2. 使用 工具设置符号链接：

这将输出可用的内核资源. 星号表示选择的来源. 要更改内核源，例如到第二个条目，执行：

3. 手动设置符号链接：

配置工具
内核提供了几种配置自身的工具.

There are also several scripts to create miscellaneous default configurations. These can make deeper configuration more time efficient. Run the following command for a full list of make targets:

The remainder of this article will describe configuration using the tool, but the procedure is similar for the other kernel build tools.

用法
In the shown menu the blue bar indicates the position of the cursor. With the and  arrow keys change the position of the cursor. The and   arrow keys traverse the menu bar in the bottom and define what happens when the  key is pressed. For the menu bar below, Select switches to a sub menu for the menu entries ending with ---> while Exit exits a sub menu. As an alternative the key can be pressed twice to exit the application.

Pressing an associated letter key - will move the position of the cursor lines that have characters in bold. The, , keys are excluded from navigation in this way; they are sanctified for other purposes. If a line begins with a Y, M, or N, the next character will be bold and capable of being jumped to. For example, relative to the cursor's current position, if the next line reads "Network Device Support --->" pressing the key will move the cursor to that line.

The following symbols can appear in front of the lines in the menus:

Furthermore some menu entries have a tag at the end:

大多数选项都有描述，可以通过按 键或在菜单栏中选择 Help 来查看.

驱动选择
See the hardware detection article and the articles in the Hardware category.

搜索模块
Within, use the  key to search modules by name.

As shown below, the search result will show numbers in front of the matches. Pressing in the example below would  jump straight to the option Bluetooth device drivers in the menu structure.

启用 Gentoo Linux 通用设置
There is a kernel configuration option called CONFIG_GENTOO_LINUX only present in and other Kernel Project maintained kernels. It does nothing on its own, but sets various required configuration options for typical installations.

This setting automatically selects  and   support, which are needed for handling  on Gentoo Linux, but might be expanded in the future to enable other mandatory settings for a Gentoo Linux system. For more information, read the help information available through the kernel configuration system as described earlier in this guide.

编译
After configuration has been accomplished successfully, compile the kernel:

A quad core system contains four logical cores plus one (4 + 1):

安装
If drivers are activated as modules, they must be installed:

The modules will be copied to a sub directory of.

To install the actual kernel:

This command executes, 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 always point to the newest kernel without changing the file path (e.g. they can be used in the bootloader configuration).

Bootloader
Change the system's bootloader configuration to load the kernel at system boot.

When the bootloader step has been finished, restart the system with the new kernel.

Comparing current kernel configuration with default configuration
Use the following procedure to get an overview of the kernel configuration settings that deviate from the default. Keep in mind that the modification of one configuration setting may alter additional configuration settings.

The search function in can be used to look up the symbols and their interpretations. When you're done, clean up:

External resources

 * Building the kernel as root can be harmful