Digg Townhall now online!
Check out the latest Digg Townhall, where Kevin and Jay answered the top questions from the Digg Community!
The Newbies Guide to Compiling Your First Kernel
linuxforums.org — So you've been using Linux for a while now and have decided to take the next step. Whether you are looking for a performance increase, added hardware support or even just to enhance your geek cred, compiling your own kernel need not be a horrifying experience. Compiling a kernel has historically been a very involved and, at times, frustratingly hai
- 1024 diggs
- digg it
- schestowitz, on 10/12/2007, -3/+20Compiling a kernel uses to be a challenge, which was the whole reason (and driver) for doing this. With distro-spcific, step-by-step guides it is no longer a challenge. It's rarely a unique experience.
It's not only educational, but it also has use if you build a customised kernel. For the latter, however, one needs skills in kernel hacking/tweaking, not just the ability to compile it. So, all in all, in most cases, the whole thing is done for the 'geek' value, not real need. New kernels arrive with the new distribution, which have a fast and frequent release cycle. - Crazychipmunk, on 10/12/2007, -23/+2When I first saw this, I thought it was about making a popcorn kernel.
Needless to say, I was disappointed. - keyguy242, on 10/12/2007, -55/+6Meeeeeeeeepzzzzooorrrrrrrpppp!! LINUX!! Oh Boy How Exciting!!! Go away women its linux time!! mmooooooooommmmmmmm Get Me My Juice Box, animal crackers and Inahler!!!!! MEEPZORP!!!!
- penno, on 10/12/2007, -5/+1hahahahahaha dunno if keyguy's serious or not, but it's a very funny comment. (c:
MEEPZORP hahahha
- penno, on 10/12/2007, -5/+1hahahahahaha dunno if keyguy's serious or not, but it's a very funny comment. (c:
- Troopy, on 10/12/2007, -8/+5This tutorial is no good for anyone that wants distribution specific instructions on how to upgrade your kernel.
It is however, not a bad overview of the process. - diggfinity, on 10/12/2007, -21/+9Step One: Put it in, but tease the Linux a bit. This isn't a race.
Step Two: Bite the drivers gently to properly arouse the Beryl.
Step Three: Compile her bits out till she reboots successfully!- marvin69, on 10/12/2007, -19/+8Step Four: Hand her the cash and post your experience on Digg before crying yourself to sleep.
- Chewie67, on 10/12/2007, -59/+6Step 1 -- get a life.
Step 2 -- there is no step 2.
If you're seriously sitting at home compiling your own Linux kernel there is no chance you will ever get laid -- and that's a good thing. Darwin called it "Thinning the herd"- Troopy, on 10/12/2007, -2/+34Chewie67 and Keyguy242,
Why do you assholes even bother commenting as the article is clearly of no interest to you?
Do us all a favour and go play in the road. - diggfinity, on 10/12/2007, -2/+19@Chewie67
I was thinking the same thing, but the joke will be on us when we're living in a Fallout-like post-apocalyptic world and --wouldn't you know it-- Linux terminals powering every goddamn major utility need to be recompiled.
The geek shall inherit the Earth. - marvin69, on 10/12/2007, -14/+5Geeks will survive the bast because they live in their mother's basement. However, they will die off quickly because the gun they found doesn't have an 'R' button to reload.
- sirhomer, on 10/12/2007, -6/+27I just compiled my own kernel while getting sucked off by my girlfriend, you insensitive clod.
- diggfinity, on 10/12/2007, -6/+11@sirhomer
Dad?? - marvin69, on 10/12/2007, -15/+7@sirhomer
Peanut butter and your dog isn't a girlfriend. - sirhomer, on 10/12/2007, -8/+3you are all jealous :(
- krazykit, on 10/12/2007, -1/+12Darwin didn't call anything "thinning the herd". Nice try though.
- RoboDonut, on 10/12/2007, -1/+11"If you're seriously sitting at home compiling your own Linux kernel there is no chance you will ever get laid -- and that's a good thing. Darwin called it 'Thinning the herd'"
I guess that explains why humans are a bunch of dumb assholes.
- Troopy, on 10/12/2007, -2/+34Chewie67 and Keyguy242,
- MrContent, on 10/12/2007, -30/+2***** like to use words like Kernel ..... ***** retards ....
- slackerbox, on 10/12/2007, -1/+3If thats the case then I know a lot of girls that _really_ like to use that word.. and they are good at it.
- JrGhoull, on 10/12/2007, -4/+1seems like it doesnt tell you too much but it does seem like a good place to start in learning how to make your own distro
- slackerbox, on 10/12/2007, -8/+2ack, wrong button. digg down.
- Lyph4, on 10/12/2007, -7/+4Step #1:
If you need a newbies guide to do it, don't do it. - Vaelan, on 10/12/2007, -3/+5Can someone explain the various tiers?
If you download a new kernel from "kernel.org" and you compile it and you successfully changed the boot-loader to load that kernel by default when you start up... The question I had is what do you get when it boots up? Do you still get a windows manager or do you now at this point need to get a windows manager?
Also what is the difference between a compiled version from "kernel.org" vs a distro like Ubuntu or Gentoo?
If someone can explain or point me in the right direction, it would be very helpful.- krazykit, on 10/12/2007, -1/+3You still get all that stuff. To put it simply, any distro is the kernel + associated programs (which is why it's often called GNU/Linux). Updating the kernel is really just updating the blood and guts of your OS. Nearest thing in Windows is updating all your drivers in one fell swoop.
- straxus, on 10/12/2007, -0/+3As long as you compile in support for all of your hardware and it's supported features, everything will work as it did before. The difference between the kernel.org kernel and the packaged distro kernels usually just comes down to some distro specific optimizations.
There are really only three reasons I can think of to compile your own kernel.
1) To gain needed hardware support that your current kernel lacks. (This is the most common reason by far)
2) Because you want to learn how it's done
3) To reduce system overhead by only compiling modules used by your system. (This is important for embedded systems with few resources - not so much for modern PCs) - krazykit, on 10/12/2007, -0/+1ffs, my edit didn't work:
The difference between distro-specific kernels and a vanilla (kernel.org) kernel is the patches. Several coders write excellent patches (Con Kolivas' ck-patches are my favorite) to tweak various things and to increase performance. You apply these patches to the kernel.org sources, configure, and compile. Distros just use whichever patches suit their needs and include them in their "official" kernels. - pauldonnelly, on 10/12/2007, -0/+0Assuming your custom kernel hasn't broken anything X needs to start, your PC will boot exactly as it did before. When Linux boots, first the bootloader loads the kernel (you tell it which file that is), and then the kernel loads init, which does whatever it has been configured to do. So a new kernel loads the same old init.
- ThePict, on 10/12/2007, -4/+0Your question reveals that you are not ready to roll your own yet.
STFW and RTFM until you're more comfortable with all the concept involved, otherwise, when you start the process, it'll be more than just your kernel that will panic.
At the very least, be sure you know how to recover from a failed kernel installation.
No disrespect, we all start somewhere. I'm just sayin', your not ready yet. Close, but not yet. - pinoyboy82, on 10/12/2007, -0/+1=============================================
File System (/) (User Space/Windows Managers, etc)
=============================================
Kernel e.g. initrd, zimage, etc. (System Space/Driver Support)
=============================================
BIOS/Bootstrap (Driver initializations)
=============================================
- hockey, on 10/12/2007, -4/+10"The Newbies Guide to Compiling Your First Kernel"
Use Gentoo. Seriously. Compiling the kernel by hand is actually part of the installation of the distro. Eventually compiling a kernel becomes old hat.- DigitalJester, on 10/12/2007, -5/+5Except, we dont want to spend 3 days installing a Distro
- MudkipsULiekEm, on 10/12/2007, -0/+23 days installing a distro? WTF are you installing it on, a Pentium 1?
On any decent machine, you can have a Stage 1 install done within a few hours.
Just use stage 2 or 3 if you don't wanna wait. You'll have a system in no time, but will learn a lot about setting it up in the process. - nickgarvey, on 10/12/2007, -1/+13 days? Take about 30 minutes to get the base down, start an emerge right before you go to sleep, wake up, everything is all done and set up for you, with only about an hour max of you actually doing anything. Easy enough.
- bitbytebit, on 10/12/2007, -2/+0@digitaljester
While 3 days is hyperbole I had to give you a thumbs up because Gentoo is just a horrible distro to install. Especially if that overnight emerge your doing fails. You wake up only to have to start it again while you go to work ..oh yeah , come home and guess what ..didn't work.
Yeah .. go Gentoo
- kahrn, on 10/12/2007, -0/+8Ok... am I the only one that thinks compiling a kernel is easier compared to most other things? Compiling a kernel is simple. It's getting things to work with your hardware (X server, etc..) that's the hard part.
- joeyrutledge, on 10/12/2007, -1/+1Ha. He used make xconfig opposed to simply make menuconfig in a terminal. This is really for noobs. ;-)
- Fartag, on 10/12/2007, -0/+1If you download a kernel from www.kernel.org, unpack it, and do a:
make menuconfig
in the directory for it (or check README for other types of methods to configure it).
You can browse around all of the options and see what kinds of things you can do with it, plus this is by default harmless regardless of what you do UNLESS you do more steps to install it after you've basically been trying to hose it.
Check out the internal helps associated with the various items.
You can import configure files you used on other / prior kernels to just concentrate on any cool + added things in the latest release.
It's really not that bad, the first one I did I was reading the internal helps though for quite a while. If you do this and you see more of the wonderment offered by open source versus software that attempts to hide / prevent you from changing all of these cool things then you may turn into a raving OSS zealot if you haven't already. (also consider use of make-kpkg if you run a Debian based distro!) - MudkipsULiekEm, on 10/12/2007, -1/+0I haven't used Linux in a while, but I'm so glad the step of copying the "System.map" is long gone. Such a useless step/file.
- lampshade, on 10/12/2007, -1/+2This is the worst guide I've ever seen. What about all the stuff inside the kernel? Options, etc?
If you know what all the little options inside the kernel config are, you probably don't need a guide to build a kernel. If you need a guide to build a kernel, you probably don't know about the options you definitely need to make your system work with the new kernel.
I think this guide is terrible.- Ub3rg33k, on 10/12/2007, -0/+1Then how about linking us to a good kernel compiling guide?
- stmiller, on 10/12/2007, -0/+1http://www.gentoo.org has excellent docs that walk you through everything. For almost all archs.
- Topher06, on 10/12/2007, -1/+0Hint 1) A newbie shouldn't need to recompile a kernel in a modern operating system.
- nickgarvey, on 10/12/2007, -0/+1Where does anything say you NEED to compile it?
- noseeme, on 10/12/2007, -3/+1Note: Compiling a newer Linux kernel DOES NOT give you geek cred.
- bitbytebit, on 10/12/2007, -0/+0@noseeme
Wrong - its still a standard question in a lot of IT interviews (non MS houses) - it shows you have a technical aptitude
- bitbytebit, on 10/12/2007, -0/+0@noseeme
- Brownout, on 10/12/2007, -1/+0"Under 'Miscellaneous Filesystems', enable Compressed Rom File Support(cramfs) and disable all others unless you have a specific need to access a special file-system type." 8-| What?! How can you access your partitions disabling all FS except crams? Maybe he should have mentioned to keep all others FSs like ext2, ext3, reiser, ... and to disable ONLY misc ones.
- migla, on 10/12/2007, -0/+1"Linux kernel in a nutshell" is available under a cc-licence from the authors site: http://www.kroah.com/lkn/
Check out the new & improved