nixpkgs/pkgs/os-specific/linux/kmod/default.nix
2012-07-29 03:57:50 -04:00

34 lines
925 B
Nix

{ stdenv, fetchurl, xz, zlib, pkgconfig }:
stdenv.mkDerivation rec {
name = "kmod-9";
src = fetchurl {
url = "mirror://kernel/linux/utils/kernel/kmod/${name}.tar.xz";
sha256 = "1kyfplx0gygzxp5dn81yk3cn8zzraqm497vis04r1g1dnry2c1q6";
};
# Disable xz/zlib support to prevent needing them in the initrd.
buildInputs = [ pkgconfig /* xz zlib */ ];
configureFlags = [ "--sysconfdir=/etc" /* "--with-xz" "--with-zlib" */ ];
patches = [ ./module-dir.patch ];
postInstall = ''
ln -s kmod $out/bin/lsmod
mkdir -p $out/sbin
for prog in rmmod insmod modinfo modprobe depmod; do
ln -sv $out/bin/kmod $out/sbin/$prog
done
'';
meta = {
homepage = http://www.kernel.org/pub/linux/utils/kernel/kmod/;
description = "Tools for loading and managing Linux kernel modules";
maintainers = [ stdenv.lib.maintainers.shlevy ];
platforms = stdenv.lib.platforms.linux;
};
}