2008-03-17 13:40:47 +03:00
|
|
|
# Given a kernel build (with modules in $kernel/lib/modules/VERSION),
|
|
|
|
# produce a module tree in $out/lib/modules/VERSION that contains only
|
|
|
|
# the modules identified by `rootModules', plus their dependencies.
|
|
|
|
# Also generate an appropriate modules.dep.
|
|
|
|
|
2018-01-08 16:13:28 +03:00
|
|
|
{ stdenvNoCC, kernel, firmware, nukeReferences, rootModules
|
2013-08-08 00:41:51 +04:00
|
|
|
, kmod, allowMissing ? false }:
|
2008-03-17 13:40:47 +03:00
|
|
|
|
2016-10-03 22:17:24 +03:00
|
|
|
stdenvNoCC.mkDerivation {
|
2008-03-17 13:40:47 +03:00
|
|
|
name = kernel.name + "-shrunk";
|
|
|
|
builder = ./modules-closure.sh;
|
2018-02-28 05:17:49 +03:00
|
|
|
nativeBuildInputs = [ nukeReferences kmod ];
|
2018-01-08 16:13:28 +03:00
|
|
|
inherit kernel firmware rootModules allowMissing;
|
2008-03-17 13:40:47 +03:00
|
|
|
allowedReferences = ["out"];
|
|
|
|
}
|