commit:     1b2ed0f7b04c245918a39e6798f3948e0d8fcfbc
Author:     Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
AuthorDate: Thu Dec 16 02:28:58 2021 +0000
Commit:     Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
CommitDate: Thu Dec 16 02:50:58 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1b2ed0f7

sys-fs/zfs-kmod: add 2.1.2

Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org>

 sys-fs/zfs-kmod/Manifest              |   2 +
 sys-fs/zfs-kmod/zfs-kmod-2.1.2.ebuild | 205 ++++++++++++++++++++++++++++++++++
 2 files changed, 207 insertions(+)

diff --git a/sys-fs/zfs-kmod/Manifest b/sys-fs/zfs-kmod/Manifest
index 2901db693d59..e5cc220e8b89 100644
--- a/sys-fs/zfs-kmod/Manifest
+++ b/sys-fs/zfs-kmod/Manifest
@@ -3,3 +3,5 @@ DIST zfs-2.0.6.tar.gz 13192941 BLAKE2B 
3a83303b016ec4259c286af8a9ceb281829d26508
 DIST zfs-2.0.6.tar.gz.asc 836 BLAKE2B 
065eba3361ef4234acc67df0236ab9a6737ba9fe5a706be98b55dd64d10360160ca787d8873f27451a2107225ae657dc4cab20a7c2a268cd2de64c8d82d0327a
 SHA512 
123569ecfcee22ac462160acf61b120144c774bc5c0d46a50d2b7312f7565da1a9d780e1a6207dba5834917c66d5b852763e4a3162378d5c9bb90b0dfde35c5c
 DIST zfs-2.1.1.tar.gz 34836374 BLAKE2B 
09ee6bd30e8266342bd975454086049c3fd9142e7dacfe52166575c20e3c92688f9b457d75b2a2068fc281e65f78e1d47450545504cdf8bc31e23663545d7800
 SHA512 
b69ce764a9f7438ec2c90f86be02abfd684c67cd38de876374e3e6f4b2f82a75d86fa70205def2ba454ad27e52ec8d955ebc4ba456e91d397129a54ea849c19c
 DIST zfs-2.1.1.tar.gz.asc 195 BLAKE2B 
d886e7dc74270228f98dfc5ca85bbbe897d5a87a5ae8bbfde28e2af1b36218227bc9f1b5902e97beebe160a298857d6e4673829d87cd8039332dc1858cfcffc0
 SHA512 
d76956b5c1bd547a319e70dd33d50beae39f65fca54532731426d2ef209385a556c51b3936051f75bc3800623c42da5b8d279c51f501a896f5fdfb7b4ed7fb94
+DIST zfs-2.1.2.tar.gz 34829045 BLAKE2B 
ab4e2d85200438373c7eeeaa5256a712dbfb2862b85de1fb7554ad0cc2b9f8e1255ab4564bca62f65a81a823adb8c112957e6e8771b8e5e6944c3731bc894584
 SHA512 
3e3932259da2a27f1c4cca8da62b909edc43bf51ab0229d2d5d0234d9a7eaa7b63b67c06a98cbe2d29ba1eb5cbcaab16e5062c2a2bc8e84cab770be10ebf2102
+DIST zfs-2.1.2.tar.gz.asc 836 BLAKE2B 
8f5666f5c3d7016a4d79191f42d0a220fe8c654a0d64e3da3b575644fe52c83dcb9f9ef49ba0553771a127bba44e2802f1d366a7a38f670e73612deef76755c3
 SHA512 
da6bfccd19a249a6891f5e1de6c4b332e98ce4f125f638c046b9cedac3fd79c56a99dd9a620105a40741e5f04b382f5d5996b56cbe576fb268b31e57e0fed6eb

