diff options
author | Warner Losh <imp@FreeBSD.org> | 2020-09-28 16:19:21 +0000 |
---|---|---|
committer | Warner Losh <imp@FreeBSD.org> | 2020-09-28 16:19:21 +0000 |
commit | 8f3b36103b20049e207e64039ad3e99ffb5b51e2 (patch) | |
tree | 98f0cf839c0f4816fb21accd68829b6c22b4b3df /stand/lua/core.lua | |
parent | fbc6840baeb0607c6d4542f298d0a8f7135b3c21 (diff) | |
download | src-8f3b36103b20049e207e64039ad3e99ffb5b51e2.tar.gz src-8f3b36103b20049e207e64039ad3e99ffb5b51e2.zip |
Report the kernel console on the boot screen
Report what console the boot loader is telling the kernel to use:
o Dual (Serial Primary)
o Dual (Video Primary)
o Serial
o Video
This allows the user to interrupt the boot and tweak the cosnole, if
needed, in a trivial way. Useful for installs where the default
selected may not be quite what you want, or when you are running a
dual setup and need to toggle over to the other console being primary.
The 'c'/'C' keys will do the cycling through the consoles. Note:
you'll still have to drop into the loader to set details about serial
consoles. And this doesn't change the console the loader is using.
Reviewed by: kevans@
MFC After: 3 days
Differential Revision: https://reviews.freebsd.org/D26573
Notes
Notes:
svn path=/head/; revision=366228
Diffstat (limited to 'stand/lua/core.lua')
-rw-r--r-- | stand/lua/core.lua | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/stand/lua/core.lua b/stand/lua/core.lua index c56443e98733..1bb2efb75446 100644 --- a/stand/lua/core.lua +++ b/stand/lua/core.lua @@ -451,6 +451,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 |