summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Evans <kevans@FreeBSD.org>2019-09-10 21:30:38 +0000
committerKyle Evans <kevans@FreeBSD.org>2019-09-10 21:30:38 +0000
commit90a2541772932ebb1cf102ef82857c41349760c1 (patch)
treec8621dfd74ffd84f62aca72f1c84790ac1a2d453
parentda327cd22e88f26f6cab9d4c45805b512139aa11 (diff)
Notes
-rw-r--r--stand/lua/core.lua10
-rw-r--r--stand/lua/drawer.lua9
2 files changed, 18 insertions, 1 deletions
diff --git a/stand/lua/core.lua b/stand/lua/core.lua
index 722381e0a066..61476a2ed721 100644
--- a/stand/lua/core.lua
+++ b/stand/lua/core.lua
@@ -325,6 +325,16 @@ function core.isZFSBoot()
return false
end
+function core.isSerialConsole()
+ local c = loader.getenv("console")
+ if c ~= nil then
+ if c:find("comconsole") ~= nil then
+ return true
+ end
+ end
+ return false
+end
+
function core.isSerialBoot()
local s = loader.getenv("boot_serial")
if s ~= nil then
diff --git a/stand/lua/drawer.lua b/stand/lua/drawer.lua
index 18030979398c..6a5b62b79817 100644
--- a/stand/lua/drawer.lua
+++ b/stand/lua/drawer.lua
@@ -144,13 +144,20 @@ local function drawmenu(menudef)
return alias_table
end
+local function defaultframe()
+ if core.isSerialConsole() then
+ return "ascii"
+ end
+ return "double"
+end
+
local function drawbox()
local x = menu_position.x - 3
local y = menu_position.y - 1
local w = frame_size.w
local h = frame_size.h
- local framestyle = loader.getenv("loader_menu_frame") or "double"
+ local framestyle = loader.getenv("loader_menu_frame") or defaultframe()
local framespec = drawer.frame_styles[framestyle]
-- If we don't have a framespec for the current frame style, just don't
-- draw a box.