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 you should see a symlink called 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 runto 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 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=