summary refs log tree commit diff
path: root/nixos/modules/system/boot/loader/grub
diff options
context:
space:
mode:
authorjokogr <ioannis.koutras@gmail.com>2016-09-25 08:37:18 +0300
committerFranz Pletz <fpletz@fnordicwalking.de>2016-09-25 07:37:18 +0200
commitb12debc076ab27aff0bd70c3fa3ced62f8f95d38 (patch)
tree6629e1da2cc3930a66b82e4eab332cc90dbd3cfd /nixos/modules/system/boot/loader/grub
parent60f31c6077ba725cd1d14ed199b12d514391c82b (diff)
downloadnixlib-b12debc076ab27aff0bd70c3fa3ced62f8f95d38.tar
nixlib-b12debc076ab27aff0bd70c3fa3ced62f8f95d38.tar.gz
nixlib-b12debc076ab27aff0bd70c3fa3ced62f8f95d38.tar.bz2
nixlib-b12debc076ab27aff0bd70c3fa3ced62f8f95d38.tar.lz
nixlib-b12debc076ab27aff0bd70c3fa3ced62f8f95d38.tar.xz
nixlib-b12debc076ab27aff0bd70c3fa3ced62f8f95d38.tar.zst
nixlib-b12debc076ab27aff0bd70c3fa3ced62f8f95d38.zip
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
Diffstat (limited to 'nixos/modules/system/boot/loader/grub')
-rw-r--r--nixos/modules/system/boot/loader/grub/grub.nix2
1 files changed, 1 insertions, 1 deletions
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";
         }
         {