summary refs log tree commit diff
path: root/pkgs/os-specific/linux/zfs/nix-build.patch
blob: ae8e82f703af954d86e62311fc92bc53d4a33687 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
diff --git a/Makefile.am b/Makefile.am
index 49b417a..f4af44d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -12,10 +12,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 d00b1c8..3242d2e 100644
--- a/include/linux/Makefile.am
+++ b/include/linux/Makefile.am
@@ -17,6 +17,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 7ddace0..8da3870 100644
--- a/include/sys/Makefile.am
+++ b/include/sys/Makefile.am
@@ -102,6 +102,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 686402b..9cbf598 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@; \
+	kmoddir=@prefix@/$(INSTALL_MOD_PATH)/lib/modules/@LINUX_VERSION@; \
 	if [ -n $$kmoddir ]; 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