mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-21 13:10:33 +00:00
fb790c15e9
with AUFS built against Linux 2.6.23). svn path=/nixpkgs/trunk/; revision=11784
29 lines
823 B
Nix
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/
|
|
'';
|
|
}
|