mirror of
https://github.com/edera-dev/sprout.git
synced 2026-11-04 19:02:20 +00:00
feat(boot): add the bls-strict-mode option
Add --bls-strict-mode and bls-strict-mode in the options of sprout.toml. It does nothing yet; the behaviors it controls follow.
This commit is contained in:
1 parent
bfca43fe07
commit
7e1207097b
3 files changed
+30
No files matched your search
@@ -199,6 +199,13 @@ fn run(reboot_on_error: &mut bool) -> Result<()> {
|
||||
.context("unable to set loader path in bootloader interface"),
|
||||
);
|
||||
|
||||
// Strict mode can be asked for on the command line or in the configuration.
|
||||
let mut options = options;
|
||||
options.bls_strict_mode |= config.options.bls_strict_mode;
|
||||
if options.bls_strict_mode {
|
||||
info!("BLS strict mode is enabled");
|
||||
}
|
||||
|
||||
// Create the root context.
|
||||
let mut root = RootContext::new(loaded_image_path, timer, options);
|
||||
|
||||
|
||||
@@ -29,6 +29,8 @@ pub struct SproutOptions {
|
||||
pub menu_style: Option<MenuStyle>,
|
||||
/// Retains the boot console before boot.
|
||||
pub retain_boot_console: bool,
|
||||
/// Makes Sprout follow the Boot Loader Specification and systemd-boot exactly.
|
||||
pub bls_strict_mode: bool,
|
||||
}
|
||||
|
||||
/// The default Sprout options.
|
||||
@@ -42,6 +44,7 @@ impl Default for SproutOptions {
|
||||
menu_timeout: None,
|
||||
menu_style: None,
|
||||
retain_boot_console: false,
|
||||
bls_strict_mode: false,
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -60,6 +63,7 @@ impl SproutOptions {
|
||||
MenuTimeout,
|
||||
MenuStyle,
|
||||
RetainBootConsole,
|
||||
BlsStrictMode,
|
||||
}
|
||||
|
||||
// All the options for the Sprout executable.
|
||||
@@ -78,6 +82,8 @@ impl SproutOptions {
|
||||
.help_text("Boot menu style, basic, simple or graphical"),
|
||||
Opt::flag(ArgID::RetainBootConsole, &["--retain-boot-console"])
|
||||
.help_text("Retain boot console before boot"),
|
||||
Opt::flag(ArgID::BlsStrictMode, &["--bls-strict-mode"])
|
||||
.help_text("Follow the BLS specification and systemd-boot exactly"),
|
||||
]);
|
||||
|
||||
// Acquire the arguments as determined by the UEFI core.
|
||||
@@ -141,6 +147,10 @@ impl SproutOptions {
|
||||
// Retain the boot console before booting.
|
||||
result.retain_boot_console = true;
|
||||
}
|
||||
ArgID::BlsStrictMode => {
|
||||
// Follow the BLS specification and systemd-boot exactly.
|
||||
result.bls_strict_mode = true;
|
||||
}
|
||||
ArgID::Help => {
|
||||
let ctx = HelpWriterContext {
|
||||
options: &OPTIONS,
|
||||
|
||||
Reference in new issue
Block a user