aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>2020-10-14 01:47:00 +0000
committerWarner Losh <imp@FreeBSD.org>2020-10-14 01:47:00 +0000
commit8e83334bb67d06323f95546a9bad2fdb939659e5 (patch)
tree8cbd28f08ca833d27e59bb0033afb7453868bbc2
parente498e31c0261a68920fc90da01dce419cc1335f8 (diff)
downloadsrc-8e83334bb67d06323f95546a9bad2fdb939659e5.tar.gz
src-8e83334bb67d06323f95546a9bad2fdb939659e5.zip
MFS12: r366422 r366588
r366588: fixes video display heuristic that prevented byhve and vmware from detecting dual consoles. r366422: Report the kernel console on the boot screen Report what console the boot loader is telling the kernel to use and allow toggling between them. Approved by: re@ (gjb)
Notes
Notes: svn path=/releng/12.2/; revision=366691
-rw-r--r--stand/efi/loader/main.c6
-rw-r--r--stand/lua/core.lua34
-rw-r--r--stand/lua/menu.lua11
3 files changed, 49 insertions, 2 deletions
diff --git a/stand/efi/loader/main.c b/stand/efi/loader/main.c
index 763a1d0771d0..a5213a51d88b 100644
--- a/stand/efi/loader/main.c
+++ b/stand/efi/loader/main.c
@@ -717,6 +717,10 @@ parse_uefi_con_out(void)
ep = buf + sz;
node = (EFI_DEVICE_PATH *)buf;
while ((char *)node < ep) {
+ if (IsDevicePathEndType(node)) {
+ if (pci_pending && vid_seen == 0)
+ vid_seen = ++seen;
+ }
pci_pending = false;
if (DevicePathType(node) == ACPI_DEVICE_PATH &&
DevicePathSubType(node) == ACPI_DP) {
@@ -749,8 +753,6 @@ parse_uefi_con_out(void)
}
node = NextDevicePathNode(node); /* Skip the end node */
}
- if (pci_pending && vid_seen == 0)
- vid_seen = ++seen;
/*
* Truth table for RB_MULTIPLE | RB_SERIAL
diff --git a/stand/lua/core.lua b/stand/lua/core.lua
index 448215d97d03..ad9a3e353fd1 100644
--- a/stand/lua/core.lua
+++ b/stand/lua/core.lua
@@ -410,6 +410,40 @@ function core.popFrontTable(tbl)
return first_value, new_tbl
end
+function core.getConsoleName()
+ if loader.getenv("boot_multicons") ~= nil then
+ if loader.getenv("boot_serial") ~= nil then
+ return "Dual (Serial primary)"
+ else
+ return "Dual (Video primary)"
+ end
+ else
+ if loader.getenv("boot_serial") ~= nil then
+ return "Serial"
+ else
+ return "Video"
+ end
+ end
+end
+
+function core.nextConsoleChoice()
+ if loader.getenv("boot_multicons") ~= nil then
+ if loader.getenv("boot_serial") ~= nil then
+ loader.unsetenv("boot_serial")
+ else
+ loader.unsetenv("boot_multicons")
+ loader.setenv("boot_serial", "YES")
+ end
+ else
+ if loader.getenv("boot_serial") ~= nil then
+ loader.unsetenv("boot_serial")
+ else
+ loader.setenv("boot_multicons", "YES")
+ loader.setenv("boot_serial", "YES")
+ end
+ end
+end
+
recordDefaults()
hook.register("config.reloaded", core.clearCachedKernels)
return core
diff --git a/stand/lua/menu.lua b/stand/lua/menu.lua
index 4e5baa9b8343..fda16fda71ff 100644
--- a/stand/lua/menu.lua
+++ b/stand/lua/menu.lua
@@ -241,6 +241,7 @@ menu.welcome = {
boot_entry_2,
menu_entries.prompt,
menu_entries.reboot,
+ menu_entries.console,
{
entry_type = core.MENU_SEPARATOR,
},
@@ -280,6 +281,16 @@ menu.welcome = {
end,
alias = {"s", "S"},
},
+ console = {
+ entry_type = core.MENU_ENTRY,
+ name = function()
+ return color.highlight("C") .. "ons: " .. core.getConsoleName()
+ end,
+ func = function()
+ core.nextConsoleChoice()
+ end,
+ alias = {"c", "C"},
+ },
prompt = {
entry_type = core.MENU_RETURN,
name = color.highlight("Esc") .. "ape to loader prompt",