Kernel Config

From The World according to Vissie
Jump to navigation Jump to search

Kernel boot panic on kernel-2.6.27-gentoo


Extract the Configuration from a Linux Kernel Image

cd /usr/src/linux
./scripts/extract-ikconfig /boot/<kernelimage> >.config

Or... Code: How to replace your config file if it gets damaged...

zcat /proc/config.gz > /usr/src/linux/.config


When you take a look in /usr/src you should see a symlink called linux pointing to your kernel source

# ls -l /usr/src/linux
lrwxrwxrwx    1 root   root    12 Oct 13 11:04 /usr/src/linux -> linux-2.6.24-r5

Upgrading a Kernel=

Remember this! http://www.gentoo.org/doc/en/kernel-upgrade.xml

Reinstalling external modules

If you use any kernel modules that are not included in the kernel source tree but are provided elsewhere in Portage (e.g. ALSA drivers and NVIDIA or ATI graphics drivers), then you must reinstall these after upgrading the kernel. This is as simple as re-merging the packages involved. For more information, refer to the chapter on Configuring the Kernel in the Gentoo Handbook.

We provide you with an easy tool (sys-kernel/module-rebuild) which rebuilds all the kernel modules you have installed using separate ebuilds for the kernel at /usr/src/linux. Its use is straightforward. After emerging it, simply run module-rebuild populate to populate the database with a list of packages that will need to be rebuilt after upgrading the kernel. Once you have finished upgrading or recompiling your kernel, run module-rebuild rebuild to rebuild the drivers for your new kernel.

For more information, run module-rebuild without any options to see a list of commands that can be passed to the utility.

Downgrading a Kernel=

emerge =sys-kernel/gentoo-sources-2.6.28-r5