19

What does make localmodconfig do and what should you set so that external hardware is supported?

Jeff Schaller
  • 67,283
  • 35
  • 116
  • 255
redcaddy
  • 225

2 Answers2

19

From the kernel README:

"make localmodconfig" Create a config based on current config and loaded modules (lsmod). Disables any module option that is not needed for the loadedmodules.

To create a localmodconfig for another machine, store the lsmod of that machine into a file and pass it in as a LSMOD parameter.

               target$ lsmod > /tmp/mylsmod
               target$ scp /tmp/mylsmod host:/tmp

               host$ make LSMOD=/tmp/mylsmod localmodconfig

The above also works when cross compiling.

 "make localyesconfig" Similar to localmodconfig, except it will convert
                       all module options to built in (=y) options.
jasonwryan
  • 73,126
3

You need to make sure that all modules you will ever need are loaded at the point you run make localmodconfig. One tool that can help to achieve this is https://github.com/graysky2/modprobed-db.

First, boot up a default distribution kernel and run /usr/bin/modprobed-db store periodically, or every time you connect some new piece of hardware.

Then, run sudo /usr/bin/modprobed-db recall which will load all the modules that were ever loaded when modprobe-db store was run, and now you do make localmodconfig.

user7610
  • 2,038