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
Code:
nodevice
and
Code:
nooption
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:

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

I'm puzzled.
 
Reading this topic alongside <https://forums.FreeBSD.org/threads/81015/post-520451> and subsequent posts


– connections time out ∴ <https://web.archive.org/web/2012020...nkity.com/~wblock/docs/html/kernelconfig.html>


– redirects to <https://docs.freebsd.org/en/books/handbook/kernelconfig/#kernelconfig-config> where some corrections are required.

Also, <https://docs.freebsd.org/en/books/handbook/kernelconfig/#kernelconfig-custom-kernel> 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:

Code:
% 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.

<https://www.freebsd.org/cgi/man.cgi?query=kldload&sektion=8&manpath=FreeBSD+14.0-current>
 
Back
Top