2008-03-17 10:40:47 +00: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 13:13:28 +00:00
|
|
|
{ stdenvNoCC, kernel, firmware, nukeReferences, rootModules
|
2013-08-07 21:41:51 +01:00
|
|
|
, kmod, allowMissing ? false }:
|
2008-03-17 10:40:47 +00:00
|
|
|
|
2016-10-03 20:17:24 +01:00
|
|
|
stdenvNoCC.mkDerivation {
|
2008-03-17 10:40:47 +00:00
|
|
|
name = kernel.name + "-shrunk";
|
|
|
|
builder = ./modules-closure.sh;
|
2018-02-28 02:17:49 +00:00
|
|
|
nativeBuildInputs = [ nukeReferences kmod ];
|
2018-01-08 13:13:28 +00:00
|
|
|
inherit kernel firmware rootModules allowMissing;
|
2008-03-17 10:40:47 +00:00
|
|
|
allowedReferences = ["out"];
|
|
|
|
}
|