Many 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.
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!
Add: Use your distro's package management system to build kernels whenever possible.
I'm happy you updated your blog again, keep up posting.
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!
good points...
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...
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).
@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...
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...
@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.
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 =(
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...
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. )
I disagree with #2. I rebuild my kernels even though all of my hardware is supported. I do it for the speed gains.
Pingback : fluffigt.com » Blog Archive » FAQ: How to set up atomatic Linux reboot if kernel panic occurs?
????????????? ? ?????????? ?????? ? ???. ? ??????? ?? ??????????? ????????? ??????? ????? ??? ????! :)
??????? ?? ??? ???? ????? ??????????, ??????? ?????? ???? ????????????? ??????. ???????!
Hey There. I found your blog using msn. This is an extremely well written article. I will be sure to bookmark it and come back to read more of your useful info. Thanks for the post. I will definitely comeback.
useful I appreciate you taking time to share such valuable information. I really like the point you are making with your last paragraph.
The next time I read a article, I hope that it doesnt disappoint me as much as this one. I mean, I know it was my choice to read, but I actually thought youd have something interesting to say. All I hear is a bunch of whining about something that you could fix if you werent too busy looking for attention.
Thanks for the sensible critique. Me and my neighbor were just preparing to do some research about this. We got a grab a book from our area library but I think I learned more from this post. I am very glad to see such great info being shared freely out there.