10+ advices BEFORE you rebuild Linux kernel

linux logoMany Linux newbies think that kernel recompilation is inherent and almost necessary thing to do after OS is just installed or some time later. By the following advices I would try to show these fellows in which situations this really makes sense and what to do if one persists :)

1. If you don’t know why you should patch/recompile kernel – DO NOT DO THIS.
2. If your running kernel is smart and supports all necessary hardware, technologies and doesn’t contain critical vulnerabilities – DO NOT REBUILD IT.
3. If you don’t know what are kernel patches and why they are used – DO NOT REBUILD KERNEL.
4. If kernel with needed functionality is available as binary package for your distribution (especially in official repositories) – DO NOT BUILD KERNEL.
5. If you insist, certainly read Kernel HOWTO and notes about kernel recompilation in regards to your distribution.
6. Do change kernel config values only if you know what they mean.
7. Don’t forget to build initrd before rebooting your system.
8. Do not remove workable kernel and make it default in boot loader menu (like grub).
9. Don’t panic if something goes wrong – most probably the same situation happened to thousands people earlier. But sometimes shit happens.
10. Rebuilding procedure usually takes hours depending on hardware you use. BE PATIENT! :)
11 (thanks to Erek Dyskant). Use your distro’s package management system to build kernels whenever possible (like make-kpkg in Debian or rpmbuild in Fedora/RedHat/CentOS)

I really hope this helps and pretty sure you’ll build your “perfect” kernel once ;)

Any further advices are WELCOME!

P.S. Thanks to Stas Kogut for encouraging me to write this post.

Read more →