Kernel/Configuration/ja

この記事では、Linux カーネル のコンフィグレーションとセットアップを手作業で行う方法について説明しています. 自動的に行う方法は、genkernel の記事を参照してください.

シンボリックリンクの作成
のシンボリックリンクは常に、現在使用中のカーネルのソースへ張られるべきです. このシンボリックリンクを張るのは、以下の3つの方法のいずれかで可能です.


 * 1. カーネルのソースをインストールする際に、symlink USE フラグを有効にする
 * この方法では、新たにインストールするカーネルソースを指す  が作成されます. もしも必要ならば、以下の2つの方法で後ほど変更することもできます:


 * 2. eselect でシンボリックリンクを設定する




 * eselect は、利用可能なカーネルソースのリストを出力します. アスタリスクは、選択中のソースを示します. カーネルソースを、例えば2つ目の項目に変更するには:




 * 3. 手作業でシンボリックリンクを設定する:



コンフィグレーションツール
カーネルは、自身のコンフィグレーションのためにいくつかのツールを提供しています:


 * make config
 * Text based configuration. The options are prompted one after another. All options need to be answered, and out-of-order access to former options is not possible.


 * 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 for kernel.

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

コンフィグレーション
This article describes the configuration using make menuconfig, but the procedure is similar for the other menus.

凡例
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. As an alternative you can also 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.
 * If 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)
 * このドライバは、カーネルに新規に追加されたもので、まだ充分には安定していないかもしれません.


 * (EXPERIMENTAL)
 * このドライバは、まだ実験的なもので、充分には安定していないというべきです.


 * (DEPRICATED)
 * このドライバは、非推奨です. ほとんどのシステムでは不要です.


 * (OBSOLETE)
 * このドライバは時代遅れで、有効にはしないべきです.

ほとんどのオプションには解説がついています. キーを押すかメニューバーの Help を選ぶことで表示させることができます.

ドライバの選択
See the hardware detection article and the articles in the Hardware category.

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

Enabling Gentoo Linux common settings
There is a kernel configuration option called  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 tmpfs and devtmpfs 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 configuring the kernel you have to compile it:

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:

セットアップ
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).

ブートローダ
Change your bootloader configuration to pick up at boot the new kernel.

Finally restart your system with the new kernel.