]> git.proxmox.com Git - zfsonlinux.git/blob - zfs-patches/0001-remove-DKMS-modules-and-dracut-build.patch
rebase zfs patches
[zfsonlinux.git] / zfs-patches / 0001-remove-DKMS-modules-and-dracut-build.patch
1 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Fabian=20Gr=C3=BCnbichler?= <f.gruenbichler@proxmox.com>
3 Date: Mon, 6 Feb 2017 11:03:10 +0100
4 Subject: [PATCH] remove DKMS, modules and dracut build
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8
9 Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
10 ---
11 debian/control.in | 37 +++---------------
12 debian/control | 1 -
13 debian/not-installed | 1 +
14 debian/rules | 105 +--------------------------------------------------
15 4 files changed, 8 insertions(+), 136 deletions(-)
16
17 diff --git a/debian/control.in b/debian/control.in
18 index b3ef99870..8e69b6e37 100644
19 --- a/debian/control.in
20 +++ b/debian/control.in
21 @@ -8,7 +8,6 @@ Uploaders: Aron Xu <aron@debian.org>,
22 Build-Depends: dh-autoreconf,
23 autotools-dev,
24 debhelper (>= 10.2),
25 - dkms (>> 2.1.1.2-5),
26 libselinux1-dev,
27 libtool,
28 lsb-release,
29 @@ -84,25 +83,11 @@ Description: OpenZFS pool library for Linux
30 .
31 This zpool library provides support for managing zpools.
32
33 -Package: zfs-dkms
34 -Architecture: all
35 -Pre-Depends: spl-dkms (>= ${source:Upstream-Version}), spl-dkms (<<${source:Upstream-Version}.)
36 -Depends: dkms (>> 2.1.1.2-5), lsb-release, ${misc:Depends}
37 -Recommends: zfsutils-linux (>= ${binary:Version}), zfs-zed
38 -Provides: zfs-modules
39 -Description: OpenZFS filesystem kernel modules for Linux
40 - The Z file system is a pooled filesystem designed for maximum data
41 - integrity, supporting data snapshots, multiple copies, and data
42 - checksums.
43 - .
44 - This DKMS package includes the SPA, DMU, ZVOL, and ZPL components of
45 - OpenZFS.
46 -
47 Package: zfs-initramfs
48 Architecture: all
49 Depends: initramfs-tools,
50 busybox-initramfs | busybox-static | busybox,
51 - zfs-modules | zfs-dkms, zfsutils-linux (>= ${binary:Version}),
52 + zfsutils-linux (>= ${binary:Version}),
53 ${misc:Depends}
54 Description: OpenZFS root filesystem capabilities for Linux - initramfs
55 The Z file system is a pooled filesystem designed for maximum data
56 @@ -112,24 +97,12 @@ Description: OpenZFS root filesystem capabilities for Linux - initramfs
57 This package adds OpenZFS to the system initramfs with a hook
58 for the initramfs-tools infrastructure.
59
60 -Package: zfs-dracut
61 -Architecture: all
62 -Depends: dracut, zfs-modules | zfs-dkms, zfsutils-linux (>= ${binary:Version}), ${misc:Depends}
63 -Description: OpenZFS root filesystem capabilities for Linux - dracut
64 - The Z file system is a pooled filesystem designed for maximum data
65 - integrity, supporting data snapshots, multiple copies, and data
66 - checksums.
67 - .
68 - This package adds OpenZFS to the system initramfs with a hook
69 - for the dracut infrastructure.
70 -
71 Package: zfsutils-linux
72 Section: contrib/admin
73 Architecture: linux-any
74 Depends: ${misc:Depends}, ${shlibs:Depends}, ${python3:Depends}, python3
75 -Recommends: lsb-base, zfs-modules | zfs-dkms, zfs-zed
76 -Breaks: zfs-dkms (>> ${binary:Version}), zfs-dkms (<< ${binary:Version})
77 -Suggests: nfs-kernel-server, samba-common-bin (>= 3.0.23), zfs-initramfs | zfs-dracut
78 +Recommends: lsb-base, zfs-zed
79 +Suggests: nfs-kernel-server, samba-common-bin (>= 3.0.23), zfs-initramfs
80 Conflicts: zfs, zfs-fuse, zutils
81 Provides: zfsutils
82 Description: command-line tools to manage OpenZFS filesystems
83 @@ -143,7 +116,7 @@ Description: command-line tools to manage OpenZFS filesystems
84 Package: zfs-zed
85 Section: contrib/admin
86 Architecture: linux-any
87 -Depends: ${misc:Depends}, ${shlibs:Depends}, zfs-modules | zfs-dkms, zfsutils-linux (>= ${binary:Version})
88 +Depends: ${misc:Depends}, ${shlibs:Depends}, zfsutils-linux (>= ${binary:Version})
89 Description: OpenZFS Event Daemon
90 The Z file system is a pooled filesystem designed for maximum data
91 integrity, supporting data snapshots, multiple copies, and data
92 @@ -154,7 +127,7 @@ Description: OpenZFS Event Daemon
93 Package: zfs-test
94 Section: contrib/admin
95 Architecture: linux-any
96 -Depends: ${misc:Depends}, ${shlibs:Depends}, zfs-modules | zfs-dkms, zfsutils-linux (>=${binary:Version}), parted, lsscsi, mdadm, bc, ksh, fio, acl, sudo, sysstat, python
97 +Depends: ${misc:Depends}, ${shlibs:Depends}, zfsutils-linux (>=${binary:Version}), parted, lsscsi, mdadm, bc, ksh, fio, acl, sudo, sysstat, python
98 Breaks: zfsutils-linux (<= 0.6.5.11-1)
99 Replaces: zfsutils-linux (<= 0.6.5.11-1)
100 Description: OpenZFS test infrastructure an support scripts
101 diff --git a/debian/control b/debian/control
102 index b3ef99870..816403e44 100644
103 --- a/debian/control
104 +++ b/debian/control
105 @@ -8,7 +8,6 @@ Uploaders: Aron Xu <aron@debian.org>,
106 Build-Depends: dh-autoreconf,
107 autotools-dev,
108 debhelper (>= 10.2),
109 - dkms (>> 2.1.1.2-5),
110 libselinux1-dev,
111 libtool,
112 lsb-release,
113 diff --git a/debian/not-installed b/debian/not-installed
114 index f54fe7310..16b1cef6c 100644
115 --- a/debian/not-installed
116 +++ b/debian/not-installed
117 @@ -5,3 +5,4 @@ etc/zfs/vdev_id.conf.alias.example
118 etc/zfs/vdev_id.conf.multipath.example
119 etc/zfs/vdev_id.conf.sas_direct.example
120 etc/zfs/vdev_id.conf.sas_switch.example
121 +usr/lib/dracut
122 diff --git a/debian/rules b/debian/rules
123 index f445b58c5..d71926b33 100755
124 --- a/debian/rules
125 +++ b/debian/rules
126 @@ -5,9 +5,6 @@ include /usr/share/dpkg/default.mk
127 LSB_DISTRIBUTOR := $(shell lsb_release -is)
128 NAME := $(shell awk '$$1 == "Name:" { print $$2; }' META)
129
130 -DKMSFILES := module include config zfs.release.in autogen.sh META AUTHORS \
131 - DISCLAIMER COPYRIGHT OPENSOLARIS.LICENSE README.markdown
132 -
133 ifndef BUILD_UDEB
134 BUILD_UDEB=false
135 endif
136 @@ -17,21 +14,16 @@ KVERS=$(shell uname -r)
137 endif
138
139 ifndef SPL
140 -SPL=/usr/src/spl-$(DEB_VERSION_UPSTREAM)
141 -endif
142 -
143 -ifndef SPLOBJ
144 -SPLOBJ=/var/lib/dkms/spl/$(DEB_VERSION_UPSTREAM)/$(KVERS)/$(DEB_TARGET_GNU_CPU)
145 +SPL=../spl-build
146 endif
147
148 non_epoch_version=$(shell echo $(KVERS) | perl -pe 's/^\d+://')
149 PACKAGE=zfs
150 -pmodules = $(PACKAGE)-modules-$(non_epoch_version)
151
152 export DEB_BUILD_MAINT_OPTIONS = hardening=+all
153
154 %:
155 - dh $@ --with autoreconf,dkms,python3,systemd --parallel
156 + dh $@ --with autoreconf,python3,systemd --parallel
157
158 override_dh_auto_configure:
159 @cp debian/control.in debian/control
160 @@ -73,36 +65,6 @@ override_dh_auto_install:
161 $(INSTALL) -d '$(CURDIR)/debian/tmp/usr/sbin/'
162 mv '$(CURDIR)/debian/tmp/sbin/zed' '$(CURDIR)/debian/tmp/usr/sbin/zed'
163
164 - @# Get a bare copy of the source code for DKMS.
165 - @# This creates the $(CURDIR)/$(NAME)-$(DEB_VERSION_UPSTREAM)/ tree, which does not
166 - @# contain the userland sources. NB: Remove-userland-dist-rules.patch
167 - $(MAKE) distdir
168 -
169 - @# Install the DKMS source.
170 - @# We only want the files needed to build the modules
171 - mkdir -p '$(CURDIR)/debian/tmp/usr/src/$(NAME)-$(DEB_VERSION_UPSTREAM)'
172 - $(foreach file,$(DKMSFILES),mv '$(CURDIR)/$(NAME)-$(DEB_VERSION_UPSTREAM)/$(file)' '$(CURDIR)/debian/tmp/usr/src/$(NAME)-$(DEB_VERSION_UPSTREAM)' || exit 1;)
173 - @# Hellish awk line:
174 - @# * Deletes from configure.ac the parts not needed for building the kernel module
175 - @# * It deletes from inside AC_CONFIG_FILES([]) everything except:
176 - @# (Makefile$|include/|module/|*.release$)
177 - @# * Takes care of spaces and tabs
178 - awk '/^AC_CONFIG_FILES\(\[/,/^\]\)/ { if ($$0 !~ /^(AC_CONFIG_FILES\(\[([ \t]+)?$$|\]\)([ \t]+)?$$|([ \t]+)?(include\/|module\/|Makefile([ \t]+)?$$|zfs\.release([ \t]+)?$$))/){next} } {print}' \
179 - '$(CURDIR)/$(NAME)-$(DEB_VERSION_UPSTREAM)/configure.ac' > '$(CURDIR)/debian/tmp/usr/src/$(NAME)-$(DEB_VERSION_UPSTREAM)/configure.ac'
180 - @# Set "SUBDIRS = module include" for CONFIG_KERNEL and remove SUBDIRS for all other configs.
181 - sed '1,/CONFIG_KERNEL/s/SUBDIRS.*=.*//g;s/SUBDIRS.*=.*/SUBDIRS = module include/g;' \
182 - '$(CURDIR)/$(NAME)-$(DEB_VERSION_UPSTREAM)/Makefile.am' > '$(CURDIR)/debian/tmp/usr/src/$(NAME)-$(DEB_VERSION_UPSTREAM)/Makefile.am'
183 - @# Sanity test
184 - grep -q 'SUBDIRS = module include' '$(CURDIR)/debian/tmp/usr/src/$(NAME)-$(DEB_VERSION_UPSTREAM)/Makefile.am'
185 - @# Run autogen on the stripped source tree
186 - cd '$(CURDIR)/debian/tmp/usr/src/$(NAME)-$(DEB_VERSION_UPSTREAM)'; ./autogen.sh
187 - rm -fr '$(CURDIR)/debian/tmp/usr/src/$(NAME)-$(DEB_VERSION_UPSTREAM)/autom4te.cache'
188 -
189 - @# This shunt allows DKMS to install the Module.symvers and zfs_config.h
190 - @# files to the ${dkms_tree} area through the POST_INSTALL directive.
191 - printf '#!/bin/sh\ncp "$$@"\n' > '$(CURDIR)/debian/tmp/usr/src/$(NAME)-$(DEB_VERSION_UPSTREAM)/cp'
192 - chmod 755 '$(CURDIR)/debian/tmp/usr/src/$(NAME)-$(DEB_VERSION_UPSTREAM)/cp'
193 -
194 mkdir -p $(CURDIR)/debian/tmp/usr/lib
195 for i in `ls $(CURDIR)/debian/tmp/lib/*.so`; do \
196 ln -s /lib/`readlink $${i}` $(CURDIR)/debian/tmp/usr/lib/`basename $${i}`; \
197 @@ -112,9 +74,6 @@ override_dh_auto_install:
198 chmod a-x $(CURDIR)/debian/tmp/etc/zfs/zfs-functions
199 chmod a-x $(CURDIR)/debian/tmp/etc/default/zfs
200
201 -override_dh_dkms:
202 - dh_dkms -V $(DEB_VERSION_UPSTREAM)
203 -
204 override_dh_makeshlibs:
205 dh_makeshlibs -a -V
206 ifeq ($(BUILD_UDEB), true)
207 @@ -152,65 +111,5 @@ override_dh_install:
208
209 # ------------
210
211 -override_dh_prep-deb-files:
212 - for templ in $(wildcard $(CURDIR)/debian/*_KVERS_*.in); do \
213 - sed -e 's/##KVERS##/$(KVERS)/g ; s/#KVERS#/$(KVERS)/g ; s/_KVERS_/$(KVERS)/g ; s/##KDREV##/$(KDREV)/g ; s/#KDREV#/$(KDREV)/g ; s/_KDREV_/$(KDREV)/g ; s/_ARCH_/$(DEB_HOST_ARCH)/' \
214 - < $$templ > `echo $$templ | sed -e 's/_KVERS_/$(KVERS)/g ; s/_ARCH_/$(DEB_HOST_ARCH)/g ; s/\.in$$//'` ; \
215 - done
216 - sed -e 's/##KVERS##/$(KVERS)/g ; s/#KVERS#/$(KVERS)/g ; s/_KVERS_/$(KVERS)/g ; s/##KDREV##/$(KDREV)/g ; s/#KDREV#/$(KDREV)/g ; s/_KDREV_/$(KDREV)/g ; s/_ARCH_/$(DEB_HOST_ARCH)/g' \
217 - < debian/control.modules.in > debian/control
218 -
219 -override_dh_configure_modules_udeb: override_dh_configure_modules_udeb_stamp
220 -override_dh_configure_modules_udeb_stamp:
221 - ./configure \
222 - --without-selinux \
223 - --with-config=kernel \
224 - --with-linux=$(KSRC) \
225 - --with-linux-obj=$(KOBJ) \
226 - --with-spl=$(SPL) \
227 - --with-spl-obj=$(SPLOBJ)
228 - touch override_dh_configure_modules_udeb_stamp
229 -
230 -override_dh_configure_modules: override_dh_configure_modules_stamp
231 -override_dh_configure_modules_stamp:
232 - ./configure \
233 - --with-config=kernel \
234 - --with-linux=$(KSRC) \
235 - --with-linux-obj=$(KOBJ) \
236 - --with-spl=$(SPL) \
237 - --with-spl-obj=$(SPLOBJ)
238 - touch override_dh_configure_modules_stamp
239 -
240 -override_dh_binary-modules-udeb: override_dh_prep-deb-files override_dh_configure_modules_udeb
241 - dh_testdir
242 - dh_testroot
243 - dh_prep
244 -
245 - $(MAKE) -C $(CURDIR)/module modules
246 -
247 - dh_installdirs -p${pmodules}-di
248 - dh_install -p${pmodules}-di
249 - dh_gencontrol -p${pmodules}-di
250 -
251 - dh_builddeb -p${pmodules}-di
252 -
253 -override_dh_binary-modules: override_dh_prep-deb-files override_dh_configure_modules
254 - dh_testdir
255 - dh_testroot
256 - dh_prep
257 -
258 - $(MAKE) -C $(CURDIR)/module modules
259 -
260 - dh_install -p${pmodules}
261 - dh_installdocs -p${pmodules}
262 - dh_installchangelogs -p${pmodules}
263 - dh_compress -p${pmodules}
264 - dh_strip -p${pmodules}
265 - dh_fixperms -p${pmodules}
266 - dh_installdeb -p${pmodules}
267 - dh_gencontrol -p${pmodules}
268 - dh_md5sums -p${pmodules}
269 - dh_builddeb -p${pmodules}
270 -
271 debian-copyright:
272 cme update dpkg-copyright -file debian/copyright.cme
273 --
274 2.14.2
275