7

Lets suppose I have a module named "mptsas". How can I find out, what kernel configuration menu entry (make menuconfig inside /usr/src/linux) corresponds to that module?

By 'corresponds' I mean what menu entry compiles the appropriate module into the kernel.

enter image description here

//edit: it works very nicely: enter image description here

colemik
  • 1,371

2 Answers2

6

There is no recorded association. You need to explore the makefiles in the kernel source. You'll find lines like

obj-$(CONFIG_FUSION_SAS)        += mptbase.o mptscsih.o mptsas.o

This means that:

  • If CONFIG_FUSION_SAS is y, then the drivers mptbase, mptscsih and mptsas are compiled into the kernel.
  • If CONFIG_FUSION_SAS is m, then the drivers mptbase, mptscsih and mptsas are compiled as modules.
  • If CONFIG_FUSION_SAS is n, then the drivers mptbase, mptscsih and mptsas are not compiled.

The command grep -R --include=Makefile '\bNAME\.o\b' from the top of the kernel source tree will return the relevant makefile line in most cases.

0

Be warned that the lsmod command lists module's name, not the module's filename. They may be different. For instance the aesni_intel module is located in a module file aesni-intel (hyphen, not underscore); therefore you must search for aesni-intel in order to find the corresponding kernel configuration tag entry:

$ grep -R --include=Makefile '\baesni-intel\.o\b'
arch/x86/crypto/Makefile:obj-$(CONFIG_CRYPTO_AES_NI_INTEL) += aesni-intel.o

EDIT: In this circumstance it may be useful the modinfo command that it shows the module's filename:

# modinfo aesni_intel | grep filename
filename:       /lib/modules/5.10.162/kernel/arch/x86/crypto/aesni-intel.ko