Bug 247143

Summary: FEATURE IDEA: implement module_disable=YES in /boot/loader.conf file
Product: Base System Reporter: Slawomir Wojciech Wojtczak <vermaden>
Component: kernAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed Feedback Timeout    
Severity: Affects Many People CC: allanjude
Priority: ---    
Version: CURRENT   
Hardware: Any   
OS: Any   

Description Slawomir Wojciech Wojtczak 2020-06-10 10:06:49 UTC
Currently many things are built into the kernel (like Bluetooth).

The syntax module_load=YES loads module at system startup.

Currently its not possible to disable (for example) Bluetooth because its compiled into the kernel without rebuilding it.

Implementing module_disable=YES could/should allow disable a feature that is build into the kernel but one would not have to recompile the kernel (and lose the freebsd-update(8) updates).

Just an idea ...

Regards.
Comment 1 Allan Jude freebsd_committer freebsd_triage 2020-06-18 14:50:47 UTC
The loader.conf variables are not read by the kernel, but by the loader scripting language, and used to load modules.

You can disable some hardware using the device.hints file, but that won't disable the code in the kernel, just keep it from attaching to the hardware.

There is a version of the kernel, called MINIMAL, that moves as much as possible out of GENERIC, and uses the 'devmatch' tool to load the drivers for all of the hardware that is detected on your system.

With some more polish, this could replace GENERIC and achieve your goal.