Configure the Kernel
Installing Gentoo - Configure the Kernel
Configuring the Linux kernel is the most difficult part of performing a Gentoo installation.
The components of the Linux kernel can either be built-in or compiled as modules which can be loaded or unloaded. Most Linux distributions will provide you with a generic kernel image with most of the hardware drivers and other components available as modules. The advantage of this method is that another piece of software can probe the system, determine the hardware components, and load the appropriate modules at startup, much in the same way that your Gentoo installation CD did. The disadvantage is that certain parts of the kernel and most of the modules will never be used. Our goal is to create the smallest, fastest, most efficient kernel possible for your target environment.
Thankfully, most of the hard part has already been done for you. Some time ago, an advocate by the name of Pappy McFae blessed us with "kernel seeds" for a number of different architectures which are freely available at his website, kernel-seeds.org. His goal was to provide starting kernel configurations, geared towards everyday use, but with the unnecessary components removed. Using of of Pappy's kernel seeds, all you need do is add in the drivers for your specific hardware and any other components you may require. Personally, I noticed a performance of around 20% using one of Pappy's kernel seeds as compared to the default kernel configuration provided by the Gentoo devs.
Emerging the kernel source files
Our first step will be to emerge the kernel source files and determine what version of the kernel we'll be using.
# emerge -av gentoo-sources
Make a note of the version that is emerged, which will usually be in the format 2.6.x-gentoo-ry. Here x represents the kernel version, and y represents the Gentoo release version of that particular kernel version. In this example we'll use the 64-bit instance of 2.6.34-gentoo-r12 as our example.
Downloading a kernel seed
We'll start by determining the correct kernel seed config file for our architecture (x86_64 for 64-bit systems or x86 for 32-bit systems). Given the example chosen above, the path to the kernel seed configuration file for a 64-bit system using 2.6.34-gentoo-r12 is http://kernel-seeds.org/seeds/64_bit/gentoo/2.6.34-gentoo-r12-x86_64-07.config . We'll use wget to download the seed and use it as our starting configuration.
# cd /usr/src/linux # wget http://kernel-seeds.org/seeds/64_bit/gentoo/2.6.34-gentoo-r12-x86_64-07.config
The freshly downloaded file will have the same target file name as its source, so let's make a copy we'll use for our actual config while keeping the original file as a backup should we need to start over.
# cp 2.6.34-gentoo-r12-x86_64-07.config .config
Identifying hardware components
To identify the hardware components in our system, we'll use a tool called pciutils.