proc/config.gz > /usr/src/linux/.config
- In the /boot directory, if the configuration was installed installed there:
cp /boot/config-3.14.14-gentoo /usr/src/linux/.config
- In the kernel directory of the currently-running kernel:
cp /usr/src/linux-3.14.14-gentoo/.config /usr/src/linux/
Configure the new kernel
To use the configuration of the old kernel with the new kernel, it needs to be converted. The conversion can be done by running either make oldconfig or make silentoldconfig.
make oldconfig gives many choices, make silentoldconfig does not. Use either, not both.
The following configuration is like the text based configuration with make config. For new configuration options, it gives a choice. For 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.
If interactivity is not wanted (no questions should be asked), then use make silentoldconfig:
When external kernel modules are installed (like nvidia or zfs), it may be necessary to run make modules_prepare as described below before bulding the kernel. Some modules cannot be installed or prepared before the kernel has been built.
Do not forget to reconfigure the bootloader to account for the new kernel filenames, and rebuild the initramfs if one is used as well.
For this step, follow the steps in the manual configuration article.
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:
emerge --ask @module-rebuild
Solving build problems
When experiencing build problems while rebuilding the current kernel, it might help to sanitize the kernel sources. Make sure to backup the .config file first, as the operation will remove it. Make sure not to use a .bak or ~ suffix as backup as make distclean will clean those up as well.
cp .config /usr/src/kernel_config_bk
mv /usr/src/kernel_config_bk .config
Removing old kernels
See the kernel removal article.