nixpkgs/pkgs/os-specific/linux/module-init-tools/aggregator.nix
Eelco Dolstra fb790c15e9 * Check against accidentally mixing kernel versions (e.g. Linux 2.6.25
with AUFS built against Linux 2.6.23).

svn path=/nixpkgs/trunk/; revision=11784
2008-05-08 15:36:19 +00:00

29 lines
823 B
Nix

{stdenv, module_init_tools, modules}:
stdenv.mkDerivation {
name = "kernel-modules";
buildCommand = ''
ensureDir $out/lib/modules
cd $out/
modules="${toString modules}"
for i in $modules; do
cp -rfs $i/* .
chmod -R u+w .
v=$(cd $i/lib/modules && ls -d *)
if test -n "$version" -a "$v" != "$version"; then
echo "kernel version mismatch: $version versus $v (in the module paths $modules)";
exit 1
fi
version=$v
done
echo "kernel version is $version"
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/ ${module_init_tools}/sbin/depmod -a $(basename lib/modules/2.*)
cd $out/
'';
}