Gentoo Archives: gentoo-commits

From: Georgy Yakovlev <gyakovlev@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-fs/zfs-kmod/files/, sys-fs/zfs-kmod/
Date: Wed, 09 Jan 2019 06:31:19
Message-Id: 1547015279.88f9fdae57b9424aabdf32ecca18718681983f33.gyakovlev@gentoo
1 commit: 88f9fdae57b9424aabdf32ecca18718681983f33
2 Author: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
3 AuthorDate: Tue Jan 8 20:00:53 2019 +0000
4 Commit: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
5 CommitDate: Wed Jan 9 06:27:59 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=88f9fdae
7
8 sys-fs/zfs-kmod: 0.7.12 linux-4.20 compatible
9
10 backport of current_kernel_time64() fix from 0.7.13-tbr
11
12 Package-Manager: Portage-2.3.54, Repoman-2.3.12
13 Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org>
14
15 .../files/zfs-kmod-0.7.12-kernel-4.20-compat.patch | 31 +++++
16 sys-fs/zfs-kmod/zfs-kmod-0.7.12-r1.ebuild | 148 +++++++++++++++++++++
17 2 files changed, 179 insertions(+)
18
19 diff --git a/sys-fs/zfs-kmod/files/zfs-kmod-0.7.12-kernel-4.20-compat.patch b/sys-fs/zfs-kmod/files/zfs-kmod-0.7.12-kernel-4.20-compat.patch
20 new file mode 100644
21 index 00000000000..75ed3c57992
22 --- /dev/null
23 +++ b/sys-fs/zfs-kmod/files/zfs-kmod-0.7.12-kernel-4.20-compat.patch
24 @@ -0,0 +1,31 @@
25 +From 4f981f6ab614a908f912f7dc147b248f96b498a2 Mon Sep 17 00:00:00 2001
26 +From: satmandu <satadru@×××××.edu>
27 +Date: Wed, 26 Dec 2018 12:36:28 -0500
28 +Subject: [PATCH] Additional fixes for current_kernel_time in 4.20 on 0.7.x
29 +
30 +While https://github.com/zfsonlinux/spl/commit/cd1b28e0cfa923db988611df28958f7b84b53530 fixed the 4.20 current_kernel_time issues in spl as per https://github.com/zfsonlinux/zfs/pull/8074 in .07.x, current_kernel_time is still being used inside zpios-ctl.h in 0.7.x.
31 +
32 +I believe this may fix this issue in 0.7.x to allow it to compile successfully for kernel 4.2.0.
33 +---
34 + include/zpios-ctl.h | 7 +++++--
35 + 1 file changed, 5 insertions(+), 2 deletions(-)
36 +
37 +diff --git a/include/zpios-ctl.h b/include/zpios-ctl.h
38 +index f17f1153260..068c9eaf173 100644
39 +--- a/include/zpios-ctl.h
40 ++++ b/include/zpios-ctl.h
41 +@@ -181,9 +181,12 @@ zpios_timespec_t
42 + zpios_timespec_now(void)
43 + {
44 + zpios_timespec_t zts_now;
45 +- struct timespec ts_now;
46 ++ #if defined(HAVE_INODE_TIMESPEC64_TIMES)
47 ++ inode_timespec_t ts_now = current_kernel_time64();
48 ++ #else
49 ++ inode_timespec_t ts_now = current_kernel_time();
50 ++ #endif
51 +
52 +- ts_now = current_kernel_time();
53 + zts_now.ts_sec = ts_now.tv_sec;
54 + zts_now.ts_nsec = ts_now.tv_nsec;
55 +
56
57 diff --git a/sys-fs/zfs-kmod/zfs-kmod-0.7.12-r1.ebuild b/sys-fs/zfs-kmod/zfs-kmod-0.7.12-r1.ebuild
58 new file mode 100644
59 index 00000000000..ad9bf31d87c
60 --- /dev/null
61 +++ b/sys-fs/zfs-kmod/zfs-kmod-0.7.12-r1.ebuild
62 @@ -0,0 +1,148 @@
63 +# Copyright 1999-2019 Gentoo Authors
64 +# Distributed under the terms of the GNU General Public License v2
65 +
66 +EAPI="5"
67 +
68 +if [ ${PV} == "9999" ]; then
69 + AUTOTOOLS_AUTORECONF="1"
70 + EGIT_REPO_URI="https://github.com/zfsonlinux/zfs.git"
71 + inherit git-r3
72 +else
73 + SRC_URI="https://github.com/zfsonlinux/zfs/releases/download/zfs-${PV}/zfs-${PV}.tar.gz"
74 + S="${WORKDIR}/zfs-${PV}"
75 + KEYWORDS="~amd64"
76 +fi
77 +
78 +inherit flag-o-matic linux-info linux-mod toolchain-funcs autotools-utils
79 +
80 +DESCRIPTION="Linux ZFS kernel module for sys-fs/zfs"
81 +HOMEPAGE="https://zfsonlinux.org/"
82 +
83 +LICENSE="CDDL debug? ( GPL-2+ )"
84 +SLOT="0"
85 +IUSE="custom-cflags debug +rootfs"
86 +RESTRICT="debug? ( strip ) test"
87 +
88 +DEPEND="
89 + =sys-kernel/spl-${PV}*
90 + dev-lang/perl
91 + virtual/awk
92 +"
93 +
94 +RDEPEND="${DEPEND}
95 + !sys-fs/zfs-fuse
96 +"
97 +
98 +AT_M4DIR="config"
99 +AUTOTOOLS_IN_SOURCE_BUILD="1"
100 +
101 +DOCS=( AUTHORS COPYRIGHT DISCLAIMER README.markdown )
102 +
103 +PATCHES=( "${FILESDIR}/${P}-kernel-4.20-compat.patch" )
104 +
105 +pkg_setup() {
106 + linux-info_pkg_setup
107 + CONFIG_CHECK="
108 + !DEBUG_LOCK_ALLOC
109 + EFI_PARTITION
110 + IOSCHED_NOOP
111 + MODULES
112 + !PAX_KERNEXEC_PLUGIN_METHOD_OR
113 + !TRIM_UNUSED_KSYMS
114 + ZLIB_DEFLATE
115 + ZLIB_INFLATE
116 + "
117 +
118 + use debug && CONFIG_CHECK="${CONFIG_CHECK}
119 + FRAME_POINTER
120 + DEBUG_INFO
121 + !DEBUG_INFO_REDUCED
122 + "
123 +
124 + use rootfs && \
125 + CONFIG_CHECK="${CONFIG_CHECK}
126 + BLK_DEV_INITRD
127 + DEVTMPFS
128 + "
129 +
130 + kernel_is ge 2 6 32 || die "Linux 2.6.32 or newer required"
131 +
132 + [ ${PV} != "9999" ] && \
133 + { kernel_is le 4 20 || die "Linux 4.20 is the latest supported version."; }
134 +
135 + check_extra_config
136 +}
137 +
138 +src_prepare() {
139 + # Remove GPLv2-licensed ZPIOS unless we are debugging
140 + use debug || sed -e 's/^subdir-m += zpios$//' -i "${S}/module/Makefile.in"
141 +
142 + # Set module revision number
143 + [ ${PV} != "9999" ] && \
144 + { sed -i "s/\(Release:\)\(.*\)1/\1\2${PR}-gentoo/" "${S}/META" || die "Could not set Gentoo release"; }
145 +
146 + autotools-utils_src_prepare
147 +}
148 +
149 +src_configure() {
150 + local SPL_PATH="$(basename $(echo "${EROOT}usr/src/spl-"*))"
151 + use custom-cflags || strip-flags
152 + filter-ldflags -Wl,*
153 +
154 + set_arch_to_kernel
155 + local myeconfargs=(${myeconfargs}
156 + --bindir="${EPREFIX}/bin"
157 + --sbindir="${EPREFIX}/sbin"
158 + --with-config=kernel
159 + --with-linux="${KV_DIR}"
160 + --with-linux-obj="${KV_OUT_DIR}"
161 + --with-spl="${EROOT}usr/src/${SPL_PATH}"
162 + --with-spl-obj="${EROOT}usr/src/${SPL_PATH}/${KV_FULL}"
163 + $(use_enable debug)
164 + )
165 +
166 + autotools-utils_src_configure
167 +}
168 +
169 +src_install() {
170 + autotools-utils_src_install INSTALL_MOD_PATH="${INSTALL_MOD_PATH:-$EROOT}"
171 +}
172 +
173 +pkg_postinst() {
174 + linux-mod_pkg_postinst
175 +
176 + # Remove old modules
177 + if [ -d "${EROOT}lib/modules/${KV_FULL}/addon/zfs" ]
178 + then
179 + ewarn "${PN} now installs modules in ${EROOT}lib/modules/${KV_FULL}/extra/zfs"
180 + ewarn "Old modules were detected in ${EROOT}lib/modules/${KV_FULL}/addon/zfs"
181 + ewarn "Automatically removing old modules to avoid problems."
182 + rm -r "${EROOT}lib/modules/${KV_FULL}/addon/zfs" || die "Cannot remove modules"
183 + rmdir --ignore-fail-on-non-empty "${EROOT}lib/modules/${KV_FULL}/addon"
184 + fi
185 +
186 + if use x86 || use arm
187 + then
188 + ewarn "32-bit kernels will likely require increasing vmalloc to"
189 + ewarn "at least 256M and decreasing zfs_arc_max to some value less than that."
190 + fi
191 +
192 + ewarn "This version of ZFSOnLinux includes support for new feature flags"
193 + ewarn "that are incompatible with previous versions. GRUB2 support for"
194 + ewarn "/boot with the new feature flags is not yet available."
195 + ewarn "Do *NOT* upgrade root pools to use the new feature flags."
196 + ewarn "Any new pools will be created with the new feature flags by default"
197 + ewarn "and will not be compatible with older versions of ZFSOnLinux. To"
198 + ewarn "create a newpool that is backward compatible wih GRUB2, use "
199 + ewarn
200 + ewarn "zpool create -d -o feature@async_destroy=enabled "
201 + ewarn " -o feature@empty_bpobj=enabled -o feature@lz4_compress=enabled"
202 + ewarn " -o feature@spacemap_histogram=enabled"
203 + ewarn " -o feature@enabled_txg=enabled "
204 + ewarn " -o feature@extensible_dataset=enabled -o feature@bookmarks=enabled"
205 + ewarn " ..."
206 + ewarn
207 + ewarn "GRUB2 support will be updated as soon as either the GRUB2"
208 + ewarn "developers do a tag or the Gentoo developers find time to backport"
209 + ewarn "support from GRUB2 HEAD."
210 +}