Every PC is unique like DNA, tailored or generic Kernel?
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Building the kernel and kernel drivers used to be a basic task of *nix administrator. I always build my own, because my distro does not provide one and because I can. Your custom kernel will be much leaner than stock and there is no need for initrd.
A custom kernel could improve your system depending on a number of things. One is you'd have to know how to configure it to support the system you are using.
A custom kernel has minimal impact on a home user usually.
Many times people could use a custom kernel for improvements to video or networking.
There is no real performance improvement by doing your own. The customization that used to be helpful has been taken over by the loadable device drivers.
the current kernel only has 3 maybe 4 drivers built in - keyboard/vga video/ramdisk/ and sometimes USB. Everything else gets loaded from the initrd that is loaded with the kernel (it is used as a root filesystem). Once the real root is identified it can then have the appropriate filesystem loaded, then mounted. Once the switch to the real root occurs any additional drivers/modules needed can be loaded during the system start.
It is possible to speed some the boot by building in the root filesystem and drivers for the disk. This allows you to skip the initrd processing and go directly to the real root. This can knock of between 5-7 seconds (not that noticable). The disadvantage is that if you have to change motherboards and such - the system won't necessarily boot.
Thank You everybody, Believe it or not all your responses make sense in their own way. I guess it comes down to, the time, the work, and the benefits.
Something to sleep on.
The only reason to actually use a custom kernel is if you need a patch just put out - and need it for functionality (such as drivers) or for a security issue you MUST have covered.
When you have that need, the easiest way to build the kernel is to copy the configuration file that is with every kernel. Usually stored in /boot with the same version number as used by the distribution kernel.
Then do a "make menuconfig" (or "make oldconfig") - and continue with the build. This ensures that the configuration of the kernel matches that of the distribution kernel. You STILL have to be careful because sometimes the kernel may update the kernel structures that no longer match some rather tightly integrated tools (I found the VM support changed... and virtual machines could no longer be run until the user space tools had been updated). But other than this, there should be no real problem.
I have had to do this before - some for updated drivers for specific peripherals, some for rather exotic bugs. Usually there is no problem between userspace and the kernel (the VM changes I experienced was due to some security bugs being fixed - and that required changes to the tools). More significant changes happen with the major number change (which doesn't happen that often), even then, the changes usually have no issues with user space tools. Usually this just adds new features - but your configuration would tend to have new features disabled by default anyway.
If you build your own, you lose the security updates when you update your distro. It used to be worth it to have the "extra" opcodes for your cpu type. But these days, unless you have an atom chipset that has "fewer" opcodes and would crash with a stock kernel, it's not needed. It depends on the application though. The make localmodconfig option can really slim down a kernel on embedded systems. Or otherwise lockdown a system by disabling usb ports by not including the modules. Or overcoming annoyances of various distros, like nfs not as a module in raspbian. Wasting limited ram and cpu cycles on something you're probably not using. *sigh*
Well, on one machine I had (*sniff* Old Dobbin ... which lives-on only in a disk drive now ...), I did compile a custom kernel, and got rid of the entire "initrd" sequence thereby. It became a game to see how fast I could get it to boot: I got it down to six seconds flat.
Not bad for a machine that had been sold with Windows 95.
I did it because I wanted to do it (using the Gentoo source-code based distribution, which meant that I actually compiled everything ...), but no, you generally don't have to do it.
If you build your own, you lose the security updates when you update your distro. It used to be worth it to have the "extra" opcodes for your cpu type. But these days, unless you have an atom chipset that has "fewer" opcodes and would crash with a stock kernel, it's not needed. It depends on the application though. The make localmodconfig option can really slim down a kernel on embedded systems. Or otherwise lockdown a system by disabling usb ports by not including the modules. Or overcoming annoyances of various distros, like nfs not as a module in raspbian. Wasting limited ram and cpu cycles on something you're probably not using. *sigh*
Shouldn't - unless there is a compiler bug.
And if you are not using the USB for mouse/keyboard, you can remove the module (usually), or remove the driver module for the usb device... No need for custom build.
Raspbian is already an embedded kernel. There is no initrd to load optional drivers from so the drivers HAVE to be builtin. Though I grant, it would be possible to load NFS. And unfortunately there are a number of missing drivers - having iscsi for instance would useful to use a server for large disks... or remote DVDs. Using an embedded form does save some storage space (the initrd is frequently around 5MB, which can put some pressure on a 4GB sdcard, specially when that sdcard may hold 2 boot systems.
Older atom chipsets lacked the moov instruction (cmoov?). Which would crash randomly depending on the kernel / distro in use. Something I ran into while trying to dd a partition on my dads old laptop on ubuntu 14.04. It depends on the options used at compile time as the debian generic kernel didn't have that issue.
I guess it comes down to, Doing it just to see if I can. That is pretty much how I know what I know. I know this is way off base but I tore an automatic transmission apart and rebuilt it. I got it correct the first time, gave me a sense of pride. Same thing here.
This can be fun. If you are the type. I do make allnoconfig and start adding options/drivers I need. If there is something I do not know - there always is - I look it up. Configuring the kernel this way takes long time ... and I enjoy every minute of it. In the end you know alot more about hardware.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.