lualoader: Create a module blacklist, add DRM modules to it
This is a step in the process of easing migration into the new world order of DRM drivers. Strongly encourage users towards loading DRM modules via rc.conf(5) instead of loader.conf(5) by failing the load from loader(8). Users so inclined may wipe out the blacklist via module_blacklist="" in loader.conf(5), and it is expected that these modules will eventually be removed from the blacklist. They may still be loaded as dependencies of other modules or explicitly via the loader prompt, but this should not be a major problem. Approved by: re (rgrimes) Relnotes: yes Differential Revision: https://reviews.freebsd.org/D16914
This commit is contained in:
parent
fc3c19a9fc
commit
532dc17243
7
UPDATING
7
UPDATING
@ -31,6 +31,13 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW:
|
|||||||
disable the most expensive debugging functionality run
|
disable the most expensive debugging functionality run
|
||||||
"ln -s 'abort:false,junk:false' /etc/malloc.conf".)
|
"ln -s 'abort:false,junk:false' /etc/malloc.conf".)
|
||||||
|
|
||||||
|
20181006:
|
||||||
|
The legacy DRM modules and drivers have now been added to the loader's
|
||||||
|
module blacklist, in favor of loading them with kld_list in rc.conf(5).
|
||||||
|
The module blacklist may be overridden with the loader.conf(5)
|
||||||
|
'module_blacklist' variable, but loading them via rc.conf(5) is strongly
|
||||||
|
encouraged.
|
||||||
|
|
||||||
20181002:
|
20181002:
|
||||||
The cam(4) based nda(4) driver will be used over nvd(4) by default on
|
The cam(4) based nda(4) driver will be used over nvd(4) by default on
|
||||||
powerpc64. You may set 'options NVME_USE_NVD=1' in your kernel conf or
|
powerpc64. You may set 'options NVME_USE_NVD=1' in your kernel conf or
|
||||||
|
@ -97,6 +97,7 @@ efi_max_resolution="1x1" # Set the max resolution for EFI loader to use:
|
|||||||
#console="vidconsole" # A comma separated list of console(s)
|
#console="vidconsole" # A comma separated list of console(s)
|
||||||
#currdev="disk1s1a" # Set the current device
|
#currdev="disk1s1a" # Set the current device
|
||||||
module_path="/boot/modules;/boot/dtb;/boot/dtb/overlays" # Set the module search path
|
module_path="/boot/modules;/boot/dtb;/boot/dtb/overlays" # Set the module search path
|
||||||
|
module_blacklist="drm drm2 radeonkms i915kms amdgpu" # Loader module blacklist
|
||||||
#prompt="\\${interpret}" # Set the command prompt
|
#prompt="\\${interpret}" # Set the command prompt
|
||||||
#root_disk_unit="0" # Force the root disk unit number
|
#root_disk_unit="0" # Force the root disk unit number
|
||||||
#rootdev="disk1s1a" # Set the root filesystem
|
#rootdev="disk1s1a" # Set the root filesystem
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
.\" SUCH DAMAGE.
|
.\" SUCH DAMAGE.
|
||||||
.\"
|
.\"
|
||||||
.\" $FreeBSD$
|
.\" $FreeBSD$
|
||||||
.Dd August 28, 2018
|
.Dd October 6, 2018
|
||||||
.Dt LOADER.CONF 5
|
.Dt LOADER.CONF 5
|
||||||
.Os
|
.Os
|
||||||
.Sh NAME
|
.Sh NAME
|
||||||
@ -147,6 +147,15 @@ If a password is set, the user must provide specified password to boot.
|
|||||||
If set to
|
If set to
|
||||||
.Dq YES ,
|
.Dq YES ,
|
||||||
module names will be displayed as they are loaded.
|
module names will be displayed as they are loaded.
|
||||||
|
.It Ar module_blacklist
|
||||||
|
Blacklist of modules.
|
||||||
|
Modules specified in the blacklist may not be loaded automatically with a
|
||||||
|
.Ar *_load
|
||||||
|
directive, but they may be loaded directly at the
|
||||||
|
.Xr loader 8
|
||||||
|
prompt.
|
||||||
|
Blacklisted modules may still be loaded indirectly as dependencies of other
|
||||||
|
moduled.
|
||||||
.It Ar *_load
|
.It Ar *_load
|
||||||
If set to
|
If set to
|
||||||
.Dq YES ,
|
.Dq YES ,
|
||||||
|
@ -54,6 +54,7 @@ local MSG_XENKERNFAIL = "Failed to load Xen kernel '%s'"
|
|||||||
local MSG_XENKERNLOADING = "Loading Xen kernel..."
|
local MSG_XENKERNLOADING = "Loading Xen kernel..."
|
||||||
local MSG_KERNLOADING = "Loading kernel..."
|
local MSG_KERNLOADING = "Loading kernel..."
|
||||||
local MSG_MODLOADING = "Loading configured modules..."
|
local MSG_MODLOADING = "Loading configured modules..."
|
||||||
|
local MSG_MODBLACKLIST = "Not loading blacklisted module '%s'"
|
||||||
local MSG_MODLOADFAIL = "Could not load one or more modules!"
|
local MSG_MODLOADFAIL = "Could not load one or more modules!"
|
||||||
|
|
||||||
local MODULEEXPR = '([%w-_]+)'
|
local MODULEEXPR = '([%w-_]+)'
|
||||||
@ -265,20 +266,37 @@ local function isValidComment(line)
|
|||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local function getBlacklist()
|
||||||
|
local blacklist_str = loader.getenv('module_blacklist')
|
||||||
|
if blacklist_str == nil then
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
|
||||||
|
local blacklist = {}
|
||||||
|
for mod in blacklist_str:gmatch("[;, ]?([%w-_]+)[;, ]?") do
|
||||||
|
blacklist[mod] = true
|
||||||
|
end
|
||||||
|
return blacklist
|
||||||
|
end
|
||||||
|
|
||||||
local function loadModule(mod, silent)
|
local function loadModule(mod, silent)
|
||||||
local status = true
|
local status = true
|
||||||
|
local blacklist = getBlacklist()
|
||||||
local pstatus
|
local pstatus
|
||||||
for k, v in pairs(mod) do
|
for k, v in pairs(mod) do
|
||||||
if v.load ~= nil and v.load:lower() == "yes" then
|
if v.load ~= nil and v.load:lower() == "yes" then
|
||||||
|
local module_name = v.name or k
|
||||||
|
if blacklist[module_name] ~= nil then
|
||||||
|
if not silent then
|
||||||
|
print(MSG_MODBLACKLIST:format(module_name))
|
||||||
|
end
|
||||||
|
goto continue
|
||||||
|
end
|
||||||
local str = "load "
|
local str = "load "
|
||||||
if v.type ~= nil then
|
if v.type ~= nil then
|
||||||
str = str .. "-t " .. v.type .. " "
|
str = str .. "-t " .. v.type .. " "
|
||||||
end
|
end
|
||||||
if v.name ~= nil then
|
str = str .. module_name
|
||||||
str = str .. v.name
|
|
||||||
else
|
|
||||||
str = str .. k
|
|
||||||
end
|
|
||||||
if v.flags ~= nil then
|
if v.flags ~= nil then
|
||||||
str = str .. " " .. v.flags
|
str = str .. " " .. v.flags
|
||||||
end
|
end
|
||||||
@ -309,6 +327,7 @@ local function loadModule(mod, silent)
|
|||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
::continue::
|
||||||
end
|
end
|
||||||
|
|
||||||
return status
|
return status
|
||||||
|
Loading…
Reference in New Issue
Block a user