lualoader: Don't autodetect kernels if 'kernels' is explicitly set

This commit is contained in:
Kyle Evans 2018-02-21 14:07:53 +00:00
parent 8404ad78db
commit 3f4eb56bde
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=329709

View File

@ -188,7 +188,7 @@ end
function core.kernelList() function core.kernelList()
local k = loader.getenv("kernel") local k = loader.getenv("kernel")
local v = loader.getenv("kernels") or "" local v = loader.getenv("kernels")
local kernels = {} local kernels = {}
local unique = {} local unique = {}
@ -199,12 +199,18 @@ function core.kernelList()
unique[k] = true unique[k] = true
end end
for n in v:gmatch("([^; ]+)[; ]?") do if v ~= nil then
if unique[n] == nil then for n in v:gmatch("([^; ]+)[; ]?") do
i = i + 1 if unique[n] == nil then
kernels[i] = n i = i + 1
unique[n] = true kernels[i] = n
unique[n] = true
end
end end
-- We will not automatically detect kernels to be displayed if
-- loader.conf(5) explicitly set 'kernels'.
return kernels
end end
-- Automatically detect other bootable kernel directories using a -- Automatically detect other bootable kernel directories using a