1 { stdenvNoCC, kmod, modules, buildEnv, name ? "kernel-modules" }:
10 source ${stdenvNoCC}/setup
12 if ! test -d "$out/lib/modules"; then
13 echo "No modules found."
14 # To support a kernel without modules
18 kernelVersion=$(cd $out/lib/modules && ls -d *)
19 if test "$(echo $kernelVersion | wc -w)" != 1; then
20 echo "inconsistent kernel versions: $kernelVersion"
24 echo "kernel version is $kernelVersion"
28 # Regenerate the depmod map files. Be sure to pass an explicit
29 # kernel version number, otherwise depmod will use `uname -r'.
30 if test -w $out/lib/modules/$kernelVersion; then
31 rm -f $out/lib/modules/$kernelVersion/modules.!(builtin*|order*)
32 ${kmod}/bin/depmod -b $out -C $out/etc/depmod.d -a $kernelVersion