summary refs log tree commit diff
path: root/pkgs/os-specific
diff options
context:
space:
mode:
authorJörg Thalheim <joerg@higgsboson.tk>2017-01-05 12:52:56 +0100
committerGitHub <noreply@github.com>2017-01-05 12:52:56 +0100
commitca0d747d6d370175a41c37c0900513324d16ed04 (patch)
treeb67ac6da2c22e4d7bf61e5398eda73249b8179f9 /pkgs/os-specific
parent1ba9a3cd9bc745f76ea79928e02687105cb38dd0 (diff)
parent4029470a6fa3c181b457debbf8f96e84de3f39e4 (diff)
downloadnixpkgs-ca0d747d6d370175a41c37c0900513324d16ed04.tar
nixpkgs-ca0d747d6d370175a41c37c0900513324d16ed04.tar.gz
nixpkgs-ca0d747d6d370175a41c37c0900513324d16ed04.tar.bz2
nixpkgs-ca0d747d6d370175a41c37c0900513324d16ed04.tar.lz
nixpkgs-ca0d747d6d370175a41c37c0900513324d16ed04.tar.xz
nixpkgs-ca0d747d6d370175a41c37c0900513324d16ed04.tar.zst
nixpkgs-ca0d747d6d370175a41c37c0900513324d16ed04.zip
Merge pull request #21578 from Mic92/zfs
zfs: add unstable variant
Diffstat (limited to 'pkgs/os-specific')
-rw-r--r--pkgs/os-specific/linux/spl/default.nix90
-rw-r--r--pkgs/os-specific/linux/zfs/default.nix252
-rw-r--r--pkgs/os-specific/linux/zfs/nix-build.patch134
3 files changed, 197 insertions, 279 deletions
diff --git a/pkgs/os-specific/linux/spl/default.nix b/pkgs/os-specific/linux/spl/default.nix
index e84c964d675..06ad440c775 100644
--- a/pkgs/os-specific/linux/spl/default.nix
+++ b/pkgs/os-specific/linux/spl/default.nix
@@ -9,56 +9,64 @@ with stdenv.lib;
 let
   buildKernel = any (n: n == configFile) [ "kernel" "all" ];
   buildUser = any (n: n == configFile) [ "user" "all" ];
-in
-
-assert any (n: n == configFile) [ "kernel" "user" "all" ];
-assert buildKernel -> kernel != null;
 
