Skip to content

linux: System.map in kernel.dev makes external modules run depmod, breaking aggregateModules (v4l2loopback) #576406

Open

Description

@erichelgeson

Nixpkgs version

  • Unstable (26.11)

Describe the bug

Since a43236f kernel.dev ships System.map. The kernel's scripts/depmod.sh only skips depmod when System.map is missing, so out-of-tree modules that install through make modules_install INSTALL_MOD_PATH=$out now run depmod and write modules.dep, modules.symbols.bin, modules.alias and so on into their own output.

aggregateModules then fails because those files collide with the kernel's:

pkgs.buildEnv error: two given paths contain a conflicting subpath:
  `/nix/store/93n5879v79ljfdhaglr8p4kxndrgmq0d-v4l2loopback-0.15.4/lib/modules/7.2.11/modules.symbols.bin' and
  `/nix/store/36c6ybh6gv1mbnfq5n5sbqy2ghbdcgsa-linux-7.2.11-modules/lib/modules/7.2.11/modules.symbols.bin'

v4l2loopback runs sed -i '/depmod/d' Makefile, but that only removes its own depmod call. The kernel's Makefile.modinst still runs DEPMOD:

  INSTALL /nix/store/...-v4l2loopback-0.15.4/lib/modules/7.2.11/updates/v4l2loopback.ko
  DEPMOD  /nix/store/...-v4l2loopback-0.15.4/lib/modules/7.2.11
depmod: WARNING: could not open modules.order at ...

Any other external module that installs through modules_install probably hits the same thing.

Steps to reproduce

boot.kernelPackages = pkgs.linuxPackages_latest; # 7.2.11
boot.extraModulePackages = [ config.boot.kernelPackages.v4l2loopback ];

Minimal reproducer

Expected behaviour

External module outputs contain only the modules, and aggregateModules regenerates the depmod files itself, as it did before.

Screenshots

No response

Relevant log output

Additional context

No response

System metadata

  • system: "x86_64-linux"
  • host os: Linux 7.2.10, NixOS, 26.11 (Zokor), 26.11pre1093333.fe13242281a6
  • multi-user?: yes
  • sandbox: yes
  • version: nix-env (Nix) 2.34.9
  • channels(root): "nixos"
  • nixpkgs: /nix/store/f79iqhh0yh5z6czs4qfsk9inrd0snh6l-nixos/nixos

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.

Activity

  1. added
    0.kind: bug
    on Oct 20, 2026
  2. fxzzi commented on Oct 20, 2026

    @fxzzi
    Member

    i seem to be hitting a similar issue on zenergy too.

  3. dcunited001 commented on Oct 20, 2026

    @dcunited001

    I'm seeing it as well. Thanks for the explanation

      boot.kernelPackages = pkgs.linuxPackages_zen;
      boot.kernelModules = [ "v4l2loopback" ];
      boot.extraModulePackages = [ config.boot.kernelPackages.v4l2loopback ];
  4. joshuakb2 commented on Oct 21, 2026

    @joshuakb2

    I'm using this workaround:

    boot.extraModulePackages =
      let
        v4l2loopback-workaround = pkgs.runCommand "v4l2loopback-workaround" { } ''
          subdir=lib/modules/${config.boot.kernelPackages.kernel.version}
          mkdir -p $out/$subdir
          cd ${config.boot.kernelPackages.v4l2loopback}
          for f in *; do
            if [[ $f =~ ^modules ]]; then continue; fi
            cp -r $f $out/$subdir/$f
          done
        '';
      in
      [ v4l2loopback-workaround ];
  5. mserajnik commented on Oct 21, 2026

    @mserajnik
    Member

    I encountered the same issue with linuxPackages_latest.yt6801 on nixos-unstable (02c087f) with Linux 7.3. nixos-hardware's TUXEDO InfinityBook modules add it to boot.extraModulePackages1:

    pkgs.buildEnv error: two given paths contain a conflicting subpath:
      `/nix/store/...-yt6801-1.0.30-20250430/lib/modules/7.3.0/modules.softdep' and
      `/nix/store/...-linux-7.3-modules/lib/modules/7.3.0/modules.softdep'
    

    Footnotes

    1. Note that tuxedo-drivers actually fails earlier, see linuxPackages_latest.tuxedo-drivers: build failure #576266; I only got this far with a local override, and that override's output contains the same modules.* files, so it would collide as well. ↩

  6. b2ag commented on Oct 21, 2026

    @b2ag
          subdir=lib/modules/${config.boot.kernelPackages.kernel.version}
    

    Had to use config.boot.kernelPackages.kernel.modDirVersion to make it work with Linux-Zen.

  7. moni-dz commented on Oct 22, 2026

    @moni-dz
    Member

    v4l2loopback users can you try #575861?

  8. nim65s commented on Oct 22, 2026

    @nim65s
    Contributor

    Same with virtualbox:

    pkgs.buildEnv error: two given paths contain a conflicting subpath:
      `/nix/store/lhhw73bgwhzpnx8q9mrjmnmvsdqjz82z-VirtualBox-GuestAdditions-7.2.20-6.18.57/lib/modules/6.18.57/modules.softdep' and
      `/nix/store/cmp57lyyw6zpvhfm1nczpi3m7ki1pb1k-linux-6.18.57-modules/lib/modules/6.18.57/modules.softdep'
    
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