1 # Given a kernel build (with modules in $kernel/lib/modules/VERSION),
2 # produce a module tree in $out/lib/modules/VERSION that contains only
3 # the modules identified by `rootModules', plus their dependencies.
4 # Also generate an appropriate modules.dep.
6 { stdenvNoCC, kernel, firmware, nukeReferences, rootModules
7 , kmod, allowMissing ? false }:
9 stdenvNoCC.mkDerivation {
10 name = kernel.name + "-shrunk";
11 builder = ./modules-closure.sh;
12 nativeBuildInputs = [ nukeReferences kmod ];
13 inherit kernel firmware rootModules allowMissing;
14 allowedReferences = ["out"];