2014-02-02 08:41:39 +00:00
|
|
|
{ stdenv, fetchurl, gnugrep, findutils }:
|
2017-03-23 09:10:04 +00:00
|
|
|
|
2014-02-02 07:33:19 +00:00
|
|
|
let
|
2017-03-23 09:10:04 +00:00
|
|
|
version = "22-1.1ubuntu1"; # Zesty
|
|
|
|
|
|
|
|
in stdenv.mkDerivation {
|
2019-08-13 22:52:01 +01:00
|
|
|
pname = "kmod-blacklist";
|
|
|
|
inherit version;
|
2014-01-20 23:29:35 +00:00
|
|
|
|
2014-02-02 07:33:19 +00:00
|
|
|
src = fetchurl {
|
2017-03-23 09:10:04 +00:00
|
|
|
url = "https://launchpad.net/ubuntu/+archive/primary/+files/kmod_${version}.debian.tar.xz";
|
|
|
|
sha256 = "1k749g707ccb82l4xmrkp53khl71f57cpj9fzd1qyzrz147fjyhi";
|
2014-01-20 23:29:35 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir "$out"
|
2014-02-02 07:33:19 +00:00
|
|
|
for f in modprobe.d/*.conf; do
|
2014-01-20 23:29:35 +00:00
|
|
|
echo "''\n''\n## file: "`basename "$f"`"''\n''\n" >> "$out"/modprobe.conf
|
|
|
|
cat "$f" >> "$out"/modprobe.conf
|
2017-03-14 10:06:44 +00:00
|
|
|
# https://bugs.launchpad.net/ubuntu/+source/kmod/+bug/1475945
|
2018-06-29 21:11:55 +01:00
|
|
|
sed -i '/^blacklist i2c_i801/d' $out/modprobe.conf
|
2014-01-20 23:29:35 +00:00
|
|
|
done
|
|
|
|
|
2014-02-02 08:41:39 +00:00
|
|
|
substituteInPlace "$out"/modprobe.conf \
|
2017-03-23 09:10:04 +00:00
|
|
|
--replace "blacklist bochs-drm" "" \
|
2014-02-02 08:41:39 +00:00
|
|
|
--replace /sbin/lsmod /run/booted-system/sw/bin/lsmod \
|
2015-04-01 22:25:56 +01:00
|
|
|
--replace /sbin/rmmod /run/booted-system/sw/bin/rmmod \
|
|
|
|
--replace /sbin/modprobe /run/booted-system/sw/bin/modprobe \
|
2014-02-02 08:41:39 +00:00
|
|
|
--replace " grep " " ${gnugrep}/bin/grep " \
|
|
|
|
--replace " xargs " " ${findutils}/bin/xargs "
|
|
|
|
'';
|
2014-01-20 23:29:35 +00:00
|
|
|
|
2017-03-23 09:10:04 +00:00
|
|
|
meta = with stdenv.lib; {
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://packages.ubuntu.com/source/zesty/kmod";
|
2014-01-20 23:29:35 +00:00
|
|
|
description = "Linux kernel module blacklists from Ubuntu";
|
2017-03-23 09:10:04 +00:00
|
|
|
platforms = platforms.linux;
|
2020-06-30 20:10:46 +01:00
|
|
|
license = with licenses; [ gpl2Plus lgpl21Plus ];
|
2014-01-20 23:29:35 +00:00
|
|
|
};
|
|
|
|
}
|