Hanging on boot after update unstable nixpkgs last week

Last week after updating nixpkgs-unstable, my system hangs after systemd-boot entry menu, no messages on the console, and I use a custom latest 7.3.1 kernel, The same kernel config workd with nixpkgs-26.05. How can I debug this problem, I enable systemd debug on the kernel boot parameter, but It doesn’t work, still empty log message after the systemd-boot entry menu.

my kernel config is:

    boot.kernelPackages = pkgs.linuxPackages_custom { ... }

fixed, after disable follow 3 options on kernel config:

1: Basic module for enforcing kernel lockdown

2: Module signature verification

3: Trim unused exported kernel symbols

Thanks all!

Rollback to an earlier working gen and then If you have a public repo share the url

And git will help us identify the issue. What was the git log number? Of the faulty commit.

That’d be the issue. Nixpkgs silently introduced a breaking change (signing requirement) in linux: generate deterministic module signatures and certificates by emilazy · Pull Request #571181 · NixOS/nixpkgs · GitHub, system won’t boot and nothing gets written to the system journal because the system didn’t boot.

You basically need to add something like this to your config:

Also, if you use custom modules, keep an eye out for linuxPackages: add kernelModuleInstallHook, apply hook to appropriate packages by B4dM4n · Pull Request #578004 · NixOS/nixpkgs · GitHub getting merged.

This is not true, there is no signing requirement by default, it only allows opting in. People shouldn’t be adding that snippet to their configurations, it’s purely a test setup. I don’t know what the cause of the original poster’s issue is, but this is misinformation.

I don’t know what to tell you, my system didn’t boot either, and I use the stock mainline kernel. Finger-wagging that we shouldn’t use test setup code doesn’t get us a bootable system. TBH I should be used to nixpkgs actively breaking every other week, but it never fails to surprise.

Have you bisected down to my PR? If there’s a regression, it should be looked at. But there was no intentional silent change to runtime behaviour, as described in the PR message, and so your post seems misleading to me. That test snippet is certainly not a supported way to change the booted kernel image.

I’m only aware of two ways that issues can occur.

One is if you use an external kernel module whose build process doesn’t use the kernel install rules, resulting in a failure to assemble the module tree due to expected signatures not being there. This is just a packaging issue, but it’s also a build failure, not a boot failure, and isn’t fixed by the systemBuilderCommands-based test setup, so if that fixed your system then this is not your issue.

The other is if you have module.sig_enforce=1 or an equivalent like lockdown=integrity|confidentiality in your kernel params. There are two possibilities in this case, and to be fair IMO either of them could reasonably be considered unsupported. One is that you had some other means of kernel module signing implemented yourself, such as custom kconfig adding CONFIG_MODULE_SIG_ALL=y to use the nondeterministic ephemeral build time keys. For those users this is indeed a regression. The other possibility is that some people just had module.sig_enforce=1 in their kernel params without any module signing, and in this case their system was actually broken before the change, and the change just exposes that fact. Before, NixOS didn’t have CONFIG_MODULE_SIG=y, which meant that you could put module.sig_enforce=1 in your kernel params and it would simply have no effect, and the user would think they had module verification enabled when they simply don’t. But now that param actually does what a user would intend for it to do, so the fact that they don’t have module verification working is now exposed to them as a boot failure. IMO this is a good thing. These users were using a config that did not do the verification it was configured to do, so flagging it up and making them figure out how they should actually administer their systems is good.

If there’s another way for boot to break as a result of these changes, I’m not aware of it. Would be good to see what your actual circumstance was so we can find a better solution than using the test code that end users should not be adopting.

I also had to add workarounds for that change; it also impacts users of linuxManualConfig for custom kernels.

At least in my case, it was caught before rebooting as i was looking at nixpkgs history due to a different kernel cleanup issue and noticed it breaks the module hashes patches.

Why are we left guessing potential solutions when we are all using nix and can simply check @hack4code’s repo if it is shared.