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/
Date: Tue, 01 Dec 2020 19:04:11
Message-Id: 1606849423.bab1390fe4648ffc57ccead636ad7a28df403bd5.gyakovlev@gentoo
1 commit: bab1390fe4648ffc57ccead636ad7a28df403bd5
2 Author: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
3 AuthorDate: Tue Dec 1 18:58:58 2020 +0000
4 Commit: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
5 CommitDate: Tue Dec 1 19:03:43 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bab1390f
7
8 sys-fs/zfs-kmod: bump to 2.0.0
9
10 Package-Manager: Portage-3.0.11, Repoman-3.0.2
11 Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org>
12
13 sys-fs/zfs-kmod/Manifest | 1 +
14 sys-fs/zfs-kmod/zfs-kmod-2.0.0.ebuild | 175 ++++++++++++++++++++++++++++++++++
15 2 files changed, 176 insertions(+)
16
17 diff --git a/sys-fs/zfs-kmod/Manifest b/sys-fs/zfs-kmod/Manifest
18 index 225791a1943..3681a1f8b22 100644
19 --- a/sys-fs/zfs-kmod/Manifest
20 +++ b/sys-fs/zfs-kmod/Manifest
21 @@ -1,3 +1,4 @@
22 DIST zfs-0.8.5.tar.gz 9196381 BLAKE2B 8376f360369c4657ff1fc040fb2bba780bbd5d6a98d149d2fa4ba39478588e213dbf6db218c7bd970839f015a69ae00ac951b90afc1c26b34aadf666b2976cab SHA512 3e6e70b76f7cc5b018adb78ce7c3009f88faf5b3da0a03170b03577cd84a2937b6056621c41fc819fd08bf59b28053caf8fec375cf375816a6786bb5646ed773
23 DIST zfs-2.0.0-rc6.tar.gz 12896465 BLAKE2B e7a91d980940998a7312d48a43c07561e3b1aa72cc6f88eb534cb39b5e18de4280964ba7f690b63f5e2dd3cfdeb57d718d7389f8ab2062ff7bb6e8bb4174801a SHA512 5daf8d39766f8c8f8bca340585ae36c39507e33642a7cd2dadb74bbe1d529d5be40420057edc95814c0b554121128c0ebde59c3fbed17259870b123a56acd2e8
24 DIST zfs-2.0.0-rc7.tar.gz 12994030 BLAKE2B 12dde3b935cddabd3d3e5874685cd914f0338526ba8d22aaba2b1ff09aae64a67cc66ea0acc7d08cdc438fd8dfc93a2727bab5e90c08c2a294074692f4189214 SHA512 fbef7bc76c2b913ef8c4af55e6feb46bcadbca856b8ba28c72432bb91b8dc88de191d657aaeb5efd67ee2d67a6ffcf5d3d53b4490f9a32211a571687694e7e65
25 +DIST zfs-2.0.0.tar.gz 12989903 BLAKE2B 2961b97aa6736af9b4a2bc968d1488f49ec0c0fd7bb22b6bc015047239279efd2d48f8d7c593f9b467ac9d40f99d67363ab551bdfaf1dd71335c37c48c759875 SHA512 2706ae1aa54b882b272502e7a46e57ff41f9db9b123e8cd5dafbdd7f61975d05538167016f943804145d22aa018a1f11c884f692dc3992b28c24eac08112650f
26
27 diff --git a/sys-fs/zfs-kmod/zfs-kmod-2.0.0.ebuild b/sys-fs/zfs-kmod/zfs-kmod-2.0.0.ebuild
28 new file mode 100644
29 index 00000000000..81328da6d29
30 --- /dev/null
31 +++ b/sys-fs/zfs-kmod/zfs-kmod-2.0.0.ebuild
32 @@ -0,0 +1,175 @@
33 +# Copyright 1999-2020 Gentoo Authors
34 +# Distributed under the terms of the GNU General Public License v2
35 +
36 +EAPI=7
37 +
38 +inherit autotools flag-o-matic linux-mod toolchain-funcs
39 +
40 +DESCRIPTION="Linux ZFS kernel module for sys-fs/zfs"
41 +HOMEPAGE="https://github.com/openzfs/zfs"
42 +
43 +if [[ ${PV} == "9999" ]]; then
44 + inherit git-r3
45 + EGIT_REPO_URI="https://github.com/openzfs/zfs.git"
46 +else
47 + MY_PV="${PV/_rc/-rc}"
48 + SRC_URI="https://github.com/openzfs/zfs/releases/download/zfs-${MY_PV}/zfs-${MY_PV}.tar.gz"
49 + KEYWORDS="~amd64 ~arm64 ~ppc64"
50 + S="${WORKDIR}/zfs-${PV%_rc?}"
51 + ZFS_KERNEL_COMPAT="5.9"
52 +fi
53 +
54 +LICENSE="CDDL MIT debug? ( GPL-2+ )"
55 +SLOT="0"
56 +IUSE="custom-cflags debug +rootfs"
57 +
58 +DEPEND=""
59 +
60 +RDEPEND="${DEPEND}
61 + !sys-kernel/spl
62 +"
63 +
64 +BDEPEND="
65 + dev-lang/perl
66 + virtual/awk
67 +"
68 +
69 +RESTRICT="debug? ( strip ) test"
70 +
71 +DOCS=( AUTHORS COPYRIGHT META README.md )
72 +
73 +pkg_setup() {
74 + CONFIG_CHECK="
75 + !DEBUG_LOCK_ALLOC
76 + EFI_PARTITION
77 + MODULES
78 + !PAX_KERNEXEC_PLUGIN_METHOD_OR
79 + !TRIM_UNUSED_KSYMS
80 + ZLIB_DEFLATE
81 + ZLIB_INFLATE
82 + "
83 +
84 + use debug && CONFIG_CHECK="${CONFIG_CHECK}
85 + FRAME_POINTER
86 + DEBUG_INFO
87 + !DEBUG_INFO_REDUCED
88 + "
89 +
90 + use rootfs && \
91 + CONFIG_CHECK="${CONFIG_CHECK}
92 + BLK_DEV_INITRD
93 + DEVTMPFS
94 + "
95 +
96 + kernel_is -lt 5 && CONFIG_CHECK="${CONFIG_CHECK} IOSCHED_NOOP"
97 +
98 + if [[ ${PV} != "9999" ]]; then
99 + local kv_major_max kv_minor_max zcompat
100 + zcompat="${ZFS_KERNEL_COMPAT_OVERRIDE:-${ZFS_KERNEL_COMPAT}}"
101 + kv_major_max="${zcompat%%.*}"
102 + zcompat="${zcompat#*.}"
103 + kv_minor_max="${zcompat%%.*}"
104 + kernel_is -le "${kv_major_max}" "${kv_minor_max}" || die \
105 + "Linux ${kv_major_max}.${kv_minor_max} is the latest supported version"
106 +
107 + fi
108 +
109 + kernel_is -ge 3 10 || die "Linux 3.10 or newer required"
110 +
111 + linux-mod_pkg_setup
112 +}
113 +
114 +src_prepare() {
115 + default
116 +
117 + if [[ ${PV} == "9999" ]]; then
118 + eautoreconf
119 + else
120 + # Set module revision number
121 + sed -i "s/\(Release:\)\(.*\)1/\1\2${PR}-gentoo/" META || die "Could not set Gentoo release"
122 + fi
123 +}
124 +
125 +src_configure() {
126 + set_arch_to_kernel
127 +
128 + use custom-cflags || strip-flags
129 +
130 + filter-ldflags -Wl,*
131 +
132 + local myconf=(
133 + CROSS_COMPILE="${CHOST}-"
134 + HOSTCC="$(tc-getBUILD_CC)"
135 + --bindir="${EPREFIX}/bin"
136 + --sbindir="${EPREFIX}/sbin"
137 + --with-config=kernel
138 + --with-linux="${KV_DIR}"
139 + --with-linux-obj="${KV_OUT_DIR}"
140 + $(use_enable debug)
141 + )
142 +
143 + econf "${myconf[@]}"
144 +}
145 +
146 +src_compile() {
147 + set_arch_to_kernel
148 +
149 + myemakeargs=(
150 + CROSS_COMPILE="${CHOST}-"
151 + HOSTCC="$(tc-getBUILD_CC)"
152 + V=1
153 + )
154 +
155 + emake "${myemakeargs[@]}"
156 +}
157 +
158 +src_install() {
159 + set_arch_to_kernel
160 +
161 + myemakeargs+=(
162 + DEPMOD="/bin/true"
163 + DESTDIR="${D}"
164 + INSTALL_MOD_PATH="${INSTALL_MOD_PATH:-$EROOT}"
165 + )
166 +
167 + emake "${myemakeargs[@]}" install
168 +
169 + einstalldocs
170 +}
171 +
172 +pkg_postinst() {
173 + linux-mod_pkg_postinst
174 +
175 + # Remove old modules
176 + if [[ -d "${EROOT}/lib/modules/${KV_FULL}/addon/zfs" ]]; then
177 + ewarn "${PN} now installs modules in ${EROOT}/lib/modules/${KV_FULL}/extra/zfs"
178 + ewarn "Old modules were detected in ${EROOT}/lib/modules/${KV_FULL}/addon/zfs"
179 + ewarn "Automatically removing old modules to avoid problems."
180 + rm -r "${EROOT}/lib/modules/${KV_FULL}/addon/zfs" || die "Cannot remove modules"
181 + rmdir --ignore-fail-on-non-empty "${EROOT}/lib/modules/${KV_FULL}/addon"
182 + fi
183 +
184 + if use x86 || use arm; then
185 + ewarn "32-bit kernels will likely require increasing vmalloc to"
186 + ewarn "at least 256M and decreasing zfs_arc_max to some value less than that."
187 + fi
188 +
189 + ewarn "This version of OpenZFS includes support for new feature flags"
190 + ewarn "that are incompatible with previous versions. GRUB2 support for"
191 + ewarn "/boot with the new feature flags is not yet available."
192 + ewarn "Do *NOT* upgrade root pools to use the new feature flags."
193 + ewarn "Any new pools will be created with the new feature flags by default"
194 + ewarn "and will not be compatible with older versions of ZFSOnLinux. To"
195 + ewarn "create a newpool that is backward compatible wih GRUB2, use "
196 + ewarn
197 + ewarn "zpool create -d -o feature@async_destroy=enabled "
198 + ewarn " -o feature@empty_bpobj=enabled -o feature@lz4_compress=enabled"
199 + ewarn " -o feature@spacemap_histogram=enabled"
200 + ewarn " -o feature@enabled_txg=enabled "
201 + ewarn " -o feature@extensible_dataset=enabled -o feature@bookmarks=enabled"
202 + ewarn " ..."
203 + ewarn
204 + ewarn "GRUB2 support will be updated as soon as either the GRUB2"
205 + ewarn "developers do a tag or the Gentoo developers find time to backport"
206 + ewarn "support from GRUB2 HEAD."
207 +}