From b12debc076ab27aff0bd70c3fa3ced62f8f95d38 Mon Sep 17 00:00:00 2001 From: jokogr Date: Sun, 25 Sep 2016 08:37:18 +0300 Subject: grub: Do not check for duplicated devices in mirroredBoots on UEFI (#18625) When Grub is to be used with UEFI, it is not going to write to any MBR of any disk. As such, it is safe to use multiple "nodev" device entries when mirroring the ESP partition to multiple disks. E.g.: ``` boot.loader.grub = { enable = true; version = 2; zfsSupport = true; efiSupport = true; mirroredBoots = [ { devices = [ "nodev" ]; path = "/boot1"; efiSysMountPoint = "/boot1"; } { devices = [ "nodev" ]; path = "/boot2"; efiSysMountPoint = "/boot2"; } { devices = [ "nodev" ]; path = "/boot3"; efiSysMountPoint = "/boot3"; } ]; }; boot.loader.efi.canTouchEfiVariables = true; ``` Fixes #18584 --- nixos/modules/system/boot/loader/grub/grub.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'nixos/modules/system') diff --git a/nixos/modules/system/boot/loader/grub/grub.nix b/nixos/modules/system/boot/loader/grub/grub.nix index e84cdb3212ce..cae045f78c37 100644 --- a/nixos/modules/system/boot/loader/grub/grub.nix +++ b/nixos/modules/system/boot/loader/grub/grub.nix @@ -503,7 +503,7 @@ in + "'boot.loader.grub.mirroredBoots' to make the system bootable."; } { - assertion = all (c: c < 2) (mapAttrsToList (_: c: c) bootDeviceCounters); + assertion = cfg.efiSupport || all (c: c < 2) (mapAttrsToList (_: c: c) bootDeviceCounters); message = "You cannot have duplicated devices in mirroredBoots"; } { -- cgit 1.4.1