summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorSamuel Dionne-Riel <samuel@dionne-riel.com>2021-04-20 17:11:21 -0400
committerSamuel Dionne-Riel <samuel@dionne-riel.com>2021-05-01 19:53:14 -0400
commitcb5c4fcd3c5d4070f040d591b2dd1da580f234d1 (patch)
tree789056946e24d554681405516c78f009a074bcb0 /nixos
parent9413da26fd3364d81bb744578f95512a4c2c7863 (diff)
downloadnixpkgs-cb5c4fcd3c5d4070f040d591b2dd1da580f234d1.tar
nixpkgs-cb5c4fcd3c5d4070f040d591b2dd1da580f234d1.tar.gz
nixpkgs-cb5c4fcd3c5d4070f040d591b2dd1da580f234d1.tar.bz2
nixpkgs-cb5c4fcd3c5d4070f040d591b2dd1da580f234d1.tar.lz
nixpkgs-cb5c4fcd3c5d4070f040d591b2dd1da580f234d1.tar.xz
nixpkgs-cb5c4fcd3c5d4070f040d591b2dd1da580f234d1.tar.zst
nixpkgs-cb5c4fcd3c5d4070f040d591b2dd1da580f234d1.zip
iso-image: Hide rEFInd from menu in known non-working situations
Looks like GRUB has issues loading EFI binaries from (cd0), which is
what would be used in e.g. qemu with OVMF with `-cdrom`. Apparently also
what is used with AArch64 + U-Boot USB.
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/installer/cd-dvd/iso-image.nix12
1 files changed, 7 insertions, 5 deletions
diff --git a/nixos/modules/installer/cd-dvd/iso-image.nix b/nixos/modules/installer/cd-dvd/iso-image.nix
index 7dd3bf23933..7a4738599b0 100644
--- a/nixos/modules/installer/cd-dvd/iso-image.nix
+++ b/nixos/modules/installer/cd-dvd/iso-image.nix
@@ -365,11 +365,13 @@ let
     }
 
     ${lib.optionalString (refindBinary != null) ''
-    menuentry 'rEFInd' --class refind {
-      # UUID is hard-coded in the derivation.
-      search --set=root --no-floppy --fs-uuid 1234-5678
-      chainloader (\$root)/EFI/boot/${refindBinary}
-    }
+    # GRUB apparently cannot do "chainloader" operations on "CD".
+    if [ "\$root" != "cd0" ]; then
+      menuentry 'rEFInd' --class refind {
+        # \$root defaults to the drive the EFI is found on.
+        chainloader (\$root)/EFI/boot/${refindBinary}
+      }
+    fi
     ''}
     menuentry 'Firmware Setup' --class settings {
       fwsetup