* Module aggregator: use buildEnv, which is much faster because it
creates symlinks lazily (i.e., it creates a single symlink to an entire tree unless another input has an overlapping tree). As a result it creates only a few dozen symlinks instead of ~ 12000 (which can take almost 2 minutes on my laptop). svn path=/nixpkgs/branches/stdenv-updates/; revision=15200
This commit is contained in:
parent
15f1feb702
commit
089eef511c
@ -1,28 +1,27 @@
|
|||||||
{stdenv, module_init_tools, modules}:
|
{stdenv, module_init_tools, modules, buildEnv}:
|
||||||
|
|
||||||
stdenv.mkDerivation {
|
buildEnv {
|
||||||
name = "kernel-modules";
|
name = "kernel-modules";
|
||||||
|
|
||||||
buildCommand = ''
|
paths = modules;
|
||||||
ensureDir $out/lib/modules
|
|
||||||
cd $out/
|
postBuild =
|
||||||
modules="${toString modules}"
|
''
|
||||||
for i in $modules; do
|
source ${stdenv}/setup
|
||||||
cp -rfs $i/* .
|
|
||||||
chmod -R u+w .
|
kernelVersion=$(cd $out/lib/modules && ls -d *)
|
||||||
v=$(cd $i/lib/modules && ls -d *)
|
if test "$(echo $kernelVersion | wc -w)" != 1; then
|
||||||
if test -n "$version" -a "$v" != "$version"; then
|
echo "inconsistent kernel versions: $kernelVersion"
|
||||||
echo "kernel version mismatch: $version versus $v (in the module paths $modules)";
|
exit 1
|
||||||
exit 1
|
fi
|
||||||
fi
|
|
||||||
version=$v
|
echo "kernel version is $kernelVersion"
|
||||||
done
|
|
||||||
echo "kernel version is $version"
|
# Regenerate the depmod map files. Be sure to pass an explicit
|
||||||
rm -rf nix-support
|
# kernel version number, otherwise depmod will use `uname -r'.
|
||||||
cd lib/modules/
|
if test -w $out/lib/modules/$kernelVersion; then
|
||||||
rm */modules.*
|
rm -f $out/lib/modules/$kernelVersion/modules.*
|
||||||
# linux-* will pass the new kernel version to depmod to take rather than `uname -r` (see man page)
|
MODULE_DIR=$out/lib/modules/ ${module_init_tools}/sbin/depmod -a $kernelVersion
|
||||||
MODULE_DIR=$PWD/ ${module_init_tools}/sbin/depmod -a $(basename lib/modules/2.*)
|
fi
|
||||||
cd $out/
|
'';
|
||||||
'';
|
|
||||||
}
|
}
|
||||||
|
@ -7313,7 +7313,7 @@ let
|
|||||||
|
|
||||||
aggregateModules = modules:
|
aggregateModules = modules:
|
||||||
import ../os-specific/linux/module-init-tools/aggregator.nix {
|
import ../os-specific/linux/module-init-tools/aggregator.nix {
|
||||||
inherit stdenv module_init_tools modules;
|
inherit stdenv module_init_tools modules buildEnv;
|
||||||
};
|
};
|
||||||
|
|
||||||
modutils = import ../os-specific/linux/modutils {
|
modutils = import ../os-specific/linux/modutils {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user