Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm getting my feet wet with kernel hacking. I've got a couple of build trees on my system now ( &; but neither matches the one I'm running (2.6.32-24). I can't find that one anywhere.

My question, then:

How do I install a kernel from source as the kernel to use with the system I am currently running so that I can insert and run modules I build against my tree?

I would appreciate tips and links, too.

share|improve this question
up vote 1 down vote accepted

I've been doing minor kernel work since the 1.2 days, so it's just possible I'm behind the times. I'm sure others will chime in if I'm off base :)

For this kind of thing, Grub is your friend (assuming you're using Grub. If not, LILO can do most of this too). Your current kernel is a great home-base, keep that, don't touch it.

To make a kernel from source is actually a pretty well documented method. Once you've done the final make install it's time to make sure your bootloader knows about it. The exact method depends on your distribution, but go into your bootloader configurator and make a new entry for the kernel you just compiled. Keep the current entries. If all goes well, on your next reboot you can boot to that kernel.

If it doesn't work, perhaps there were interesting error messages when you booted. Boot back to your stock kernel and rebuild the bits you need. Install. Wash, rinse, repeat until you've booted. Hooray! You're now running a stock kernel.

Assuming you really are kernel hacking, I'm assuming you're just tweaking modules or perhaps making new. In that case, you need to be very aware of

make M=drivers/acpi

That tells it to just make the modules in that directory. That way you don't have to rebuild the entire thing. If you've booted into that kernel, you can safely copy out the old modules from /lib/modules and copy in the new ones, rmmod, insmod, and load the new module (assuming you can). You can wash, rinse, repeat with this method many times.

Hopefully this gets you on the path you're looking for.

share|improve this answer
Awesome! Thanks :) I also found documentation on this a little farther down in the README file in my build directory. I appreciate the tips! – KeatsKelleher Aug 28 '10 at 3:39

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.