Compiling the Kernel in Linux

Z

ZZs

Guest
Ok new question here for me. What is the purpose of compiling your own kernel for Linux?
I read @ryanvade always complies his own kernel. The distribution supplies the kernel so why would you compile one? Is compiling the kernel common knowledge to becoming a proficient Linux power user?
 


I have never done it, because I have never had the need, but one reason I know of is to add support for hardware not supported in the version of the kernel used by a distribution. For example, some Debian users roll their own kernels so they can use hardware too new for the release's kernel. I am sure there are other reasons, but not having a need to it, I have not bothered to learn much about it.
 
Are you asking about compiling your personal kernel with your own modifications or just the latest kernel release? Different matters. I'll assume you're inquiring about the last thing, which's more recurrent...

I used to compile the latest kernel release when I used an Ubuntu minimal distro "built" on my own quite some time ago. Apart from other tiny annoyances, I had to fine tune/tweak the package manager configuration file manually after upgrades, in case the kernel name changed (Ubuntu...). I also had to reload the video drivers (proprietary) - mandatory. Not difficult at all, yet another little pain, I may tell you. I guess it will normally happen with all proprietary drivers if you don't script automations for their compilation after kernel upgrades (Catalyst-hook, on Arch, is a service that automatizes that process for proprietary AMD video drivers, for instance). On other words: after kernel compilations, if you didn't somehow embed the drivers you wanted in it, tell them bye bye until next meeting. These boring details forced me to avoid non-rolling operating systems (which can definitely be more stable though).

If you are using a good rolling distro like Arch, just wait for the kernel upgrades, they will reach you sooner than you think; so that you won't have to tweak or even reinstall the "whole" OS for a properly updated system. That's one of the main beauties of Arch or any proper rolling release distribution.

Unless you really need a specific hardware feature/enhancement that only a younger (or just different) kernel can provide you with, there's no need to upgrade your system beforehand, just pick a rolling distro and wait for the official downloads.

Even on rolling... If you feel your OS is taking great advantage of your hardware and no device in your system was left behind, there's likely no need to upgrade the kernel at the moment. It will prevent "ruining" your system/making you roll back to the latest working kernel. Development (sometimes even stable) kernels can cause major issues, like ruining your wireless or SSD performance. Happened with me.

I believe the power user thing is very subjective. If you do all you want with your OS, considering its inherent limits, then I guess that's all to it :)
 
Last edited:
Sometimes, users configure and compile their own kernel to make a high-speed kernel specifically for their system. The kernels that come with Linux distros are very general, but users can make a stripped-down, fast kernel for their system.
 
Sometimes, users configure and compile their own kernel to make a high-speed kernel specifically for their system. The kernels that come with Linux distros are very general, but users can make a stripped-down, fast kernel for their system.
That's a truer view on compiling your own kernel :D (compared with that, compiling a merely downloaded kernel not meant for a given distribution sounds really easy). @DevynCJohnson (and whoever else has the experience), I have got a question that may be pertinent in this thread, but if it's too hijacking I can open my own annoying topic :D. If I strip off all things unrelated to my hardware from the Kernel, will it really improve performance considerably? Just asking...
 
That's a truer view on compiling your own kernel :D (compared with that, compiling a merely downloaded kernel not meant for a given distribution sounds really easy). @DevynCJohnson (and whoever else has the experience), I have got a question that may be pertinent in this thread, but if it's too hijacking I can open my own annoying topic :D. If I strip off all things unrelated to my hardware from the Kernel, will it really improve performance considerably? Just asking...
It most likely would.
 
First of all, Thanks for all the replies guys!
I started wondering about building the kernel after seeing Devyn posting articles on it. I thought to myself I won't be doing any of that so I never read the article. Then I started coming across it more from reading about users rolling back their kernel to fix their issue to building your own firewall with iptables in an article on this site . Again I kind of blew it off, but I keep seeing "compiling the kernel" coming up in many situations. I was just curious how important it is to know.
 
That's a truer view on compiling your own kernel :D (compared with that, compiling a merely downloaded kernel not meant for a given distribution sounds really easy). @DevynCJohnson (and whoever else has the experience), I have got a question that may be pertinent in this thread, but if it's too hijacking I can open my own annoying topic :D. If I strip off all things unrelated to my hardware from the Kernel, will it really improve performance considerably? Just asking...

Like Ryan said, it will enhance performance. Also, removing modules/code for debugging also helps speed as well as reduce memory usage.
 

Members online


Latest posts

Top