I tried compiling a kernel from sources that I got from kernel.org (mainline) with make allyesconfig and make allmodconfig, but both builds resulted in a kernel, that won't boot.

I was thinking, that by compiling everything, It should work on close to any hardware. What am I doing wrong?

And how do I compile a working kernel?

  • I don't think "all yes" is a good idea, since there are options that conflict with one another. The people who compile kernels for distribution have to choose very carefully to include support for most (but not all) hardware. You have to do the same and choose options for your hardware.
    – phunehehe
    Apr 12, 2011 at 6:02

1 Answer 1


One thing you can do is boot a working kernel, run lsmod, and make sure that all the modules listed are turned on in your config (either built-in or as modules).

It's easiest to start with a working config, and then tweak it. If you're lucky, your distribution ships the config file along with the kernel. For example, in Ubuntu you'll find it in /boot/config-version. Copy that file into your new kernel directory and name it .config. If it's for an older kernel, you can try make oldconfig to be asked only about new options. In general, accept the default answer for everything unless you know what it is.

  • 2
    +1. @poleman: Use the config of a distribution kernel which is close in version but <= the version you are trying to use from upstream, then tweak the config as necessary. Apr 12, 2011 at 21:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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