From 7bd84b66850100c3ffdec3ee9ef7c27a6a57ce41 Mon Sep 17 00:00:00 2001 From: Joerie de Gram Date: Sun, 26 Sep 2021 17:54:36 +0200 Subject: systemd-boot: add 'graceful' configuration option On some systems bootctl cannot write the `LoaderSystemToken` EFI variable during installation, which results in a failure to install the boot loader. Upstream provides a flag (--graceful) to ignore such write failures - this change exposes it as a configuration option. As the exact semantics of this option appear to be somewhat volatile it should be used only if systemd-boot otherwise fails to install. --- .../system/boot/loader/systemd-boot/systemd-boot.nix | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'nixos/modules/system/boot/loader/systemd-boot/systemd-boot.nix') diff --git a/nixos/modules/system/boot/loader/systemd-boot/systemd-boot.nix b/nixos/modules/system/boot/loader/systemd-boot/systemd-boot.nix index ff304f570d3..0f76d7d6b24 100644 --- a/nixos/modules/system/boot/loader/systemd-boot/systemd-boot.nix +++ b/nixos/modules/system/boot/loader/systemd-boot/systemd-boot.nix @@ -24,7 +24,7 @@ let configurationLimit = if cfg.configurationLimit == null then 0 else cfg.configurationLimit; - inherit (cfg) consoleMode; + inherit (cfg) consoleMode graceful; inherit (efi) efiSysMountPoint canTouchEfiVariables; @@ -126,6 +126,22 @@ in { ''; }; }; + + graceful = mkOption { + default = false; + + type = types.bool; + + description = '' + Invoke bootctl install with the --graceful 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 systemd-boot otherwise fails to install, as the + scope or implication of the --graceful option may change in the future. + ''; + }; + }; config = mkIf cfg.enable { -- cgit 1.4.1