diff --git a/sys-fs/zfs-kmod/zfs-kmod-2.1.2.ebuild 
b/sys-fs/zfs-kmod/zfs-kmod-2.1.2.ebuild
new file mode 100644
index 000000000000..2da5383cff4e
--- /dev/null
+++ b/sys-fs/zfs-kmod/zfs-kmod-2.1.2.ebuild
@@ -0,0 +1,205 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit autotools dist-kernel-utils flag-o-matic linux-mod toolchain-funcs
+
+DESCRIPTION="Linux ZFS kernel module for sys-fs/zfs"
+HOMEPAGE="https://github.com/openzfs/zfs";
+
+if [[ ${PV} == "9999" ]]; then
+       inherit git-r3
+       EGIT_REPO_URI="https://github.com/openzfs/zfs.git";
+else
+       VERIFY_SIG_OPENPGP_KEY_PATH=${BROOT}/usr/share/openpgp-keys/openzfs.asc
+       inherit verify-sig
+
+       MY_PV="${PV/_rc/-rc}"
+       
SRC_URI="https://github.com/openzfs/zfs/releases/download/zfs-${MY_PV}/zfs-${MY_PV}.tar.gz";
+       SRC_URI+=" verify-sig? ( 
https://github.com/openzfs/zfs/releases/download/zfs-${MY_PV}/zfs-${MY_PV}.tar.gz.asc
 )"
