While we talked before about kernel compilation and configuration, we focused on the general idea. This time we want to dig deeper into the configuration part, giving you useful advice you will need when tailoring a kernel to perfectly match your hardware.
The main idea behind this is that you will need to know your hardware extremely well in order to have a kernel built exactly for it. At the beginning we will cover what you will need in order to compile your kernel and after that we move into Linux kernel configuration, compilation and installation. Please note that this time it’s not very important if you compile a vanilla kernel or a distribution kernel. We will however, recommend a “modus operandi”, which of course does not mean that you have to follow. After reading this guide you will be able to decide what suits you best. We expect some moderate knowledge about Linux system internals and development tools.
What you will need
From now on, as stated before, we will show you how we do this, so everything you’ll read will be specific to our system, unless stated otherwise. Typing ‘du -h’ in our kernel source tree shows 1.1G. This is after we typed ‘make clean’. In short, we’d say you better have at least 2.5G available for the kernel tree, since code gets added constantly and object files take quite some space. Also /lib/modules/ will use a lot of disk as time passes, and, if you have a separate /boot partition, that may get crowded too.
Of course, after you configure the kernel, you’ll want to compile it, so the usual suspects must be present : make, git, gcc, the readline library for menuconfig… Speaking of git, you might have heard about the recent break of kernel.org, so if you try to clone the usual location or try to pull, you will get
$ git pull
fatal: Unable to look up git.kernel.org (port 9418) (Name or service not known)
What you can do is use the new, temporary location of the git tree as announced by Linus Torvalds :
$ git pull git://github.com/torvalds/linux.git