Bug 247143 - FEATURE IDEA: implement module_disable=YES in /boot/loader.conf file
Summary: FEATURE IDEA: implement module_disable=YES in /boot/loader.conf file
Status: Closed Feedback Timeout
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Many People
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-06-10 10:06 UTC by Slawomir Wojciech Wojtczak
Modified: 2020-10-28 19:20 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.