20.03 UEFI installation problem vs. instructions

Hi

Following the https://nixos.org/nixos/manual/index.html#sec-installation and the UEFI-steps led to a failure. The nixos-generate-config made a configuration file that contains the following two lines:

  boot.loader.systemd-boot.enable = true;
  boot.loader.efi.canTouchEfiVariables = true;

The nixos-install fails quite similarly to what is described in the issue. It leaves the machine in state that the os does not start.

In the issue thread there is a hint to set canTouchEfiVariables = false and then the installation works.

The current installation instructions don’t mention anything about that canTouchEfiVariables and the example 2.4 that contains very short configuration.nix does not show up canTouchEfiVariables.

As a user, I trusted that the nixos-generate-config does it’s job as it should and I was really confused on how to even find out the cause of the problem and how to fix it.

So, are there any chances to either

  1. change what the nixos-generate-config outputs, or
  2. update the installation instructions?

(Or both.) If having that

  boot.loader.efi.canTouchEfiVariables = true;

on by default is better than removing or commenting it, there might could be a comment line for the user stating that # In case of efi-related installation failure, try commenting the following line and re-running nixos-install. or something similar.

And also the installation instructions could might have something about this. The problem of course is that listing different kinds of problem cases can be vast and many and why choose to describe this and that and leaving out some other problem cases. Anyhow, installation problems are something that one sees in the very beginning and can leave a bit shaky experience.

Reading the issues it seems to be that NixOS fails to install · Issue #34508 · NixOS/nixpkgs · GitHub might be the issue.

I’m not sure how it works on other laptops/computers, but on mine, when I had a few hundred /sys/firmware/efi/efivars/dump-*, it was painfully obvious, with 5-10 minutes of POST time during boot.

1 Like

Which device were you trying to install on? This sounds like some kind of UEFI bug.

I haven’t looked at the implementation, but I assume canTouchEfiVariables enables writing to EFI variables. This is generally desirable, because without it, the boot order cannot be changed and a proper UEFI boot entry cannot be added. Without this, booting only works though the well known path efi/bootx64.efi on the EFI system partition.

A comment explaining all of this and saying something like “if your device has buggy firmware, try turning off this setting” might not be a bad idea, because we can’t really do anything about what vendors put on devices.

Yep, it’s a buggy UEFI that doesn’t support canTouchEfiVariables = true. Almost all hardware supports this properly.

I tried to add the canTouchEfiVariables = true afterwards (as told in the issue thread) and it looks to be working (at least it rebooted).

My mobo is a bit older: https://www.asus.com/Motherboards/X99DELUXE/ so maybe it has some problems - or maybe it is just time for me to update the bios?