Kernel/Upgrade/zh-cn

这篇文章描述了升级到新内核步骤.

安装
当系统更新后安装了新的内核源代码，或者你自己安装了新的内核源代码，升级内核是必要的.

配置
The configuration parallels that of the manual configuration, since only the config file is reused. All steps are mentioned here again for the sake of completeness, for a more verbose explanation see the other article.

设置符号链接
符号链接 应该总是指向正在运行的内核的源代码. 有三种方法实现这一点：


 * 1. 使用symlink USE flag安装内核
 * 这将会把链接到你新安装的内核源码. 如果有必要，还可以通过下面的两种方法进行修改：


 * 2. 使用eselect设置符号链接:




 * 这将输出可用的内核. 星号表示当前选中的内核. 要更换内核，例如到第二个内核，运行下面的命令：




 * 3. 手动设置符号链接：



净化内核
如果你在重新编译当前内核的时候遇到问题，这也许有助于净化内核. 确保你首先备份了文件，因为操作过程会删除它. 确保备份文件不要以 或者 为后缀，因为 同样会删除这些文件.

拷贝之前的内核配置文件
需要把当前正在运行的内核的配置文件拷贝到新内核中. 配置文件可以在几个地方找到：


 * 如果在当前内核中选项Enable access to .config through /proc/config.gz是激活的，配置文件在procfs 文件系统：




 * 目录,如果你把配置文件安装到了这里:




 * In the kernel directory of the currently-running kernel:



make oldconfig
Now update the previous config file for your new kernel:

The following configuration parallels that of the text based configuration with make config. For every difference between the kernel versions, it asks if you want to activate the driver or feature. An example:

The string (NEW) at the end of the line marks this option as new. Left to the string in square brackets are the possible answers: Yes, no, module or ? to show the help. The recommend answer is capitalized (here Y). The help explains the option or driver.

Unfortunately make oldconfig doesn't show - next to the help - a lot more information for each option, like the context, so that it is sometimes difficult to give the right answer. In this case the best way to go is to remember the option name and revise it afterwards through one of the graphical kernel configuration tools.

Reinstall external kernel modules
Any external kernel modules, such as binary kernel modules, need to be rebuilt for each new kernel. If the kernel hasn't been built yet, it has to first be prepared for the building of the external kernel modules:

You can rebuild the packages using the @module-rebuild set:

Build
For this step, follow the steps in the manual configuration article.

Removing old kernels
See the kernel removal article.

External resources

 * kernel changelog with some explanations of new features