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