diff --git a/modules/installer/cd-dvd/iso-image.nix b/modules/installer/cd-dvd/iso-image.nix index d775c855ad63..76b4803ccec0 100644 --- a/modules/installer/cd-dvd/iso-image.nix +++ b/modules/installer/cd-dvd/iso-image.nix @@ -196,6 +196,8 @@ in boot.initrd.kernelModules = [ "loop" ]; + boot.kernelModules = pkgs.stdenv.lib.optional config.isoImage.makeEfiBootable "efivars": + # In stage 1, mount a tmpfs on top of / (the ISO image) and # /nix/store (the squashfs image) to make this a live CD. boot.initrd.postMountCommands = diff --git a/modules/installer/efi-boot-stub/efi-boot-stub-builder.sh b/modules/installer/efi-boot-stub/efi-boot-stub-builder.sh index 9df4cb1fe59e..26b2f48fd265 100644 --- a/modules/installer/efi-boot-stub/efi-boot-stub-builder.sh +++ b/modules/installer/efi-boot-stub/efi-boot-stub-builder.sh @@ -93,7 +93,7 @@ mkdir -p "@efiSysMountPoint@/efi/nixos/" # Remove all old boot manager entries if test -n "@runEfibootmgr@"; then set +e - modprobe efivars + modprobe efivars > /dev/null 2>&1 for bootnum in $(efibootmgr | grep "NixOS" | grep "Generation" | sed 's/Boot//' | sed 's/\*.*//'); do efibootmgr -B -b "$bootnum" > /dev/null 2>&1 done