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.

Welcome to Linux Screw! If you're new here, you may want to subscribe our RSS feed.

Share This
 
 
» You might also be interested in the following articles:
FAQ: How to set up atomatic Linux reboot if kernel panic occurs?
Web app. of the day: interactive Linux kernel map
Manage FreeBSD kernel modules on the fly
Get information about Linux kernel modules
Linux history: 0.02 and 0.03 releases memories



» Want to stay up to date? Subscribe to our E-MAIL or RSS feed!


15 Responses to “10+ advices BEFORE you rebuild Linux kernel”


  1. 1 Josh Beck

    Seems a bit pessimistic. Succesfully compiling a module or something in
    can be one heck of a learning experience. I remember the first time I pulled it off on Slack with a copy of O'Reilly’s 'Running Linux' in tow many moons ago. Necessary? No. Fun and worth a try? You bet!

  2. 2 Erek Dyskant

    Add: Use your distro’s package management system to build kernels whenever possible.

  3. 3 Neezar

    I'm happy you updated your blog again, keep up posting.

  4. 4 artiomix

    Hi Josh!

    Agreed with you completely: if one know why and for what to rebuild kernel and looks for learning experience he/she will do it without any advises :)

    Hi Erek!

    Thank you for great advice! Added.

    Hi Neezar!

    Actually, shame on me that I didn't post here for one month. Thank you!

  5. 5 confiq

    good points…

  6. 6 Rip_Van_Winkle

    RE: #10

    my kernels build in about 10 minutes, of course i have saved my .config from the previous build and just load it with menuconfig but i still look through it for any changes, and if i don't build support & features for hardware i don't have, and filesystem support (ext3) is built in to the kernel itself making an initrd unnecessary most of the rest is built as modules…

  7. 7 StasikOS

    Erek, it is a part of 5th advice - read notes about kernel rebuild in your distribution ) Because this is more than just make-kpkg or rpmbuild, it may be distribution-specific patches (restricted modules in ubuntu, etc).

  8. 8 Erek

    @staticOS. Sure enough. It is mentioned there.

    I was assuming that if you're rebuilding with the package management tool you're starting with the distro’s kernel source package, so you pick up all the distro-specific stuff and go from there rather than starting at vanilla…

  9. 9 StasikOS

    No, this is not logic of newbies. They are download latest vanilla kernel source and build it with "make", than install it with "make install" =). This is because advanced newbies using Slackware with it vanilla software and give advices to newbies use Slackware too. But if newbie don't use Slackware, and using distros with package-managers, they are prefer to slackware-way to build software from vanilla sources, and then "make install" them…

  10. 10 Erek Dyskant

    @StaticOS

    It'd help if applications shipped with READMEs that say "use your distro’s package management, or use the included spec file" rather than "Type su root, make, make install"

    Oh well. If someone wants to make their system unmaintainable there are lots of fun and creative ways to do it.

  11. 11 StasikOS

    Erek, yes, i agree this. ) But it is old windows logic - software must be searched via google, downloaded and then installed, without any package managers =(

  12. 12 Mel

    http://www.oreilly.com/catalog/9780596100797/

    This is actually a great book if you somewhat understand linux this is a good read very explaintory i think ive read it about 5 times over and learn a new trick here and there…

    Kernel building I would say is almost a fundamental part of Linux… you should do atleast 1 or 2 rebuilds with in a year or so… Granite depending on your distro, as a long time Gentoo/Fedora person and have been between the both I actually have a ritual of rebuilding my Kernels alot esp because i like to work with alternative Arch’s.

    >.> so… I actually disagree with your "dont do this" attitude because the only way you do Learn is by so to speak "Screwing the Pooch" a few times.. God knows ive done it more then a dozen times… Plus who likes vanilla/Generic Kernels?

    Pfft thats why were not microsoft…

  13. 13 StasikOS

    Mel, i can't say nothing if it is (kernel build) interesting to you. But if you want just "all in my computer just works", you can't rebuild kernel if you haven't anymore to do instead of just enjoy working system. )

  14. 14 LinuxCrayon

    I disagree with #2. I rebuild my kernels even though all of my hardware is supported. I do it for the speed gains.

  1. 1 fluffigt.com » Blog Archive » FAQ: How to set up atomatic Linux reboot if kernel panic occurs?

Leave a Reply

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word




Friendly Sites:Who is behind Linux Screw?
Aspiring Sysadmin | GeekyBits³ | Bash Cures Cancer | TOTMS
Linux Operating System | Small Linux Deployments | My SysAd Blog
The Danesh Project | ZEPY | LinuxHaxor.net | Planet Sysadmin
The Sys Admin | {buhay sysad} | a non-geek's linux notes
CyberCapital.Org | G-LOADED! | The Linux Alternative Project
My name is Artem Nosulchik (artiomix AT gmail DOT com) and I'm Linux/Unix, Cisco systems engineer. The main idea of Linux Screw is to share relevant knowledge, skills and observations over The Web. Here you can find a lot of information related to different Linux distributions, FreeBSD, IOS as well as a other Open Source around staff. Read more ››