Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F149680761
D14419.id39455.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
D14419.id39455.diff
View Options
Index: head/stand/lua/core.lua
===================================================================
--- head/stand/lua/core.lua
+++ head/stand/lua/core.lua
@@ -127,17 +127,47 @@
local v = loader.getenv("kernels") or "";
local kernels = {};
+ local unique = {};
local i = 0;
if (k ~= nil) then
i = i + 1;
kernels[i] = k;
+ unique[k] = true;
end
for n in v:gmatch("([^; ]+)[; ]?") do
- if (n ~= k) then
+ if (unique[n] == nil) then
i = i + 1;
kernels[i] = n;
+ unique[n] = true;
end
+ end
+
+ -- Automatically detect other bootable kernel directories using a
+ -- heuristic. Any directory in /boot that contains an ordinary file
+ -- named "kernel" is considered eligible.
+ for file in lfs.dir("/boot") do
+ local fname = "/boot/" .. file;
+
+ if (file == "." or file == "..") then
+ goto continue;
+ end
+
+ if (lfs.attributes(fname, "mode") ~= "directory") then
+ goto continue;
+ end
+
+ if (lfs.attributes(fname .. "/kernel", "mode") ~= "file") then
+ goto continue;
+ end
+
+ if (unique[file] == nil) then
+ i = i + 1;
+ kernels[i] = file;
+ unique[file] = true;
+ end
+
+ ::continue::
end
return kernels;
end
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Mar 27, 5:37 AM (12 h, 5 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
30411927
Default Alt Text
D14419.id39455.diff (1 KB)
Attached To
Mode
D14419: lua loader: Auto detect eligible list of kernels to boot
Attached
Detach File
Event Timeline
Log In to Comment