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

sys-fs/zfs-kmod: Remove

parent b8768bfb
No related branches found
No related tags found
No related merge requests found
AUX zfs-kmod-2.1.9-6.3-compat.patch 3588 BLAKE2B 2f78329bc613be0d5cd7c5cddbc37096218c6a0f72d3241037ae843f493c9204b0fa5072d30ba6ba7276b6f5217cc385cb80aa89fc4255895418b9c1ec9857f4 SHA512 808b565b247faf5a005e8088d9b556f2711f271eb7f7df177675a1ecc9331710ed19028296dc70db225f4979333237fd391bfb64a7f5d5d743e358e578c93e9b
AUX zfs-kmod-2.1.9-blkdev-compat.patch 1667 BLAKE2B 4cbfabbb37e9ed590a7c082b2d1c12ff3fb3c471a313e3db6b8c5bfe63fb956015370268caf0c0d11230f1e41fc6136ed1ec26710ca539c0a20281f2dfb18485 SHA512 b17a67cad309b498351b5833c7863b1df017e62d34843bef2784b951fd9bfc019671b0e5574da86314d7a36901c71bbfd302464096d2ab551e9842ca801ed409
DIST zfs-2.1.9.tar.gz 35106538 BLAKE2B d7553cc162687531b254089e29e2e15e2eb6b362cecd8e70c24bbb5dbffbde82036ad2d416f4caeceaa324bee8a2e59d9e3cd8a3bf55a2e3c0718c7af9562812 SHA512 a3c410abe911be7d3d66af8ad7023a810eb4ae3284001e544c3a34275eb17a4916a7c094936a2628a590007c007eea84673efa9f3201fd9f24c499fd5ed3ed75
DIST zfs-2.1.9.tar.gz.asc 836 BLAKE2B 1e76525eab338398dd6ff7539ea4e7d18847d0f40e9093d813ec93fce5fa4c16e09f91c0805ba01a29190f673d131f85442c13035166d6f2d007a7e42dc15486 SHA512 35e1213fcac0458e1243355beba021dfefef455df2b341fbc4b10047f9ed4747df84e319d10ffe4bbcd572fbf014019e0dec200eb4e7d3c116fb805369182cb0
EBUILD zfs-kmod-2.1.9.ebuild 5653 BLAKE2B cdcad3067962346a759f56706bb0fd5ab8d8213ae14948d78736c173ed821c4d5d7465def7c0a271fea9deb28dea8e7de8d6e39de540d84c526453b50e2045e3 SHA512 e82965568fbab4a1d2dde1e10d93c7ef8c4b227c0478d54d2d568262c4aea14bce45aef286a6b82b4cec8beadcb821370c84707ca5214ff596c588f4a267263f
EBUILD zfs-kmod-9999.ebuild 6569 BLAKE2B 8930919548137104670e3b2567bba97e763b67265b6fe00621d6a458546770318602dc1333fcd908475ce6583a6150e38a1bcceaf76a85da219071564d3ab387 SHA512 c32cfef598f388bc7ce5474ca27dcc115ac35620aa16a06cd5b5c9bc101819d2f5116605e2b1d6300ceb1bdc048fd70bbae2c18bac831517b281cb7b4a47d926
MISC metadata.xml 651 BLAKE2B 477c5d768a2eddab7bc0c14d0845801e25bfd9298fe229a132d7ff11a8560988d0230ec5d4b1447df32f58b9754df0cbe989f2a5600cd3fa99124ea4edc45cdd SHA512 d9bf0598c87bcdaab7d81dd5502caf1400f3c8d3834a6770630d85ed365cd4ebb3beeebae72d2d4d49bcdd0aa6cd709aa57cb2af4195dfc04a9c0cef89cfd724
From 3ace9dea01f2088e81c0b90ca8e07faad7364eca Mon Sep 17 00:00:00 2001
From: Rich Ercolani <rincebrain@gmail.com>
Date: Thu, 23 Mar 2023 03:45:42 -0400
Subject: [PATCH] An attempt at 6.3 compat
Signed-off-by: Rich Ercolani <rincebrain@gmail.com>
---
config/kernel-generic_io_acct.m4 | 28 +++++++++++++++----
include/os/linux/kernel/linux/blkdev_compat.h | 9 ++++--
2 files changed, 30 insertions(+), 7 deletions(-)
diff --git a/config/kernel-generic_io_acct.m4 b/config/kernel-generic_io_acct.m4
index a8a448c6fe9..2e30c480030 100644
--- a/config/kernel-generic_io_acct.m4
+++ b/config/kernel-generic_io_acct.m4
@@ -2,7 +2,20 @@ dnl #
dnl # Check for generic io accounting interface.
dnl #
AC_DEFUN([ZFS_AC_KERNEL_SRC_GENERIC_IO_ACCT], [
- ZFS_LINUX_TEST_SRC([bdev_io_acct], [
+ ZFS_LINUX_TEST_SRC([bdev_io_acct_62], [
+ #include <linux/blkdev.h>
+ ], [
+ struct block_device *bdev = NULL;
+ struct bio *bio = NULL;
+ unsigned long passed_time = 0;
+ unsigned long start_time;
+
+ start_time = bdev_start_io_acct(bdev, bio_op(bio),
+ bio_sectors(bio), passed_time);
+ bdev_end_io_acct(bdev, bio_op(bio), bio_sectors(bio), start_time);
+ ])
+
+ ZFS_LINUX_TEST_SRC([bdev_io_acct_old], [
#include <linux/blkdev.h>
], [
struct block_device *bdev = NULL;
@@ -68,13 +81,17 @@ AC_DEFUN([ZFS_AC_KERNEL_GENERIC_IO_ACCT], [
dnl # disk_start_io_acct() and disk_end_io_acct() have been replaced by
dnl # bdev_start_io_acct() and bdev_end_io_acct().
dnl #
- AC_MSG_CHECKING([whether generic bdev_*_io_acct() are available])
- ZFS_LINUX_TEST_RESULT([bdev_io_acct], [
+ AC_MSG_CHECKING([whether 6.2+ bdev_*_io_acct() are available])
+ ZFS_LINUX_TEST_RESULT([bdev_io_acct_62], [
AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_BDEV_IO_ACCT, 1, [bdev_*_io_acct() available])
+ AC_DEFINE(HAVE_BDEV_IO_ACCT_62, 1, [bdev_*_io_acct() available])
], [
AC_MSG_RESULT(no)
-
+ AC_MSG_CHECKING([whether pre-6.3 bdev_*_io_acct() are available])
+ ZFS_LINUX_TEST_RESULT([bdev_io_acct_old], [
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_BDEV_IO_ACCT_OLD, 1, [bdev_*_io_acct() available])
+ ], [
dnl #
dnl # 5.12 API,
dnl #
@@ -137,3 +154,4 @@ AC_DEFUN([ZFS_AC_KERNEL_GENERIC_IO_ACCT], [
])
])
])
+])
\ No newline at end of file
diff --git a/include/os/linux/kernel/linux/blkdev_compat.h b/include/os/linux/kernel/linux/blkdev_compat.h
index f04eb5b2593..470abbd3454 100644
--- a/include/os/linux/kernel/linux/blkdev_compat.h
+++ b/include/os/linux/kernel/linux/blkdev_compat.h
@@ -592,7 +592,10 @@ blk_generic_start_io_acct(struct request_queue *q __attribute__((unused)),
struct gendisk *disk __attribute__((unused)),
int rw __attribute__((unused)), struct bio *bio)
{
-#if defined(HAVE_BDEV_IO_ACCT)
+#if defined(HAVE_BDEV_IO_ACCT_62)
+ return (bdev_start_io_acct(bio->bi_bdev, bio_op(bio),
+ bio_sectors(bio), jiffies));
+#elif defined(HAVE_BDEV_IO_ACCT_OLD)
return (bdev_start_io_acct(bio->bi_bdev, bio_sectors(bio),
bio_op(bio), jiffies));
#elif defined(HAVE_DISK_IO_ACCT)
@@ -618,7 +621,9 @@ blk_generic_end_io_acct(struct request_queue *q __attribute__((unused)),
struct gendisk *disk __attribute__((unused)),
int rw __attribute__((unused)), struct bio *bio, unsigned long start_time)
{
-#if defined(HAVE_BDEV_IO_ACCT)
+#if defined(HAVE_BDEV_IO_ACCT_62)
+ bdev_end_io_acct(bio->bi_bdev, bio_op(bio), bio_sectors(bio), start_time);
+#elif defined(HAVE_BDEV_IO_ACCT_OLD)
bdev_end_io_acct(bio->bi_bdev, bio_op(bio), start_time);
#elif defined(HAVE_DISK_IO_ACCT)
disk_end_io_acct(disk, bio_op(bio), start_time);
From 2e9c9b792fd34b4fe1fb524444529f41bcb1b7c5 Mon Sep 17 00:00:00 2001
From: Rich Ercolani <rincebrain@gmail.com>
Date: Thu, 23 Mar 2023 06:49:04 -0400
Subject: [PATCH] go away
---
config/kernel-generic_io_acct.m4 | 3 ++-
include/os/linux/kernel/linux/blkdev_compat.h | 2 +-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/config/kernel-generic_io_acct.m4 b/config/kernel-generic_io_acct.m4
index 2e30c480030..c7b700c5d40 100644
--- a/config/kernel-generic_io_acct.m4
+++ b/config/kernel-generic_io_acct.m4
@@ -11,7 +11,7 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_GENERIC_IO_ACCT], [
unsigned long start_time;
start_time = bdev_start_io_acct(bdev, bio_op(bio),
- bio_sectors(bio), passed_time);
+ passed_time);
bdev_end_io_acct(bdev, bio_op(bio), bio_sectors(bio), start_time);
])
@@ -92,6 +92,7 @@ AC_DEFUN([ZFS_AC_KERNEL_GENERIC_IO_ACCT], [
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_BDEV_IO_ACCT_OLD, 1, [bdev_*_io_acct() available])
], [
+ AC_MSG_RESULT(no)
dnl #
dnl # 5.12 API,
dnl #
diff --git a/include/os/linux/kernel/linux/blkdev_compat.h b/include/os/linux/kernel/linux/blkdev_compat.h
index 470abbd3454..c6cc743c866 100644
--- a/include/os/linux/kernel/linux/blkdev_compat.h
+++ b/include/os/linux/kernel/linux/blkdev_compat.h
@@ -594,7 +594,7 @@ blk_generic_start_io_acct(struct request_queue *q __attribute__((unused)),
{
#if defined(HAVE_BDEV_IO_ACCT_62)
return (bdev_start_io_acct(bio->bi_bdev, bio_op(bio),
- bio_sectors(bio), jiffies));
+ jiffies));
#elif defined(HAVE_BDEV_IO_ACCT_OLD)
return (bdev_start_io_acct(bio->bi_bdev, bio_sectors(bio),
bio_op(bio), jiffies));
<?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-2023 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.2"
# 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=(
# Workaround for kernel 6.2.8/6.3.x support:
# https://github.com/openzfs/zfs/issues/14658#issuecomment-1480723155
"${FILESDIR}"/${PN}-2.1.9-6.3-compat.patch
"${FILESDIR}"/${PN}-2.1.9-blkdev-compat.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
}
# Copyright 1999-2023 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 )
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=:
# INSTALL_MOD_PATH ?= $(DESTDIR) in module/Makefile
DESTDIR="${D}"
)
emake "${myemakeargs[@]}" install
einstalldocs
}
_old_layout_cleanup() {
# new files are just extra/{spl,zfs}.ko with no subdirs.
local olddir=(
avl/zavl
icp/icp
lua/zlua
nvpair/znvpair
spl/spl
unicode/zunicode
zcommon/zcommon
zfs/zfs
zstd/zzstd
)
# kernel/module/Kconfig contains possible compressed extentions.
local kext kextfiles
for kext in .ko{,.{gz,xz,zst}}; do
kextfiles+=( "${olddir[@]/%/${kext}}" )
done
local oldfile oldpath
for oldfile in "${kextfiles[@]}"; do
oldpath="${EROOT}/lib/modules/${KV_FULL}/extra/${oldfile}"
if [[ -f "${oldpath}" ]]; then
ewarn "Found obsolete zfs module ${oldfile} for current kernel ${KV_FULL}, removing."
rm -rv "${oldpath}" || die
# we do not remove non-empty directories just for safety in case there's something else.
# also it may fail if there are both compressed and uncompressed modules installed.
rmdir -v --ignore-fail-on-non-empty "${oldpath%/*.*}" || die
fi
done
}
pkg_postinst() {
# check for old module layout before doing anything else.
# only attempt layout cleanup if new .ko location is used.
local newko=( "${EROOT}/lib/modules/${KV_FULL}/extra"/{zfs,spl}.ko* )
# we check first array member, if glob above did not exand, it will be "zfs.ko*" and -f will return false.
# if glob expanded -f will do correct file precense check.
[[ -f ${newko[0]} ]] && _old_layout_cleanup
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