Changeset View
Changeset View
Standalone View
Standalone View
stand/lua/loader.lua
Show All 32 Lines | |||||
-- defines are necessary for the Lua-based loader to operate in general. | -- defines are necessary for the Lua-based loader to operate in general. | ||||
-- Other modules will also need some of the functions it defines to safely | -- Other modules will also need some of the functions it defines to safely | ||||
-- execute loader commands. | -- execute loader commands. | ||||
require("cli") | require("cli") | ||||
local color = require("color") | local color = require("color") | ||||
local core = require("core") | local core = require("core") | ||||
local config = require("config") | local config = require("config") | ||||
local password = require("password") | local password = require("password") | ||||
-- The menu module will be brought in after config has loaded if we actually | |||||
-- need it. | |||||
local menu | |||||
try_include("local") | try_include("local") | ||||
config.load() | config.load() | ||||
-- Our console may have been setup for a different color scheme before we get | |||||
-- here, so make sure we set the default. | |||||
if color.isEnabled() then | |||||
printc(color.default()) | |||||
end | |||||
if not core.isMenuSkipped() then | |||||
menu = require("menu") | |||||
end | |||||
if core.isUEFIBoot() then | if core.isUEFIBoot() then | ||||
loader.perform("efi-autoresizecons") | loader.perform("efi-autoresizecons") | ||||
end | end | ||||
-- Our console may have been setup with different settings before we get | |||||
-- here, so make sure we reset everything back to default. | |||||
if color.isEnabled() then | |||||
imp: Why only reset of if color is enabled if the goal is to also reset scrolling regions?
| |||||
Not Done Inline ActionsTo not bother people who don't want to see ANSI escape sequences. Making the set of loader options even more complicated seemed less user friendly. freqlabs: To not bother people who don't want to see ANSI escape sequences. Making the set of loader… | |||||
printc(core.KEYSTR_RESET) | |||||
end | |||||
password.check() | password.check() | ||||
-- menu might be disabled | if not core.isMenuSkipped() then | ||||
Done Inline ActionsI'd consider going a step further and eliminating the single-use 'menu' local and instead just invoking require("menu").run(). I really don't recall why I split this up... trolling through the history doesn't explain much. kevans: I'd consider going a step further and eliminating the single-use 'menu' local and instead just… | |||||
if menu ~= nil then | require("menu").run() | ||||
menu.run() | |||||
else | else | ||||
-- Load kernel/modules before we go | -- Load kernel/modules before we go | ||||
config.loadelf() | config.loadelf() | ||||
end | end |
Why only reset of if color is enabled if the goal is to also reset scrolling regions?