Merge pull request #140278 from ius/systemd-boot
systemd-boot: add 'graceful' configuration option
This commit is contained in:
commit
3dbcbd1bcd
|
@ -208,10 +208,15 @@ def main() -> None:
|
||||||
if os.path.exists("@efiSysMountPoint@/loader/loader.conf"):
|
if os.path.exists("@efiSysMountPoint@/loader/loader.conf"):
|
||||||
os.unlink("@efiSysMountPoint@/loader/loader.conf")
|
os.unlink("@efiSysMountPoint@/loader/loader.conf")
|
||||||
|
|
||||||
if "@canTouchEfiVariables@" == "1":
|
flags = []
|
||||||
subprocess.check_call(["@systemd@/bin/bootctl", "--path=@efiSysMountPoint@", "install"])
|
|
||||||
else:
|
if "@canTouchEfiVariables@" != "1":
|
||||||
subprocess.check_call(["@systemd@/bin/bootctl", "--path=@efiSysMountPoint@", "--no-variables", "install"])
|
flags.append("--no-variables")
|
||||||
|
|
||||||
|
if "@graceful@" == "1":
|
||||||
|
flags.append("--graceful")
|
||||||
|
|
||||||
|
subprocess.check_call(["@systemd@/bin/bootctl", "--path=@efiSysMountPoint@"] + flags + ["install"])
|
||||||
else:
|
else:
|
||||||
# Update bootloader to latest if needed
|
# Update bootloader to latest if needed
|
||||||
systemd_version = subprocess.check_output(["@systemd@/bin/bootctl", "--version"], universal_newlines=True).split()[1]
|
systemd_version = subprocess.check_output(["@systemd@/bin/bootctl", "--version"], universal_newlines=True).split()[1]
|
||||||
|
|
|
@ -24,7 +24,7 @@ let
|
||||||
|
|
||||||
configurationLimit = if cfg.configurationLimit == null then 0 else cfg.configurationLimit;
|
configurationLimit = if cfg.configurationLimit == null then 0 else cfg.configurationLimit;
|
||||||
|
|
||||||
inherit (cfg) consoleMode;
|
inherit (cfg) consoleMode graceful;
|
||||||
|
|
||||||
inherit (efi) efiSysMountPoint canTouchEfiVariables;
|
inherit (efi) efiSysMountPoint canTouchEfiVariables;
|
||||||
|
|
||||||
|
@ -126,6 +126,22 @@ in {
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
graceful = mkOption {
|
||||||
|
default = false;
|
||||||
|
|
||||||
|
type = types.bool;
|
||||||
|
|
||||||
|
description = ''
|
||||||
|
Invoke <literal>bootctl install</literal> with the <literal>--graceful</literal> option,
|
||||||
|
which ignores errors when EFI variables cannot be written or when the EFI System Partition
|
||||||
|
cannot be found. Currently only applies to random seed operations.
|
||||||
|
|
||||||
|
Only enable this option if <literal>systemd-boot</literal> otherwise fails to install, as the
|
||||||
|
scope or implication of the <literal>--graceful</literal> option may change in the future.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user