Kernel module aggregator: Use kmod instead of module-init-tools

This commit is contained in:
Eelco Dolstra
2013-08-09 18:48:52 +02:00
parent d9a4706f73
commit 9845e6ec5c
2 changed files with 6 additions and 6 deletions
@@ -0,0 +1,27 @@
{ stdenv, kmod, modules, buildEnv }:
buildEnv {
name = "kernel-modules";
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.*
${kmod}/sbin/depmod -b $out -a $kernelVersion
fi
'';
}