diff options
author | enc0urage <127197575+enc0urage@users.noreply.github.com> | 2023-04-18 08:38:36 +0000 |
---|---|---|
committer | enc0urage <127197575+enc0urage@users.noreply.github.com> | 2023-08-13 12:04:34 +0000 |
commit | 1488a2bc1a15f4f7fd6e2a756f1e1f104036fcf7 (patch) | |
tree | 420bf6d32c15903cd103c89458654334848021c9 | |
parent | f0451844bbdf545f696f029d1448de4906c7f753 (diff) |
nixos/grub: Replace proprietary memtest86 with free memtest86+ in UEFI mode
-rw-r--r-- | nixos/modules/system/boot/loader/grub/memtest.nix | 49 |
1 files changed, 11 insertions, 38 deletions
diff --git a/nixos/modules/system/boot/loader/grub/memtest.nix b/nixos/modules/system/boot/loader/grub/memtest.nix index ee969e9bff5bf..8e68431ac571a 100644 --- a/nixos/modules/system/boot/loader/grub/memtest.nix +++ b/nixos/modules/system/boot/loader/grub/memtest.nix @@ -1,12 +1,10 @@ -# This module adds Memtest86+/Memtest86 to the GRUB boot menu. - +# This module adds Memtest86+ to the GRUB boot menu. { config, lib, pkgs, ... }: with lib; let memtest86 = pkgs.memtest86plus; - efiSupport = config.boot.loader.grub.efiSupport; cfg = config.boot.loader.grub.memtest86; in @@ -19,11 +17,8 @@ in default = false; type = types.bool; description = lib.mdDoc '' - Make Memtest86+ (or MemTest86 if EFI support is enabled), - a memory testing program, available from the - GRUB boot menu. MemTest86 is an unfree program, so - this requires `allowUnfree` to be set to - `true`. + Make Memtest86+, a memory testing program, available from the GRUB + boot menu. ''; }; @@ -63,34 +58,12 @@ in }; }; - config = mkMerge [ - (mkIf (cfg.enable && efiSupport) { - assertions = [ - { - assertion = cfg.params == []; - message = "Parameters are not available for MemTest86"; - } - ]; - - boot.loader.grub.extraFiles = { - "memtest86.efi" = "${pkgs.memtest86-efi}/BOOTX64.efi"; - }; - - boot.loader.grub.extraEntries = '' - menuentry "Memtest86" { - chainloader /memtest86.efi - } - ''; - }) - - (mkIf (cfg.enable && !efiSupport) { - boot.loader.grub.extraEntries = '' - menuentry "Memtest86+" { - linux16 @bootRoot@/memtest.bin ${toString cfg.params} - } - ''; - - boot.loader.grub.extraFiles."memtest.bin" = "${memtest86}/memtest.bin"; - }) - ]; + config = mkIf cfg.enable { + boot.loader.grub.extraEntries = '' + menuentry "Memtest86+" { + linux @bootRoot@/memtest.bin ${toString cfg.params} + } + ''; + boot.loader.grub.extraFiles."memtest.bin" = "${memtest86}/memtest.bin"; + }; } |