The moment that you need to add some modules in the kernel which are not compiled in by default you will notice that there is a need to compile a Kernel.
In order to compile your kernel. There are steps you need to take to compile your own as follow:
Start by downloading the kernel source from kernel.org and place it to /usr/src or get it from the apt repository.
#apt-get source linux-image
You will need to install some extra packages:
#apt-get install fakeroot kernel-package libncurses5-dev
The downloaded image should be located in /usr/src.
If you had downloaded the package from kernel.org the package will be most probably archived wtih bzip2 so you will need to unpack it.:
#tar -xvJf linux-3.17.tar.xz
Use configure the kernel. Best we start with the configuration file of the current setup. To do that use the following command:
Run make menuconfig to add the new modules you need to r
#cp /boot/config-`uname -r` .config
Select the modules you need and save the configuration file before you exit.
It is time to start the compilation. First we need to clean the source.
Before we start building the new kernel it is a good idea to set the new concurrency level.
The maximum which can be set is equal with the number of cores your system have +1. For example if you have a 4 core cpu then the concurency level is equal with 5. Setting the concurrency level will significantly shorten he new kernel’s compilation time.
Now lets build the new kernel.
#fakeroot make-kpkg --append-to-version "-customkernel" --revision "1" initrd kernel_image kernel_headers
--append-to-version you set a custom description in the kernel name. The
--revision would set the revision version of the build.
After the kernel is compiled the new packages will be found in
You can install them by running the following command:
/usr/src# dpkg -i linux-image-3.17.0-customkernel_1_amd64.deb /usr/src# dpkg -i linux-headers-3.17.0-customkernel_1_amd64.deb