aboutsummaryrefslogtreecommitdiff
path: root/stand
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>2024-02-02 19:01:56 +0000
committerWarner Losh <imp@FreeBSD.org>2024-02-02 19:04:57 +0000
commit5fdf01dbeef1f64f8c446561498d662702451ac1 (patch)
treedbc39f42c1538bf87c208db3f09df5914655199a /stand
parent30f8cb812e27d8ab40a2c0669ac20a8ee45a7c56 (diff)
downloadsrc-5fdf01dbeef1f64f8c446561498d662702451ac1.tar.gz
src-5fdf01dbeef1f64f8c446561498d662702451ac1.zip
Revert "stand/lua: always allow overriding with local config files"
This reverts commit d3d0b735571d9562812ce5b343a6e91f7a795dbe. no mail sent out, and the commit message was wrong. Sponsored by: Netflix
Diffstat (limited to 'stand')
-rw-r--r--stand/defaults/loader.conf3
-rw-r--r--stand/defaults/loader.conf.532
-rw-r--r--stand/lua/config.lua15
-rw-r--r--stand/lua/config.lua.88
4 files changed, 10 insertions, 48 deletions
diff --git a/stand/defaults/loader.conf b/stand/defaults/loader.conf
index a5d27b96b6ba..e0062bbc8149 100644
--- a/stand/defaults/loader.conf
+++ b/stand/defaults/loader.conf
@@ -13,9 +13,8 @@ exec="echo Loading /boot/defaults/loader.conf"
kernel="kernel" # /boot sub-directory containing kernel and modules
bootfile="kernel" # Kernel name (possibly absolute path)
kernel_options="" # Flags to be passed to the kernel
-loader_conf_files="/boot/device.hints /boot/loader.conf"
+loader_conf_files="/boot/device.hints /boot/loader.conf /boot/loader.conf.local"
loader_conf_dirs="/boot/loader.conf.d"
-local_loader_conf_files="/boot/loader.conf.local"
nextboot_conf="/boot/nextboot.conf"
verbose_loading="NO" # Set to YES for verbose loader output
diff --git a/stand/defaults/loader.conf.5 b/stand/defaults/loader.conf.5
index e38ad865c288..0d82a3dac9b3 100644
--- a/stand/defaults/loader.conf.5
+++ b/stand/defaults/loader.conf.5
@@ -131,10 +131,6 @@ Space separated list of directories to process for configuration files.
The lua-based loader will process files with a
.Dq .conf
suffix that are placed in these directories.
-Files found here are processed after the ones listed in
-.Va loader_conf_files
-but before the ones found in
-.Va local_loader_conf_files .
.It Ar loader_conf_files
Defines additional configuration files to be processed right after the
present file.
@@ -142,13 +138,6 @@ present file.
should be treated as write-only.
One cannot depend on any value remaining in the loader environment or carried
over into the kernel environment.
-.It Ar local_loader_conf_files
-Space separated list of additional configuration files to be processed at last,
-i.e., after
-.Va loader_conf_files
-and
-.Va loader_conf_dirs
-are processed.
.It Ar product_vars
When set, must be a space separated list of environment variable names to walk
through to guess product information.
@@ -285,14 +274,6 @@ default settings can be ignored.
The few of them which are important
or useful are:
.Bl -tag -width bootfile -offset indent
-.It Va local_loader_conf_files
-.Pq Dq /boot/loader.conf.local
-Ensure
-.Va loader.conf.local
-can always be used to override settings from files found in
-.Va loader_conf_files
-and
-.Va loader_conf_dirs .
.It Va bitmap_load
.Pq Dq NO
If set to
@@ -474,18 +455,13 @@ It is not available in the default Forth-based loader.
.Sh FILES
.Bl -tag -width /boot/defaults/loader.conf -compact
.It Pa /boot/defaults/loader.conf
-Default settings \(em do not change this file.
+default settings \(em do not change this file.
.It Pa /boot/loader.conf
-User defined settings.
+user defined settings.
.It Pa /boot/loader.conf.lua
-User defined settings written in lua.
-.It Pa /boot/loader.conf.d/*.conf
-User defined settings split in separate files.
-.It Pa /boot/loader.conf.d/*.lua
-User defined settings written in lua and split in separate files.
+user defined settings written in lua.
.It Pa /boot/loader.conf.local
-Machine-specific settings for sites with a common loader.conf. Allow to override
-settings defined in other files.
+machine-specific settings for sites with a common loader.conf.
.El
.Sh SEE ALSO
.Xr kenv 1 ,
diff --git a/stand/lua/config.lua b/stand/lua/config.lua
index 86f5ef6174a2..210bb9338783 100644
--- a/stand/lua/config.lua
+++ b/stand/lua/config.lua
@@ -630,7 +630,8 @@ function config.readConf(file, loaded_files)
return
end
- local top_level = next(loaded_files) == nil -- Are we the top-level readConf?
+ -- We'll process loader_conf_dirs at the top-level readConf
+ local load_conf_dirs = next(loaded_files) == nil
print("Loading " .. file)
-- The final value of loader_conf_files is not important, so just
@@ -655,7 +656,7 @@ function config.readConf(file, loaded_files)
end
end
- if top_level then
+ if load_conf_dirs then
local loader_conf_dirs = getEnv("loader_conf_dirs")
-- If product_vars is set, it must be a list of environment variable names
@@ -681,7 +682,6 @@ function config.readConf(file, loaded_files)
end
end
- -- Process "loader_conf_dirs" extra-directories
if loader_conf_dirs ~= nil then
for name in loader_conf_dirs:gmatch("[%w%p]+") do
if lfs.attributes(name, "mode") ~= "directory" then
@@ -700,15 +700,6 @@ function config.readConf(file, loaded_files)
::nextdir::
end
end
-
- -- Always allow overriding with local config files, e.g.,
- -- /boot/loader.conf.local.
- local local_loader_conf_files = getEnv("local_loader_conf_files")
- if local_loader_conf_files then
- for name in local_loader_conf_files:gmatch("[%w%p]+") do
- config.readConf(name, loaded_files)
- end
- end
end
end
diff --git a/stand/lua/config.lua.8 b/stand/lua/config.lua.8
index b2b1122285eb..f9896f2aa420 100644
--- a/stand/lua/config.lua.8
+++ b/stand/lua/config.lua.8
@@ -64,13 +64,9 @@ as a configuration file
.Po e.g., as
.Pa loader.conf
.Pc
-and then process files listed in the
+and then processing files listed in
.Ev loader_conf_files
-variable. Additionnaly, the top-level call to readConf will process files listed in the
-.Ev loader_conf_dirs
-and
-.Ev local_loader_conf_files
-variables
+variable
.Po see
.Xr loader.conf 5
.Pc .