2009-04-20 21:13:40 +02:00
|
|
|
{stdenv, module_init_tools, modules, buildEnv}:
|
2008-01-04 18:02:12 +01:00
|
|
|
|
2009-04-20 21:13:40 +02:00
|
|
|
buildEnv {
|
2008-05-08 17:36:19 +02:00
|
|
|
name = "kernel-modules";
|
|
|
|
|
2009-04-20 21:13:40 +02:00
|
|
|
paths = modules;
|
|
|
|
|
|
|
|
postBuild =
|
|
|
|
''
|
|
|
|
source ${stdenv}/setup
|
|
|
|
|
|
|
|
kernelVersion=$(cd $out/lib/modules && ls -d *)
|
|
|
|
if test "$(echo $kernelVersion | wc -w)" != 1; then
|
|
|
|
echo "inconsistent kernel versions: $kernelVersion"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "kernel version is $kernelVersion"
|
|
|
|
|
|
|
|
# Regenerate the depmod map files. Be sure to pass an explicit
|
|
|
|
# kernel version number, otherwise depmod will use `uname -r'.
|
|
|
|
if test -w $out/lib/modules/$kernelVersion; then
|
|
|
|
rm -f $out/lib/modules/$kernelVersion/modules.*
|
|
|
|
MODULE_DIR=$out/lib/modules/ ${module_init_tools}/sbin/depmod -a $kernelVersion
|
|
|
|
fi
|
|
|
|
'';
|
2008-01-04 18:02:12 +01:00
|
|
|
}
|