1 |
commit: eaac4cdc5998fde7b3038e4c91513300fa58c6b2 |
2 |
Author: Richard Yao <ryao <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Jan 4 19:52:22 2016 +0000 |
4 |
Commit: Richard Yao <ryao <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Jan 4 20:02:26 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=eaac4cdc |
7 |
|
8 |
sys-fs/zfs-0.6.5.3-r2: Many fixes |
9 |
|
10 |
Fixes have been backported from both HEAD and the proposed stable API branch. |
11 |
|
12 |
Package-Manager: portage-2.2.24 |
13 |
Signed-off-by: Richard Yao <ryao <AT> gentoo.org> |
14 |
|
15 |
sys-fs/zfs/zfs-0.6.5.3-r2.ebuild | 230 +++++++++++++++++++++++++++++++++++++++ |
16 |
1 file changed, 230 insertions(+) |
17 |
|
18 |
diff --git a/sys-fs/zfs/zfs-0.6.5.3-r2.ebuild b/sys-fs/zfs/zfs-0.6.5.3-r2.ebuild |
19 |
new file mode 100644 |
20 |
index 0000000..6963b74 |
21 |
--- /dev/null |
22 |
+++ b/sys-fs/zfs/zfs-0.6.5.3-r2.ebuild |
23 |
@@ -0,0 +1,230 @@ |
24 |
+# Copyright 1999-2015 Gentoo Foundation |
25 |
+# Distributed under the terms of the GNU General Public License v2 |
26 |
+# $Id$ |
27 |
+ |
28 |
+EAPI="5" |
29 |
+PYTHON_COMPAT=( python{2_7,3_3,3_4,3_5} ) |
30 |
+ |
31 |
+AT_M4DIR="config" |
32 |
+AUTOTOOLS_AUTORECONF="1" |
33 |
+AUTOTOOLS_IN_SOURCE_BUILD="1" |
34 |
+ |
35 |
+if [ ${PV} == "9999" ] ; then |
36 |
+ inherit git-r3 linux-mod |
37 |
+ AUTOTOOLS_AUTORECONF="1" |
38 |
+ EGIT_REPO_URI="git://github.com/zfsonlinux/${PN}.git" |
39 |
+else |
40 |
+ SRC_URI="https://github.com/zfsonlinux/${PN}/releases/download/${P}/${P}.tar.gz |
41 |
+ https://dev.gentoo.org/~ryao/dist/${P}-patches-p1.tar.xz" |
42 |
+ KEYWORDS="~amd64 ~arm ~ppc ~ppc64" |
43 |
+fi |
44 |
+ |
45 |
+inherit autotools-utils bash-completion-r1 flag-o-matic linux-info python-r1 systemd toolchain-funcs udev |
46 |
+ |
47 |
+DESCRIPTION="Userland utilities for ZFS Linux kernel module" |
48 |
+HOMEPAGE="http://zfsonlinux.org/" |
49 |
+ |
50 |
+LICENSE="BSD-2 CDDL MIT" |
51 |
+SLOT="0" |
52 |
+IUSE="custom-cflags debug kernel-builtin +rootfs test-suite static-libs" |
53 |
+RESTRICT="test" |
54 |
+ |
55 |
+COMMON_DEPEND=" |
56 |
+ sys-apps/util-linux[static-libs?] |
57 |
+ sys-libs/zlib[static-libs(+)?] |
58 |
+ virtual/awk |
59 |
+" |
60 |
+DEPEND="${COMMON_DEPEND} |
61 |
+ virtual/pkgconfig |
62 |
+" |
63 |
+ |
64 |
+RDEPEND="${COMMON_DEPEND} |
65 |
+ !=sys-apps/grep-2.13* |
66 |
+ !kernel-builtin? ( |
67 |
+ =sys-fs/zfs-kmod-${PV}* |
68 |
+ !<sys-fs/zfs-kmod-0.6.5.3-r1 |
69 |
+ ) |
70 |
+ !sys-fs/zfs-fuse |
71 |
+ !prefix? ( virtual/udev ) |
72 |
+ test-suite? ( |
73 |
+ sys-apps/util-linux |
74 |
+ sys-devel/bc |
75 |
+ sys-block/parted |
76 |
+ sys-fs/lsscsi |
77 |
+ sys-fs/mdadm |
78 |
+ sys-process/procps |
79 |
+ virtual/modutils |
80 |
+ ) |
81 |
+ rootfs? ( |
82 |
+ app-arch/cpio |
83 |
+ app-misc/pax-utils |
84 |
+ !<sys-boot/grub-2.00-r2:2 |
85 |
+ ) |
86 |
+ !>=sys-fs/udev-init-scripts-28 |
87 |
+" |
88 |
+ |
89 |
+AT_M4DIR="config" |
90 |
+AUTOTOOLS_IN_SOURCE_BUILD="1" |
91 |
+ |
92 |
+pkg_setup() { |
93 |
+ if use kernel_linux && use test-suite; then |
94 |
+ linux-info_pkg_setup |
95 |
+ if ! linux_config_exists; then |
96 |
+ ewarn "Cannot check the linux kernel configuration." |
97 |
+ else |
98 |
+ # recheck that we don't have usblp to collide with libusb |
99 |
+ if use test-suite; then |
100 |
+ if linux_chkconfig_present BLK_DEV_LOOP; then |
101 |
+ eerror "The ZFS test suite requires loop device support enabled." |
102 |
+ eerror "Please enable it:" |
103 |
+ eerror " CONFIG_BLK_DEV_LOOP=y" |
104 |
+ eerror "in /usr/src/linux/.config or" |
105 |
+ eerror " Device Drivers --->" |
106 |
+ eerror " Block devices --->" |
107 |
+ eerror " [ ] Loopback device support" |
108 |
+ fi |
109 |
+ fi |
110 |
+ fi |
111 |
+ fi |
112 |
+ |
113 |
+} |
114 |
+ |
115 |
+src_prepare() { |
116 |
+ if [ ${PV} != "9999" ] |
117 |
+ then |
118 |
+ # Apply patch set |
119 |
+ EPATCH_SUFFIX="patch" \ |
120 |
+ EPATCH_FORCE="yes" \ |
121 |
+ epatch "${WORKDIR}/${P}-patches" |
122 |
+ fi |
123 |
+ |
124 |
+ # Update paths |
125 |
+ sed -e "s|/sbin/lsmod|/bin/lsmod|" \ |
126 |
+ -e "s|/usr/bin/scsi-rescan|/usr/sbin/rescan-scsi-bus|" \ |
127 |
+ -e "s|/sbin/parted|/usr/sbin/parted|" \ |
128 |
+ -i scripts/common.sh.in |
129 |
+ |
130 |
+ autotools-utils_src_prepare |
131 |
+} |
132 |
+ |
133 |
+src_configure() { |
134 |
+ use custom-cflags || strip-flags |
135 |
+ local myeconfargs=( |
136 |
+ --bindir="${EPREFIX}/bin" |
137 |
+ --sbindir="${EPREFIX}/sbin" |
138 |
+ --with-config=user |
139 |
+ --with-dracutdir="/usr/$(get_libdir)/dracut" |
140 |
+ --with-linux="${KV_DIR}" |
141 |
+ --with-linux-obj="${KV_OUT_DIR}" |
142 |
+ --with-udevdir="$(get_udevdir)" |
143 |
+ --with-blkid |
144 |
+ $(use_enable debug) |
145 |
+ ) |
146 |
+ autotools-utils_src_configure |
147 |
+ |
148 |
+ # prepare systemd unit and helper script |
149 |
+ cat "${FILESDIR}/zfs.service.in" | \ |
150 |
+ sed -e "s:@sbindir@:${EPREFIX}/sbin:g" \ |
151 |
+ -e "s:@sysconfdir@:${EPREFIX}/etc:g" \ |
152 |
+ > "${T}/zfs.service" || die |
153 |
+ cat "${FILESDIR}/zfs-init.sh.in" | \ |
154 |
+ sed -e "s:@sbindir@:${EPREFIX}/sbin:g" \ |
155 |
+ -e "s:@sysconfdir@:${EPREFIX}/etc:g" \ |
156 |
+ > "${T}/zfs-init.sh" || die |
157 |
+} |
158 |
+ |
159 |
+src_install() { |
160 |
+ autotools-utils_src_install |
161 |
+ gen_usr_ldscript -a uutil nvpair zpool zfs zfs_core |
162 |
+ use test-suite || rm -rf "${ED}usr/share/zfs" |
163 |
+ |
164 |
+ newbashcomp "${FILESDIR}/bash-completion-r1" zfs |
165 |
+ bashcomp_alias zfs zpool |
166 |
+ |
167 |
+ exeinto /usr/libexec |
168 |
+ doexe "${T}/zfs-init.sh" |
169 |
+ systemd_dounit "${T}/zfs.service" |
170 |
+} |
171 |
+ |
172 |
+pkg_postinst() { |
173 |
+ if ! use kernel-builtin && [ ${PV} = "9999" ] |
174 |
+ then |
175 |
+ einfo "Adding ${P} to the module database to ensure that the" |
176 |
+ einfo "kernel modules and userland utilities stay in sync." |
177 |
+ update_moduledb |
178 |
+ fi |
179 |
+ |
180 |
+ if [ -e "${EROOT}etc/runlevels/boot/zfs" ] |
181 |
+ then |
182 |
+ einfo 'The zfs boot script has been split into the zfs-import,' |
183 |
+ einfo 'zfs-mount and zfs-share scripts.' |
184 |
+ einfo |
185 |
+ einfo 'You had the zfs script in your boot runlevel. For your' |
186 |
+ einfo 'convenience, it has been automatically removed and the three' |
187 |
+ einfo 'scripts that replace it have been configured to start.' |
188 |
+ einfo 'The zfs-import and zfs-mount scripts have been added to the boot' |
189 |
+ einfo 'runlevel while the zfs-share script is in the default runlevel.' |
190 |
+ |
191 |
+ rm "${EROOT}etc/runlevels/boot/zfs" |
192 |
+ ln -snf "${EROOT}etc/init.d/zfs-import" \ |
193 |
+ "${EROOT}etc/runlevels/boot/zfs-import" |
194 |
+ ln -snf "${EROOT}etc/init.d/zfs-mount" \ |
195 |
+ "${EROOT}etc/runlevels/boot/zfs-mount" |
196 |
+ ln -snf "${EROOT}etc/init.d/zfs-share" \ |
197 |
+ "${EROOT}etc/runlevels/default/zfs-share" |
198 |
+ else |
199 |
+ [ -e "${EROOT}etc/runlevels/boot/zfs-import" ] || \ |
200 |
+ einfo "You should add zfs-import to the boot runlevel." |
201 |
+ [ -e "${EROOT}etc/runlevels/boot/zfs-mount" ] || \ |
202 |
+ einfo "You should add zfs-mount to the boot runlevel." |
203 |
+ [ -e "${EROOT}etc/runlevels/default/zfs-share" ] || \ |
204 |
+ einfo "You should add zfs-share to the default runlevel." |
205 |
+ fi |
206 |
+ |
207 |
+ if [ -e "${EROOT}etc/runlevels/default/zed" ] |
208 |
+ then |
209 |
+ einfo 'The downstream OpenRC zed script has replaced by the upstream' |
210 |
+ einfo 'OpenRC zfs-zed script.' |
211 |
+ einfo |
212 |
+ einfo 'You had the zed script in your default runlevel. For your' |
213 |
+ einfo 'convenience, it has been automatically removed and the zfs-zed' |
214 |
+ einfo 'script that replaced it has been configured to start.' |
215 |
+ |
216 |
+ rm "${EROOT}etc/runlevels/boot/zed" |
217 |
+ ln -snf "${EROOT}etc/init.d/zfs-sed" \ |
218 |
+ "${EROOT}etc/runlevels/default/zfs-zed" |
219 |
+ else |
220 |
+ [ -e "${EROOT}etc/runlevels/default/zfs-zed" ] || \ |
221 |
+ einfo "You should add zfs-zed to the default runlevel." |
222 |
+ fi |
223 |
+ |
224 |
+ if [ -e "${EROOT}etc/runlevels/shutdown/zfs-shutdown" ] |
225 |
+ then |
226 |
+ einfo "The zfs-shutdown script is obsolete. Removing it from runlevel." |
227 |
+ rm "${EROOT}etc/runlevels/shutdown/zfs-shutdown" |
228 |
+ fi |
229 |
+ |
230 |
+ einfo "sys-kernel/spl-0.6.5.3-r1, sys-fs/zfs-kmod-0.6.5.3-r1 and " |
231 |
+ einfo "sys-fs/zfs-0.6.5.3-r1 have introduced a partial stable " |
232 |
+ einfo "/dev/zfs API developed by ClusterHQ. This means that situations " |
233 |
+ einfo "arising from the kernel modules and userland tools being " |
234 |
+ einfo "mismatched on future updates will not cause problems." |
235 |
+ einfo |
236 |
+ einfo "In specific, this should solve the failure to mount filesystems when " |
237 |
+ einfo "old modules are cached in an old initramfs provided that those " |
238 |
+ einfo "modules support this API" |
239 |
+ if use rootfs |
240 |
+ then |
241 |
+ einfo |
242 |
+ ewarn "The older modules will *NOT* work with the new userland code." |
243 |
+ ewarn "It is very important that you update your initramfs after this " |
244 |
+ ewarn "update." |
245 |
+ fi |
246 |
+} |
247 |
+ |
248 |
+pkg_postrm() { |
249 |
+ if ! use kernel-builtin && [ ${PV} = "9999" ] |
250 |
+ then |
251 |
+ remove_moduledb |
252 |
+ fi |
253 |
+} |