# Kernel modules keep being built



## stewe (Jun 5, 2013)

Hi,

I am switching from 9.1-p3 to 9-STABLE and I did pretty everything required but what bothers me is that when I wanted to build custom kernel, I used my custom config and then point make in /usr/src to pick it like

`make buildkernel KERNCONF=MYKERNEL`

After that and after installing

`make installkernel KERNCONF=MYKERNEL`

it is placed in /boot/kernel and /boot/kernel.old is made.

What I do not understand at all is that I have commented out my custom kernel configuration very heavily in order to get rid of everything I do not care about. All that network and raid modules and so on. But what I see is that every module is built as well and I ended up with exactly the same set of modules as with a GENERIC kernel. What is wrong with that?

I used the configuration as attached.


----------



## SirDice (Jun 5, 2013)

Almost _everything_ is always built as a module, regardless if it's in the kernel config or not.

Have a look at MODULES_OVERRIDE, NO_MODULES and WITHOUT_MODULES in make.conf(5).


----------



## wblock@ (Jun 5, 2013)

To add to that: the kernel configuration file only describes what to build into the monolithic kernel file, /boot/kernel/kernel.


----------

