Skip to content

linux: aggregateModules fails when external kernel modules lack .ko.cer files #575192

Open
0 of 2 issues completed

Description

@siflfran

Edited by @me-and to format code parts for easier reading

Nixpkgs version

  • Unstable (26.11)

Describe the bug

After updating nixpkgs in my flake.lock, building my NixOS system fails while
building the Linux kernel module aggregation derivation.

The relevant error is:

cat: kernel/drivers/hwmon/zenpower/zenpower.ko.cer: No such file or directory
cat: misc/acpi_call.ko.cer: No such file or directory

The failure appears related to commit 6bd7526
("aggregateModules: merge certificates from external modules"), which
generates module certificate paths from modules.dep and tries to concatenate
them into modules.cer. The kernel/module-signing change in c736bb8
("linux: generate deterministic module signatures and certificates") may
also be relevant.

My configuration adds these external modules:

boot = lib.mkIf config.services.tlp.enable {
  kernelModules = [ "acpi_call" ];
  extraModulePackages = with config.boot.kernelPackages; [ acpi_call ];
};

boot.extraModulePackages = [ config.boot.kernelPackages.zenpower ];

Both packages are taken from config.boot.kernelPackages.

The failing derivation is:
/nix/store/q04gy37ysfvpzmzvm1dqv8dqw8s1079b-linux-7.2.11-modules.drv

Steps to reproduce

Use nixpkgs 353adf2

Add

boot = {
  kernelModules = [ "acpi_call" ];
  extraModulePackages = with config.boot.kernelPackages; [ acpi_call ];
};

to the config. Do nixos-rebuild switch.

Minimal reproducer

Expected behaviour

Kernel module aggregation does not fail.

Screenshots

No response

Relevant log output

❯ nix log /nix/store/q04gy37ysfvpzmzvm1dqv8dqw8s1079b-linux-7.2.11-modules.drv
structuredAttrs is enabled
created 363 symlinks in user environment
structuredAttrs is enabled
kernel version is 7.2.11
cat: kernel/drivers/hwmon/zenpower/zenpower.ko.cer: No such file or directory
cat: misc/acpi_call.ko.cer: No such file or directory

Additional context

No response

System metadata

  • system: "x86_64-linux"
  • host os: Linux 7.2.10, NixOS, 26.11 (Zokor), 26.11.20261012.6aa7ad7
  • multi-user?: yes
  • sandbox: yes
  • version: nix-env (Nix) 2.35.3
  • channels(…): "home-manager, nixgl, nixpkgs"
  • channels(root): "nixos"
  • nixpkgs: /nix/store/wzd256m3cw2wihaxdky68c01h8qycipy-nixpkgs/nixpkgs

Notify maintainers

@emilazy


