1{ fetchFromGitHub, stdenv, autoreconfHook, coreutils, gawk
2
3# Kernel dependencies
4, kernel
5}:
6
7with stdenv.lib;
8
9assert kernel != null;
10
11stdenv.mkDerivation rec {
12 name = "spl-${version}-${kernel.version}";
13 version = "0.7.9";
14
15 src = fetchFromGitHub {
16 owner = "zfsonlinux";
17 repo = "spl";
18 rev = "spl-${version}";
19 sha256 = "0540m1dv9jvrzk9kw61glg0h0cwj976mr9zb42y3nh17k47ywff0";
20 };
21
22 patches = [ ./install_prefix.patch ];
23
24 nativeBuildInputs = [ autoreconfHook ] ++ kernel.moduleBuildDependencies;
25
26 hardeningDisable = [ "fortify" "stackprotector" "pic" ];
27
28 preConfigure = ''
29 substituteInPlace ./module/spl/spl-generic.c --replace /usr/bin/hostid hostid
30 substituteInPlace ./module/spl/spl-generic.c --replace "PATH=/sbin:/usr/sbin:/bin:/usr/bin" "PATH=${coreutils}:${gawk}:/bin"
31 substituteInPlace ./module/splat/splat-vnode.c --replace "PATH=/sbin:/usr/sbin:/bin:/usr/bin" "PATH=${coreutils}:/bin"
32 substituteInPlace ./module/splat/splat-linux.c --replace "PATH=/sbin:/usr/sbin:/bin:/usr/bin" "PATH=${coreutils}:/bin"
33 '';
34
35 configureFlags = [
36 "--with-config=kernel"
37 "--with-linux=${kernel.dev}/lib/modules/${kernel.modDirVersion}/source"
38 "--with-linux-obj=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
39 ];
40
41 enableParallelBuilding = true;
42
43 meta = {
44 description = "Kernel module driver for solaris porting layer (needed by in-kernel zfs)";
45
46 longDescription = ''
47 This kernel module is a porting layer for ZFS to work inside the linux
48 kernel.
49 '';
50
51 homepage = http://zfsonlinux.org/;
52 platforms = platforms.linux;
53 license = licenses.gpl2Plus;
54 maintainers = with maintainers; [ jcumming wizeman wkennington fpletz globin ];
55 broken = stdenv.lib.versionAtLeast kernel.version "4.18";
56 };
57}