mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-03 15:15:01 +00:00
loader: lua: test that /boot exists first
Otherwise on fs like tftp where no directory listing is possible we fail
on the .dir method.
Reviewed by: imp, kevans
MFC after: 2 weeks
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D33414
(cherry picked from commit c4dc907254
)
This commit is contained in:
parent
c95afea4a8
commit
28d2b8b700
|
@ -229,6 +229,13 @@ function core.kernelList()
|
|||
end
|
||||
end
|
||||
|
||||
-- Do not attempt to autodetect if underlying filesystem
|
||||
-- do not support directory listing (e.g. tftp, http)
|
||||
if not lfs.attributes("/boot", "mode") then
|
||||
autodetect = "no"
|
||||
loader.setenv("kernels_autodetect", "NO")
|
||||
end
|
||||
|
||||
-- Base whether we autodetect kernels or not on a loader.conf(5)
|
||||
-- setting, kernels_autodetect. If it's set to 'yes', we'll add
|
||||
-- any kernels we detect based on the criteria described.
|
||||
|
|
Loading…
Reference in a new issue