I would like to build a kernel for my system that only contains modules for the hardware which is really in place. Of course I can walk through lspci and manually select all the necessary device drivers to be build as a module.

But I am wondering if there is some script that can automate this process to some degree. For example which scan's the output of lsusb/lspci/cpuinfo etc. and then produces a .config kernel configuration file that can be modified further and acts as a baseline.

There are several tools that provide a good overview of the hardware contained in a system, but none produces a kernel .config file.



I have just learned about the 'make localmodconfig' parameter which seems to be a real time safer.

This links also contains some valuable information to speed up things, however it does not provide the information i am looking for: http://gentoovps.net/kernel-tips/

  • Ideally this would be a tool that compares a list of hardware (either harvested from lspci and lsusb or specified by the user) with your kernel config and points out missing drivers and unnecessary drivers, with a workflow that makes it easy to adjust your kernel config according to the suggestions.
    – Mutant Bob
    Jun 16, 2015 at 20:08

1 Answer 1


With modprobed-db you can reload stored earlier modules and run make localmodconfig


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.