commit
48bb168e26
@ -24,11 +24,9 @@ let
|
|||||||
kernel = config.boot.kernelPackages;
|
kernel = config.boot.kernelPackages;
|
||||||
|
|
||||||
packages = if config.boot.zfs.enableUnstable then {
|
packages = if config.boot.zfs.enableUnstable then {
|
||||||
spl = null;
|
|
||||||
zfs = kernel.zfsUnstable;
|
zfs = kernel.zfsUnstable;
|
||||||
zfsUser = pkgs.zfsUnstable;
|
zfsUser = pkgs.zfsUnstable;
|
||||||
} else {
|
} else {
|
||||||
spl = kernel.spl;
|
|
||||||
zfs = kernel.zfs;
|
zfs = kernel.zfs;
|
||||||
zfsUser = pkgs.zfs;
|
zfsUser = pkgs.zfs;
|
||||||
};
|
};
|
||||||
@ -325,8 +323,8 @@ in
|
|||||||
virtualisation.lxd.zfsSupport = true;
|
virtualisation.lxd.zfsSupport = true;
|
||||||
|
|
||||||
boot = {
|
boot = {
|
||||||
kernelModules = [ "zfs" ] ++ optional (!cfgZfs.enableUnstable) "spl";
|
kernelModules = [ "zfs" ];
|
||||||
extraModulePackages = with packages; [ zfs ] ++ optional (!cfgZfs.enableUnstable) spl;
|
extraModulePackages = with packages; [ zfs ];
|
||||||
};
|
};
|
||||||
|
|
||||||
boot.initrd = mkIf inInitrd {
|
boot.initrd = mkIf inInitrd {
|
||||||
|
@ -1,61 +0,0 @@
|
|||||||
{ fetchFromGitHub, stdenv, autoreconfHook, coreutils, gawk
|
|
||||||
, fetchpatch
|
|
||||||
# Kernel dependencies
|
|
||||||
, kernel
|
|
||||||
}:
|
|
||||||
|
|
||||||
with stdenv.lib;
|
|
||||||
|
|
||||||
assert kernel != null;
|
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
|
||||||
name = "spl-${version}-${kernel.version}";
|
|
||||||
version = "0.7.13";
|
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
|
||||||
owner = "zfsonlinux";
|
|
||||||
repo = "spl";
|
|
||||||
rev = "spl-${version}";
|
|
||||||
sha256 = "1rzqgiszy8ad2gx20577azp1y5jgad0907slfzl5y2zb05jgaipa";
|
|
||||||
};
|
|
||||||
|
|
||||||
patches = [ ./install_prefix.patch ];
|
|
||||||
|
|
||||||
# Backported fix for 0.7.13 to build with 5.1, please remove when updating to 0.7.14
|
|
||||||
postPatch = optionalString (versionAtLeast kernel.version "5.1") ''
|
|
||||||
sed -i 's/get_ds()/KERNEL_DS/g' module/spl/spl-vnode.c
|
|
||||||
'';
|
|
||||||
|
|
||||||
nativeBuildInputs = [ autoreconfHook ] ++ kernel.moduleBuildDependencies;
|
|
||||||
|
|
||||||
hardeningDisable = [ "fortify" "stackprotector" "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"
|
|
||||||
'';
|
|
||||||
|
|
||||||
configureFlags = [
|
|
||||||
"--with-config=kernel"
|
|
||||||
"--with-linux=${kernel.dev}/lib/modules/${kernel.modDirVersion}/source"
|
|
||||||
"--with-linux-obj=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
|
|
||||||
];
|
|
||||||
|
|
||||||
enableParallelBuilding = true;
|
|
||||||
|
|
||||||
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.
|
|
||||||
'';
|
|
||||||
|
|
||||||
homepage = http://zfsonlinux.org/;
|
|
||||||
platforms = platforms.linux;
|
|
||||||
license = licenses.gpl2Plus;
|
|
||||||
maintainers = with maintainers; [ jcumming wizeman fpletz globin ];
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,168 +0,0 @@
|
|||||||
diff --git a/Makefile.am b/Makefile.am
|
|
||||||
index 4977448..ac17217 100644
|
|
||||||
--- a/Makefile.am
|
|
||||||
+++ b/Makefile.am
|
|
||||||
@@ -12,10 +12,10 @@ endif
|
|
||||||
if CONFIG_KERNEL
|
|
||||||
SUBDIRS += module
|
|
||||||
|
|
||||||
-extradir = @prefix@/src/spl-$(VERSION)
|
|
||||||
+extradir = @prefix@/libexec/spl
|
|
||||||
extra_HEADERS = spl.release.in spl_config.h.in
|
|
||||||
|
|
||||||
-kerneldir = @prefix@/src/spl-$(VERSION)/$(LINUX_VERSION)
|
|
||||||
+kerneldir = @prefix@/libexec/spl/$(LINUX_VERSION)
|
|
||||||
nodist_kernel_HEADERS = spl.release spl_config.h module/$(LINUX_SYMBOLS)
|
|
||||||
endif
|
|
||||||
|
|
||||||
diff --git a/include/Makefile.am b/include/Makefile.am
|
|
||||||
index 3200222..4a47aaa 100644
|
|
||||||
--- a/include/Makefile.am
|
|
||||||
+++ b/include/Makefile.am
|
|
||||||
@@ -13,6 +13,6 @@ USER_H =
|
|
||||||
EXTRA_DIST = $(COMMON_H) $(KERNEL_H) $(USER_H)
|
|
||||||
|
|
||||||
if CONFIG_KERNEL
|
|
||||||
-kerneldir = @prefix@/src/spl-$(VERSION)/include
|
|
||||||
+kerneldir = @prefix@/libexec/spl/include
|
|
||||||
kernel_HEADERS = $(KERNEL_H)
|
|
||||||
endif
|
|
||||||
diff --git a/include/fs/Makefile.am b/include/fs/Makefile.am
|
|
||||||
index e0da4b3..d6d7af0 100644
|
|
||||||
--- a/include/fs/Makefile.am
|
|
||||||
+++ b/include/fs/Makefile.am
|
|
||||||
@@ -8,6 +8,6 @@ USER_H =
|
|
||||||
EXTRA_DIST = $(COMMON_H) $(KERNEL_H) $(USER_H)
|
|
||||||
|
|
||||||
if CONFIG_KERNEL
|
|
||||||
-kerneldir = @prefix@/src/spl-$(VERSION)/include/fs
|
|
||||||
+kerneldir = @prefix@/libexec/spl/include/fs
|
|
||||||
kernel_HEADERS = $(KERNEL_H)
|
|
||||||
endif
|
|
||||||
diff --git a/include/linux/Makefile.am b/include/linux/Makefile.am
|
|
||||||
index 712e94e..4af9fb7 100644
|
|
||||||
--- a/include/linux/Makefile.am
|
|
||||||
+++ b/include/linux/Makefile.am
|
|
||||||
@@ -18,6 +18,6 @@ USER_H =
|
|
||||||
EXTRA_DIST = $(COMMON_H) $(KERNEL_H) $(USER_H)
|
|
||||||
|
|
||||||
if CONFIG_KERNEL
|
|
||||||
-kerneldir = @prefix@/src/spl-$(VERSION)/include/linux
|
|
||||||
+kerneldir = @prefix@/libexec/spl/include/linux
|
|
||||||
kernel_HEADERS = $(KERNEL_H)
|
|
||||||
endif
|
|
||||||
diff --git a/include/rpc/Makefile.am b/include/rpc/Makefile.am
|
|
||||||
index cfc8246..4fbd33d 100644
|
|
||||||
--- a/include/rpc/Makefile.am
|
|
||||||
+++ b/include/rpc/Makefile.am
|
|
||||||
@@ -9,6 +9,6 @@ USER_H =
|
|
||||||
EXTRA_DIST = $(COMMON_H) $(KERNEL_H) $(USER_H)
|
|
||||||
|
|
||||||
if CONFIG_KERNEL
|
|
||||||
-kerneldir = @prefix@/src/spl-$(VERSION)/include/rpc
|
|
||||||
+kerneldir = @prefix@/libexec/spl/include/rpc
|
|
||||||
kernel_HEADERS = $(KERNEL_H)
|
|
||||||
endif
|
|
||||||
diff --git a/include/sharefs/Makefile.am b/include/sharefs/Makefile.am
|
|
||||||
index 10e7093..febecdf 100644
|
|
||||||
--- a/include/sharefs/Makefile.am
|
|
||||||
+++ b/include/sharefs/Makefile.am
|
|
||||||
@@ -8,6 +8,6 @@ USER_H =
|
|
||||||
EXTRA_DIST = $(COMMON_H) $(KERNEL_H) $(USER_H)
|
|
||||||
|
|
||||||
if CONFIG_KERNEL
|
|
||||||
-kerneldir = @prefix@/src/spl-$(VERSION)/include/sharefs
|
|
||||||
+kerneldir = @prefix@/libexec/spl/include/sharefs
|
|
||||||
kernel_HEADERS = $(KERNEL_H)
|
|
||||||
endif
|
|
||||||
diff --git a/include/sys/Makefile.am b/include/sys/Makefile.am
|
|
||||||
index 73c4a84..31a9f50 100644
|
|
||||||
--- a/include/sys/Makefile.am
|
|
||||||
+++ b/include/sys/Makefile.am
|
|
||||||
@@ -107,7 +107,7 @@ USER_H =
|
|
||||||
EXTRA_DIST = $(COMMON_H) $(KERNEL_H) $(USER_H)
|
|
||||||
|
|
||||||
if CONFIG_KERNEL
|
|
||||||
-kerneldir = @prefix@/src/spl-$(VERSION)/include/sys
|
|
||||||
+kerneldir = @prefix@/libexec/spl/include/sys
|
|
||||||
kernel_HEADERS = $(KERNEL_H)
|
|
||||||
endif
|
|
||||||
|
|
||||||
diff --git a/include/sys/fm/Makefile.am b/include/sys/fm/Makefile.am
|
|
||||||
index 2821cbe..a84ce8e 100644
|
|
||||||
--- a/include/sys/fm/Makefile.am
|
|
||||||
+++ b/include/sys/fm/Makefile.am
|
|
||||||
@@ -9,6 +9,6 @@ USER_H =
|
|
||||||
EXTRA_DIST = $(COMMON_H) $(KERNEL_H) $(USER_H)
|
|
||||||
|
|
||||||
if CONFIG_KERNEL
|
|
||||||
-kerneldir = @prefix@/src/spl-$(VERSION)/include/sys/fm
|
|
||||||
+kerneldir = @prefix@/libexec/spl/include/sys/fm
|
|
||||||
kernel_HEADERS = $(KERNEL_H)
|
|
||||||
endif
|
|
||||||
diff --git a/include/sys/fs/Makefile.am b/include/sys/fs/Makefile.am
|
|
||||||
index 581083e..0c35fb7 100644
|
|
||||||
--- a/include/sys/fs/Makefile.am
|
|
||||||
+++ b/include/sys/fs/Makefile.am
|
|
||||||
@@ -8,6 +8,6 @@ USER_H =
|
|
||||||
EXTRA_DIST = $(COMMON_H) $(KERNEL_H) $(USER_H)
|
|
||||||
|
|
||||||
if CONFIG_KERNEL
|
|
||||||
-kerneldir = @prefix@/src/spl-$(VERSION)/include/sys/fs
|
|
||||||
+kerneldir = @prefix@/libexec/spl/include/sys/fs
|
|
||||||
kernel_HEADERS = $(KERNEL_H)
|
|
||||||
endif
|
|
||||||
diff --git a/include/util/Makefile.am b/include/util/Makefile.am
|
|
||||||
index e2bf09f..3f5d6ce 100644
|
|
||||||
--- a/include/util/Makefile.am
|
|
||||||
+++ b/include/util/Makefile.am
|
|
||||||
@@ -9,6 +9,6 @@ USER_H =
|
|
||||||
EXTRA_DIST = $(COMMON_H) $(KERNEL_H) $(USER_H)
|
|
||||||
|
|
||||||
if CONFIG_KERNEL
|
|
||||||
-kerneldir = @prefix@/src/spl-$(VERSION)/include/util
|
|
||||||
+kerneldir = @prefix@/libexec/spl/include/util
|
|
||||||
kernel_HEADERS = $(KERNEL_H)
|
|
||||||
endif
|
|
||||||
diff --git a/include/vm/Makefile.am b/include/vm/Makefile.am
|
|
||||||
index 7faab0a..8148b3d 100644
|
|
||||||
--- a/include/vm/Makefile.am
|
|
||||||
+++ b/include/vm/Makefile.am
|
|
||||||
@@ -10,6 +10,6 @@ USER_H =
|
|
||||||
EXTRA_DIST = $(COMMON_H) $(KERNEL_H) $(USER_H)
|
|
||||||
|
|
||||||
if CONFIG_KERNEL
|
|
||||||
-kerneldir = @prefix@/src/spl-$(VERSION)/include/vm
|
|
||||||
+kerneldir = @prefix@/libexec/spl/include/vm
|
|
||||||
kernel_HEADERS = $(KERNEL_H)
|
|
||||||
endif
|
|
||||||
--- a/module/Makefile.in
|
|
||||||
+++ b/module/Makefile.in
|
|
||||||
@@ -21,22 +21,22 @@
|
|
||||||
modules_install:
|
|
||||||
@# Install the kernel modules
|
|
||||||
$(MAKE) -C @LINUX_OBJ@ M=`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
|
|
||||||
|
|
||||||
modules_uninstall:
|
|
||||||
@# Uninstall the kernel modules
|
|
||||||
- kmoddir=$(DESTDIR)$(INSTALL_MOD_PATH)/lib/modules/@LINUX_VERSION@
|
|
||||||
+ kmoddir=@prefix@/$(INSTALL_MOD_PATH)/lib/modules/@LINUX_VERSION@
|
|
||||||
list='$(subdir-m)'; for subdir in $$list; do \
|
|
||||||
$(RM) -R $$kmoddir/$(INSTALL_MOD_DIR)/$$subdir; \
|
|
||||||
done
|
|
@ -9,7 +9,7 @@
|
|||||||
, gawk, gnugrep, gnused, systemd
|
, gawk, gnugrep, gnused, systemd
|
||||||
|
|
||||||
# Kernel dependencies
|
# Kernel dependencies
|
||||||
, kernel ? null, spl ? null
|
, kernel ? null
|
||||||
}:
|
}:
|
||||||
|
|
||||||
with stdenv.lib;
|
with stdenv.lib;
|
||||||
@ -20,10 +20,8 @@ let
|
|||||||
common = { version
|
common = { version
|
||||||
, sha256
|
, sha256
|
||||||
, extraPatches
|
, extraPatches
|
||||||
, spl
|
|
||||||
, rev ? "zfs-${version}"
|
, rev ? "zfs-${version}"
|
||||||
, isUnstable ? false
|
, isUnstable ? false
|
||||||
, isLegacyCrypto ? false
|
|
||||||
, incompatibleKernelVersion ? null }:
|
, incompatibleKernelVersion ? null }:
|
||||||
if buildKernel &&
|
if buildKernel &&
|
||||||
(incompatibleKernelVersion != null) &&
|
(incompatibleKernelVersion != null) &&
|
||||||
@ -52,10 +50,8 @@ let
|
|||||||
|
|
||||||
nativeBuildInputs = [ autoreconfHook nukeReferences ]
|
nativeBuildInputs = [ autoreconfHook nukeReferences ]
|
||||||
++ optional buildKernel (kernel.moduleBuildDependencies ++ [ perl ]);
|
++ optional buildKernel (kernel.moduleBuildDependencies ++ [ perl ]);
|
||||||
buildInputs =
|
buildInputs = optionals buildUser [ zlib libuuid python3 attr ]
|
||||||
optionals buildKernel [ spl ]
|
++ optionals (buildUser) [ openssl ]
|
||||||
++ optionals buildUser [ zlib libuuid python3 attr ]
|
|
||||||
++ optionals (buildUser && (isUnstable || isLegacyCrypto)) [ openssl ]
|
|
||||||
++ optional stdenv.hostPlatform.isMusl [ libtirpc ];
|
++ optional stdenv.hostPlatform.isMusl [ libtirpc ];
|
||||||
|
|
||||||
# for zdb to get the rpath to libgcc_s, needed for pthread_cancel to work
|
# for zdb to get the rpath to libgcc_s, needed for pthread_cancel to work
|
||||||
@ -107,8 +103,6 @@ let
|
|||||||
] ++ optionals buildKernel [
|
] ++ optionals buildKernel [
|
||||||
"--with-linux=${kernel.dev}/lib/modules/${kernel.modDirVersion}/source"
|
"--with-linux=${kernel.dev}/lib/modules/${kernel.modDirVersion}/source"
|
||||||
"--with-linux-obj=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
|
"--with-linux-obj=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
|
||||||
] ++ optionals (buildKernel && spl != null) [
|
|
||||||
"--with-spl=${spl}/libexec/spl"
|
|
||||||
];
|
];
|
||||||
|
|
||||||
enableParallelBuilding = true;
|
enableParallelBuilding = true;
|
||||||
@ -162,19 +156,13 @@ in {
|
|||||||
# incompatibleKernelVersion = "4.20";
|
# incompatibleKernelVersion = "4.20";
|
||||||
|
|
||||||
# this package should point to the latest release.
|
# this package should point to the latest release.
|
||||||
version = "0.7.13";
|
version = "0.8.0";
|
||||||
|
|
||||||
sha256 = "1l77bq7pvc54vl15pnrjd0njgpf00qjzy0x85dpfh5jxng84x1fb";
|
sha256 = "1lqb9q2im5bbm4l8kfb31cb6rvy37h5ni6rnqlki127ynilymkj8";
|
||||||
|
|
||||||
extraPatches = [
|
extraPatches = [
|
||||||
# in case this gets out of date, just send Mic92 a pull request!
|
./build-fixes-unstable.patch
|
||||||
(fetchpatch {
|
|
||||||
url = "https://github.com/Mic92/zfs/commit/cf23c1d38bfc698a8a729fc0c5f9ca41591f4d95.patch";
|
|
||||||
sha256 = "14v3x9ipvg2qd1vyf70nv909jd5zdxlsw5y8k60pfyvwm7g80wr5";
|
|
||||||
})
|
|
||||||
];
|
];
|
||||||
|
|
||||||
inherit spl;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
zfsUnstable = common rec {
|
zfsUnstable = common rec {
|
||||||
@ -189,10 +177,7 @@ in {
|
|||||||
isUnstable = true;
|
isUnstable = true;
|
||||||
|
|
||||||
extraPatches = [
|
extraPatches = [
|
||||||
# in case this gets out of date, just send Mic92 a pull request!
|
|
||||||
./build-fixes-unstable.patch
|
./build-fixes-unstable.patch
|
||||||
];
|
];
|
||||||
|
|
||||||
spl = null;
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -15446,8 +15446,6 @@ in
|
|||||||
|
|
||||||
sch_cake = callPackage ../os-specific/linux/sch_cake { };
|
sch_cake = callPackage ../os-specific/linux/sch_cake { };
|
||||||
|
|
||||||
spl = callPackage ../os-specific/linux/spl { };
|
|
||||||
|
|
||||||
sysdig = callPackage ../os-specific/linux/sysdig {};
|
sysdig = callPackage ../os-specific/linux/sysdig {};
|
||||||
|
|
||||||
systemtap = callPackage ../development/tools/profiling/systemtap { };
|
systemtap = callPackage ../development/tools/profiling/systemtap { };
|
||||||
@ -15476,7 +15474,7 @@ in
|
|||||||
|
|
||||||
inherit (callPackage ../os-specific/linux/zfs {
|
inherit (callPackage ../os-specific/linux/zfs {
|
||||||
configFile = "kernel";
|
configFile = "kernel";
|
||||||
inherit kernel spl;
|
inherit kernel;
|
||||||
}) zfsStable zfsUnstable;
|
}) zfsStable zfsUnstable;
|
||||||
|
|
||||||
zfs = zfsStable;
|
zfs = zfsStable;
|
||||||
|
Loading…
Reference in New Issue
Block a user