summary refs log tree commit diff
path: root/pkgs/os-specific/linux/module-init-tools/aggregator.nix
blob: 9779efe3305f8c57d50d692ab9693a21d48371f6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
args : with args;
	let localDefs = builderDefs {
		addSbinPath = true;
		src = "";
		buildInputs = [module_init_tools];
		configureFlags = [];
	} null; /* null is a terminator for sumArgs */
	in with localDefs;
let 

doCollect = FullDepEntry (''
ensureDir $out/lib/modules
cd $out/
for i in $moduleSources; do 
	cp -rfs $i/* .
	chmod -R u+w .
done
rm -rf nix-support
cd lib/modules/
rm */modules.*
#  linux-* will pass the new kernel version to depmod to take rather than `uname -r` (see man page)
MODULE_DIR=$PWD/ depmod -a $(basename lib/modules/2.*)
cd $out/
'') [minInit addInputs defEnsureDir];
in
stdenv.mkDerivation rec {
	name = "kernel-modules";
	inherit moduleSources;
	builder = writeScript (name + "-builder")
		(textClosure localDefs [doCollect doForceShare doPropagate]);
	meta = {
		description = "
		A directory to hold all  the modules, including those 
		built separately from kernel. Later mentioned directories in 
		moduleSources have higher priority.
";
		inherit src;
	};
}