2017-02-07 17:17:28 +00:00
|
|
|
{ stdenv, buildPackages, lib, fetchurl, autoreconfHook, pkgconfig, libxslt, xz }:
|
2012-03-25 20:05:36 +00:00
|
|
|
|
2016-08-14 09:53:52 +00:00
|
|
|
let
|
2016-08-15 23:42:03 +00:00
|
|
|
systems = [ "/run/current-system/kernel-modules" "/run/booted-system/kernel-modules" "" ];
|
|
|
|
modulesDirs = lib.concatMapStringsSep ":" (x: "${x}/lib/modules") systems;
|
2016-08-14 09:53:52 +00:00
|
|
|
|
|
|
|
in stdenv.mkDerivation rec {
|
|
|
|
name = "kmod-${version}";
|
2017-03-14 10:06:55 +00:00
|
|
|
version = "24";
|
2012-03-25 20:05:36 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2012-06-15 17:58:42 +00:00
|
|
|
url = "mirror://kernel/linux/utils/kernel/kmod/${name}.tar.xz";
|
2017-03-14 10:06:55 +00:00
|
|
|
sha256 = "15xkkkzvca9flvkm48gkh8y8f13vlm3sl7nz9ydc7b3jy4fqs2v1";
|
2012-03-25 20:05:36 +00:00
|
|
|
};
|
|
|
|
|
2016-08-14 09:53:52 +00:00
|
|
|
nativeBuildInputs = [ autoreconfHook pkgconfig libxslt ];
|
2017-02-07 17:17:28 +00:00
|
|
|
buildInputs = [ xz ];
|
|
|
|
# HACK until BUG issue #21191 is addressed
|
|
|
|
crossAttrs.preUnpack = ''PATH="${buildPackages.xz}/bin''${PATH:+:}$PATH"'';
|
2012-03-25 20:05:36 +00:00
|
|
|
|
2016-08-14 09:53:52 +00:00
|
|
|
configureFlags = [
|
|
|
|
"--sysconfdir=/etc"
|
|
|
|
"--with-xz"
|
|
|
|
"--with-modulesdirs=${modulesDirs}"
|
|
|
|
];
|
2012-03-25 20:05:36 +00:00
|
|
|
|
2012-04-04 19:24:07 +00:00
|
|
|
patches = [ ./module-dir.patch ];
|
|
|
|
|
2012-04-04 19:28:33 +00:00
|
|
|
postInstall = ''
|
2016-08-14 09:53:52 +00:00
|
|
|
for prog in rmmod insmod lsmod modinfo modprobe depmod; do
|
|
|
|
ln -sv $out/bin/kmod $out/bin/$prog
|
2012-04-04 19:28:33 +00:00
|
|
|
done
|
2016-08-14 09:53:52 +00:00
|
|
|
|
|
|
|
# Backwards compatibility
|
|
|
|
ln -s bin $out/sbin
|
2012-04-04 19:28:33 +00:00
|
|
|
'';
|
|
|
|
|
2012-03-25 20:05:36 +00:00
|
|
|
meta = {
|
|
|
|
homepage = http://www.kernel.org/pub/linux/utils/kernel/kmod/;
|
|
|
|
description = "Tools for loading and managing Linux kernel modules";
|
|
|
|
platforms = stdenv.lib.platforms.linux;
|
|
|
|
};
|
|
|
|
}
|