-stdenv.mkDerivation rec {
-  name = "spl-${configFile}-${version}${optionalString buildKernel "-${kernel.version}"}";
+  common = { version, sha256 } @ args : stdenv.mkDerivation rec {
+    name = "spl-${configFile}-${version}${optionalString buildKernel "-${kernel.version}"}";
 
-  version = "0.6.5.8";
-
-  src = fetchFromGitHub {
-    owner = "zfsonlinux";
-    repo = "spl";
-    rev = "spl-${version}";
-    sha256 = "000yvaccqlkrq15sdz0734fp3lkmx58182cdcfpm4869i0q7rf0s";
-  };
+    src = fetchFromGitHub {
+      owner = "zfsonlinux";
+      repo = "spl";
+      rev = "spl-${version}";
+      inherit sha256;
+    };
 
-  patches = [ ./const.patch ./install_prefix.patch ];
+    patches = [ ./const.patch ./install_prefix.patch ];
 
-  nativeBuildInputs = [ autoreconfHook ];
+    nativeBuildInputs = [ autoreconfHook ];
 
-  hardeningDisable = [ "pic" ];
+    hardeningDisable = [ "pic" ];
 
-  preConfigure = ''
-    substituteInPlace ./module/spl/spl-generic.c --replace /usr/bin/hostid hostid
-    substituteInPlace ./module/spl/spl-generic.c --replace "PATH=/sbin:/usr/sbin:/bin:/usr/bin" "PATH=${coreutils}:${gawk}:/bin"
-    substituteInPlace ./module/splat/splat-vnode.c --replace "PATH=/sbin:/usr/sbin:/bin:/usr/bin" "PATH=${coreutils}:/bin"
-    substituteInPlace ./module/splat/splat-linux.c --replace "PATH=/sbin:/usr/sbin:/bin:/usr/bin" "PATH=${coreutils}:/bin"
-  '';
+    preConfigure = ''
+      substituteInPlace ./module/spl/spl-generic.c --replace /usr/bin/hostid hostid
+      substituteInPlace ./module/spl/spl-generic.c --replace "PATH=/sbin:/usr/sbin:/bin:/usr/bin" "PATH=${coreutils}:${gawk}:/bin"
+      substituteInPlace ./module/splat/splat-vnode.c --replace "PATH=/sbin:/usr/sbin:/bin:/usr/bin" "PATH=${coreutils}:/bin"
+      substituteInPlace ./module/splat/splat-linux.c --replace "PATH=/sbin:/usr/sbin:/bin:/usr/bin" "PATH=${coreutils}:/bin"
+    '';
 
-  configureFlags = [
-    "--with-config=${configFile}"
-  ] ++ optionals buildKernel [
-    "--with-linux=${kernel.dev}/lib/modules/${kernel.modDirVersion}/source"
-    "--with-linux-obj=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
-  ];
+    configureFlags = [
+      "--with-config=${configFile}"
+    ] ++ optionals buildKernel [
+      "--with-linux=${kernel.dev}/lib/modules/${kernel.modDirVersion}/source"
+      "--with-linux-obj=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
+    ];
 
-  enableParallelBuilding = true;
+    enableParallelBuilding = true;
 
-  meta = {
-    description = "Kernel module driver for solaris porting layer (needed by in-kernel zfs)";
+    meta = {
+      description = "Kernel module driver for solaris porting layer (needed by in-kernel zfs)";
 
-    longDescription = ''
-      This kernel module is a porting layer for ZFS to work inside the linux
-      kernel.
-    '';
+      longDescription = ''
+          This kernel module is a porting layer for ZFS to work inside the linux
+          kernel.
+      '';
 
-    homepage = http://zfsonlinux.org/;
-    platforms = platforms.linux;
-    license = licenses.gpl2Plus;
-    maintainers = with maintainers; [ jcumming wizeman wkennington fpletz ];
+      homepage = http://zfsonlinux.org/;
+      platforms = platforms.linux;
+      license = licenses.gpl2Plus;
+      maintainers = with maintainers; [ jcumming wizeman wkennington fpletz ];
+    };
   };
-}
+
+in
+  assert any (n: n == configFile) [ "kernel" "user" "all" ];
+  assert buildKernel -> kernel != null;
+  {
+    splStable = common {
+      version = "0.6.5.8";
+      sha256 = "000yvaccqlkrq15sdz0734fp3lkmx58182cdcfpm4869i0q7rf0s";
+    };
+    splUnstable = common {
+      version = "0.7.0-rc2";
+      sha256 = "1y7jlyj8jwgrgnd6hiabms5h9430b6wjbnr3pwb16mv40wns1i65";
+    };
+  }
diff --git a/pkgs/os-specific/linux/zfs/default.nix b/pkgs/os-specific/linux/zfs/default.nix
index d7e406107b1..bd2767a66b4 100644
--- a/pkgs/os-specific/linux/zfs/default.nix
+++ b/pkgs/os-specific/linux/zfs/default.nix
@@ -1,117 +1,161 @@
-{ stdenv, fetchFromGitHub, autoreconfHook, utillinux, nukeReferences, coreutils
+{ stdenv, fetchFromGitHub, autoreconfHook, utillinux, nukeReferences, coreutils, fetchpatch
 , configFile ? "all"
 
 # Userspace dependencies
-, zlib, libuuid, python
+, zlib, libuuid, python, attr
 
 # Kernel dependencies
-, kernel ? null, spl ? null
+, kernel ? null, spl ? null, splUnstable ? null
 }:
 
 with stdenv.lib;
 let
   buildKernel = any (n: n == configFile) [ "kernel" "all" ];
   buildUser = any (n: n == configFile) [ "user" "all" ];
-in
 
-assert any (n: n == configFile) [ "kernel" "user" "all" ];
-assert buildKernel -> kernel != null && spl != null;
-
-stdenv.mkDerivation rec {
-  name = "zfs-${configFile}-${version}${optionalString buildKernel "-${kernel.version}"}";
-
-  version = "0.6.5.8";
-
-  src = fetchFromGitHub {
-    owner = "zfsonlinux";
-    repo = "zfs";
-    rev = "zfs-${version}";
-    sha256 = "0qccz1832p3i80qlrrrypypspb9sy9hmpgcfx9vmhnqmkf0yri4a";
-  };
-
-  patches = [ ./nix-build.patch ];
-
-  buildInputs = [ autoreconfHook nukeReferences ]
-    ++ optionals buildKernel [ spl ]
-    ++ optionals buildUser [ zlib libuuid python ];
-
-  # for zdb to get the rpath to libgcc_s, needed for pthread_cancel to work
-  NIX_CFLAGS_LINK = "-lgcc_s";
-
-  hardeningDisable = [ "pic" ];
-
-  preConfigure = ''
-    substituteInPlace ./module/zfs/zfs_ctldir.c   --replace "umount -t zfs"           "${utillinux}/bin/umount -t zfs"
-    substituteInPlace ./module/zfs/zfs_ctldir.c   --replace "mount -t zfs"            "${utillinux}/bin/mount -t zfs"
-    substituteInPlace ./lib/libzfs/libzfs_mount.c --replace "/bin/umount"             "${utillinux}/bin/umount"
-    substituteInPlace ./lib/libzfs/libzfs_mount.c --replace "/bin/mount"              "${utillinux}/bin/mount"
-    substituteInPlace ./udev/rules.d/*            --replace "/lib/udev/vdev_id"       "$out/lib/udev/vdev_id"
-    substituteInPlace ./cmd/ztest/ztest.c         --replace "/usr/sbin/ztest"         "$out/sbin/ztest"
-    substituteInPlace ./cmd/ztest/ztest.c         --replace "/usr/sbin/zdb"           "$out/sbin/zdb"
-    substituteInPlace ./config/user-systemd.m4    --replace "/usr/lib/modules-load.d" "$out/etc/modules-load.d"
-    substituteInPlace ./config/zfs-build.m4       --replace "\$sysconfdir/init.d"     "$out/etc/init.d"
-    substituteInPlace ./etc/zfs/Makefile.am       --replace "\$(sysconfdir)"          "$out/etc"
-    substituteInPlace ./cmd/zed/Makefile.am       --replace "\$(sysconfdir)"          "$out/etc"
-    substituteInPlace ./module/Makefile.in        --replace "/bin/cp"                 "cp"
-    substituteInPlace ./etc/systemd/system/zfs-share.service.in \
-        --replace "@bindir@/rm " "${coreutils}/bin/rm "
-    ./autogen.sh
-  '';
-
-  configureFlags = [
-    "--with-config=${configFile}"
-  ] ++ optionals buildUser [
-    "--with-dracutdir=$(out)/lib/dracut"
-    "--with-udevdir=$(out)/lib/udev"
-    "--with-systemdunitdir=$(out)/etc/systemd/system"
-    "--with-systemdpresetdir=$(out)/etc/systemd/system-preset"
-    "--with-mounthelperdir=$(out)/bin"
-    "--sysconfdir=/etc"
-    "--localstatedir=/var"
-    "--enable-systemd"
-  ] ++ optionals buildKernel [
-    "--with-spl=${spl}/libexec/spl"
-    "--with-linux=${kernel.dev}/lib/modules/${kernel.modDirVersion}/source"
-    "--with-linux-obj=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
-  ];
-
-  enableParallelBuilding = true;
-
-  installFlags = [
-    "sysconfdir=\${out}/etc"
-    "DEFAULT_INITCONF_DIR=\${out}/default"
-  ];
-
-  postInstall = ''
-    # Prevent kernel modules from depending on the Linux -dev output.
-    nuke-refs $(find $out -name "*.ko")
-  '' + optionalString buildUser ''
-    # Remove provided services as they are buggy
-    rm $out/etc/systemd/system/zfs-import-*.service
-
-    sed -i '/zfs-import-scan.service/d' $out/etc/systemd/system/*
-
-    for i in $out/etc/systemd/system/*; do
-      substituteInPlace $i --replace "zfs-import-cache.service" "zfs-import.target"
-    done
-
-    # Fix pkgconfig.
-    ln -s ../share/pkgconfig $out/lib/pkgconfig
-
-    # Remove tests because they add a runtime dependency on gcc
-    rm -rf $out/share/zfs/zfs-tests
-  '';
-
-  meta = {
-    description = "ZFS Filesystem Linux Kernel module";
-    longDescription = ''
-      ZFS is a filesystem that combines a logical volume manager with a
-      Copy-On-Write filesystem with data integrity detection and repair,
-      snapshotting, cloning, block devices, deduplication, and more.
+  common = { version, sha256, extraPatches, spl, inkompatibleKernelVersion ? null } @ args:
+    if buildKernel &&
+       (inkompatibleKernelVersion != null) &&
+       versionAtLeast kernel.version inkompatibleKernelVersion then
+      throw "linux v${kernel.version} is not yet supported by zfsonlinux v${version}"
+    else stdenv.mkDerivation rec {
+      name = "zfs-${configFile}-${version}${optionalString buildKernel "-${kernel.version}"}";
+
+      src = fetchFromGitHub {
+        owner = "zfsonlinux";
+        repo = "zfs";
+        rev = "zfs-${version}";
+        inherit sha256;
+      };
+
+      patches = extraPatches;
+
+      buildInputs = [ autoreconfHook nukeReferences ]
+      ++ optionals buildKernel [ spl ]
+      ++ optionals buildUser [ zlib libuuid python attr ];
+
+      # for zdb to get the rpath to libgcc_s, needed for pthread_cancel to work
+      NIX_CFLAGS_LINK = "-lgcc_s";
+
+      hardeningDisable = [ "pic" ];
+
+      preConfigure = ''
+        substituteInPlace ./module/zfs/zfs_ctldir.c   --replace "umount -t zfs"           "${utillinux}/bin/umount -t zfs"
+        substituteInPlace ./module/zfs/zfs_ctldir.c   --replace "mount -t zfs"            "${utillinux}/bin/mount -t zfs"
+        substituteInPlace ./lib/libzfs/libzfs_mount.c --replace "/bin/umount"             "${utillinux}/bin/umount"
+        substituteInPlace ./lib/libzfs/libzfs_mount.c --replace "/bin/mount"              "${utillinux}/bin/mount"
+        substituteInPlace ./udev/rules.d/*            --replace "/lib/udev/vdev_id"       "$out/lib/udev/vdev_id"
+        substituteInPlace ./cmd/ztest/ztest.c         --replace "/usr/sbin/ztest"         "$out/sbin/ztest"
+        substituteInPlace ./cmd/ztest/ztest.c         --replace "/usr/sbin/zdb"           "$out/sbin/zdb"
+        substituteInPlace ./config/user-systemd.m4    --replace "/usr/lib/modules-load.d" "$out/etc/modules-load.d"
+        substituteInPlace ./config/zfs-build.m4       --replace "\$sysconfdir/init.d"     "$out/etc/init.d"
+        substituteInPlace ./etc/zfs/Makefile.am       --replace "\$(sysconfdir)"          "$out/etc"
+        substituteInPlace ./cmd/zed/Makefile.am       --replace "\$(sysconfdir)"          "$out/etc"
+        substituteInPlace ./module/Makefile.in        --replace "/bin/cp"                 "cp"
+        substituteInPlace ./etc/systemd/system/zfs-share.service.in \
+          --replace "@bindir@/rm " "${coreutils}/bin/rm "
+        ./autogen.sh
+      '';
+
+      configureFlags = [
+        "--with-config=${configFile}"
+        ] ++ optionals buildUser [
+        "--with-dracutdir=$(out)/lib/dracut"
+        "--with-udevdir=$(out)/lib/udev"
+        "--with-systemdunitdir=$(out)/etc/systemd/system"
+        "--with-systemdpresetdir=$(out)/etc/systemd/system-preset"
+        "--with-mounthelperdir=$(out)/bin"
+        "--sysconfdir=/etc"
+        "--localstatedir=/var"
+        "--enable-systemd"
+        ] ++ optionals buildKernel [
+        "--with-spl=${spl}/libexec/spl"
+        "--with-linux=${kernel.dev}/lib/modules/${kernel.modDirVersion}/source"
+        "--with-linux-obj=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
+      ];
+
+      enableParallelBuilding = true;
+
+      installFlags = [
+        "sysconfdir=\${out}/etc"
+        "DEFAULT_INITCONF_DIR=\${out}/default"
+      ];
+
+      postInstall = ''
+        # Prevent kernel modules from depending on the Linux -dev output.
+        nuke-refs $(find $out -name "*.ko")
+      '' + optionalString buildUser ''
+        # Remove provided services as they are buggy
+        rm $out/etc/systemd/system/zfs-import-*.service
+
+        sed -i '/zfs-import-scan.service/d' $out/etc/systemd/system/*
+
+        for i in $out/etc/systemd/system/*; do
+        substituteInPlace $i --replace "zfs-import-cache.service" "zfs-import.target"
+        done
+
+        # Fix pkgconfig.
+        ln -s ../share/pkgconfig $out/lib/pkgconfig
+
+        # Remove tests because they add a runtime dependency on gcc
+        rm -rf $out/share/zfs/zfs-tests
       '';
-    homepage = http://zfsonlinux.org/;
-    license = licenses.cddl;
-    platforms = platforms.linux;
-    maintainers = with maintainers; [ jcumming wizeman wkennington fpletz ];
-  };
-}
+
+      meta = {
+        description = "ZFS Filesystem Linux Kernel module";
+        longDescription = ''
+          ZFS is a filesystem that combines a logical volume manager with a
+          Copy-On-Write filesystem with data integrity detection and repair,
+          snapshotting, cloning, block devices, deduplication, and more.
+        '';
+        homepage = http://zfsonlinux.org/;
+        license = licenses.cddl;
+        platforms = platforms.linux;
+        maintainers = with maintainers; [ jcumming wizeman wkennington fpletz ];
+      };
+    };
+in
+  assert any (n: n == configFile) [ "kernel" "user" "all" ];
+  assert buildKernel -> kernel != null && spl != null;
+  {
+    # also check if kernel version constraints in
+    # ./nixos/modules/tasks/filesystems/zfs.nix needs
+    # to be adapted
+    zfsStable = common {
+      # comment/uncomment if breaking kernel versions are known
+      inkompatibleKernelVersion = "4.9";
+
+      version = "0.6.5.8";
+
+      # this package should point to the latest release.
+      sha256 = "0qccz1832p3i80qlrrrypypspb9sy9hmpgcfx9vmhnqmkf0yri4a";
+      extraPatches = [
+        (fetchpatch {
+          url = "https://github.com/Mic92/zfs/compare/zfs-0.6.5.8...nixos-zfs-0.6.5.8.patch";
+          sha256 = "14kqqphzg02m9a7qncdhff8958cfzdrvsid3vsrm9k75lqv1w08z";
+        })
+      ];
+      inherit spl;
+    };
+    zfsUnstable = common {
+      # comment/uncomment if breaking kernel versions are known
+      inkompatibleKernelVersion = "4.10";
+
+      version = "0.7.0-rc2";
+
+      # this package should point to a version / git revision compatible with the latest kernel release
+      sha256 = "197y2jyav9h1ksri9kzqvrwmzpb58mlgw27vfvgd4bvxpwfxq53s";
+      extraPatches = [
+        (fetchpatch {
+          url = "https://github.com/Mic92/zfs/compare/zfs-0.7.0-rc2...nixos-zfs-0.7.0-rc2.patch";
+          sha256 = "1p33bwd6p5r5phbqb657x8h9x3bd012k2mdmbzgnb09drh9v0r82";
+        })
+        (fetchpatch {
+          name = "Kernel_4.9_zfs_aio_fsync_removal.patch";
+          url = "https://github.com/zfsonlinux/zfs/commit/99ca173929cb693012dabe98bcee4f12ec7e6e92.patch";
+          sha256 = "10npvpj52rpq88vdsn7zkdhx2lphzvqypsd9abdadjbqkwxld9la";
+        })
+      ];
+      spl = splUnstable;
+    };
+  }
diff --git a/pkgs/os-specific/linux/zfs/nix-build.patch b/pkgs/os-specific/linux/zfs/nix-build.patch
deleted file mode 100644
index cc9e36838c7..00000000000
--- a/pkgs/os-specific/linux/zfs/nix-build.patch
+++ /dev/null
@@ -1,134 +0,0 @@
-diff --git a/Makefile.am b/Makefile.am
-index f8abb5f..82e8fb6 100644
---- a/Makefile.am
-+++ b/Makefile.am
-@@ -11,10 +11,10 @@ endif
- if CONFIG_KERNEL
- SUBDIRS += module
- 
--extradir = @prefix@/src/zfs-$(VERSION)
-+extradir = @prefix@/libexec/zfs-$(VERSION)
- extra_HEADERS = zfs.release.in zfs_config.h.in
- 
--kerneldir = @prefix@/src/zfs-$(VERSION)/$(LINUX_VERSION)
-+kerneldir = @prefix@/zfs-$(VERSION)/$(LINUX_VERSION)
- nodist_kernel_HEADERS = zfs.release zfs_config.h module/$(LINUX_SYMBOLS)
- endif
- 
-diff --git a/include/Makefile.am b/include/Makefile.am
-index a94cad5..a160fe2 100644
---- a/include/Makefile.am
-+++ b/include/Makefile.am
-@@ -29,6 +29,6 @@ libzfs_HEADERS = $(COMMON_H) $(USER_H)
- endif
- 
- if CONFIG_KERNEL
--kerneldir = @prefix@/src/zfs-$(VERSION)/include
-+kerneldir = @prefix@/include
- kernel_HEADERS = $(COMMON_H) $(KERNEL_H)
- endif
-diff --git a/include/linux/Makefile.am b/include/linux/Makefile.am
-index 595d1db..d41375d 100644
---- a/include/linux/Makefile.am
-+++ b/include/linux/Makefile.am
-@@ -18,6 +18,6 @@ libzfs_HEADERS = $(COMMON_H) $(USER_H)
- endif
- 
- if CONFIG_KERNEL
--kerneldir = @prefix@/src/zfs-$(VERSION)/include/linux
-+kerneldir = @prefix@/include/linux
- kernel_HEADERS = $(COMMON_H) $(KERNEL_H)
- endif
-diff --git a/include/sys/Makefile.am b/include/sys/Makefile.am
-index 77ecfb2..52b3612 100644
---- a/include/sys/Makefile.am
-+++ b/include/sys/Makefile.am
-@@ -114,6 +114,6 @@ libzfs_HEADERS = $(COMMON_H) $(USER_H)
- endif
- 
- if CONFIG_KERNEL
--kerneldir = @prefix@/src/zfs-$(VERSION)/include/sys
-+kerneldir = @prefix@/include/sys
- kernel_HEADERS = $(COMMON_H) $(KERNEL_H)
- endif
-diff --git a/include/sys/fm/Makefile.am b/include/sys/fm/Makefile.am
-index 8bca5d8..a5eafcd 100644
---- a/include/sys/fm/Makefile.am
-+++ b/include/sys/fm/Makefile.am
-@@ -16,6 +16,6 @@ libzfs_HEADERS = $(COMMON_H) $(USER_H)
- endif
- 
- if CONFIG_KERNEL
--kerneldir = @prefix@/src/zfs-$(VERSION)/include/sys/fm
-+kerneldir = @prefix@/include/sys/fm
- kernel_HEADERS = $(COMMON_H) $(KERNEL_H)
- endif
-diff --git a/include/sys/fm/fs/Makefile.am b/include/sys/fm/fs/Makefile.am
-index fdc9eb5..807c47c 100644
---- a/include/sys/fm/fs/Makefile.am
-+++ b/include/sys/fm/fs/Makefile.am
-@@ -13,6 +13,6 @@ libzfs_HEADERS = $(COMMON_H) $(USER_H)
- endif
- 
- if CONFIG_KERNEL
--kerneldir = @prefix@/src/zfs-$(VERSION)/include/sys/fm/fs
-+kerneldir = @prefix@/include/sys/fm/fs
- kernel_HEADERS = $(COMMON_H) $(KERNEL_H)
- endif
-diff --git a/include/sys/fs/Makefile.am b/include/sys/fs/Makefile.am
-index 0859b9f..b0c6eec 100644
---- a/include/sys/fs/Makefile.am
-+++ b/include/sys/fs/Makefile.am
-@@ -13,6 +13,6 @@ libzfs_HEADERS = $(COMMON_H) $(USER_H)
- endif
- 
- if CONFIG_KERNEL
--kerneldir = @prefix@/src/zfs-$(VERSION)/include/sys/fs
-+kerneldir = @prefix@/include/sys/fs
- kernel_HEADERS = $(COMMON_H) $(KERNEL_H)
- endif
-diff --git a/module/Makefile.in b/module/Makefile.in
-index d4ddee2..876c811 100644
---- a/module/Makefile.in
-+++ b/module/Makefile.in
-@@ -18,9 +18,9 @@ modules:
- 	@# installed devel headers, or they may be in the module
- 	@# subdirectory when building against the spl source tree.
- 	@if [ -f @SPL_OBJ@/@SPL_SYMBOLS@ ]; then \
--		/bin/cp @SPL_OBJ@/@SPL_SYMBOLS@ .; \
-+		cp @SPL_OBJ@/@SPL_SYMBOLS@ .; \
- 	elif [ -f @SPL_OBJ@/module/@SPL_SYMBOLS@ ]; then \
--		/bin/cp @SPL_OBJ@/module/@SPL_SYMBOLS@ .; \
-+		cp @SPL_OBJ@/module/@SPL_SYMBOLS@ .; \
- 	else \
- 		echo -e "\n" \
- 		"*** Missing spl symbols ensure you have built the spl:\n" \
-@@ -28,6 +28,8 @@ modules:
- 		"*** - @SPL_OBJ@/module/@SPL_SYMBOLS@\n"; \
- 		exit 1; \
- 	fi
-+	@# when copying a file out of the nix store, we need to make it writable again.
-+	chmod +w @SPL_SYMBOLS@
- 	$(MAKE) -C @LINUX_OBJ@ SUBDIRS=`pwd` @KERNELMAKE_PARAMS@ CONFIG_ZFS=m $@
- 
- clean:
-@@ -42,15 +44,15 @@ clean:
- modules_install:
- 	@# Install the kernel modules
- 	$(MAKE) -C @LINUX_OBJ@ SUBDIRS=`pwd` $@ \
--		INSTALL_MOD_PATH=$(DESTDIR)$(INSTALL_MOD_PATH) \
-+		INSTALL_MOD_PATH=@prefix@/$(INSTALL_MOD_PATH) \
- 		INSTALL_MOD_DIR=$(INSTALL_MOD_DIR) \
- 		KERNELRELEASE=@LINUX_VERSION@
- 	@# Remove extraneous build products when packaging
--	kmoddir=$(DESTDIR)$(INSTALL_MOD_PATH)/lib/modules/@LINUX_VERSION@; \
--	if [ -n "$(DESTDIR)" ]; then \
-+	kmoddir=@prefix@/$(INSTALL_MOD_PATH)/lib/modules/@LINUX_VERSION@; \
-+	if [ -n "@prefix@" ]; then \
- 		find $$kmoddir -name 'modules.*' | xargs $(RM); \
- 	fi
--	sysmap=$(DESTDIR)$(INSTALL_MOD_PATH)/boot/System.map-@LINUX_VERSION@; \
-+	sysmap=@prefix@/$(INSTALL_MOD_PATH)/boot/System.map-@LINUX_VERSION@; \
- 	if [ -f $$sysmap ]; then \
- 		depmod -ae -F $$sysmap @LINUX_VERSION@; \
- 	fi