Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm willing to build a minimal kernel with only the needed things for my machine; so I started by compiling the kernel from the ground up, using the default configuration and adding things that I know for sure I have (i.e.: Ethernet card, WiFi card, ...).

But there are several other things not so easy to know about (i.e.: the watchdog timer) so I came across AutoKernConf which supposedly detects the hardware of the machine and generates a kernel configuration file with the settings for the found devices.

The problem is it contained several settings repeated and even some which I don't have (I'm using a Dell laptop and one of the things it "found" was something of a Toshiba one).

So I ended up building a kernel with the configuration that came out of the make allmodconfig command, which is a kernel with most of the things compiled as modules.

Booting into that kernel and running lsmod I can see all of the kernel modules in use (the ones really needed) and I would like to know if there is a tool or some way for me to parse that list and convert it to the corresponding kernel configuration file.

Or how to map each one with the appropriate options in the kernel so that I can manually set them.

Thank you very much for your time.

share|improve this question

1 Answer 1

up vote 6 down vote accepted

If you're using Linux 2.6.32 and above, you may want to check out the "localmodconfig" make target. It does pretty much what you ask—it determines what modules you have running, and generates a .config making sure those modules are built. The "localyesconfig" target will compile those modules statically into the kernel rather than creating modules.

More info available here: Easy local kernel configuration.

share|improve this answer
    
Thank you very much, I was using a 2.6.33 variant so I can use that target. –  Carla May 29 '10 at 12:28

Your Answer

 
discard

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.