From 9413da26fd3364d81bb744578f95512a4c2c7863 Mon Sep 17 00:00:00 2001 From: Samuel Dionne-Riel Date: Tue, 20 Apr 2021 17:03:15 -0400 Subject: iso-image: Provide the right rEFInd binary --- nixos/modules/installer/cd-dvd/iso-image.nix | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'nixos/modules/installer') diff --git a/nixos/modules/installer/cd-dvd/iso-image.nix b/nixos/modules/installer/cd-dvd/iso-image.nix index b876e83e237..7dd3bf23933 100644 --- a/nixos/modules/installer/cd-dvd/iso-image.nix +++ b/nixos/modules/installer/cd-dvd/iso-image.nix @@ -162,12 +162,14 @@ let isolinuxCfg = concatStringsSep "\n" ([ baseIsolinuxCfg ] ++ optional config.boot.loader.grub.memtest86.enable isolinuxMemtest86Entry); + refindBinary = if targetArch == "x64" || targetArch == "aa64" then "refind_${targetArch}.efi" else null; + # Setup instructions for rEFInd. refind = - if targetArch == "x64" then + if refindBinary != null then '' # Adds rEFInd to the ISO. - cp -v ${pkgs.refind}/share/refind/refind_x64.efi $out/EFI/boot/ + cp -v ${pkgs.refind}/share/refind/${refindBinary} $out/EFI/boot/ '' else "# No refind for ${targetArch}" @@ -362,11 +364,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/refind_x64.efi + chainloader (\$root)/EFI/boot/${refindBinary} } + ''} menuentry 'Firmware Setup' --class settings { fwsetup clear -- cgit 1.4.1