diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2013-08-09 17:55:45 +0200 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2013-08-09 18:48:52 +0200 |
commit | 9845e6ec5c9dd9dbc3d692e4c62f6c86a0b4dad7 (patch) | |
tree | bea8a8773ffdac1b82602034481476f99b0ca369 /pkgs/os-specific/linux/kmod/aggregator.nix | |
parent | d9a4706f73430169bf1d49ea76ea0c15a1bb909b (diff) | |
download | nixpkgs-9845e6ec5c9dd9dbc3d692e4c62f6c86a0b4dad7.tar nixpkgs-9845e6ec5c9dd9dbc3d692e4c62f6c86a0b4dad7.tar.gz nixpkgs-9845e6ec5c9dd9dbc3d692e4c62f6c86a0b4dad7.tar.bz2 nixpkgs-9845e6ec5c9dd9dbc3d692e4c62f6c86a0b4dad7.tar.lz nixpkgs-9845e6ec5c9dd9dbc3d692e4c62f6c86a0b4dad7.tar.xz nixpkgs-9845e6ec5c9dd9dbc3d692e4c62f6c86a0b4dad7.tar.zst nixpkgs-9845e6ec5c9dd9dbc3d692e4c62f6c86a0b4dad7.zip |
Kernel module aggregator: Use kmod instead of module-init-tools
Diffstat (limited to 'pkgs/os-specific/linux/kmod/aggregator.nix')
-rw-r--r-- | pkgs/os-specific/linux/kmod/aggregator.nix | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/pkgs/os-specific/linux/kmod/aggregator.nix b/pkgs/os-specific/linux/kmod/aggregator.nix new file mode 100644 index 00000000000..161af38ff60 --- /dev/null +++ b/pkgs/os-specific/linux/kmod/aggregator.nix @@ -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 + ''; +} |