Index: stand/lua/core.lua =================================================================== --- stand/lua/core.lua +++ stand/lua/core.lua @@ -240,32 +240,34 @@ -- 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, ftype in lfs.dir("/boot") do - local fname = "/boot/" .. file + if lfs.attributes("/boot", "mode") ~= nil then + for file, ftype in lfs.dir("/boot") do + local fname = "/boot/" .. file - if file == "." or file == ".." then - goto continue - end + if file == "." or file == ".." then + goto continue + end - if ftype then - if ftype ~= lfs.DT_DIR then + if ftype then + if ftype ~= lfs.DT_DIR then + goto continue + end + elseif lfs.attributes(fname, "mode") ~= "directory" then goto continue end - elseif lfs.attributes(fname, "mode") ~= "directory" then - goto continue - end - if lfs.attributes(fname .. "/kernel", "mode") ~= "file" 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 + if unique[file] == nil then + i = i + 1 + kernels[i] = file + unique[file] = true + end - ::continue:: + ::continue:: + end end core.cached_kernels = kernels return core.cached_kernels