Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F102718096
D42967.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D42967.diff
View Options
diff --git a/stand/lua/core.lua b/stand/lua/core.lua
--- a/stand/lua/core.lua
+++ b/stand/lua/core.lua
@@ -201,17 +201,18 @@
return core.cached_kernels
end
- local k = loader.getenv("kernel")
+ local default_kernel = loader.getenv("kernel")
local v = loader.getenv("kernels")
local autodetect = loader.getenv("kernels_autodetect") or ""
local kernels = {}
local unique = {}
local i = 0
- if k ~= nil then
+
+ if default_kernel then
i = i + 1
- kernels[i] = k
- unique[k] = true
+ kernels[i] = default_kernel
+ unique[default_kernel] = true
end
if v ~= nil then
@@ -239,6 +240,8 @@
return core.cached_kernels
end
+ local present = {}
+
-- Automatically detect other bootable kernel directories using a
-- heuristic. Any directory in /boot that contains an ordinary file
-- named "kernel" is considered eligible.
@@ -267,8 +270,25 @@
unique[file] = true
end
+ present[file] = true
+
::continue::
end
+
+ -- If we found more than one kernel, prune the "kernel" specified kernel
+ -- off of the list if it wasn't found during traversal. If we didn't
+ -- actually find any kernels, we just assume that they know what they're
+ -- doing and leave it alone.
+ if default_kernel and not present[default_kernel] and #kernels > 1 then
+ for i = 1, #kernels do
+ if i == #kernels then
+ kernels[i] = nil
+ else
+ kernels[i] = kernels[i + 1]
+ end
+ end
+ end
+
core.cached_kernels = kernels
return core.cached_kernels
end
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 17, 7:30 AM (20 h, 40 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14672555
Default Alt Text
D42967.diff (1 KB)
Attached To
Mode
D42967: loader: lua: remove the default kernel if it doesn't exist
Attached
Detach File
Event Timeline
Log In to Comment