Note for maintainers: Please tag this issue in your pull request description. (i.e. Resolves #ISSUE.)

I assert that this issue is relevant for Nixpkgs

Is this issue important to you?

Add a 👍 reaction to issues you find important.

Sub-issues

Sub-issues

0 of 2 Issues completed
Loading 2 sub-issues

Activity

  1. added
    0.kind: bug
    on Oct 17, 2026
  2. emilazy commented on Oct 17, 2026

    @emilazy
    Member

    Thanks for the report. This is a bug in the linuxPackages.acpi_call and linuxPackages.zenpower packaging; they’re not going through the Kbuild module installation flow. That also means they weren’t getting compressed before.

    linuxPackages.acpi_call has an upstream install target that passes through to the Kbuild modules_install, so it just needs to add "INSTALL_MOD_PATH=${placeholder "out"}" to its makeFlags, drop the explicit install(1) of the module, and move the additional one to postInstall. (It may also want "DEPMOD=true" to silence a warning, although perhaps we should put that in the global kernelModuleMakeFlags.) cc @7c6f434c @Mic92 as maintainers.

    linuxPackages.zenpower needs kernelModuleMakeFlags in its makeFlags along with the same changes to it as linuxPackages.acpi_call. The upstream Makefile doesn’t expose the Kbuild install_modules target, so in addition to those, it’ll have to set installTargets = [ "modules_install" ]; and installFlags = [ "-C" "${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" "M=$(PWD)" ];. cc @alexbakker @Artturin as maintainers.

  3. camini commented on Oct 20, 2026

    @camini

    Another affected package: xpad-noone

    Same failure as in this issue, hit on a full system build with xpad-noone in boot.extraModulePackages (together with xpadneo, xone, v4l2loopback).

    nixpkgs 09063bd (2026-10-17), kernel linux_6_18 (6.18.57)
    nixos-rebuild build fails in linux-6.18.57-modules.drv:
    xpad-noone’s installPhase copies the .ko by hand (install *.ko) instead of using modules_install, so no .ko.cer is generated.

  4. camini commented on Oct 20, 2026

    @camini

    Two more affected packages: hid-fanatecff and new-lg4ff (follow-up to my xpad-noone comment above)

    Same context: nixpkgs 09063bd (2026-10-17), linux_6_18 (6.18.57), module aggregated with aggregateModules the way nixos/modules/system/boot/kernel.nix does it.

    linuxPackages.hid-fanatecff (0.2.3) builds, but its output has no .ko.cer, so aggregation fails:

    It passes kernelModuleMakeFlags, but the upstream Makefile’s install target just does cp hid-fanatec.ko ${MODULEDIR} rather than going through Kbuild’s modules_install.

    linuxPackages.new-lg4ff (0.5.0) doesn’t build at all. It fails in configurePhase:

    Its preConfigure expands kernelModuleMakeFlags into makeFlagsArray+=( ... ) via builtins.concatStringsSep, and that list contains cmd_sign=...$(space)$@, which looks like what bash is trying to run as a command. I haven’t confirmed this beyond the log.

    I couldn’t find existing issues or PRs for either (searched fanatecff, new-lg4ff, lg4ff since 2026-10-08, so the search is narrow).

  5. teto commented on Oct 20, 2026

    @teto
    Member

    had issues with ddcci as well

    ❯ nix log /nix/store/lxhdvqlzq6a3z6snw93vdyjw3047ifrx-linux-7.2.11-modules.drv
       1 structuredAttrs is enabled
       2 created 156 symlinks in user environment
       3 structuredAttrs is enabled
       4 kernel version is 7.2.11
       5 cat: extra/ddcci-backlight.ko.cer: No such file or directory
       6 cat: extra/ddcci.ko.cer: No such file or directory
    
  6. AbdulrahmanNahhas commented on Oct 20, 2026

    @AbdulrahmanNahhas

    I have the same problem

    linux-7.2.11-modules> cat: kernel/drivers/hid/razeraccessory.ko.cer: No such file or directory
    linux-7.2.11-modules> cat: kernel/drivers/hid/razermouse.ko.cer: No such file or directory
    linux-7.2.11-modules> cat: kernel/drivers/hid/razerkraken.ko.cer: No such file or directory
    linux-7.2.11-modules> cat: kernel/drivers/hid/razerkbd.ko.cer: No such file or directory
    
    error: Cannot build '/nix/store/9s66gl7fgx361lcc7hfd8lsjm7qb2aaj-linux-7.2.11-modules.drv'.
           Reason: builder failed with exit code 123.
           Output paths:
             /nix/store/d86vg24r34qq6ls0156jkhmabf8xs3qb-linux-7.2.11-modules
    
  7. SuperSandro2000 commented on Oct 20, 2026

    @SuperSandro2000
    Member

    openrazer PR #576293

  8. 91 remaining items

  9. added a commit that references this issue on Nov 11, 2026
    7c54574
  10. vpayno commented on Nov 13, 2026

    @vpayno
    Contributor

    ajantv2 PR #587470

  11. vpayno commented on Nov 13, 2026

    @vpayno
    Contributor

    asus-ec-sensors PR: #587487

  12. vpayno commented on Nov 14, 2026

    @vpayno
    Contributor

    linuxPackages.it87 PR: #587980

  13. vpayno commented on Nov 14, 2026

    @vpayno
    Contributor

    linuxPackages.liquidtux PR: #588270

  14. added a commit that references this issue on Nov 14, 2026
  15. vpayno commented on Nov 15, 2026

    @vpayno
    Contributor

    linuxPackages.qc71_laptop PR: #588440

  16. vpayno commented on Nov 15, 2026

    @vpayno
    Contributor

    linuxPackages.r8168 PR: #588453

  17. vpayno commented on Nov 15, 2026

    @vpayno
    Contributor

    linuxPackages.rtl8821cu PR: #588465

  18. vpayno commented on Nov 15, 2026

    @vpayno
    Contributor

    linuxPackages.rtw88 PR: #588490

  19. thyTwilightGoth commented on Nov 28, 2026

    @thyTwilightGoth

    corefreg packages appears to be affected as well.

  20. giorgiga commented on Nov 30, 2026

    @giorgiga
    Contributor

    tp_smapi, thinkpad_ec, and hdapsd seem to have the same issue.

    building '/nix/store/qvdzvdmva3a5nhgh0xhk6vsnz139h8h5-linux-6.18.65-modules.drv'...
    error: builder for '/nix/store/qvdzvdmva3a5nhgh0xhk6vsnz139h8h5-linux-6.18.65-modules.drv' failed with exit code 123;
           last 5 log lines:
           > created 151 symlinks in user environment
           > kernel version is 6.18.65
           > cat: kernel/drivers/firmware/tp_smapi.ko.cer: No such file or directory
           > cat: kernel/drivers/firmware/thinkpad_ec.ko.cer: No such file or directory
           > cat: kernel/drivers/firmware/hdapsd.ko.cer: No such file or directory
           For full logs, run 'nix log /nix/store/qvdzvdmva3a5nhgh0xhk6vsnz139h8h5-linux-6.18.65-modules.drv'.
    error: 1 dependencies of derivation '/nix/store/wa4yn6sjl0zv2qay09ns7pkxmwgfrz2s-nixos-system-x220-26.11-2517139-dirty-2026-11-29.2052Z.drv' failed to build
    

    There are several open issues for other modules as well.

    edit: PR for tp_smapi (which covers the three missing certs above): #595556

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    0.kind: bug

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions