Changeset View
Changeset View
Standalone View
Standalone View
stand/lua/password.lua
Show First 20 Lines • Show All 129 Lines • ▼ Show 20 Lines | function password.check() | ||||
if geli_prompt ~= nil and geli_prompt:lower() == "yes" then | if geli_prompt ~= nil and geli_prompt:lower() == "yes" then | ||||
local passphrase = doPrompt("GELI Passphrase:") | local passphrase = doPrompt("GELI Passphrase:") | ||||
loader.setenv("kern.geom.eli.passphrase", passphrase) | loader.setenv("kern.geom.eli.passphrase", passphrase) | ||||
end | end | ||||
local pwd = loader.getenv("password") | local pwd = loader.getenv("password") | ||||
if pwd ~= nil then | if pwd ~= nil then | ||||
core.autoboot() | core.autoboot() | ||||
loader.setenv("autoboot_delay", "NO") | |||||
-- The autoboot sequence was interrupted, so we'll need to | -- The autoboot sequence was interrupted, so we'll need to | ||||
-- prompt for a password. Put the screen back into a known | -- prompt for a password. Put the screen back into a known | ||||
-- good state, otherwise we're drawing back a couple lines | -- good state, otherwise we're drawing back a couple lines | ||||
-- in the middle of other text. | -- in the middle of other text. | ||||
setup_screen() | setup_screen() | ||||
end | end | ||||
compare("Loader password:", pwd) | compare("Loader password:", pwd) | ||||
end | end | ||||
return password | return password |