Initramfs unpacking failed with 24.05 live usb

I’m trying to install NixOS on an oldish system (motherboard is an Asus P8H61-I rev1) but when booting the live usb in UEFI mode I run into the following error:

Initramfs unpacking failed: ZSTD-compressed data is corrupt

Suspecting an hardware issue I did 4 passes of memtest with no errors, I also tried multiple usb keys, just in case but to no avail.

I tried other distributions’ live usb (mint, arch…) and had either the previous error or this one:

Initramfs unpacking failed: Invalid magic at start of compressed

I then tried older NixOS live usb, I had the same error with 23.11 but it turns out 23.05 is working fine. So it must be related to something that changed between 23.11 and 23.05.

I tried to create my own live usb, with 24.05 but changed the kernel version to the one on 23.05 and still had the same error. I tried to set boot.initrd.compressor to gzip and had the invalid magic error instead of the zstd one.

Also the 24.05 live usb is actually working in legacy mode, just not with UEFI. But the fact that 23.05 works in UEFI makes me think that there might be some option that changed between the two and that I could just change to have a 24.05 UEFI install working.

It sounds like buggy firmware, tbh. Especially if it’s happening with other distros’ ISOs as you say. There’s not much we can do about that. It’s curious that it works with 23.05. It could be the Grub version. IIRC there was a pretty major update in between 23.05 and 23.11. You could try the unstable ISO; there have been a few changes there recently, though I doubt they would fix the issues you’re having. Hydra - Build 273074715 of job nixos:trunk-combined:nixos.iso_gnome.x86_64-linux

Thank you. I’ve tried the unstable iso but unfortunately had the same error.

I’m probably spending too much time on this but I was trying to build an iso from my local copy of the nixpkgs repo, to try to bisect between 23.05 and 23.11.
But I’m having trouble doing so, I tried to start from the reproduce script from the Hydra task you linked, using --print-flags to get the nix-build flags and change them to the 23.05 hash but I can’t find what revCount is in the command:

nix-build --arg nixpkgs \{\ outPath\ =\ /tmp/build-273074715/nixpkgs/source\;\ rev\ =\ \"4ecab3273592f27479a583fb6d975d4aba3486fe\"\;\ shortRev\ =\ \"4ecab32\"\;\ revCount\ =\ 683289\;\ \} -I nixpkgs=. --option system x86_64-linux /tmp/build-273074715/nixpkgs/source/nixos/release-combined.nix -A nixos.iso_minimal

I think there must be a simpler way.

I wouldn’t try to use Hydra’s “reproduce locally” thing honestly. If you want to bisect it, checkout nixpkgs, find the merge-base with git merge-base origin/nixos-23.05 origin/nixos-23.11, and git bisect between that and 23.11. Make sure to start the bisect with --first-parent; otherwise you’ll be bisecting into incomplete PRs and staging branches and you’ll waste a ton of time on commits that won’t actually work.

(Though, I have a fairly strong feeling the problem is going to be that big Grub update I mentioned. Either this, this, or this would be my guess, most likely the first one)

I tried bisecting but I had a few revisions where the iso wouldn’t even reach grub, showing only a black screen and a single white underscore. I marked these as bad and ended up with 91cd77d7f34172e0238bcb69e8f6aa420e37b44b as the first bad commit but this doesn’t make sense as it’s just a package update. I probably messed up somewhere or encountered another issue.

Anyway I found a way to make it work. The config I was trying to install doesn’t use grub but systemd loader, so I used the last working iso to boot and install my config from it and thankfully systemd loader does not encounter this issue.

Thanks a lot for your help.

should have marked them as skipped I guess

Did you do --first-parent?

I did use --first-parent, and I started to mark them as skipped but I had a lot like this.