Lines Matching refs:params
29 local function scan (params)
30 local sep = string.sub (params.dir, -1) == "/" and "" or "/"
31 if not params.items then params.items = {} end
32 for name in lfs.dir (params.dir) do
33 local path = params.dir .. sep .. name
37 local initrd = params.dir .. sep .. "initrd.img-" .. version
42 table.insert (params.items, {
45 … execute = function () sl.boot_linux (path, initrd_param .. params.append .. modifiers ()) end
95 local function draw (params)
96 print_or_call (params.title, "\n=== Boot menu ===")
97 for i, item in ipairs (params.items) do
98 print ((i == params.default and " > " or " ") .. i .. " " .. item.show ())
100 print ("\nKernel arguments:\n " .. params.append .. modifiers ())
104 local function choose (params)
105 draw (params)
106 print ("\nBooting in " .. params.timeout .. " s...")
108 local i = sl.get_key (params.timeout * 1000)
113 i = params.default
115 params.default = params.default < #params.items and params.default + 1 or #params.items
117 params.default = params.default > 1 and params.default - 1 or 1
121 if params.items[i] then
122 params.items[i].execute ()
124 params.timeout = 0
125 draw (params)
130 local function run (params)
131 scan (params)
132 if not next (params.items) then
133 print ("No kernels found in directory " .. params.dir)
136 table.sort (params.items, kernel_gt)
137 table.insert (params.items, {
141 table.insert (params.items, {
145 choose (params)