# make.conf MODULES_OVERRIDE =?



## hruodr (Jan 31, 2021)

From where I get the module names for MODULES_OVERRIDE when compiling the kernel?

`man 4 re` gives:

device miibus
device re

There is a directory re in /usr/src/sys/modules, but no miibus, 
perhaps mi is the corrct one.

But I do not find anything for run(4), neither run, nor if_run, nor runfw, etc. What should I put in the variable?
And how do I get it?

Thanks !


----------



## hruodr (Jan 31, 2021)

And there is also a module snd_uaudio, but I also not know how to build it, what should I put in MODULES_OVERRIDE.

And it seems I also need uhid, but there is also no directory for it in /usr/src/sys/modules/.

UPDATE: uhid and run are in directory usb, uaudio in sound. Does thos mean that paths are allowed values for MODULES_OVERRIDE?


----------



## sandrain (Feb 15, 2021)

I am pretty new to FreeBSD, but `MODULES_OVERRIDE` seems to accept the paths, specifically the relative directory paths under /usr/src/sys/modules. For instance, mine (/etc/make.conf) looks like:


```
MODULES_OVERRIDE= \
        cpuctl \
        drm2/drm2 \
        drm2/i915kms \
        ext2fs \
        fusefs \
        i2c/controllers/ichsmb \
        i2c/smbus \
        iwm \
        iwmfw/iwm7265Dfw \
        linuxkpi \
        tmpfs \
        usb/uhid \
        usb/ums \
        usb/wmt \
        wlan_ccmp \
        wlan_tkip \
        wlan_wep
```

I found out this by encountering/fixing errors while running `make buildkernel`. It would be nice if this was clearly documented in the handbook.

After building the kernel, /boot/kernel has become significantly lighter:


```
[root@freemeow /usr/src]# ls -l /boot/kernel
total 24612
-r-xr-xr-x  1 root  wheel     23784 Feb 14 19:50 cpuctl.ko*
-r-xr-xr-x  1 root  wheel    498136 Feb 14 19:50 drm2.ko*
-r-xr-xr-x  1 root  wheel    210328 Feb 14 19:50 ext2fs.ko*
lrwxr-xr-x  1 root  wheel         9 Feb 14 19:50 fuse.ko@ -> fusefs.ko
-r-xr-xr-x  1 root  wheel    175232 Feb 14 19:50 fusefs.ko*
-r-xr-xr-x  1 root  wheel    968640 Feb 14 19:50 i915kms.ko*
-r-xr-xr-x  1 root  wheel     26664 Feb 14 19:50 ichsmb.ko*
-r-xr-xr-x  1 root  wheel    224392 Feb 14 19:50 if_iwm.ko*
-r-xr-xr-x  1 root  wheel   1034312 Feb 14 19:50 iwm7265Dfw.ko*
-r-xr-xr-x  1 root  wheel  21274944 Feb 14 19:50 kernel*
-rw-r--r--  1 root  wheel     40160 Feb 14 19:50 linker.hints
-r-xr-xr-x  1 root  wheel    209536 Feb 14 19:50 linuxkpi.ko*
-r-xr-xr-x  1 root  wheel     12336 Feb 14 19:50 smbus.ko*
-r-xr-xr-x  1 root  wheel     90040 Feb 14 19:50 tmpfs.ko*
-r-xr-xr-x  1 root  wheel     24328 Feb 14 19:50 uhid.ko*
-r-xr-xr-x  1 root  wheel     32176 Feb 14 19:50 ums.ko*
-r-xr-xr-x  1 root  wheel     44832 Feb 14 19:50 wlan_ccmp.ko*
-r-xr-xr-x  1 root  wheel     30392 Feb 14 19:50 wlan_tkip.ko*
-r-xr-xr-x  1 root  wheel     24856 Feb 14 19:50 wlan_wep.ko*
-r-xr-xr-x  1 root  wheel     23952 Feb 14 19:50 wmt.ko*
[root@freemeow /usr/src]# du -sh /boot/kernel
24M    /boot/kernel
[root@freemeow /usr/src]#
```

I think yours needs to look like:


```
MODULES_OVERRIDE = mii usb/uhid sound/driver/uaudio ...
```


----------

