Working with WITHOUT_MODULES and custom kernels

Hi all,

I'm experimenting with a custom kernel configuration for my limited VPS resources. I have been manually copying GENERIC and taking out options and devices manually until I realsied that /etc/make.conf can be used to achieve something similar.

Can someone enlighten me what WITHOUT_MODULES will accept? This is not documented in the make conf man page. I'm also curious to know whether there is a way to exclude different options and devices using a similar config flag instead of having to manually edit the copy of the GENERIC kernel config.

Seems like an exclusion list would be perfect as the kernel changes over time and maintaining a list of exclusions would be more handy than the manual options.

Thanks in advance,

-- Attila
Last edited by a moderator:
yes, someone over twitter pointed me to that article and have been following that plan. I included GENERIC in my kernel conf and then issued a few
too. I've excluded sound and wlan devices for example from my config but when I install the newly built kernel to the system using
sudo make buildkernel KERNCONF=REWIREMIN and then sudo make installkernel KERNCONF=REWIREMIN I am getting the same amount of files installed under /boot/kernel as GENERIC. These even seem to include wlan and sound objects.

What am I missing?

I've cleared /usr/obj prior to compiling and installing the new kernel, so I'm a bit lost here. Here's my kernel configuration as a reference.
I'm just wondering... How come that the file count is significantly in case I use a slimmed down version of GENERIC instead of importing it and applying exclusions afterwards?

The diff is significant between these kernel builds. The first 2 are slim versions of GENERIC, the 3rd (current one) is a kernel built with the exclusion technique mentioned above:

attila@cloud ~> ls -la /boot/kernel.old | wc -l
attila@cloud ~> ls -la /boot/kernel.old1/ | wc -l
attila@cloud ~> ls -la /boot/kernel/ | wc -l

I'm puzzled.
Reading this topic alongside <> and subsequent posts

– connections time out ∴ <>

– redirects to <> where some corrections are required.

Also, <> states:

… Kernel modules exist in /boot/kernel and may be dynamically loaded into the running kernel using kldload(8). …

– however neither chapter eight of the Handbook, nor the manual page, mentions /boot/modules for the same purpose:

% uname -KrU
14.0-CURRENT 1400024 1400024
% pkg provides /boot/modules/drm.ko
Name    : drm-devel-kmod-5.4.92.g20210526
Desc    : DRM modules for the linuxkpi-based KMS components (development version)
Repo    : FreeBSD
Filename: boot/modules/drm.ko

Name    : drm-current-kmod-5.4.92.g20210526
Desc    : DRM modules for the linuxkpi-based KMS components
Repo    : FreeBSD
Filename: boot/modules/drm.ko

– and so on.