[Solved] Custom kernel package issues; kernel modules not included in build output

Hello everyone,
because it takes a “lot of time” to build a kernel I wanted to shift that workload to my server.
So far I’ve been using the boot.kernelPatches option/set (which works perfectly fine); however, for hydra I wanted/had to write a proper kernel package.

After some short reading I thought I had figured it out…

I’ve copied the desired kernel package:

and added the desired patches (could have also just wrote an override and maybe I will (so I don’t need to manually update the src for every minor version update)).

for test purposes I’ve added it to my local package collection like that:
surface-linux = pkgs.callPackage ./surface-linux/default.nix {};
linuxPackages_surface = pkgs.recurseIntoAttrs (pkgs.linuxPackagesFor surface-linux);

However, after building the kernel the $out/lib/modules/$version/kernel folder is empty…

Could somebody please take look at my kernel package and tell me what I’m doing wrong?

For reference I’ve temporarily uploaded the relevant package files to:

And the derivations out directory tree:

Ophanim s908vcbsdb7hgx3q71q5bxzynw6vzaml-linux-4.19.17 #  tree                                                        
├── bzImage
├── lib
│   └── modules
│       └── 4.19.17
│           ├── kernel
│           ├── modules.alias
│           ├── modules.alias.bin
│           ├── modules.builtin
│           ├── modules.builtin.bin
│           ├── modules.dep
│           ├── modules.dep.bin
│           ├── modules.devname
│           ├── modules.order
│           ├── modules.softdep
│           ├── modules.symbols
│           └── modules.symbols.bin
└── System.map

Thanks a lot in advance!

I’ve solved the issue by adding the two kernelpatch “packages” bridge-stp-helper and modinst-arg-list-too-long.

1 Like