Skip to content
Snippets Groups Projects
Verified Commit 2f672905 authored by Spotlight Deveaux's avatar Spotlight Deveaux :fox:
Browse files

sys-fs/zfs-kmod: Add support for Linux 6.1.x

parent 6c35285a
No related branches found
No related tags found
No related merge requests found
AUX zfs-kmod-2.1.6-fgrep.patch 2183 BLAKE2B b8c9b58cc6d94e9ddeacbe3c5eca9d040f1c6fba84b814c8c553d5c1e15334765d3190286a4ad2298762bc54f66a8b89ef69d115cfbd5a25d928170a1d46a770 SHA512 f65e7ffa8cfd00da7ad6d1fcbf5d61172c52e55ea2630f719b49750692c1c046e8baed0e04cadc841adbd804cf861ec712b0d07dbbcae7c1c3b475326045ae8c
DIST zfs-2.1.7.tar.gz 35092436 BLAKE2B 9c85c3eb72f3bb39bc4fd44aaa80338ca197a4e8183436fee73cd56705abfdaecfaf1b6fbe8dd508ccce707c8259c7ab6e1733b60b17757f0a7ff92d4e52bbad SHA512 6a31eb8fbee90ad1abcfedb9000991761aff7591b11362eb5ec6e0bb4b785a7004a251439409d7bd3f51fc995c859614da6313655337952f70bae07ac8ee0140
DIST zfs-2.1.7.tar.gz.asc 836 BLAKE2B 648fb818860a1cecc2ec42f23102e0466c038bfe48f5feca1ab58afb9cb439a0fe51cb89941f63a05c14d3b6f95c64dd3910c9a06b9cac14c467b963c65c2948 SHA512 4d4fef707bdfc37a82eb79aa0a21c71e30779bcf2ac54fe2df45a03e3302e2a45cb9f4e4ff0122b892b1e608a9f09e86d1334e0c7d9bf681780505f6e1439f9f
EBUILD zfs-kmod-2.1.7.ebuild 5487 BLAKE2B a86578cba17f00faef6dbb0bc5ef4d33716d5bb3296a1e529b4ff4f4466ca409fc283c159b8cf8e516bbca4037d930748a2b53d36df0875f8da606810f7f873e SHA512 18f456bdd577585c0626fc2ab240d9c650a79e60e9f2e8bcee38d8d6d28e4906dda9e833fc04d9deef5536bff379b874e8605f9ad1fc242839e890f0cfa61355
MISC metadata.xml 651 BLAKE2B 477c5d768a2eddab7bc0c14d0845801e25bfd9298fe229a132d7ff11a8560988d0230ec5d4b1447df32f58b9754df0cbe989f2a5600cd3fa99124ea4edc45cdd SHA512 d9bf0598c87bcdaab7d81dd5502caf1400f3c8d3834a6770630d85ed365cd4ebb3beeebae72d2d4d49bcdd0aa6cd709aa57cb2af4195dfc04a9c0cef89cfd724
https://github.com/openzfs/zfs/commit/d30577c9dd811688f2609ad532b011b99bceb485
From d30577c9dd811688f2609ad532b011b99bceb485 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=D0=BD=D0=B0=D0=B1?= <nabijaczleweli@nabijaczleweli.xyz>
Date: Sat, 12 Mar 2022 00:26:46 +0100
Subject: [PATCH] fgrep -> grep -F
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: John Kennedy <john.kennedy@delphix.com>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #13259
--- a/config/kernel.m4
+++ b/config/kernel.m4
@@ -394,11 +394,11 @@ AC_DEFUN([ZFS_AC_KERNEL], [
utsrelease1=$kernelbuild/include/linux/version.h
utsrelease2=$kernelbuild/include/linux/utsrelease.h
utsrelease3=$kernelbuild/include/generated/utsrelease.h
- AS_IF([test -r $utsrelease1 && fgrep -q UTS_RELEASE $utsrelease1], [
+ AS_IF([test -r $utsrelease1 && grep -qF UTS_RELEASE $utsrelease1], [
utsrelease=$utsrelease1
- ], [test -r $utsrelease2 && fgrep -q UTS_RELEASE $utsrelease2], [
+ ], [test -r $utsrelease2 && grep -qF UTS_RELEASE $utsrelease2], [
utsrelease=$utsrelease2
- ], [test -r $utsrelease3 && fgrep -q UTS_RELEASE $utsrelease3], [
+ ], [test -r $utsrelease3 && grep -qF UTS_RELEASE $utsrelease3], [
utsrelease=$utsrelease3
])
--- a/config/zfs-build.m4
+++ b/config/zfs-build.m4
@@ -173,7 +173,7 @@ AC_DEFUN([ZFS_AC_DEBUG_KMEM_TRACKING], [
])
AC_DEFUN([ZFS_AC_DEBUG_INVARIANTS_DETECT_FREEBSD], [
- AS_IF([sysctl -n kern.conftxt | fgrep -qx $'options\tINVARIANTS'],
+ AS_IF([sysctl -n kern.conftxt | grep -Fqx $'options\tINVARIANTS'],
[enable_invariants="yes"],
[enable_invariants="no"])
])
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_wait/zpool_wait.kshlib
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_wait/zpool_wait.kshlib
@@ -120,5 +120,5 @@ function check_while_waiting
# Whether any vdev in the given pool is initializing
function is_vdev_initializing # pool
{
- zpool status -i "$1" | grep 'initialized, started' >/dev/null
+ zpool status -i "$1" | grep -q 'initialized, started'
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person">
<email>gyakovlev@gentoo.org</email>
<name>Georgy Yakovlev</name>
</maintainer>
<maintainer type="person">
<email>sam@gentoo.org</email>
<name>Sam James</name>
</maintainer>
<use>
<flag name="rootfs">Pull dependencies and check kernel options required for root-on-zfs</flag>
</use>
<upstream>
<bugs-to>https://github.com/openzfs/zfs/issues</bugs-to>
<doc>https://openzfs.github.io/openzfs-docs</doc>
<remote-id type="github">openzfs/zfs</remote-id>
</upstream>
</pkgmetadata>
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
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="6.1"
# 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 ~sparc"
fi
fi
LICENSE="CDDL MIT debug? ( GPL-2+ )"
SLOT="0/${PVR}"
IUSE="custom-cflags debug +rootfs"
RDEPEND="${DEPEND}"
BDEPEND="
dev-lang/perl
app-alternatives/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? ( sec-keys/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 )
PATCHES=(
"${FILESDIR}"/${PN}-2.1.6-fgrep.patch
)
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_unpack() {
if use verify-sig ; then
# Needed for downloaded patch (which is unsigned, which is fine)
verify-sig_verify_detached "${DISTDIR}"/zfs-${MY_PV}.tar.gz{,.asc}
fi
default
}
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=:
# INSTALL_MOD_PATH ?= $(DESTDIR) in module/Makefile
DESTDIR="${D}"
)
emake "${myemakeargs[@]}" install
einstalldocs
}
pkg_postinst() {
linux-mod_pkg_postinst
if [[ -z ${ROOT} ]] && use dist-kernel; then
set_arch_to_pkgmgr
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 OpenZFS. To"
ewarn "create a new pool that is backward compatible wih GRUB2, use "
ewarn
ewarn "zpool create -o compatibility=grub2 ..."
ewarn
ewarn "Refer to /usr/share/zfs/compatibility.d/grub2 for list of features."
fi
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment