alwaysInBeta Stable software is for the weak

Notes on Linux Kernel Compilation date: 2014-04-14 03:28:37+00:00

In theory, kernel compilation is simple and pretty similar to installing anything else from source. Instead of "./configure && make && make install", however, there is a little more variation, and the general outline is "make someconfig && make && make modulesinstall":

make someconfig - where someconfig is usually one of {menuconfig, oldconfig, localyesconfig}; menuconfig lets you use a menu interface to configure options, oldconfig uses an existing .confg file (usually you use this when upgrading from a previous kernel), and localyesconfig configures the kernel you're building to build in as much as it can of the currently running kernel's configuration. There are more targets described in /usr/src/linux/README as well.

make - completely normal / same as usual; takes forever

make installmodules - installs kernel modules for the kernel you just built into the system

If memory serves, there's also a target that installs the kernel itself into the bootloader, but I believe that only works if your system is using LILO (and I honestly don't think I've ever seen a system actually using LILO; it's a bit old). So once you've compiled the kernel, you need to copy it into /boot and possibly update your bootloader configuration to use it. On my system this looks like "cp /usr/src/linux-3.9.6-gentoo/arch/x86/boot/bzImage /boot/ && vim /boot/syslinux/syslinux.cfg", although of course substitute your own source directory/version and bootloader as appropriate.

EDIT 2015-08-08: make modulesinstall, not make installmodules