diff options
author | Ben Wiederhake <BenWiederhake.GitHub@gmx.de> | 2021-10-23 18:26:50 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-10-25 23:38:28 +0200 |
commit | 8d13f6ddce54deca5ed9bff9af2a4d31bb290121 (patch) | |
tree | ee400910bcbe04621c5bf561a0933536bfefd48f /Kernel/CommandLine.cpp | |
parent | 09432a82412357421b2a1247001e4c919e954777 (diff) | |
download | serenity-8d13f6ddce54deca5ed9bff9af2a4d31bb290121.zip |
Kernel+SystemServer: Change bootmode to system_mode
'bootmode' now only controls which set of services are started by
SystemServer, so it is more appropriate to rename it to system_mode, and
no longer validate it in the Kernel.
Diffstat (limited to 'Kernel/CommandLine.cpp')
-rw-r--r-- | Kernel/CommandLine.cpp | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/Kernel/CommandLine.cpp b/Kernel/CommandLine.cpp index e35bd9b815..7741367f4a 100644 --- a/Kernel/CommandLine.cpp +++ b/Kernel/CommandLine.cpp @@ -39,8 +39,13 @@ UNMAP_AFTER_INIT void CommandLine::initialize() s_the = new CommandLine(s_cmd_line); dmesgln("Kernel Commandline: {}", kernel_command_line().string()); // Validate the modes the user passed in. - (void)s_the->boot_mode(Validate::Yes); (void)s_the->panic_mode(Validate::Yes); + if (s_the->contains("boot_mode"sv)) { + // I know, we don't do legacy, but even though I eliminated 'boot_mode' from the codebase, there + // is a good chance that someone's still using it. Let's be nice and tell them where to look. + // TODO: Remove this in 2022. + PANIC("'boot_mode' is now split into panic=[halt|shutdown], fbdev=[on|off], and system_mode=[graphical|text|selftest]."); + } } UNMAP_AFTER_INIT void CommandLine::build_commandline(const String& cmdline_from_bootloader) @@ -199,20 +204,9 @@ UNMAP_AFTER_INIT AHCIResetMode CommandLine::ahci_reset_mode() const PANIC("Unknown AHCIResetMode: {}", ahci_reset_mode); } -BootMode CommandLine::boot_mode(Validate should_validate) const +StringView CommandLine::system_mode() const { - const auto boot_mode = lookup("boot_mode"sv).value_or("graphical"sv); - if (boot_mode == "no-fbdev"sv) { - return BootMode::NoFramebufferDevices; - } else if (boot_mode == "self-test"sv) { - return BootMode::SelfTest; - } else if (boot_mode == "graphical"sv) { - return BootMode::Graphical; - } - - if (should_validate == Validate::Yes) - PANIC("Unknown BootMode: {}", boot_mode); - return BootMode::Unknown; + return lookup("system_mode"sv).value_or("graphical"sv); } PanicMode CommandLine::panic_mode(Validate should_validate) const |