One of the thing you want to be proud of using Linux is you can compile the kernel yourself! Of course, if you using Linux distro on your desktop, you will not need to worry of the kernel compilation or upgrade. Time to time, there will be ready binary download for you to upgrade.
But if you want to learn then carry on the reading.
Few days ago, I have tried out serveral method to learn how to compile Linux kernel and for Debian or be more precise, I found that you just need 2 main command lines then you can have your kernel well installed on your desktop.
However, let us go through step by step see what I have learn. Correct me if I missed out any.
1. Download the full source code from kernel.org. The version I tested was the latest 2.6.23.1
2. Meanwhile, prepare all the tools you need. You can get all this by download from Ubuntu server.
sudo apt-get install linux-kernel-devel fakeroot build-essential
3. Extract the kernel souce files tar.bz2 package you have downloaded earlier.
tar -xjvf linux-2.6.23.1.tar.bz2
4. Use the command make mrproper as advise from the README file. To ensure whatever leftover from the previous compilation is completely clean.
5. Config the configuration files, so that the kernel will be compiled based according to your desktop requirement. There are several arguments you can use. My favorite one is make gconfig, it was specially tailored for Gnome Desktop. Or, you could just back use your existing old config file.
6. Run the below command:
fakeroot make-kpkg --initrd --append-to-version=-customkernel_image kernel_headers
You can set the what the custom text to be shown to different it with the rest of the kernel. I basically set it to the version number. So it will be like –append-to-version=-2.6.23.1
7. After maybe half an hour or hours of compilation, you will get two files. One is the header package and another one is the image package.
linux-image-2.6.23.1_i386.deb
linux-header-2.6.23.1_i386.deb
8. So, you should quite familiar with deb package. You just treat is as a deb package and install with the dpkg command.
dpkg -i kernel-image-2.6.23.1_i386.deb
dpkg -i kernel-headers-2.6.23.1_i386.deb
The benefits to have it as a deb package, so you can easily distribute the package to your friends who are using debian system.
9. Then just reboot your system! In Step 8, it has already fully taken care of the GRUB bootloader. So you don’t have to worry about it.





