Linux – Binding lsmod module name with kernel configuration menu entry

kernel-moduleslinux-kernelsearch

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

Best Answer

  • 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.

  • Related Question