2017-02-07 17:17:28 +00:00
|
|
|
{ stdenv, buildPackages, lib, fetchurl, autoreconfHook, pkgconfig, libxslt, xz }:
|
2012-03-25 21:05:36 +01:00
|
|
|
|
2016-08-14 10:53:52 +01:00
|
|
|
let
|
2016-08-16 00:42:03 +01:00
|
|
|
systems = [ "/run/current-system/kernel-modules" "/run/booted-system/kernel-modules" "" ];
|
|
|
|
modulesDirs = lib.concatMapStringsSep ":" (x: "${x}/lib/modules") systems;
|
2016-08-14 10:53:52 +01:00
|
|
|
|
|
|
|
in stdenv.mkDerivation rec {
|
|
|
|
name = "kmod-${version}";
|
2017-03-14 10:06:55 +00:00
|
|
|
version = "24";
|
2012-03-25 21:05:36 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
2012-06-15 18:58:42 +01:00
|
|
|
url = "mirror://kernel/linux/utils/kernel/kmod/${name}.tar.xz";
|
2017-03-14 10:06:55 +00:00
|
|
|
sha256 = "15xkkkzvca9flvkm48gkh8y8f13vlm3sl7nz9ydc7b3jy4fqs2v1";
|
2012-03-25 21:05:36 +01:00
|
|
|
};
|
|
|
|
|
2016-08-14 10:53:52 +01: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 21:05:36 +01:00
|
|
|
|
2016-08-14 10:53:52 +01:00
|
|
|
configureFlags = [
|
|
|
|
"--sysconfdir=/etc"
|
|
|
|
"--with-xz"
|
|
|
|
"--with-modulesdirs=${modulesDirs}"
|
|
|
|
];
|
2012-03-25 21:05:36 +01:00
|
|
|
|
2012-04-04 20:24:07 +01:00
|
|
|
patches = [ ./module-dir.patch ];
|
|
|
|
|
2012-04-04 20:28:33 +01:00
|
|
|
postInstall = ''
|
2016-08-14 10:53:52 +01:00
|
|
|
for prog in rmmod insmod lsmod modinfo modprobe depmod; do
|
|
|
|
ln -sv $out/bin/kmod $out/bin/$prog
|
2012-04-04 20:28:33 +01:00
|
|
|
done
|
2016-08-14 10:53:52 +01:00
|
|
|
|
|
|
|
# Backwards compatibility
|
|
|
|
ln -s bin $out/sbin
|
2012-04-04 20:28:33 +01:00
|
|
|
'';
|
|
|
|
|
2012-03-25 21:05:36 +01:00
|
|
|
meta = {
|
2017-08-02 22:50:51 +01:00
|
|
|
homepage = https://www.kernel.org/pub/linux/utils/kernel/kmod/;
|
2012-03-25 21:05:36 +01:00
|
|
|
description = "Tools for loading and managing Linux kernel modules";
|
|
|
|
platforms = stdenv.lib.platforms.linux;
|
|
|
|
};
|
|
|
|
}
|