2008-01-04 18:02:12 +01:00
|
|
|
args : with args;
|
2008-01-18 13:36:56 +01:00
|
|
|
let localDefs = builderDefs {
|
2008-01-04 18:02:12 +01:00
|
|
|
addSbinPath = true;
|
|
|
|
src = "";
|
2008-01-13 00:35:23 +01:00
|
|
|
buildInputs = [module_init_tools];
|
2008-01-04 18:02:12 +01:00
|
|
|
configureFlags = [];
|
|
|
|
} null; /* null is a terminator for sumArgs */
|
2008-01-18 13:36:56 +01:00
|
|
|
in with localDefs;
|
2008-01-04 18:02:12 +01:00
|
|
|
let
|
|
|
|
|
|
|
|
doCollect = FullDepEntry (''
|
2008-01-13 00:35:23 +01:00
|
|
|
ensureDir $out/lib/modules
|
2008-01-04 18:02:12 +01:00
|
|
|
cd $out/
|
|
|
|
for i in $moduleSources; do
|
2008-01-13 11:33:27 +01:00
|
|
|
cp -rfs $i/* .
|
|
|
|
chmod -R u+w .
|
2008-01-04 18:02:12 +01:00
|
|
|
done
|
2008-01-13 11:49:52 +01:00
|
|
|
rm -rf nix-support
|
2008-01-04 18:02:12 +01:00
|
|
|
cd lib/modules/
|
|
|
|
rm */modules.*
|
2008-01-31 22:55:38 +01:00
|
|
|
# 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.*)
|
2008-01-13 11:49:52 +01:00
|
|
|
cd $out/
|
2008-01-04 18:02:12 +01:00
|
|
|
'') [minInit addInputs defEnsureDir];
|
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
2008-01-13 00:35:23 +01:00
|
|
|
name = "kernel-modules";
|
2008-01-04 18:02:12 +01:00
|
|
|
inherit moduleSources;
|
|
|
|
builder = writeScript (name + "-builder")
|
2008-01-18 13:36:56 +01:00
|
|
|
(textClosure localDefs [doCollect doForceShare doPropagate]);
|
2008-01-04 18:02:12 +01:00
|
|
|
meta = {
|
|
|
|
description = "
|
|
|
|
A directory to hold all the modules, including those
|
2008-01-13 11:33:27 +01:00
|
|
|
built separately from kernel. Later mentioned directories in
|
2008-01-04 18:02:12 +01:00
|
|
|
moduleSources have higher priority.
|
|
|
|
";
|
|
|
|
};
|
|
|
|
}
|