System won't boot path EFI stub

All of a sudden my computer doesn’t boot up successfully anymore. After selecting the NixOS generation in the boot loader menu, I get

EFI stub: Loaded initrd from LINUX_EFI_INITRD_MEDIA_GUID device path
EFI stub: Measured initrd data into PCR 9

Nothing seems to happen afterwards. This also happens for older NixOS generations that worked previously. I recently tried to set up LUKS decryption via key file which did not work. But that should only be able to break one generation and doesn’t explain why older generations suddenly stop working.

When you stop getting any output after those lines, it pretty much always means one of two things.

  1. An extremely early kernel panic. Like super early, before it’s even managed to setup a console. Sometimes you can use the earlycon= kernel param to get some output this early. But this is very unlikely to be your problem.
  2. The much more likely possibility is that you just need to use the correct console= kernel param. The system is probably booting as expected, but just not showing it on the screen

What kind of hardware are you using?

1 Like

I’m using a Gigabyte X670 Gaming X AX with a Ryzen 7 7700. I just assembled this system and noticed that it doesn’t work too well overall, quite often nothing happens after switching it on (no Bios, the screen doesn’t even get a signal). Not sure if that’s related

What I find puzzling is that even older generations that previously worked showed this behaviour now. Those generations include Kernel, Initrd and Init scripts, right? So i would assume they are somewhat reproducable. I’m not sure if I somehow managed to modify implicit state in the /boot partition or somewhere else. But if it’s about the correct console= parameter, that should not suddenly break for a NixOS generation that worked before, right?

Anyway, I’m already reinstalling the system so I can no longer debug this issue for now :crossed_fingers:

actually the newly installed system exhibits the same behaviour :frowning: Booting into the NixOS installer ISO worked alright, but now booting into the newly installed system hangs again at EFI stub: Measured initrd data into PCR 9

This time I installed the system without disk encryption, so it should start without interaction. I still don’t get SSH connectivity, so I assume that it’s not just a problem of missing output on the screen.

Yea, with regular ole consumer PC hardware like that, I wouldn’t expect either of the things I mentioned to come up. Console should be fine out of the box, and a super early kernel panic would be very surprising indeed.

That is indeed quite worrying. Though I don’t really have any guidance on the matter. The fact that old generations used to work and stopped working is also quite concerning. I’m starting to worry that the hardware went from a working state to a non-working state, but it would take some more evidence to confirm that.

Difference between an ISO image and an installed one seems to be missing drivers or problematic kernel upgrades I assume.

By now I’m confident that this was related to my mainboard not booting correctly. I upgraded my BIOS and since then both problems disappeared.

I had the same issue but when different hardware:

Device: Dell Latitiude 5400
Platform: Intel
Installed BIOS version: 1.5.6

When attempting to install NixOS 23.05 (Plasma); my install also halted after the “Measured initrd data into PCR 9” message. After finding your post on discourse; I updated the device’s BIOS to the latest version (1.25.2) and the device now boots up into NixOS properly. Thanks for posting this!

2 Likes

I also have experienced this issue on this hardware:

Device: Dell Latitude 5500
Platform: Intel
Installed BIOS version: 1.7.4

The interesting thing is that I am able to workaround this issue by booting twice:
From a cold boot I select my NixOS generation and the boot hangs on the previously mentioned output:
“measured initrd data into PCR 9”, however if I power off the machine after receiving this message and boot again, I am able to boot as normal.

This also appears to be related to the power being plugged in. When the laptop is on battery it appears not able to boot, but when power was applied I was able to reboot into the system.

Looks like this is the only thread that shows up in Google about this issue, so I’ll post this here, perhaps it will help someone. I had the same issue on a Xiaomi Redmi Book Pro 14, I couldn’t get past “EFI stub: Measured initrd data into PCR 9” when booting from the NixOS live CD (nixos-minimal-24.11.712148.edf04b75c13c-x86_64-linux.iso). I tried updating BIOS as other people suggested, but it was already up to date. Arch and Ubuntu worked fine, however, so I figured it had something with the kernel. I tried older and newer versions of the kernel to no avail, then I started bisecting the diff between Ubuntu’s and NixOS’s kernel config, until I ended up with this:

{ config, pkgs, modulesPath, lib, ... }: {
  imports = [
    "${modulesPath}/installer/cd-dvd/installation-cd-minimal.nix"
#   "${modulesPath}/installer/cd-dvd/installation-cd-graphical-gnome.nix"
  ];

  boot.kernelPatches = lib.singleton {
    name = "config";
    patch = null;
    extraStructuredConfig = with lib.kernel; {
      ACPI_DEBUG = yes;
    };
  };
}

Adding CONFIG_ACPI_DEBUG fixed the issue, I managed to produce a working ISO with this command:

$ NIX_PATH=nixpkgs=https://github.com/NixOS/nixpkgs/archive/release-24.11.tar.gz nix-shell -p nixos-generators --run "nixos-generate --format iso --configuration ./image.nix -o result"

IIUC, this option enables debug output for ACPI events, so I have no idea why it would be needed for boot, but it works.

I also had to add this boot.kernelPatches to my configuration.nix, otherwise the system wouldn’t boot after installation.

1 Like

Before this thread gets any longer, I want to make it very clear that this “EFI stub:” message has nothing to do with any of the issues anyone in this thread had. This is simply the last message that the kernel outputs before exiting EFI boot services and proceeding to normal kernel startup. The fact that you all had this message in common does not indicate any commonality between your issues, except that whatever went wrong most likely happened after exiting EFI boot services. For instance, this could happen when ACPI tables are broken, or it could happen when the kernel selects the wrong TTY for its console and is simply booting silently, or it could happen if the kernel fails to set up some critical hardware. There really is no commonality here, except that it’s probably something to do with the kernel.

1 Like