+       S="${WORKDIR}/zfs-${PV%_rc?}"
+       ZFS_KERNEL_COMPAT="5.15"
+
+       #  increments minor eg 5.14 -> 5.15, and still supports override.
+       ZFS_KERNEL_DEP="${ZFS_KERNEL_COMPAT_OVERRIDE:-${ZFS_KERNEL_COMPAT}}"
+       ZFS_KERNEL_DEP="${ZFS_KERNEL_DEP%%.*}.$(( ${ZFS_KERNEL_DEP##*.} + 1))"
+
+       if [[ ${PV} != *_rc* ]]; then
+               KEYWORDS="~amd64 ~arm64 ~ppc64 ~riscv"
+       fi
+fi
+
+LICENSE="CDDL MIT debug? ( GPL-2+ )"
+SLOT="0/${PVR}"
+IUSE="custom-cflags debug +rootfs"
+
+RDEPEND="${DEPEND}
+       !sys-kernel/spl
+"
+
+BDEPEND="
+       dev-lang/perl
+       virtual/awk
+"
+
+# we want dist-kernel block in BDEPEND because of portage resolver.
+# since linux-mod.eclass already sets version-unbounded dep, portage
+# will pull new versions. So we set it in BDEPEND which takes priority.
+# and we don't need in in git ebuild.
+if [[ ${PV} != "9999" ]] ; then
+       BDEPEND+="
+               verify-sig? ( app-crypt/openpgp-keys-openzfs )
+               dist-kernel? ( <virtual/dist-kernel-${ZFS_KERNEL_DEP}:= )
+       "
+fi
+
+# PDEPEND in this form is needed to trick portage suggest
+# enabling dist-kernel if only 1 package have it set
+PDEPEND="dist-kernel? ( ~sys-fs/zfs-${PV}[dist-kernel] )"
+
+RESTRICT="debug? ( strip ) test"
+
+DOCS=( AUTHORS COPYRIGHT META README.md )
+
+pkg_pretend() {
+       use rootfs || return 0
+
+       if has_version virtual/dist-kernel && ! use dist-kernel; then
+               ewarn "You have virtual/dist-kernel installed, but"
+               ewarn "USE=\"dist-kernel\" is not enabled for ${CATEGORY}/${PN}"
+               ewarn "It's recommended to globally enable dist-kernel USE flag"
+               ewarn "to auto-trigger initrd rebuilds with kernel updates"
+       fi
+}
+
+pkg_setup() {
+       CONFIG_CHECK="
+               !DEBUG_LOCK_ALLOC
+               EFI_PARTITION
+               MODULES
+               !PAX_KERNEXEC_PLUGIN_METHOD_OR
+               !TRIM_UNUSED_KSYMS
+               ZLIB_DEFLATE
+               ZLIB_INFLATE
+       "
+
+       use debug && CONFIG_CHECK="${CONFIG_CHECK}
+               FRAME_POINTER
+               DEBUG_INFO
+               !DEBUG_INFO_REDUCED
+       "
+
+       use rootfs && \
+               CONFIG_CHECK="${CONFIG_CHECK}
+                       BLK_DEV_INITRD
+                       DEVTMPFS
+       "
+
+       kernel_is -lt 5 && CONFIG_CHECK="${CONFIG_CHECK} IOSCHED_NOOP"
+
+       if [[ ${PV} != "9999" ]]; then
+               local kv_major_max kv_minor_max zcompat
+               zcompat="${ZFS_KERNEL_COMPAT_OVERRIDE:-${ZFS_KERNEL_COMPAT}}"
+               kv_major_max="${zcompat%%.*}"
+               zcompat="${zcompat#*.}"
+               kv_minor_max="${zcompat%%.*}"
+               kernel_is -le "${kv_major_max}" "${kv_minor_max}" || die \
+                       "Linux ${kv_major_max}.${kv_minor_max} is the latest 
supported version"
+
+       fi
+
+       kernel_is -ge 3 10 || die "Linux 3.10 or newer required"
+
+       linux-mod_pkg_setup
+}
+
+src_prepare() {
+       default
+
+       # Run unconditionally (bug #792627)
+       eautoreconf
+
+       if [[ ${PV} != "9999" ]]; then
+               # Set module revision number
+               sed -i "s/\(Release:\)\(.*\)1/\1\2${PR}-gentoo/" META || die 
"Could not set Gentoo release"
+       fi
+}
+
+src_configure() {
+       set_arch_to_kernel
+
+       use custom-cflags || strip-flags
+
+       filter-ldflags -Wl,*
+
+       # Set CROSS_COMPILE in the environment.
+       # This allows the user to override it via make.conf or via a local 
Makefile.
+       # https://bugs.gentoo.org/811600
+       export CROSS_COMPILE=${CROSS_COMPILE-${CHOST}-}
+
+       local myconf=(
+               HOSTCC="$(tc-getBUILD_CC)"
+               --bindir="${EPREFIX}/bin"
+               --sbindir="${EPREFIX}/sbin"
+               --with-config=kernel
+               --with-linux="${KV_DIR}"
+               --with-linux-obj="${KV_OUT_DIR}"
+               $(use_enable debug)
+       )
+
+       econf "${myconf[@]}"
+}
+
+src_compile() {
+       set_arch_to_kernel
+
+       myemakeargs=(
+               HOSTCC="$(tc-getBUILD_CC)"
+               V=1
+       )
+
+       emake "${myemakeargs[@]}"
+}
+
+src_install() {
+       set_arch_to_kernel
+
+       myemakeargs+=(
+               DEPMOD=:
+               DESTDIR="${D}"
+               INSTALL_MOD_PATH="${EPREFIX:-/}" # lib/modules/<kver> added by 
KBUILD
+       )
+
+       emake "${myemakeargs[@]}" install
+
+       einstalldocs
+}
+
+pkg_postinst() {
+       linux-mod_pkg_postinst
+
+       if [[ -z ${ROOT} ]] && use dist-kernel; then
+               set_arch_to_portage
+               dist-kernel_reinstall_initramfs "${KV_DIR}" "${KV_FULL}"
+       fi
+
+       if use x86 || use arm; then
+               ewarn "32-bit kernels will likely require increasing vmalloc to"
+               ewarn "at least 256M and decreasing zfs_arc_max to some value 
less than that."
+       fi
+
+       if has_version sys-boot/grub; then
+               ewarn "This version of OpenZFS includes support for new feature 
flags"
+               ewarn "that are incompatible with previous versions. GRUB2 
support for"
+               ewarn "/boot with the new feature flags is not yet available."
+               ewarn "Do *NOT* upgrade root pools to use the new feature 
flags."
+               ewarn "Any new pools will be created with the new feature flags 
by default"
+               ewarn "and will not be compatible with older versions of 
ZFSOnLinux. To"
+               ewarn "create a newpool that is backward compatible wih GRUB2, 
use "
+               ewarn
+               ewarn "zpool create -o compatibility=grub2 ..."
+               ewarn
+               ewarn "Refer to /etc/zfs/compatibility.d/grub2 for list of 
features."
+       fi
+}

Reply via email to