From 53580d514a9fc64b3a641a2b74e34dd7dffce3cd Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Sun, 18 Mar 2012 18:55:47 +0000 Subject: [PATCH] You cant modprobe efivars from within the chroot, so modprobe efivars when booting an efi-compatible install CD svn path=/nixos/trunk/; revision=33241 --- modules/installer/cd-dvd/iso-image.nix | 2 ++ modules/installer/efi-boot-stub/efi-boot-stub-builder.sh | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) 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