core.lua (ecdc73429903f59eaa7b467b7c9b2103b99de6c3) core.lua (a7cf056239ff1366cb231f8c6f516b023922bf4e)
1--
2-- Copyright (c) 2015 Pedro Souza <pedrosouza@freebsd.org>
3-- All rights reserved.
4--
5-- Redistribution and use in source and binary forms, with or without
6-- modification, are permitted provided that the following conditions
7-- are met:
8-- 1. Redistributions of source code must retain the above copyright

--- 15 unchanged lines hidden (view full) ---

24-- SUCH DAMAGE.
25--
26-- $FreeBSD$
27--
28
29local core = {};
30
31-- Commonly appearing constants
1--
2-- Copyright (c) 2015 Pedro Souza <pedrosouza@freebsd.org>
3-- All rights reserved.
4--
5-- Redistribution and use in source and binary forms, with or without
6-- modification, are permitted provided that the following conditions
7-- are met:
8-- 1. Redistributions of source code must retain the above copyright

--- 15 unchanged lines hidden (view full) ---

24-- SUCH DAMAGE.
25--
26-- $FreeBSD$
27--
28
29local core = {};
30
31-- Commonly appearing constants
32core.KEY_ENTER = 13;
33core.KEY_BACKSPACE = 127;
32core.KEY_ENTER = 13;
33core.KEY_BACKSPACE = 127;
34
34
35core.KEYSTR_ESCAPE = "\027";
35core.KEYSTR_ESCAPE = "\027";
36
36
37core.MENU_RETURN = "return";
38core.MENU_ENTRY = "entry";
39core.MENU_SEPARATOR = "separator";
40core.MENU_SUBMENU = "submenu";
41core.MENU_CAROUSEL_ENTRY = "carousel_entry";
42
37function core.setVerbose(b)
38 if (b == nil) then
39 b = not core.verbose;
40 end
41
42 if (b == true) then
43 loader.setenv("boot_verbose", "YES");
44 else

--- 69 unchanged lines hidden (view full) ---

114 end
115 core.sm = b;
116end
117
118function core.kernelList()
119 local k = loader.getenv("kernel");
120 local v = loader.getenv("kernels") or "";
121
43function core.setVerbose(b)
44 if (b == nil) then
45 b = not core.verbose;
46 end
47
48 if (b == true) then
49 loader.setenv("boot_verbose", "YES");
50 else

--- 69 unchanged lines hidden (view full) ---

120 end
121 core.sm = b;
122end
123
124function core.kernelList()
125 local k = loader.getenv("kernel");
126 local v = loader.getenv("kernels") or "";
127
128 v = "kernel;kernel.GENERIC"
122 local kernels = {};
123 local i = 0;
124 if k ~= nil then
125 i = i + 1;
126 kernels[i] = k;
127 end
128
129 for n in v:gmatch("([^; ]+)[; ]?") do

--- 46 unchanged lines hidden ---
129 local kernels = {};
130 local i = 0;
131 if k ~= nil then
132 i = i + 1;
133 kernels[i] = k;
134 end
135
136 for n in v:gmatch("([^; ]+)[; ]?") do

--- 46 unchanged lines hidden ---