diff --git a/files/zfs/3510.2.6/overlay/eclass/dist-kernel-utils.eclass b/files/zfs/3510.2.6/overlay/eclass/dist-kernel-utils.eclass deleted file mode 100644 index 6903183..0000000 --- a/files/zfs/3510.2.6/overlay/eclass/dist-kernel-utils.eclass +++ /dev/null @@ -1,201 +0,0 @@ -# Copyright 2020-2023 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -# @ECLASS: dist-kernel-utils.eclass -# @MAINTAINER: -# Distribution Kernel Project -# @AUTHOR: -# Michał Górny -# @SUPPORTED_EAPIS: 7 8 -# @BLURB: Utility functions related to Distribution Kernels -# @DESCRIPTION: -# This eclass provides various utility functions related to Distribution -# Kernels. - -# @ECLASS_VARIABLE: KERNEL_IUSE_SECUREBOOT -# @PRE_INHERIT -# @DEFAULT_UNSET -# @DESCRIPTION: -# If set to a non-null value, inherits secureboot.eclass -# and allows signing of generated kernel images. - -if [[ ! ${_DIST_KERNEL_UTILS} ]]; then - -case ${EAPI} in - 7|8) ;; - *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; -esac - -if [[ ${KERNEL_IUSE_SECUREBOOT} ]]; then - inherit secureboot -fi - -# @FUNCTION: dist-kernel_build_initramfs -# @USAGE: -# @DESCRIPTION: -# Build an initramfs for the kernel. specifies the absolute -# path where initramfs will be created, while specifies -# the kernel version, used to find modules. -# -# Note: while this function uses dracut at the moment, other initramfs -# variants may be supported in the future. -dist-kernel_build_initramfs() { - debug-print-function ${FUNCNAME} "${@}" - - [[ ${#} -eq 2 ]] || die "${FUNCNAME}: invalid arguments" - local output=${1} - local version=${2} - - local rel_image_path=$(dist-kernel_get_image_path) - local image=${output%/*}/${rel_image_path##*/} - - local args=( - --force - # if uefi=yes is used, dracut needs to locate the kernel image - --kernel-image "${image}" - - # positional arguments - "${output}" "${version}" - ) - - ebegin "Building initramfs via dracut" - dracut "${args[@]}" - eend ${?} || die -n "Building initramfs failed" -} - -# @FUNCTION: dist-kernel_get_image_path -# @DESCRIPTION: -# Get relative kernel image path specific to the current ${ARCH}. -dist-kernel_get_image_path() { - case ${ARCH} in - amd64|x86) - echo arch/x86/boot/bzImage - ;; - arm64) - echo arch/arm64/boot/Image.gz - ;; - arm) - echo arch/arm/boot/zImage - ;; - hppa|ppc|ppc64|sparc) - # https://www.kernel.org/doc/html/latest/powerpc/bootwrapper.html - # ./ is required because of ${image_path%/*} - # substitutions in the code - echo ./vmlinux - ;; - riscv) - echo arch/riscv/boot/Image.gz - ;; - *) - die "${FUNCNAME}: unsupported ARCH=${ARCH}" - ;; - esac -} - -# @FUNCTION: dist-kernel_install_kernel -# @USAGE: -# @DESCRIPTION: -# Install kernel using installkernel tool. specifies -# the kernel version, full path to the image, -# full path to System.map. -dist-kernel_install_kernel() { - debug-print-function ${FUNCNAME} "${@}" - - [[ ${#} -eq 3 ]] || die "${FUNCNAME}: invalid arguments" - local version=${1} - local image=${2} - local map=${3} - - # if dracut is used in uefi=yes mode, initrd will actually - # be a combined kernel+initramfs UEFI executable. we can easily - # recognize it by PE magic (vs cpio for a regular initramfs) - local initrd=${image%/*}/initrd - local magic - [[ -s ${initrd} ]] && read -n 2 magic < "${initrd}" - if [[ ${magic} == MZ ]]; then - einfo "Combined UEFI kernel+initramfs executable found" - # install the combined executable in place of kernel - image=${initrd%/*}/uki.efi - mv "${initrd}" "${image}" || die - # We moved the generated initrd, prevent dracut from running again - # https://github.com/dracutdevs/dracut/pull/2405 - shopt -s nullglob - local plugins=() - for file in "${EROOT}"/etc/kernel/install.d/*.install; do - plugins+=( "${file}" ) - done - for file in "${EROOT}"/usr/lib/kernel/install.d/*.install; do - if ! has "${file##*/}" 50-dracut.install 51-dracut-rescue.install "${plugins[@]##*/}"; then - plugins+=( "${file}" ) - fi - done - shopt -u nullglob - export KERNEL_INSTALL_PLUGINS="${KERNEL_INSTALL_PLUGINS} ${plugins[@]}" - fi - - if [[ ${KERNEL_IUSE_SECUREBOOT} ]]; then - # Kernel-install requires uki's are named uki.efi, sign in-place - secureboot_sign_efi_file "${image}" "${image}" - fi - - ebegin "Installing the kernel via installkernel" - # note: .config is taken relatively to System.map; - # initrd relatively to bzImage - installkernel "${version}" "${image}" "${map}" - eend ${?} || die -n "Installing the kernel failed" -} - -# @FUNCTION: dist-kernel_reinstall_initramfs -# @USAGE: -# @DESCRIPTION: -# Rebuild and install initramfs for the specified dist-kernel. -# is the kernel source directory (${KV_DIR} from linux-info), -# while is the full kernel version (${KV_FULL}). -# The function will determine whether is actually -# a dist-kernel, and whether initramfs was used. -# -# This function is to be used in pkg_postinst() of ebuilds installing -# kernel modules that are included in the initramfs. -dist-kernel_reinstall_initramfs() { - debug-print-function ${FUNCNAME} "${@}" - - [[ ${#} -eq 2 ]] || die "${FUNCNAME}: invalid arguments" - local kernel_dir=${1} - local ver=${2} - - local image_path=${kernel_dir}/$(dist-kernel_get_image_path) - local initramfs_path=${image_path%/*}/initrd - if [[ ! -f ${image_path} ]]; then - eerror "Kernel install missing, image not found:" - eerror " ${image_path}" - eerror "Initramfs will not be updated. Please reinstall your kernel." - return - fi - if [[ ! -f ${initramfs_path} && ! -f ${initramfs_path%/*}/uki.efi ]]; then - einfo "No initramfs or uki found at ${image_path}" - return - fi - - dist-kernel_build_initramfs "${initramfs_path}" "${ver}" - dist-kernel_install_kernel "${ver}" "${image_path}" \ - "${kernel_dir}/System.map" -} - -# @FUNCTION: dist-kernel_PV_to_KV -# @USAGE: -# @DESCRIPTION: -# Convert a Gentoo-style ebuild version to kernel "x.y.z[-rcN]" version. -dist-kernel_PV_to_KV() { - debug-print-function ${FUNCNAME} "${@}" - - [[ ${#} -ne 1 ]] && die "${FUNCNAME}: invalid arguments" - local pv=${1} - - local kv=${pv%%_*} - [[ -z $(ver_cut 3- "${kv}") ]] && kv+=".0" - [[ ${pv} == *_* ]] && kv+=-${pv#*_} - echo "${kv}" -} - -_DIST_KERNEL_UTILS=1 -fi diff --git a/files/zfs/3510.2.6/overlay/metadata/layout.conf b/files/zfs/3510.2.6/overlay/metadata/layout.conf deleted file mode 100644 index e85e826..0000000 --- a/files/zfs/3510.2.6/overlay/metadata/layout.conf +++ /dev/null @@ -1,4 +0,0 @@ -masters = portage-stable -thin-manifests = true -sign-commits = false -sign-manifests = false diff --git a/files/zfs/3510.2.6/overlay/profiles/repo_name b/files/zfs/3510.2.6/overlay/profiles/repo_name deleted file mode 100644 index e0f34db..0000000 --- a/files/zfs/3510.2.6/overlay/profiles/repo_name +++ /dev/null @@ -1 +0,0 @@ -zfs-overlay diff --git a/files/zfs/3510.2.6/overlay/sys-fs/udev-init-scripts/Manifest b/files/zfs/3510.2.6/overlay/sys-fs/udev-init-scripts/Manifest deleted file mode 100644 index 838b43a..0000000 --- a/files/zfs/3510.2.6/overlay/sys-fs/udev-init-scripts/Manifest +++ /dev/null @@ -1,2 +0,0 @@ -DIST udev-init-scripts-34.tar.gz 3660 BLAKE2B 954b003c78b31649fef69213a5424098f40e17e7ed11f4ec1443247950ea60db8536f37ca603caa06e5c9f8bab07b5ac3cb8c9435144532a97ff04836c24da49 SHA512 ed48bcd0815e235b2b3fa38f857cd97f164aac7c6ea805be87890eb06a0d52064bd733da240c6e2a34c8c73e10fd047b5e53096de06f17bc81d8266d70c0cc9d -DIST udev-init-scripts-35.tar.gz 3666 BLAKE2B fddae466428605ea930519e8a47e0ea91f89f9eacc1fd97c137d175142125b12c3d045aec68db35a463de444ac6d8c037cca55f9628f10576c968259d566a9e4 SHA512 da9d2093149967e2e1b9bc7190ddfd55a87c9ae2177e3216f7cb2694fc9b64037eb6f2599ad8a4b7594ef32ced88fbb319c92904bc72a81ea5404945f8a8378a diff --git a/files/zfs/3510.2.6/overlay/sys-fs/udev-init-scripts/metadata.xml b/files/zfs/3510.2.6/overlay/sys-fs/udev-init-scripts/metadata.xml deleted file mode 100644 index 31123d0..0000000 --- a/files/zfs/3510.2.6/overlay/sys-fs/udev-init-scripts/metadata.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - systemd@gentoo.org - - diff --git a/files/zfs/3510.2.6/overlay/sys-fs/udev-init-scripts/udev-init-scripts-34.ebuild b/files/zfs/3510.2.6/overlay/sys-fs/udev-init-scripts/udev-init-scripts-34.ebuild deleted file mode 100644 index 26fa347..0000000 --- a/files/zfs/3510.2.6/overlay/sys-fs/udev-init-scripts/udev-init-scripts-34.ebuild +++ /dev/null @@ -1,50 +0,0 @@ -# Copyright 1999-2021 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 -OLD_PN=udev-gentoo-scripts -OLD_P=${OLD_PN}-${PV} - -if [ "${PV}" = "9999" ]; then - EGIT_REPO_URI="git://anongit.gentoo.org/proj/${OLD_PN}.git" - inherit git-r3 -else - SRC_URI="https://gitweb.gentoo.org/proj/${OLD_PN}.git/snapshot/${OLD_P}.tar.gz -> ${P}.tar.gz" - S="${WORKDIR}/${OLD_P}" - KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86" -fi - -DESCRIPTION="udev startup scripts for openrc" -HOMEPAGE="https://wiki.gentoo.org/wiki/No_homepage" - -LICENSE="GPL-2" -SLOT="0" - -RESTRICT="test" - -RDEPEND=">=virtual/udev-217 - ! -Date: Fri, 18 Dec 2020 11:35:07 -0800 -Subject: [PATCH] copy-builtin: handle missing .gitignore - -acfc4944d0d6db114db9f2bb5401251c5bd767b6 broke copy-builtin in -release tarballs, because those do not contain .gitignore file. -Adding -f to rm call will make it return 0 even if file does not exist. - -Signed-off-by: Georgy Yakovlev ---- - copy-builtin | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/copy-builtin b/copy-builtin -index 84f469fef02..6a6eb1f3695 100755 ---- a/copy-builtin -+++ b/copy-builtin -@@ -36,7 +36,7 @@ rm -rf "$KERNEL_DIR/include/zfs" "$KERNEL_DIR/fs/zfs" - cp --recursive include "$KERNEL_DIR/include/zfs" - cp --recursive module "$KERNEL_DIR/fs/zfs" - cp zfs_config.h "$KERNEL_DIR/include/zfs/" --rm "$KERNEL_DIR/include/zfs/.gitignore" -+rm -f "$KERNEL_DIR/include/zfs/.gitignore" - - for MODULE in "${MODULES[@]}" - do diff --git a/files/zfs/3510.2.6/overlay/sys-fs/zfs-kmod/files/2.1.4-ZERO_RANGE.patch b/files/zfs/3510.2.6/overlay/sys-fs/zfs-kmod/files/2.1.4-ZERO_RANGE.patch deleted file mode 100644 index 338b142..0000000 --- a/files/zfs/3510.2.6/overlay/sys-fs/zfs-kmod/files/2.1.4-ZERO_RANGE.patch +++ /dev/null @@ -1,304 +0,0 @@ -https://github.com/openzfs/zfs/commit/c220771a47e4206fb43e6849957657c9504b1b14 -https://github.com/openzfs/zfs/issues/13329 - -From c220771a47e4206fb43e6849957657c9504b1b14 Mon Sep 17 00:00:00 2001 -From: Rich Ercolani <214141+rincebrain@users.noreply.github.com> -Date: Wed, 20 Apr 2022 19:07:03 -0400 -Subject: [PATCH] Corrected oversight in ZERO_RANGE behavior - -It turns out, no, in fact, ZERO_RANGE and PUNCH_HOLE do -have differing semantics in some ways - in particular, -one requires KEEP_SIZE, and the other does not. - -Also added a zero-range test to catch this, corrected a flaw -that made the punch-hole test succeed vacuously, and a typo -in file_write. - -Reviewed-by: Brian Behlendorf -Signed-off-by: Rich Ercolani -Closes #13329 -Closes #13338 ---- a/module/os/linux/zfs/zpl_file.c -+++ b/module/os/linux/zfs/zpl_file.c -@@ -781,11 +781,13 @@ zpl_fallocate_common(struct inode *ip, int mode, loff_t offset, loff_t len) - if (mode & (test_mode)) { - flock64_t bf; - -- if (offset > olen) -- goto out_unmark; -+ if (mode & FALLOC_FL_KEEP_SIZE) { -+ if (offset > olen) -+ goto out_unmark; - -- if (offset + len > olen) -- len = olen - offset; -+ if (offset + len > olen) -+ len = olen - offset; -+ } - bf.l_type = F_WRLCK; - bf.l_whence = SEEK_SET; - bf.l_start = offset; ---- a/tests/runfiles/linux.run -+++ b/tests/runfiles/linux.run -@@ -94,7 +94,7 @@ tests = ['events_001_pos', 'events_002_pos', 'zed_rc_filter', 'zed_fd_spill'] - tags = ['functional', 'events'] - - [tests/functional/fallocate:Linux] --tests = ['fallocate_prealloc'] -+tests = ['fallocate_prealloc', 'fallocate_zero-range'] - tags = ['functional', 'fallocate'] - - [tests/functional/fault:Linux] ---- a/tests/zfs-tests/cmd/file_write/file_write.c -+++ b/tests/zfs-tests/cmd/file_write/file_write.c -@@ -251,7 +251,7 @@ usage(char *prog) - "\t[-s offset] [-c write_count] [-d data]\n\n" - "Where [data] equal to zero causes chars " - "0->%d to be repeated throughout, or [data]\n" -- "equal to 'R' for psudorandom data.\n", -+ "equal to 'R' for pseudorandom data.\n", - prog, DATA_RANGE); - - exit(1); ---- a/tests/zfs-tests/include/libtest.shlib -+++ b/tests/zfs-tests/include/libtest.shlib -@@ -4236,6 +4236,22 @@ function punch_hole # offset length file - esac - } - -+function zero_range # offset length file -+{ -+ typeset offset=$1 -+ typeset length=$2 -+ typeset file=$3 -+ -+ case "$UNAME" in -+ Linux) -+ fallocate --zero-range --offset $offset --length $length "$file" -+ ;; -+ *) -+ false -+ ;; -+ esac -+} -+ - # - # Wait for the specified arcstat to reach non-zero quiescence. - # If echo is 1 echo the value after reaching quiescence, otherwise ---- a/tests/zfs-tests/tests/functional/fallocate/Makefile.am -+++ b/tests/zfs-tests/tests/functional/fallocate/Makefile.am -@@ -3,4 +3,5 @@ dist_pkgdata_SCRIPTS = \ - setup.ksh \ - cleanup.ksh \ - fallocate_prealloc.ksh \ -- fallocate_punch-hole.ksh -+ fallocate_punch-hole.ksh \ -+ fallocate_zero-range.ksh ---- a/tests/zfs-tests/tests/functional/fallocate/fallocate_punch-hole.ksh -+++ b/tests/zfs-tests/tests/functional/fallocate/fallocate_punch-hole.ksh -@@ -60,13 +60,17 @@ function cleanup - [[ -e $TESTDIR ]] && log_must rm -f $FILE - } - --function check_disk_size -+function check_reported_size - { - typeset expected_size=$1 - -- disk_size=$(du $TESTDIR/file | awk '{print $1}') -- if [ $disk_size -ne $expected_size ]; then -- log_fail "Incorrect size: $disk_size != $expected_size" -+ if ! [ -e "${FILE}" ]; then -+ log_fail "$FILE does not exist" -+ fi -+ -+ reported_size=$(du "${FILE}" | awk '{print $1}') -+ if [ "$reported_size" != "$expected_size" ]; then -+ log_fail "Incorrect reported size: $reported_size != $expected_size" - fi - } - -@@ -74,9 +78,9 @@ function check_apparent_size - { - typeset expected_size=$1 - -- apparent_size=$(stat_size) -- if [ $apparent_size -ne $expected_size ]; then -- log_fail "Incorrect size: $apparent_size != $expected_size" -+ apparent_size=$(stat_size "${FILE}") -+ if [ "$apparent_size" != "$expected_size" ]; then -+ log_fail "Incorrect apparent size: $apparent_size != $expected_size" - fi - } - -@@ -86,25 +90,30 @@ log_onexit cleanup - - # Create a dense file and check it is the correct size. - log_must file_write -o create -f $FILE -b $BLKSZ -c 8 --log_must check_disk_size $((131072 * 8)) -+sync_pool $TESTPOOL -+log_must check_reported_size 1027 - - # Punch a hole for the first full block. - log_must punch_hole 0 $BLKSZ $FILE --log_must check_disk_size $((131072 * 7)) -+sync_pool $TESTPOOL -+log_must check_reported_size 899 - - # Partially punch a hole in the second block. - log_must punch_hole $BLKSZ $((BLKSZ / 2)) $FILE --log_must check_disk_size $((131072 * 7)) -+sync_pool $TESTPOOL -+log_must check_reported_size 899 - --# Punch a hole which overlaps the third and forth block. -+# Punch a hole which overlaps the third and fourth block. - log_must punch_hole $(((BLKSZ * 2) + (BLKSZ / 2))) $((BLKSZ)) $FILE --log_must check_disk_size $((131072 * 7)) -+sync_pool $TESTPOOL -+log_must check_reported_size 899 - - # Punch a hole from the fifth block past the end of file. The apparent - # file size should not change since --keep-size is implied. - apparent_size=$(stat_size $FILE) - log_must punch_hole $((BLKSZ * 4)) $((BLKSZ * 10)) $FILE --log_must check_disk_size $((131072 * 4)) -+sync_pool $TESTPOOL -+log_must check_reported_size 387 - log_must check_apparent_size $apparent_size - - log_pass "Ensure holes can be punched in files making them sparse" ---- /dev/null -+++ b/tests/zfs-tests/tests/functional/fallocate/fallocate_zero-range.ksh -@@ -0,0 +1,119 @@ -+#!/bin/ksh -p -+# -+# CDDL HEADER START -+# -+# The contents of this file are subject to the terms of the -+# Common Development and Distribution License (the "License"). -+# You may not use this file except in compliance with the License. -+# -+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE -+# or http://www.opensolaris.org/os/licensing. -+# See the License for the specific language governing permissions -+# and limitations under the License. -+# -+# When distributing Covered Code, include this CDDL HEADER in each -+# file and include the License file at usr/src/OPENSOLARIS.LICENSE. -+# If applicable, add the following below this CDDL HEADER, with the -+# fields enclosed by brackets "[]" replaced with your own identifying -+# information: Portions Copyright [yyyy] [name of copyright owner] -+# -+# CDDL HEADER END -+# -+ -+# -+# Copyright (c) 2020 by Lawrence Livermore National Security, LLC. -+# Copyright (c) 2021 by The FreeBSD Foundation. -+# -+ -+. $STF_SUITE/include/libtest.shlib -+ -+# -+# DESCRIPTION: -+# Test FALLOC_FL_ZERO_RANGE functionality -+# -+# STRATEGY: -+# 1. Create a dense file -+# 2. Zero various ranges in the file and verify the result. -+# -+ -+verify_runnable "global" -+ -+if is_freebsd; then -+ log_unsupported "FreeBSD does not implement an analogue to ZERO_RANGE." -+fi -+ -+FILE=$TESTDIR/$TESTFILE0 -+BLKSZ=$(get_prop recordsize $TESTPOOL) -+ -+function cleanup -+{ -+ [[ -e $TESTDIR ]] && log_must rm -f $FILE -+} -+ -+# Helpfully, this function expects kilobytes, and check_apparent_size expects bytes. -+function check_reported_size -+{ -+ typeset expected_size=$1 -+ -+ if ! [ -e "${FILE}" ]; then -+ log_fail "$FILE does not exist" -+ fi -+ -+ reported_size=$(du "${FILE}" | awk '{print $1}') -+ if [ "$reported_size" != "$expected_size" ]; then -+ log_fail "Incorrect reported size: $reported_size != $expected_size" -+ fi -+} -+ -+function check_apparent_size -+{ -+ typeset expected_size=$1 -+ -+ apparent_size=$(stat_size "${FILE}") -+ if [ "$apparent_size" != "$expected_size" ]; then -+ log_fail "Incorrect apparent size: $apparent_size != $expected_size" -+ fi -+} -+ -+log_assert "Ensure ranges can be zeroed in files" -+ -+log_onexit cleanup -+ -+# Create a dense file and check it is the correct size. -+log_must file_write -o create -f $FILE -b $BLKSZ -c 8 -+sync_pool $TESTPOOL -+log_must check_reported_size 1027 -+ -+# Zero a range covering the first full block. -+log_must zero_range 0 $BLKSZ $FILE -+sync_pool $TESTPOOL -+log_must check_reported_size 899 -+ -+# Partially zero a range in the second block. -+log_must zero_range $BLKSZ $((BLKSZ / 2)) $FILE -+sync_pool $TESTPOOL -+log_must check_reported_size 899 -+ -+# Zero range which overlaps the third and fourth block. -+log_must zero_range $(((BLKSZ * 2) + (BLKSZ / 2))) $((BLKSZ)) $FILE -+sync_pool $TESTPOOL -+log_must check_reported_size 899 -+ -+# Zero range from the fifth block past the end of file, with --keep-size. -+# The apparent file size must not change, since we did specify --keep-size. -+apparent_size=$(stat_size $FILE) -+log_must fallocate --keep-size --zero-range --offset $((BLKSZ * 4)) --length $((BLKSZ * 10)) "$FILE" -+sync_pool $TESTPOOL -+log_must check_reported_size 387 -+log_must check_apparent_size $apparent_size -+ -+# Zero range from the fifth block past the end of file. The apparent -+# file size should change since --keep-size is not implied, unlike -+# with PUNCH_HOLE. -+apparent_size=$(stat_size $FILE) -+log_must zero_range $((BLKSZ * 4)) $((BLKSZ * 10)) $FILE -+sync_pool $TESTPOOL -+log_must check_reported_size 387 -+log_must check_apparent_size $((BLKSZ * 14)) -+ -+log_pass "Ensure ranges can be zeroed in files" ---- a/tests/zfs-tests/tests/functional/fallocate/setup.ksh -+++ b/tests/zfs-tests/tests/functional/fallocate/setup.ksh -@@ -26,4 +26,7 @@ - . $STF_SUITE/include/libtest.shlib - - DISK=${DISKS%% *} --default_setup $DISK -+default_setup_noexit $DISK -+log_must zfs set compression=off $TESTPOOL -+log_pass -+ - diff --git a/files/zfs/3510.2.6/overlay/sys-fs/zfs-kmod/files/zfs-kmod-2.1.11-gentoo.patch b/files/zfs/3510.2.6/overlay/sys-fs/zfs-kmod/files/zfs-kmod-2.1.11-gentoo.patch deleted file mode 100644 index 53c5f27..0000000 --- a/files/zfs/3510.2.6/overlay/sys-fs/zfs-kmod/files/zfs-kmod-2.1.11-gentoo.patch +++ /dev/null @@ -1,24 +0,0 @@ -Hack to pass the full linux-mod-r1 toolchain to make during ./configure. -Not needed at build time given can pass it normally then. - -Eclass has workarounds, compiler/version matching, and its own set of -user variables which creates disparity between ebuilds if not used. - -For the (normal) alternative: KERNEL_{CC,LD} alone is insufficient, -but combining with KERNEL_LLVM=1 when CC_IS_CLANG will allow it -to work for *most* people (will likely still need KERNEL_LD from -linux-mod-r1, or ThinLTO kernels may fail with sandbox violations). - -Note KERNEL_* also cause failure if they contain spaces. - -https://bugs.gentoo.org/865157 ---- a/config/kernel.m4 -+++ b/config/kernel.m4 -@@ -646,6 +646,5 @@ - AC_TRY_COMMAND([ - KBUILD_MODPOST_NOFINAL="$5" KBUILD_MODPOST_WARN="$6" -- make modules -k -j$TEST_JOBS ${KERNEL_CC:+CC=$KERNEL_CC} -- ${KERNEL_LD:+LD=$KERNEL_LD} ${KERNEL_LLVM:+LLVM=$KERNEL_LLVM} -+ make modules -k -j$TEST_JOBS '${GENTOO_MAKEARGS_EVAL}' - CONFIG_MODULES=y CFLAGS_MODULE=-DCONFIG_MODULES - -C $LINUX_OBJ $ARCH_UM M=$PWD/$1 >$1/build.log 2>&1]) diff --git a/files/zfs/3510.2.6/overlay/sys-fs/zfs-kmod/metadata.xml b/files/zfs/3510.2.6/overlay/sys-fs/zfs-kmod/metadata.xml deleted file mode 100644 index 7e27782..0000000 --- a/files/zfs/3510.2.6/overlay/sys-fs/zfs-kmod/metadata.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - gyakovlev@gentoo.org - Georgy Yakovlev - - - sam@gentoo.org - Sam James - - - Prevents upgrading to an unsupported kernel version when combined with USE=dist-kernel - Pull dependencies and check kernel options required for root-on-zfs - - - https://github.com/openzfs/zfs/issues - https://openzfs.github.io/openzfs-docs - openzfs/zfs - - diff --git a/files/zfs/3510.2.6/overlay/sys-fs/zfs-kmod/zfs-kmod-0.8.6.ebuild b/files/zfs/3510.2.6/overlay/sys-fs/zfs-kmod/zfs-kmod-0.8.6.ebuild deleted file mode 100644 index f3bf1e8..0000000 --- a/files/zfs/3510.2.6/overlay/sys-fs/zfs-kmod/zfs-kmod-0.8.6.ebuild +++ /dev/null @@ -1,212 +0,0 @@ -# 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 - SRC_URI="https://github.com/openzfs/zfs/releases/download/zfs-${PV}/zfs-${PV}.tar.gz" - KEYWORDS="amd64 arm64 ppc64" - S="${WORKDIR}/zfs-${PV}" - ZFS_KERNEL_COMPAT="5.9" - - # 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))" -fi - -LICENSE="CDDL debug? ( GPL-2+ )" -SLOT="0/${PVR}" -IUSE="custom-cflags debug +rootfs" - -DEPEND="" - -RDEPEND="${DEPEND} - !sys-kernel/spl -" - -BDEPEND=" - dev-lang/perl - virtual/awk - dist-kernel? ( added by KBUILD - ) - - emake "${myemakeargs[@]}" install - - einstalldocs -} - -pkg_postinst() { - linux-mod_pkg_postinst - - # Remove old modules - if [[ -d "${EROOT}/lib/modules/${KV_FULL}/addon/zfs" ]]; then - ewarn "${PN} now installs modules in ${EROOT}/lib/modules/${KV_FULL}/extra/zfs" - ewarn "Old modules were detected in ${EROOT}/lib/modules/${KV_FULL}/addon/zfs" - ewarn "Automatically removing old modules to avoid problems." - rm -r "${EROOT}/lib/modules/${KV_FULL}/addon/zfs" || die "Cannot remove modules" - rmdir --ignore-fail-on-non-empty "${EROOT}/lib/modules/${KV_FULL}/addon" - fi - - 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 - - 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 newpool that is backward compatible wih GRUB2, use " - ewarn - ewarn "zpool create -d -o feature@async_destroy=enabled " - ewarn " -o feature@empty_bpobj=enabled -o feature@lz4_compress=enabled" - ewarn " -o feature@spacemap_histogram=enabled" - ewarn " -o feature@enabled_txg=enabled " - ewarn " -o feature@extensible_dataset=enabled -o feature@bookmarks=enabled" - ewarn " ..." - ewarn - ewarn "GRUB2 support will be updated as soon as either the GRUB2" - ewarn "developers do a tag or the Gentoo developers find time to backport" - ewarn "support from GRUB2 HEAD." -} diff --git a/files/zfs/3510.2.6/overlay/sys-fs/zfs-kmod/zfs-kmod-2.0.7.ebuild b/files/zfs/3510.2.6/overlay/sys-fs/zfs-kmod/zfs-kmod-2.0.7.ebuild deleted file mode 100644 index 154ef60..0000000 --- a/files/zfs/3510.2.6/overlay/sys-fs/zfs-kmod/zfs-kmod-2.0.7.ebuild +++ /dev/null @@ -1,212 +0,0 @@ -# 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" - 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? ( sec-keys/openpgp-keys-openzfs ) - dist-kernel? ( 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 OpenZFS. To" - ewarn "create a newpool that is backward compatible wih GRUB2, use " - ewarn - ewarn "zpool create -d -o feature@async_destroy=enabled " - ewarn " -o feature@empty_bpobj=enabled -o feature@lz4_compress=enabled" - ewarn " -o feature@spacemap_histogram=enabled" - ewarn " -o feature@enabled_txg=enabled " - ewarn " -o feature@extensible_dataset=enabled -o feature@bookmarks=enabled" - ewarn " ..." - ewarn - ewarn "GRUB2 support will be updated as soon as either the GRUB2" - ewarn "developers do a tag or the Gentoo developers find time to backport" - ewarn "support from GRUB2 HEAD." - fi -} diff --git a/files/zfs/3510.2.6/overlay/sys-fs/zfs-kmod/zfs-kmod-2.1.11-r1.ebuild b/files/zfs/3510.2.6/overlay/sys-fs/zfs-kmod/zfs-kmod-2.1.11-r1.ebuild deleted file mode 100644 index 7bf3eba..0000000 --- a/files/zfs/3510.2.6/overlay/sys-fs/zfs-kmod/zfs-kmod-2.1.11-r1.ebuild +++ /dev/null @@ -1,177 +0,0 @@ -# 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-r1 multiprocessing - -DESCRIPTION="Linux ZFS kernel module for sys-fs/zfs" -HOMEPAGE="https://github.com/openzfs/zfs" - -MODULES_KERNEL_MAX=6.2 -MODULES_KERNEL_MIN=3.10 - -if [[ ${PV} == 9999 ]] ; then - EGIT_REPO_URI="https://github.com/openzfs/zfs.git" - inherit git-r3 - unset MODULES_KERNEL_MAX -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="${MODULES_KERNEL_MAX}" - # 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" -RESTRICT="test" - -BDEPEND=" - dev-lang/perl - app-alternatives/awk -" - -if [[ ${PV} != 9999 ]] ; then - BDEPEND+=" verify-sig? ( sec-keys/openpgp-keys-openzfs )" - - IUSE+=" +dist-kernel-cap" - RDEPEND=" - dist-kernel-cap? ( dist-kernel? ( - 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? ( 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? ( sec-keys/openpgp-keys-openzfs ) - dist-kernel? ( 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 OpenZFS. To" - ewarn "create a newpool 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 -} diff --git a/files/zfs/3510.2.6/overlay/sys-fs/zfs-kmod/zfs-kmod-2.1.4-r1.ebuild b/files/zfs/3510.2.6/overlay/sys-fs/zfs-kmod/zfs-kmod-2.1.4-r1.ebuild deleted file mode 100644 index a861d60..0000000 --- a/files/zfs/3510.2.6/overlay/sys-fs/zfs-kmod/zfs-kmod-2.1.4-r1.ebuild +++ /dev/null @@ -1,209 +0,0 @@ -# Copyright 1999-2022 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.17" - - # 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? ( sec-keys/openpgp-keys-openzfs ) - dist-kernel? ( 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? ( sec-keys/openpgp-keys-openzfs ) - dist-kernel? ( 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? ( 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" -RESTRICT="test" - -BDEPEND=" - app-alternatives/awk - dev-lang/perl -" - -if [[ ${PV} != 9999 ]] ; then - BDEPEND+=" verify-sig? ( sec-keys/openpgp-keys-openzfs )" - - IUSE+=" +dist-kernel-cap" - RDEPEND=" - dist-kernel-cap? ( dist-kernel? ( - 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" -RESTRICT="test" - -BDEPEND=" - app-alternatives/awk - dev-lang/perl -" - -if [[ ${PV} != 9999 ]] ; then - BDEPEND+=" verify-sig? ( sec-keys/openpgp-keys-openzfs )" - - IUSE+=" +dist-kernel-cap" - RDEPEND=" - dist-kernel-cap? ( dist-kernel? ( - -Date: Sat, 22 May 2021 22:27:39 -0700 -Subject: [PATCH 1/2] systemd: add weekly and monthly scrub timers - -timers can be enabled as follows: - -systemctl enable zfs-scrub-weekly@rpool.timer --now -systemctl enable zfs-scrub-monthly@datapool.timer --now - -Each timer will pull in zfs-scrub@${poolname}.service, which is not -schedule-specific. - -Signed-off-by: Georgy Yakovlev ---- - etc/systemd/system/.gitignore | 1 + - etc/systemd/system/Makefile.am | 5 ++++- - etc/systemd/system/zfs-scrub-monthly@.timer.in | 12 ++++++++++++ - etc/systemd/system/zfs-scrub-weekly@.timer.in | 12 ++++++++++++ - etc/systemd/system/zfs-scrub@.service.in | 14 ++++++++++++++ - 5 files changed, 43 insertions(+), 1 deletion(-) - create mode 100644 etc/systemd/system/zfs-scrub-monthly@.timer.in - create mode 100644 etc/systemd/system/zfs-scrub-weekly@.timer.in - create mode 100644 etc/systemd/system/zfs-scrub@.service.in - -diff --git a/etc/systemd/system/Makefile.am b/etc/systemd/system/Makefile.am -index c374a52ac..5e65e1db4 100644 ---- a/etc/systemd/system/Makefile.am -+++ b/etc/systemd/system/Makefile.am -@@ -12,7 +12,10 @@ systemdunit_DATA = \ - zfs-volume-wait.service \ - zfs-import.target \ - zfs-volumes.target \ -- zfs.target -+ zfs.target \ -+ zfs-scrub-monthly@.timer \ -+ zfs-scrub-weekly@.timer \ -+ zfs-scrub@.service - - SUBSTFILES += $(systemdpreset_DATA) $(systemdunit_DATA) - -diff --git a/etc/systemd/system/zfs-scrub-monthly@.timer.in b/etc/systemd/system/zfs-scrub-monthly@.timer.in -new file mode 100644 -index 000000000..903068468 ---- /dev/null -+++ b/etc/systemd/system/zfs-scrub-monthly@.timer.in -@@ -0,0 +1,12 @@ -+[Unit] -+Description=Monthly zpool scrub timer for %i -+Documentation=man:zpool-scrub(8) -+ -+[Timer] -+OnCalendar=monthly -+Persistent=true -+RandomizedDelaySec=1h -+Unit=zfs-scrub@%i.service -+ -+[Install] -+WantedBy=timers.target -diff --git a/etc/systemd/system/zfs-scrub-weekly@.timer.in b/etc/systemd/system/zfs-scrub-weekly@.timer.in -new file mode 100644 -index 000000000..ede699500 ---- /dev/null -+++ b/etc/systemd/system/zfs-scrub-weekly@.timer.in -@@ -0,0 +1,12 @@ -+[Unit] -+Description=Weekly zpool scrub timer for %i -+Documentation=man:zpool-scrub(8) -+ -+[Timer] -+OnCalendar=weekly -+Persistent=true -+RandomizedDelaySec=1h -+Unit=zfs-scrub@%i.service -+ -+[Install] -+WantedBy=timers.target -diff --git a/etc/systemd/system/zfs-scrub@.service.in b/etc/systemd/system/zfs-scrub@.service.in -new file mode 100644 -index 000000000..c04ac292a ---- /dev/null -+++ b/etc/systemd/system/zfs-scrub@.service.in -@@ -0,0 +1,14 @@ -+[Unit] -+Description=zpool scrub on %i -+Documentation=man:zpool-scrub(8) -+Requires=zfs.target -+After=zfs.target -+ConditionACPower=true -+ConditionPathIsDirectory=/sys/module/zfs -+ -+[Service] -+ExecStart=/bin/sh -c '\ -+if @sbindir@/zpool status %i | grep "scrub in progress"; then\ -+exec @sbindir@/zpool wait -t scrub %i;\ -+else exec @sbindir@/zpool scrub -w %i; fi' -+ExecStop=-/bin/sh -c '@sbindir@/zpool scrub -p %i 2>/dev/null || true' --- -2.34.1 diff --git a/files/zfs/3510.2.6/overlay/sys-fs/zfs/files/2.1.2-musl-tests.patch b/files/zfs/3510.2.6/overlay/sys-fs/zfs/files/2.1.2-musl-tests.patch deleted file mode 100644 index 3d2c563..0000000 --- a/files/zfs/3510.2.6/overlay/sys-fs/zfs/files/2.1.2-musl-tests.patch +++ /dev/null @@ -1,58 +0,0 @@ -From 123c87b3c2d75636da79f57a4b0ed60d2a3133a8 Mon Sep 17 00:00:00 2001 -From: Georgy Yakovlev -Date: Mon, 20 Dec 2021 12:25:11 -0800 -Subject: [PATCH] zfs-test/mmap_seek: fix build on musl - -it needs linux/fs.h for SEEK_DATA and friends - -without linux/fs.h: - -``` -mmap_seek.c -mmap_seek.c: In function 'seek_data': -mmap_seek.c:37:40: error: 'SEEK_DATA' undeclared (first use in this function); -did you mean 'SEEK_SET'? - 37 | off_t data_offset = lseek(fd, offset, SEEK_DATA); -``` - -also it needs sys/sysmacros.h for P2ROUNDUP -without it: - -``` -mmap_seek.c: In function 'main': -mmap_seek.c:122:19: warning: -implicit declaration of function 'P2ROUNDUP' [-Wimplicit-function-declaration] - 122 | seek_hole(fd, 0, P2ROUNDUP(file_size / 2, block_size)); - | ^~~~~~~~~ -powerpc64-gentoo-linux-musl/bin/ld: mmap_seek.o: in function `main': -mmap_seek.c:(.text.startup+0x1b8): undefined reference to `P2ROUNDUP' -powerpc64-gentoo-linux-musl/bin/ld: mmap_seek.c:(.text.startup+0x1d8): - undefined reference to `P2ROUNDUP' -powerpc64-gentoo-linux-musl/bin/ld: mmap_seek.c:(.text.startup+0x21c): - undefined reference to `P2ROUNDUP' -collect2: error: ld returned 1 exit status -make[5]: *** [Makefile:754: mmap_seek] Error 1 -``` - -Closes: https://github.com/openzfs/zfs/pull/12891 -Signed-off-by: Georgy Yakovlev ---- - tests/zfs-tests/cmd/mmap_seek/mmap_seek.c | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/tests/zfs-tests/cmd/mmap_seek/mmap_seek.c b/tests/zfs-tests/cmd/mmap_seek/mmap_seek.c -index f476e1dba9a..bb36527aafe 100644 ---- a/tests/zfs-tests/cmd/mmap_seek/mmap_seek.c -+++ b/tests/zfs-tests/cmd/mmap_seek/mmap_seek.c -@@ -29,7 +29,11 @@ - #include - #include - #include -+#include - #include -+#ifdef __linux__ -+#include -+#endif - - static void - seek_data(int fd, off_t offset, off_t expected) diff --git a/files/zfs/3510.2.6/overlay/sys-fs/zfs/files/2.1.2-openrc-vendor.patch b/files/zfs/3510.2.6/overlay/sys-fs/zfs/files/2.1.2-openrc-vendor.patch deleted file mode 100644 index abe222a..0000000 --- a/files/zfs/3510.2.6/overlay/sys-fs/zfs/files/2.1.2-openrc-vendor.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 6ef28c526ba7199a3740407d764b6505618ca8ba Mon Sep 17 00:00:00 2001 -From: Peter Levine -Date: Fri, 29 Oct 2021 18:34:37 -0400 -Subject: [PATCH] Set DEFAULT_INIT_SHELL to /sbin/openrc-run for Gentoo and - Alpine - -Gentoo and Alpine always set the rc init scripts' shebang to -#!/sbin/openrc-run, whether or not openrc is installed. - -Reviewed-by: Brian Behlendorf -Signed-off-by: Peter Levine -Closes #12683 -Closes #12692 ---- - config/zfs-build.m4 | 14 +++++--------- - 1 file changed, 5 insertions(+), 9 deletions(-) - -diff --git a/config/zfs-build.m4 b/config/zfs-build.m4 -index 27041c054c2..ec4a2026bf5 100644 ---- a/config/zfs-build.m4 -+++ b/config/zfs-build.m4 -@@ -564,15 +564,11 @@ AC_DEFUN([ZFS_AC_DEFAULT_PACKAGE], [ - *) DEFAULT_INIT_SCRIPT=lsb ;; - esac - -- # On gentoo, it's possible that OpenRC isn't installed. Check if -- # /sbin/openrc-run exists, and if not, fall back to generic defaults. -- -- DEFAULT_INIT_SHELL="/bin/sh" -- AS_IF([test "$DEFAULT_INIT_SCRIPT" = "openrc"], [ -- AS_IF([test -x "/sbin/openrc-run"], -- [DEFAULT_INIT_SHELL="/sbin/openrc-run"], -- [DEFAULT_INIT_SCRIPT=lsb]) -- ]) -+ case "$VENDOR" in -+ gentoo) DEFAULT_INIT_SHELL="/sbin/openrc-run";; -+ alpine) DEFAULT_INIT_SHELL="/sbin/openrc-run";; -+ *) DEFAULT_INIT_SHELL="/bin/sh" ;; -+ esac - - AC_MSG_RESULT([$DEFAULT_INIT_SCRIPT:$DEFAULT_INIT_SHELL]) - AC_SUBST(DEFAULT_INIT_SCRIPT) diff --git a/files/zfs/3510.2.6/overlay/sys-fs/zfs/files/2.1.2-scrub-timers.patch b/files/zfs/3510.2.6/overlay/sys-fs/zfs/files/2.1.2-scrub-timers.patch deleted file mode 100644 index f1c5b56..0000000 --- a/files/zfs/3510.2.6/overlay/sys-fs/zfs/files/2.1.2-scrub-timers.patch +++ /dev/null @@ -1,147 +0,0 @@ -From 2c9844d159024d4c742d24639a218213fb53d537 Mon Sep 17 00:00:00 2001 -From: Georgy Yakovlev -Date: Sat, 22 May 2021 22:27:39 -0700 -Subject: [PATCH 1/2] systemd: add weekly and monthly scrub timers - -timers can be enabled as follows: - -systemctl enable zfs-scrub-weekly@rpool.timer --now -systemctl enable zfs-scrub-monthly@datapool.timer --now - -Each timer will pull in zfs-scrub@${poolname}.service, which is not -schedule-specific. - -Signed-off-by: Georgy Yakovlev ---- - etc/systemd/system/.gitignore | 1 + - etc/systemd/system/Makefile.am | 5 ++++- - etc/systemd/system/zfs-scrub-monthly@.timer.in | 12 ++++++++++++ - etc/systemd/system/zfs-scrub-weekly@.timer.in | 12 ++++++++++++ - etc/systemd/system/zfs-scrub@.service.in | 14 ++++++++++++++ - 5 files changed, 43 insertions(+), 1 deletion(-) - create mode 100644 etc/systemd/system/zfs-scrub-monthly@.timer.in - create mode 100644 etc/systemd/system/zfs-scrub-weekly@.timer.in - create mode 100644 etc/systemd/system/zfs-scrub@.service.in - -diff --git a/etc/systemd/system/Makefile.am b/etc/systemd/system/Makefile.am -index c374a52ac..5e65e1db4 100644 ---- a/etc/systemd/system/Makefile.am -+++ b/etc/systemd/system/Makefile.am -@@ -12,7 +12,10 @@ systemdunit_DATA = \ - zfs-volume-wait.service \ - zfs-import.target \ - zfs-volumes.target \ -- zfs.target -+ zfs.target \ -+ zfs-scrub-monthly@.timer \ -+ zfs-scrub-weekly@.timer \ -+ zfs-scrub@.service - - SUBSTFILES += $(systemdpreset_DATA) $(systemdunit_DATA) - -diff --git a/etc/systemd/system/zfs-scrub-monthly@.timer.in b/etc/systemd/system/zfs-scrub-monthly@.timer.in -new file mode 100644 -index 000000000..903068468 ---- /dev/null -+++ b/etc/systemd/system/zfs-scrub-monthly@.timer.in -@@ -0,0 +1,12 @@ -+[Unit] -+Description=Monthly zpool scrub timer for %i -+Documentation=man:zpool-scrub(8) -+ -+[Timer] -+OnCalendar=monthly -+Persistent=true -+RandomizedDelaySec=1h -+Unit=zfs-scrub@%i.service -+ -+[Install] -+WantedBy=timers.target -diff --git a/etc/systemd/system/zfs-scrub-weekly@.timer.in b/etc/systemd/system/zfs-scrub-weekly@.timer.in -new file mode 100644 -index 000000000..ede699500 ---- /dev/null -+++ b/etc/systemd/system/zfs-scrub-weekly@.timer.in -@@ -0,0 +1,12 @@ -+[Unit] -+Description=Weekly zpool scrub timer for %i -+Documentation=man:zpool-scrub(8) -+ -+[Timer] -+OnCalendar=weekly -+Persistent=true -+RandomizedDelaySec=1h -+Unit=zfs-scrub@%i.service -+ -+[Install] -+WantedBy=timers.target -diff --git a/etc/systemd/system/zfs-scrub@.service.in b/etc/systemd/system/zfs-scrub@.service.in -new file mode 100644 -index 000000000..c04ac292a ---- /dev/null -+++ b/etc/systemd/system/zfs-scrub@.service.in -@@ -0,0 +1,14 @@ -+[Unit] -+Description=zpool scrub on %i -+Documentation=man:zpool-scrub(8) -+Requires=zfs.target -+After=zfs.target -+ConditionACPower=true -+ConditionPathIsDirectory=/sys/module/zfs -+ -+[Service] -+ExecStart=/bin/sh -c '\ -+if @sbindir@/zpool status %i | grep "scrub in progress"; then\ -+exec @sbindir@/zpool wait -t scrub %i;\ -+else exec @sbindir@/zpool scrub -w %i; fi' -+ExecStop=-/bin/sh -c '@sbindir@/zpool scrub -p %i 2>/dev/null || true' --- -2.34.1 - -From 4bac4eae0345fb322337b66a9b4923e9f3f52b0f Mon Sep 17 00:00:00 2001 -From: Georgy Yakovlev -Date: Fri, 29 Oct 2021 21:40:50 -0700 -Subject: [PATCH 2/2] zpool-scrub.8: add PERIODIC SCRUB section - -Signed-off-by: Georgy Yakovlev ---- - man/man8/zpool-scrub.8 | 21 +++++++++++++++++++++ - 1 file changed, 21 insertions(+) - -diff --git a/man/man8/zpool-scrub.8 b/man/man8/zpool-scrub.8 -index 768f71539..69ae825b6 100644 ---- a/man/man8/zpool-scrub.8 -+++ b/man/man8/zpool-scrub.8 -@@ -116,8 +116,29 @@ scanned at 100M/s, and 68.4M of that file data has been - scrubbed sequentially at 10.0M/s. - .El - .El -+.Sh PERIODIC SCRUB -+On machines using systemd, scrub timers can be enabled on per-pool basis. -+.Nm weekly -+and -+.Nm monthly -+timer units are provided. -+.Bl -tag -width Ds -+.It Xo -+.Xc -+.Nm systemctl -+.Cm enable -+.Cm zfs-scrub-\fIweekly\fB@\fIrpool\fB.timer -+.Cm --now -+.It Xo -+.Xc -+.Nm systemctl -+.Cm enable -+.Cm zfs-scrub-\fImonthly\fB@\fIotherpool\fB.timer -+.Cm --now -+.El - . - .Sh SEE ALSO -+.Xr systemd.timer 5 , - .Xr zpool-iostat 8 , - .Xr zpool-resilver 8 , - .Xr zpool-status 8 --- -2.34.1 - diff --git a/files/zfs/3510.2.6/overlay/sys-fs/zfs/files/2.1.5-dracut-zfs-missing.patch b/files/zfs/3510.2.6/overlay/sys-fs/zfs/files/2.1.5-dracut-zfs-missing.patch deleted file mode 100644 index 077bcd5..0000000 --- a/files/zfs/3510.2.6/overlay/sys-fs/zfs/files/2.1.5-dracut-zfs-missing.patch +++ /dev/null @@ -1,14 +0,0 @@ -https://github.com/openzfs/zfs/commit/ebbfc6cb853d2d2f3f0671362d5ff5588be39e9d -https://github.com/openzfs/zfs/issues/13595 ---- b/contrib/dracut/90zfs/module-setup.sh.in -+++ a/contrib/dracut/90zfs/module-setup.sh.in -@@ -19,7 +19,7 @@ - } - - installkernel() { -+ instmods zfs -- instmods -c zfs - } - - install() { - diff --git a/files/zfs/3510.2.6/overlay/sys-fs/zfs/files/2.1.5-r2-dracut-non-root.patch b/files/zfs/3510.2.6/overlay/sys-fs/zfs/files/2.1.5-r2-dracut-non-root.patch deleted file mode 100644 index a9c6130..0000000 --- a/files/zfs/3510.2.6/overlay/sys-fs/zfs/files/2.1.5-r2-dracut-non-root.patch +++ /dev/null @@ -1,60 +0,0 @@ -https://github.com/openzfs/zfs/commit/eefe83eaa68f7cb4a49c580dd940d3688e42c849 -https://bugs.gentoo.org/854333 - -From eefe83eaa68f7cb4a49c580dd940d3688e42c849 Mon Sep 17 00:00:00 2001 -From: Toyam Cox -Date: Thu, 30 Jun 2022 13:47:58 -0400 -Subject: [PATCH] dracut: fix boot on non-zfs-root systems - -Simply prevent overwriting root until it needs to be overwritten. - -Dracut could change this value before this module is called, but won't -change the kernel command line. - -Reviewed-by: Andrew J. Hesford -Signed-off-by: Toyam Cox -Closes #13592 ---- - contrib/dracut/90zfs/zfs-lib.sh.in | 10 +++++----- - 1 file changed, 5 insertions(+), 5 deletions(-) - -diff --git a/contrib/dracut/90zfs/zfs-lib.sh.in b/contrib/dracut/90zfs/zfs-lib.sh.in -index e44673c2d75..3a43e514d6f 100755 ---- a/contrib/dracut/90zfs/zfs-lib.sh.in -+++ b/contrib/dracut/90zfs/zfs-lib.sh.in -@@ -88,11 +88,11 @@ decode_root_args() { - return - fi - -- root=$(getarg root=) -+ xroot=$(getarg root=) - rootfstype=$(getarg rootfstype=) - - # shellcheck disable=SC2249 -- case "$root" in -+ case "$xroot" in - ""|zfs|zfs:|zfs:AUTO) - root=zfs:AUTO - rootfstype=zfs -@@ -100,7 +100,7 @@ decode_root_args() { - ;; - - ZFS=*|zfs:*) -- root="${root#zfs:}" -+ root="${xroot#zfs:}" - root="${root#ZFS=}" - root=$(echo "$root" | tr '+' ' ') - rootfstype=zfs -@@ -109,9 +109,9 @@ decode_root_args() { - esac - - if [ "$rootfstype" = "zfs" ]; then -- case "$root" in -+ case "$xroot" in - "") root=zfs:AUTO ;; -- *) root=$(echo "$root" | tr '+' ' ') ;; -+ *) root=$(echo "$xroot" | tr '+' ' ') ;; - esac - return 0 - fi - diff --git a/files/zfs/3510.2.6/overlay/sys-fs/zfs/files/bash-completion-sudo.patch b/files/zfs/3510.2.6/overlay/sys-fs/zfs/files/bash-completion-sudo.patch deleted file mode 100644 index 8ae9d25..0000000 --- a/files/zfs/3510.2.6/overlay/sys-fs/zfs/files/bash-completion-sudo.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 3829d0b867f6aa4bde8798147dee74a86435d12c Mon Sep 17 00:00:00 2001 -From: Georgy Yakovlev -Date: Fri, 22 Mar 2019 22:04:40 -0700 -Subject: [PATCH] contrib/bash_completion.d/zfs: remove sudo reference - ---- - contrib/bash_completion.d/zfs | 10 +++++----- - 1 file changed, 5 insertions(+), 5 deletions(-) - -diff --git a/contrib/bash_completion.d/zfs b/contrib/bash_completion.d/zfs -index 914db43c..b1aded36 100644 ---- a/contrib/bash_completion.d/zfs -+++ b/contrib/bash_completion.d/zfs -@@ -21,13 +21,13 @@ - # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - # OTHER DEALINGS IN THE SOFTWARE. - --if [[ -w /dev/zfs ]]; then -+#if [[ -w /dev/zfs ]]; then - __ZFS_CMD="zfs" - __ZPOOL_CMD="zpool" --else -- __ZFS_CMD="sudo zfs" -- __ZPOOL_CMD="sudo zpool" --fi -+#else -+# __ZFS_CMD="sudo zfs" -+# __ZPOOL_CMD="sudo zpool" -+#fi - - __zfs_get_commands() - { --- -2.21.0 - diff --git a/files/zfs/3510.2.6/overlay/sys-fs/zfs/metadata.xml b/files/zfs/3510.2.6/overlay/sys-fs/zfs/metadata.xml deleted file mode 100644 index 8518b15..0000000 --- a/files/zfs/3510.2.6/overlay/sys-fs/zfs/metadata.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - - - gyakovlev@gentoo.org - Georgy Yakovlev - - - sam@gentoo.org - Sam James - - - Disable dependency on sys-fs/zfs-kmod under the assumption that ZFS is part of the kernel source tree - Don't install python scripts (arcstat, dbufstat etc) and avoid dependency on dev-lang/python - Install zfs_key pam module, for automatically loading zfs encryption keys for home datasets - Enable dependencies required for booting off a pool containing a rootfs - Install regression test suite - - - https://github.com/openzfs/zfs/issues - https://openzfs.github.io/openzfs-docs - openzfs/zfs - - - OpenZFS is an advanced file system and volume manager which was originally developed - for Solaris and is now maintained by the OpenZFS community - - It includes the functionality of both traditional file systems and volume manager. - It has many advanced features including: - * Protection against data corruption. Integrity checking for both data and metadata. - * Continuous integrity verification and automatic “self-healing” repair - * Data redundancy with mirroring, RAID-Z1/2/3 [and DRAID] - * Support for high storage capacities — up to 256 trillion yobibytes (2^128 bytes) - * Space-saving with transparent compression using LZ4, GZIP or ZSTD - * Hardware-accelerated native encryption - * Efficient storage with snapshots and copy-on-write clones - * Efficient local or remote replication — send only changed blocks with ZFS send and receive - - The OpenZFS project brings together developers from the Linux, FreeBSD, illumos, MacOS, and Windows platforms. - OpenZFS is supported by a wide range of companies. - - diff --git a/files/zfs/3510.2.6/overlay/sys-fs/zfs/zfs-0.8.6-r2.ebuild b/files/zfs/3510.2.6/overlay/sys-fs/zfs/zfs-0.8.6-r2.ebuild deleted file mode 100644 index 46403d3..0000000 --- a/files/zfs/3510.2.6/overlay/sys-fs/zfs/zfs-0.8.6-r2.ebuild +++ /dev/null @@ -1,245 +0,0 @@ -# Copyright 1999-2022 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -DISTUTILS_OPTIONAL=1 -PYTHON_COMPAT=( python3_{7,8,9} ) - -inherit autotools bash-completion-r1 dist-kernel-utils distutils-r1 flag-o-matic linux-info systemd udev usr-ldscript - -DESCRIPTION="Userland utilities for ZFS Linux kernel module" -HOMEPAGE="https://github.com/openzfs/zfs" - -if [[ ${PV} == "9999" ]] ; then - inherit git-r3 linux-mod - EGIT_REPO_URI="https://github.com/openzfs/zfs.git" -else - SRC_URI="https://github.com/openzfs/${PN}/releases/download/${P}/${P}.tar.gz" - KEYWORDS="amd64 arm64 ppc64" -fi - -LICENSE="BSD-2 CDDL MIT" -SLOT="0/2" # just libzfs soname major for now. possible candidates: libuutil, libzpool, libnvpair -IUSE="custom-cflags debug dist-kernel kernel-builtin minimal nls pam python +rootfs test-suite" - -DEPEND=" - net-libs/libtirpc:= - sys-apps/util-linux - sys-libs/zlib - virtual/awk - virtual/libudev:= - dev-libs/openssl:0= - !minimal? ( ${PYTHON_DEPS} ) - python? ( - virtual/python-cffi[${PYTHON_USEDEP}] - ) -" - -BDEPEND="virtual/awk - virtual/pkgconfig - nls? ( sys-devel/gettext ) - python? ( - dev-python/setuptools[${PYTHON_USEDEP}] - ) -" - -RDEPEND="${DEPEND} - !kernel-builtin? ( ~sys-fs/zfs-kmod-${PV}:= ) - !prefix? ( virtual/udev ) - sys-fs/udev-init-scripts - virtual/awk - dist-kernel? ( virtual/dist-kernel:= ) - rootfs? ( - app-arch/cpio - app-misc/pax-utils - !" - eerror " Block devices --->" - eerror " [X] Loopback device support" - fi - fi - fi - fi -} - -src_prepare() { - default - - if [[ ${PV} == "9999" ]]; then - eautoreconf - else - # Set revision number - sed -i "s/\(Release:\)\(.*\)1/\1\2${PR}-gentoo/" META || die "Could not set Gentoo release" - fi - - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_prepare - popd >/dev/null || die - fi - - # prevent errors showing up on zfs-mount stop, #647688 - # openrc will unmount all filesystems anyway. - sed -i "/^ZFS_UNMOUNT=/ s/yes/no/" "etc/default/zfs.in" || die -} - -src_configure() { - use custom-cflags || strip-flags - use minimal || python_setup - - local myconf=( - --bindir="${EPREFIX}/bin" - --enable-shared - --enable-systemd - --enable-sysvinit - --localstatedir="${EPREFIX}/var" - --sbindir="${EPREFIX}/sbin" - --with-config=user - --with-dracutdir="${EPREFIX}/usr/lib/dracut" - --with-linux="${KV_DIR}" - --with-linux-obj="${KV_OUT_DIR}" - --with-udevdir="$(get_udevdir)" - --with-systemdunitdir="$(systemd_get_systemunitdir)" - --with-systemdpresetdir="$(systemd_get_systempresetdir)" - $(use_enable debug) - $(use_enable nls) - $(use_enable python pyzfs) - --disable-static - $(usex minimal --without-python --with-python="${EPYTHON}") - ) - - CONFIG_SHELL="${EPREFIX}/bin/bash" econf "${myconf[@]}" -} - -src_compile() { - default - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_compile - popd >/dev/null || die - fi -} - -src_install() { - default - - gen_usr_ldscript -a uutil nvpair zpool zfs zfs_core - - use test-suite || rm -rf "${ED}/usr/share/zfs" - - find "${ED}/" -name '*.la' -delete || die - - dobashcomp contrib/bash_completion.d/zfs - bashcomp_alias zfs zpool - - # strip executable bit from conf.d file - fperms 0644 /etc/conf.d/zfs - - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_install - popd >/dev/null || die - fi - - # enforce best available python implementation - use minimal || python_fix_shebang "${ED}/bin" -} - -pkg_postinst() { - # we always need userspace utils in sync with zfs-kmod - # so force initrd update for userspace as well, to avoid - # situation when zfs-kmod trigger initrd rebuild before - # userspace component is rebuilt - # KV_* variables are provided by linux-info.eclass - if [[ -z ${ROOT} ]] && use dist-kernel; then - dist-kernel_reinstall_initramfs "${KV_DIR}" "${KV_FULL}" - fi - - if use rootfs; then - if ! has_version sys-kernel/genkernel && ! has_version sys-kernel/dracut; then - elog "root on zfs requires initramfs to boot" - elog "the following packages known to provide one and tested on regular basis:" - elog " sys-kernel/dracut ( preferred, module maintained by zfs developers )" - elog " sys-kernel/genkernel" - fi - fi - - if ! use kernel-builtin && [[ ${PV} = "9999" ]]; then - einfo "Adding ${P} to the module database to ensure that the" - einfo "kernel modules and userland utilities stay in sync." - update_moduledb - fi - - if systemd_is_booted || has_version sys-apps/systemd; then - einfo "Please refer to ${EROOT}/$(systemd_get_systempresetdir)/50-zfs.preset" - einfo "for default zfs systemd service configuration" - else - [[ -e "${EROOT}/etc/runlevels/boot/zfs-import" ]] || \ - einfo "You should add zfs-import to the boot runlevel." - [[ -e "${EROOT}/etc/runlevels/boot/zfs-mount" ]]|| \ - einfo "You should add zfs-mount to the boot runlevel." - [[ -e "${EROOT}/etc/runlevels/default/zfs-share" ]] || \ - einfo "You should add zfs-share to the default runlevel." - [[ -e "${EROOT}/etc/runlevels/default/zfs-zed" ]] || \ - einfo "You should add zfs-zed to the default runlevel." - fi -} - -pkg_postrm() { - if ! use kernel-builtin && [[ ${PV} == "9999" ]]; then - remove_moduledb - fi -} diff --git a/files/zfs/3510.2.6/overlay/sys-fs/zfs/zfs-2.0.7.ebuild b/files/zfs/3510.2.6/overlay/sys-fs/zfs/zfs-2.0.7.ebuild deleted file mode 100644 index e4ff7ef..0000000 --- a/files/zfs/3510.2.6/overlay/sys-fs/zfs/zfs-2.0.7.ebuild +++ /dev/null @@ -1,302 +0,0 @@ -# Copyright 1999-2022 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -DISTUTILS_OPTIONAL=1 -PYTHON_COMPAT=( python3_{8..10} ) - -inherit autotools bash-completion-r1 dist-kernel-utils distutils-r1 flag-o-matic linux-info pam systemd udev usr-ldscript - -DESCRIPTION="Userland utilities for ZFS Linux kernel module" -HOMEPAGE="https://github.com/openzfs/zfs" - -if [[ ${PV} == "9999" ]]; then - inherit git-r3 linux-mod - 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_P="${P/_rc/-rc}" - SRC_URI="https://github.com/openzfs/${PN}/releases/download/${MY_P}/${MY_P}.tar.gz" - SRC_URI+=" verify-sig? ( https://github.com/openzfs/${PN}/releases/download/${MY_P}/${MY_P}.tar.gz.asc )" - S="${WORKDIR}/${P%_rc?}" - - if [[ ${PV} != *_rc* ]]; then - KEYWORDS="amd64 arm64 ppc64" - fi -fi - -LICENSE="BSD-2 CDDL MIT" -# just libzfs soname major for now. -# possible candidates: libuutil, libzpool, libnvpair. Those do not provide stable abi, but are considered. -# see libsoversion_check() below as well -SLOT="0/4" -IUSE="custom-cflags debug dist-kernel kernel-builtin minimal nls pam python +rootfs test-suite" - -DEPEND=" - net-libs/libtirpc:= - sys-apps/util-linux - sys-libs/zlib - virtual/libudev:= - dev-libs/openssl:0= - !minimal? ( ${PYTHON_DEPS} ) - pam? ( sys-libs/pam ) - python? ( - virtual/python-cffi[${PYTHON_USEDEP}] - ) -" - -BDEPEND="virtual/awk - virtual/pkgconfig - nls? ( sys-devel/gettext ) - python? ( - dev-python/setuptools[${PYTHON_USEDEP}] - || ( - dev-python/packaging[${PYTHON_USEDEP}] - dev-python/distlib[${PYTHON_USEDEP}] - ) - ) -" - -if [[ ${PV} != "9999" ]] ; then - BDEPEND+=" verify-sig? ( sec-keys/openpgp-keys-openzfs )" -fi - -# awk is used for some scripts, completions, and the Dracut module -RDEPEND="${DEPEND} - !kernel-builtin? ( ~sys-fs/zfs-kmod-${PV}:= ) - !prefix? ( virtual/udev ) - sys-fs/udev-init-scripts - virtual/awk - dist-kernel? ( virtual/dist-kernel:= ) - rootfs? ( - app-arch/cpio - app-misc/pax-utils - !" - eerror " Block devices --->" - eerror " [X] Loopback device support" - fi - fi - fi - fi -} - -libsoversion_check() { - - local bugurl libzfs_sover - bugurl="https://bugs.gentoo.org/enter_bug.cgi?form_name=enter_bug&product=Gentoo+Linux&component=Current+packages" - - libzfs_sover="$(grep 'libzfs_la_LDFLAGS += -version-info' lib/libzfs/Makefile.am \ - | grep -Eo '[0-9]+:[0-9]+:[0-9]+')" - libzfs_sover="${libzfs_sover%%:*}" - - if [[ ${libzfs_sover} -ne $(ver_cut 2 ${SLOT}) ]]; then - echo - eerror "BUG BUG BUG BUG BUG BUG BUG BUG" - eerror "ebuild subslot does not match libzfs soversion!" - eerror "libzfs soversion: ${libzfs_sover}" - eerror "ebuild value: $(ver_cut 2 ${SLOT})" - eerror "This is a bug in the ebuild, please use the following URL to report it" - eerror "${bugurl}&short_desc=${CATEGORY}%2F${P}+update+subslot" - echo - # we want to abort for releases, but just print a warning for live ebuild - # to keep package installable - [[ ${PV} == "9999" ]] || die - fi -} - -src_prepare() { - default - libsoversion_check - - # Run unconditionally (bug #792627) - eautoreconf - - if [[ ${PV} != "9999" ]]; then - # Set revision number - sed -i "s/\(Release:\)\(.*\)1/\1\2${PR}-gentoo/" META || die "Could not set Gentoo release" - fi - - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_prepare - popd >/dev/null || die - fi - - # prevent errors showing up on zfs-mount stop, #647688 - # openrc will unmount all filesystems anyway. - sed -i "/^ZFS_UNMOUNT=/ s/yes/no/" "etc/default/zfs.in" || die -} - -src_configure() { - use custom-cflags || strip-flags - use minimal || python_setup - - local myconf=( - --bindir="${EPREFIX}/bin" - --enable-shared - --enable-systemd - --enable-sysvinit - --localstatedir="${EPREFIX}/var" - --sbindir="${EPREFIX}/sbin" - --with-config=user - --with-dracutdir="${EPREFIX}/usr/lib/dracut" - --with-linux="${KV_DIR}" - --with-linux-obj="${KV_OUT_DIR}" - --with-udevdir="$(get_udevdir)" - --with-pamconfigsdir="${EPREFIX}/unwanted_files" - --with-pammoduledir="$(getpam_mod_dir)" - --with-systemdunitdir="$(systemd_get_systemunitdir)" - --with-systemdpresetdir="$(systemd_get_systempresetdir)" - --with-vendor=gentoo - $(use_enable debug) - $(use_enable nls) - $(use_enable pam) - $(use_enable python pyzfs) - --disable-static - $(usex minimal --without-python --with-python="${EPYTHON}") - ) - - econf "${myconf[@]}" -} - -src_compile() { - default - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_compile - popd >/dev/null || die - fi -} - -src_install() { - default - - gen_usr_ldscript -a nvpair uutil zfsbootenv zfs zfs_core zpool - - use pam && { rm -rv "${ED}/unwanted_files" || die ; } - - use test-suite || { rm -r "${ED}/usr/share/zfs" || die ; } - - find "${ED}" -name '*.la' -delete || die - - dobashcomp contrib/bash_completion.d/zfs - bashcomp_alias zfs zpool - - # strip executable bit from conf.d file - fperms 0644 /etc/conf.d/zfs - - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_install - popd >/dev/null || die - fi - - # enforce best available python implementation - use minimal || python_fix_shebang "${ED}/bin" -} - -pkg_postinst() { - # we always need userspace utils in sync with zfs-kmod - # so force initrd update for userspace as well, to avoid - # situation when zfs-kmod trigger initrd rebuild before - # userspace component is rebuilt - # KV_* variables are provided by linux-info.eclass - if [[ -z ${ROOT} ]] && use dist-kernel; then - dist-kernel_reinstall_initramfs "${KV_DIR}" "${KV_FULL}" - fi - - if use rootfs; then - if ! has_version sys-kernel/genkernel && ! has_version sys-kernel/dracut; then - elog "Root on zfs requires an initramfs to boot" - elog "The following packages provide one and are tested on a regular basis:" - elog " sys-kernel/dracut ( preferred, module maintained by zfs developers )" - elog " sys-kernel/genkernel" - fi - fi - - if ! use kernel-builtin && [[ ${PV} == "9999" ]]; then - einfo "Adding ${P} to the module database to ensure that the" - einfo "kernel modules and userland utilities stay in sync." - update_moduledb - fi - - if systemd_is_booted || has_version sys-apps/systemd; then - einfo "Please refer to ${EROOT}/$(systemd_get_systempresetdir)/50-zfs.preset" - einfo "for default zfs systemd service configuration" - else - [[ -e "${EROOT}/etc/runlevels/boot/zfs-import" ]] || \ - einfo "You should add zfs-import to the boot runlevel." - [[ -e "${EROOT}/etc/runlevels/boot/zfs-mount" ]]|| \ - einfo "You should add zfs-mount to the boot runlevel." - [[ -e "${EROOT}/etc/runlevels/default/zfs-share" ]] || \ - einfo "You should add zfs-share to the default runlevel." - [[ -e "${EROOT}/etc/runlevels/default/zfs-zed" ]] || \ - einfo "You should add zfs-zed to the default runlevel." - fi -} - -pkg_postrm() { - if ! use kernel-builtin && [[ ${PV} == "9999" ]]; then - remove_moduledb - fi -} diff --git a/files/zfs/3510.2.6/overlay/sys-fs/zfs/zfs-2.1.11.ebuild b/files/zfs/3510.2.6/overlay/sys-fs/zfs/zfs-2.1.11.ebuild deleted file mode 100644 index c67dc48..0000000 --- a/files/zfs/3510.2.6/overlay/sys-fs/zfs/zfs-2.1.11.ebuild +++ /dev/null @@ -1,320 +0,0 @@ -# Copyright 1999-2023 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -DISTUTILS_OPTIONAL=1 -PYTHON_COMPAT=( python3_{9..11} ) - -inherit autotools bash-completion-r1 dist-kernel-utils distutils-r1 flag-o-matic linux-info pam systemd udev usr-ldscript - -DESCRIPTION="Userland utilities for ZFS Linux kernel module" -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_P="${P/_rc/-rc}" - SRC_URI="https://github.com/openzfs/${PN}/releases/download/${MY_P}/${MY_P}.tar.gz" - SRC_URI+=" verify-sig? ( https://github.com/openzfs/${PN}/releases/download/${MY_P}/${MY_P}.tar.gz.asc )" - S="${WORKDIR}/${P%_rc?}" - - if [[ ${PV} != *_rc* ]]; then - KEYWORDS="amd64 arm64 ppc64 ~riscv ~sparc" - fi -fi - -LICENSE="BSD-2 CDDL MIT" -# just libzfs soname major for now. -# possible candidates: libuutil, libzpool, libnvpair. Those do not provide stable abi, but are considered. -# see libsoversion_check() below as well -SLOT="0/5" -IUSE="custom-cflags debug dist-kernel kernel-builtin minimal nls pam python +rootfs selinux test-suite" - -DEPEND=" - net-libs/libtirpc:= - sys-apps/util-linux - sys-libs/zlib - virtual/libudev:= - dev-libs/openssl:0= - !minimal? ( ${PYTHON_DEPS} ) - pam? ( sys-libs/pam ) - python? ( - virtual/python-cffi[${PYTHON_USEDEP}] - ) -" - -BDEPEND="app-alternatives/awk - virtual/pkgconfig - nls? ( sys-devel/gettext ) - python? ( - dev-python/setuptools[${PYTHON_USEDEP}] - || ( - dev-python/packaging[${PYTHON_USEDEP}] - dev-python/distlib[${PYTHON_USEDEP}] - ) - ) -" - -if [[ ${PV} != "9999" ]] ; then - BDEPEND+=" verify-sig? ( sec-keys/openpgp-keys-openzfs )" -fi - -# awk is used for some scripts, completions, and the Dracut module -RDEPEND="${DEPEND} - !kernel-builtin? ( ~sys-fs/zfs-kmod-${PV}:= ) - !prefix? ( virtual/udev ) - sys-fs/udev-init-scripts - app-alternatives/awk - dist-kernel? ( virtual/dist-kernel:= ) - rootfs? ( - app-arch/cpio - app-misc/pax-utils - ) - selinux? ( sec-policy/selinux-zfs ) - test-suite? ( - app-shells/ksh - sys-apps/kmod[tools] - sys-apps/util-linux - sys-devel/bc - sys-block/parted - sys-fs/lsscsi - sys-fs/mdadm - sys-process/procps - ) -" - -# PDEPEND in this form is needed to trick portage suggest -# enabling dist-kernel if only 1 package have it set, without suggesting to disable -PDEPEND="dist-kernel? ( ~sys-fs/zfs-kmod-${PV}[dist-kernel] )" - -REQUIRED_USE=" - !minimal? ( ${PYTHON_REQUIRED_USE} ) - python? ( !minimal ) - test-suite? ( !minimal ) -" - -RESTRICT="test" - -PATCHES=( - # bug #854333 - "${FILESDIR}"/2.1.5-r2-dracut-non-root.patch - - "${FILESDIR}"/2.1.5-dracut-zfs-missing.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() { - if use kernel_linux; then - linux-info_pkg_setup - - if ! linux_config_exists; then - ewarn "Cannot check the linux kernel configuration." - else - if use test-suite; then - if linux_chkconfig_present BLK_DEV_LOOP; then - eerror "The ZFS test suite requires loop device support enabled." - eerror "Please enable it:" - eerror " CONFIG_BLK_DEV_LOOP=y" - eerror "in /usr/src/linux/.config or" - eerror " Device Drivers --->" - eerror " Block devices --->" - eerror " [X] Loopback device support" - fi - fi - fi - fi -} - -libsoversion_check() { - local bugurl libzfs_sover - bugurl="https://bugs.gentoo.org/enter_bug.cgi?form_name=enter_bug&product=Gentoo+Linux&component=Current+packages" - - libzfs_sover="$(grep 'libzfs_la_LDFLAGS += -version-info' lib/libzfs/Makefile.am \ - | grep -Eo '[0-9]+:[0-9]+:[0-9]+')" - libzfs_sover="${libzfs_sover%%:*}" - - if [[ ${libzfs_sover} -ne $(ver_cut 2 ${SLOT}) ]]; then - echo - eerror "BUG BUG BUG BUG BUG BUG BUG BUG" - eerror "ebuild subslot does not match libzfs soversion!" - eerror "libzfs soversion: ${libzfs_sover}" - eerror "ebuild value: $(ver_cut 2 ${SLOT})" - eerror "This is a bug in the ebuild, please use the following URL to report it" - eerror "${bugurl}&short_desc=${CATEGORY}%2F${P}+update+subslot" - echo - # we want to abort for releases, but just print a warning for live ebuild - # to keep package installable - [[ ${PV} == "9999" ]] || die - fi -} - -src_unpack() { - if use verify-sig ; then - # Needed for downloaded patch (which is unsigned, which is fine) - verify-sig_verify_detached "${DISTDIR}"/${MY_P}.tar.gz{,.asc} - fi - - default -} - -src_prepare() { - default - libsoversion_check - - # Run unconditionally (bug #792627) - eautoreconf - - if [[ ${PV} != "9999" ]]; then - # Set revision number - sed -i "s/\(Release:\)\(.*\)1/\1\2${PR}-gentoo/" META || die "Could not set Gentoo release" - fi - - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_prepare - popd >/dev/null || die - fi - - # prevent errors showing up on zfs-mount stop, #647688 - # openrc will unmount all filesystems anyway. - sed -i "/^ZFS_UNMOUNT=/ s/yes/no/" "etc/default/zfs.in" || die -} - -src_configure() { - use custom-cflags || strip-flags - use minimal || python_setup - - # All the same issue: - # Segfaults w/ GCC 12 and 'zfs send' - # bug #856373 - # https://github.com/openzfs/zfs/issues/13620 - # https://github.com/openzfs/zfs/issues/13605 - append-flags -fno-tree-vectorize - - local myconf=( - --bindir="${EPREFIX}/bin" - --enable-shared - --enable-sysvinit - --localstatedir="${EPREFIX}/var" - --sbindir="${EPREFIX}/sbin" - --with-config=user - --with-dracutdir="${EPREFIX}/usr/lib/dracut" - --with-linux="${KV_DIR}" - --with-linux-obj="${KV_OUT_DIR}" - --with-udevdir="$(get_udevdir)" - --with-pamconfigsdir="${EPREFIX}/unwanted_files" - --with-pammoduledir="$(getpam_mod_dir)" - --with-systemdunitdir="$(systemd_get_systemunitdir)" - --with-systemdpresetdir="$(systemd_get_systempresetdir)" - --with-vendor=gentoo - # Building zfs-mount-generator.c on musl breaks as strndupa - # isn't available. But systemd doesn't support musl anyway, so - # just disable building it. - $(use_enable !elibc_musl systemd) - $(use_enable debug) - $(use_enable nls) - $(use_enable pam) - $(use_enable python pyzfs) - --disable-static - $(usex minimal --without-python --with-python="${EPYTHON}") - ) - - econf "${myconf[@]}" -} - -src_compile() { - default - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_compile - popd >/dev/null || die - fi -} - -src_install() { - default - - gen_usr_ldscript -a nvpair uutil zfsbootenv zfs zfs_core zpool - - use pam && { rm -rv "${ED}/unwanted_files" || die ; } - - use test-suite || { rm -r "${ED}"/usr/share/zfs/{test-runner,zfs-tests,runfiles,*sh} || die ; } - - find "${ED}" -name '*.la' -delete || die - - dobashcomp contrib/bash_completion.d/zfs - bashcomp_alias zfs zpool - - # strip executable bit from conf.d file - fperms 0644 /etc/conf.d/zfs - - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_install - popd >/dev/null || die - fi - - # enforce best available python implementation - use minimal || python_fix_shebang "${ED}/bin" -} - -pkg_postinst() { - udev_reload - - # we always need userspace utils in sync with zfs-kmod - # so force initrd update for userspace as well, to avoid - # situation when zfs-kmod trigger initrd rebuild before - # userspace component is rebuilt - # KV_* variables are provided by linux-info.eclass - if [[ -z ${ROOT} ]] && use dist-kernel; then - dist-kernel_reinstall_initramfs "${KV_DIR}" "${KV_FULL}" - fi - - if use rootfs; then - if ! has_version sys-kernel/genkernel && ! has_version sys-kernel/dracut; then - elog "Root on zfs requires an initramfs to boot" - elog "The following packages provide one and are tested on a regular basis:" - elog " sys-kernel/dracut ( preferred, module maintained by zfs developers )" - elog " sys-kernel/genkernel" - fi - fi - - if systemd_is_booted || has_version sys-apps/systemd; then - einfo "Please refer to ${EROOT}/$(systemd_get_systempresetdir)/50-zfs.preset" - einfo "for default zfs systemd service configuration" - else - [[ -e "${EROOT}/etc/runlevels/boot/zfs-import" ]] || \ - einfo "You should add zfs-import to the boot runlevel." - [[ -e "${EROOT}/etc/runlevels/boot/zfs-load-key" ]] || \ - einfo "You should add zfs-load-key to the boot runlevel." - [[ -e "${EROOT}/etc/runlevels/boot/zfs-mount" ]]|| \ - einfo "You should add zfs-mount to the boot runlevel." - [[ -e "${EROOT}/etc/runlevels/default/zfs-share" ]] || \ - einfo "You should add zfs-share to the default runlevel." - [[ -e "${EROOT}/etc/runlevels/default/zfs-zed" ]] || \ - einfo "You should add zfs-zed to the default runlevel." - fi -} - -pkg_postrm() { - udev_reload - - if ! use kernel-builtin && [[ ${PV} == "9999" ]]; then - remove_moduledb - fi -} diff --git a/files/zfs/3510.2.6/overlay/sys-fs/zfs/zfs-2.1.2-r1.ebuild b/files/zfs/3510.2.6/overlay/sys-fs/zfs/zfs-2.1.2-r1.ebuild deleted file mode 100644 index d119026..0000000 --- a/files/zfs/3510.2.6/overlay/sys-fs/zfs/zfs-2.1.2-r1.ebuild +++ /dev/null @@ -1,303 +0,0 @@ -# Copyright 1999-2022 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -DISTUTILS_OPTIONAL=1 -PYTHON_COMPAT=( python3_{8,9,10} ) - -inherit autotools bash-completion-r1 dist-kernel-utils distutils-r1 flag-o-matic linux-info pam systemd udev usr-ldscript - -DESCRIPTION="Userland utilities for ZFS Linux kernel module" -HOMEPAGE="https://github.com/openzfs/zfs" - -if [[ ${PV} == "9999" ]]; then - inherit git-r3 linux-mod - 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_P="${P/_rc/-rc}" - SRC_URI="https://github.com/openzfs/${PN}/releases/download/${MY_P}/${MY_P}.tar.gz" - SRC_URI+=" verify-sig? ( https://github.com/openzfs/${PN}/releases/download/${MY_P}/${MY_P}.tar.gz.asc )" - S="${WORKDIR}/${P%_rc?}" - - if [[ ${PV} != *_rc* ]]; then - KEYWORDS="amd64 arm64 ppc64 ~riscv" - fi -fi - -LICENSE="BSD-2 CDDL MIT" -# just libzfs soname major for now. -# possible candidates: libuutil, libzpool, libnvpair. Those do not provide stable abi, but are considered. -# see libsoversion_check() below as well -SLOT="0/5" -IUSE="custom-cflags debug dist-kernel kernel-builtin minimal nls pam python +rootfs test-suite" - -DEPEND=" - net-libs/libtirpc:= - sys-apps/util-linux - sys-libs/zlib - virtual/libudev:= - dev-libs/openssl:0= - !minimal? ( ${PYTHON_DEPS} ) - pam? ( sys-libs/pam ) - python? ( - virtual/python-cffi[${PYTHON_USEDEP}] - ) -" - -BDEPEND="virtual/awk - virtual/pkgconfig - nls? ( sys-devel/gettext ) - python? ( - dev-python/setuptools[${PYTHON_USEDEP}] - || ( - dev-python/packaging[${PYTHON_USEDEP}] - dev-python/distlib[${PYTHON_USEDEP}] - ) - ) -" - -if [[ ${PV} != "9999" ]] ; then - BDEPEND+=" verify-sig? ( sec-keys/openpgp-keys-openzfs )" -fi - -# awk is used for some scripts, completions, and the Dracut module -RDEPEND="${DEPEND} - !kernel-builtin? ( ~sys-fs/zfs-kmod-${PV}:= ) - !prefix? ( virtual/udev ) - sys-fs/udev-init-scripts - virtual/awk - dist-kernel? ( virtual/dist-kernel:= ) - rootfs? ( - app-arch/cpio - app-misc/pax-utils - !" - eerror " Block devices --->" - eerror " [X] Loopback device support" - fi - fi - fi - fi -} - -libsoversion_check() { - local bugurl libzfs_sover - bugurl="https://bugs.gentoo.org/enter_bug.cgi?form_name=enter_bug&product=Gentoo+Linux&component=Current+packages" - - libzfs_sover="$(grep 'libzfs_la_LDFLAGS += -version-info' lib/libzfs/Makefile.am \ - | grep -Eo '[0-9]+:[0-9]+:[0-9]+')" - libzfs_sover="${libzfs_sover%%:*}" - - if [[ ${libzfs_sover} -ne $(ver_cut 2 ${SLOT}) ]]; then - echo - eerror "BUG BUG BUG BUG BUG BUG BUG BUG" - eerror "ebuild subslot does not match libzfs soversion!" - eerror "libzfs soversion: ${libzfs_sover}" - eerror "ebuild value: $(ver_cut 2 ${SLOT})" - eerror "This is a bug in the ebuild, please use the following URL to report it" - eerror "${bugurl}&short_desc=${CATEGORY}%2F${P}+update+subslot" - echo - # we want to abort for releases, but just print a warning for live ebuild - # to keep package installable - [[ ${PV} == "9999" ]] || die - fi -} - -src_prepare() { - default - libsoversion_check - - # Run unconditionally (bug #792627) - eautoreconf - - if [[ ${PV} != "9999" ]]; then - # Set revision number - sed -i "s/\(Release:\)\(.*\)1/\1\2${PR}-gentoo/" META || die "Could not set Gentoo release" - fi - - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_prepare - popd >/dev/null || die - fi - - # prevent errors showing up on zfs-mount stop, #647688 - # openrc will unmount all filesystems anyway. - sed -i "/^ZFS_UNMOUNT=/ s/yes/no/" "etc/default/zfs.in" || die -} - -src_configure() { - use custom-cflags || strip-flags - use minimal || python_setup - - local myconf=( - --bindir="${EPREFIX}/bin" - --enable-shared - --enable-sysvinit - --localstatedir="${EPREFIX}/var" - --sbindir="${EPREFIX}/sbin" - --with-config=user - --with-dracutdir="${EPREFIX}/usr/lib/dracut" - --with-linux="${KV_DIR}" - --with-linux-obj="${KV_OUT_DIR}" - --with-udevdir="$(get_udevdir)" - --with-pamconfigsdir="${EPREFIX}/unwanted_files" - --with-pammoduledir="$(getpam_mod_dir)" - --with-systemdunitdir="$(systemd_get_systemunitdir)" - --with-systemdpresetdir="$(systemd_get_systempresetdir)" - --with-vendor=gentoo - # Building zfs-mount-generator.c on musl breaks as strndupa - # isn't available. But systemd doesn't support musl anyway, so - # just disable building it. - $(use_enable !elibc_musl systemd) - $(use_enable debug) - $(use_enable nls) - $(use_enable pam) - $(use_enable python pyzfs) - --disable-static - $(usex minimal --without-python --with-python="${EPYTHON}") - ) - - econf "${myconf[@]}" -} - -src_compile() { - default - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_compile - popd >/dev/null || die - fi -} - -src_install() { - default - - gen_usr_ldscript -a nvpair uutil zfsbootenv zfs zfs_core zpool - - use pam && { rm -rv "${ED}/unwanted_files" || die ; } - - use test-suite || { rm -r "${ED}"/usr/share/zfs/{test-runner,zfs-tests,runfiles,*sh} || die ; } - - find "${ED}" -name '*.la' -delete || die - - dobashcomp contrib/bash_completion.d/zfs - bashcomp_alias zfs zpool - - # strip executable bit from conf.d file - fperms 0644 /etc/conf.d/zfs - - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_install - popd >/dev/null || die - fi - - # enforce best available python implementation - use minimal || python_fix_shebang "${ED}/bin" -} - -pkg_postinst() { - # we always need userspace utils in sync with zfs-kmod - # so force initrd update for userspace as well, to avoid - # situation when zfs-kmod trigger initrd rebuild before - # userspace component is rebuilt - # KV_* variables are provided by linux-info.eclass - if [[ -z ${ROOT} ]] && use dist-kernel; then - dist-kernel_reinstall_initramfs "${KV_DIR}" "${KV_FULL}" - fi - - if use rootfs; then - if ! has_version sys-kernel/genkernel && ! has_version sys-kernel/dracut; then - elog "Root on zfs requires an initramfs to boot" - elog "The following packages provide one and are tested on a regular basis:" - elog " sys-kernel/dracut ( preferred, module maintained by zfs developers )" - elog " sys-kernel/genkernel" - fi - fi - - if ! use kernel-builtin && [[ ${PV} == "9999" ]]; then - einfo "Adding ${P} to the module database to ensure that the" - einfo "kernel modules and userland utilities stay in sync." - update_moduledb - fi - - if systemd_is_booted || has_version sys-apps/systemd; then - einfo "Please refer to ${EROOT}/$(systemd_get_systempresetdir)/50-zfs.preset" - einfo "for default zfs systemd service configuration" - else - [[ -e "${EROOT}/etc/runlevels/boot/zfs-import" ]] || \ - einfo "You should add zfs-import to the boot runlevel." - [[ -e "${EROOT}/etc/runlevels/boot/zfs-mount" ]]|| \ - einfo "You should add zfs-mount to the boot runlevel." - [[ -e "${EROOT}/etc/runlevels/default/zfs-share" ]] || \ - einfo "You should add zfs-share to the default runlevel." - [[ -e "${EROOT}/etc/runlevels/default/zfs-zed" ]] || \ - einfo "You should add zfs-zed to the default runlevel." - fi -} - -pkg_postrm() { - if ! use kernel-builtin && [[ ${PV} == "9999" ]]; then - remove_moduledb - fi -} diff --git a/files/zfs/3510.2.6/overlay/sys-fs/zfs/zfs-2.1.4.ebuild b/files/zfs/3510.2.6/overlay/sys-fs/zfs/zfs-2.1.4.ebuild deleted file mode 100644 index f5e9ee0..0000000 --- a/files/zfs/3510.2.6/overlay/sys-fs/zfs/zfs-2.1.4.ebuild +++ /dev/null @@ -1,300 +0,0 @@ -# Copyright 1999-2022 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -DISTUTILS_OPTIONAL=1 -PYTHON_COMPAT=( python3_{8,9,10} ) - -inherit autotools bash-completion-r1 dist-kernel-utils distutils-r1 flag-o-matic linux-info pam systemd udev usr-ldscript - -DESCRIPTION="Userland utilities for ZFS Linux kernel module" -HOMEPAGE="https://github.com/openzfs/zfs" - -if [[ ${PV} == "9999" ]]; then - inherit git-r3 linux-mod - 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_P="${P/_rc/-rc}" - SRC_URI="https://github.com/openzfs/${PN}/releases/download/${MY_P}/${MY_P}.tar.gz" - SRC_URI+=" verify-sig? ( https://github.com/openzfs/${PN}/releases/download/${MY_P}/${MY_P}.tar.gz.asc )" - S="${WORKDIR}/${P%_rc?}" - - # 2.1.3 unkeyworded briefly for some testing - if [[ ${PV} != *_rc* ]]; then - KEYWORDS="amd64 ~arm64 ppc64 ~riscv" - fi -fi - -LICENSE="BSD-2 CDDL MIT" -# just libzfs soname major for now. -# possible candidates: libuutil, libzpool, libnvpair. Those do not provide stable abi, but are considered. -# see libsoversion_check() below as well -SLOT="0/5" -IUSE="custom-cflags debug dist-kernel kernel-builtin +minimal nls pam python rootfs test-suite" - -DEPEND=" - net-libs/libtirpc:= - sys-apps/util-linux - sys-libs/zlib - virtual/libudev:= - dev-libs/openssl:0= - !minimal? ( ${PYTHON_DEPS} ) - pam? ( sys-libs/pam ) - python? ( - virtual/python-cffi[${PYTHON_USEDEP}] - ) -" - -BDEPEND="virtual/awk - virtual/pkgconfig - nls? ( sys-devel/gettext ) - python? ( - dev-python/setuptools[${PYTHON_USEDEP}] - || ( - dev-python/packaging[${PYTHON_USEDEP}] - dev-python/distlib[${PYTHON_USEDEP}] - ) - ) -" - -if [[ ${PV} != "9999" ]] ; then - BDEPEND+=" verify-sig? ( sec-keys/openpgp-keys-openzfs )" -fi - -# awk is used for some scripts, completions, and the Dracut module -RDEPEND="${DEPEND} - !kernel-builtin? ( ~sys-fs/zfs-kmod-${PV}:= ) - !prefix? ( virtual/udev ) - sys-fs/udev-init-scripts - virtual/awk - dist-kernel? ( virtual/dist-kernel:= ) - rootfs? ( - app-arch/cpio - app-misc/pax-utils - !" - eerror " Block devices --->" - eerror " [X] Loopback device support" - fi - fi - fi - fi -} - -libsoversion_check() { - local bugurl libzfs_sover - bugurl="https://bugs.gentoo.org/enter_bug.cgi?form_name=enter_bug&product=Gentoo+Linux&component=Current+packages" - - libzfs_sover="$(grep 'libzfs_la_LDFLAGS += -version-info' lib/libzfs/Makefile.am \ - | grep -Eo '[0-9]+:[0-9]+:[0-9]+')" - libzfs_sover="${libzfs_sover%%:*}" - - if [[ ${libzfs_sover} -ne $(ver_cut 2 ${SLOT}) ]]; then - echo - eerror "BUG BUG BUG BUG BUG BUG BUG BUG" - eerror "ebuild subslot does not match libzfs soversion!" - eerror "libzfs soversion: ${libzfs_sover}" - eerror "ebuild value: $(ver_cut 2 ${SLOT})" - eerror "This is a bug in the ebuild, please use the following URL to report it" - eerror "${bugurl}&short_desc=${CATEGORY}%2F${P}+update+subslot" - echo - # we want to abort for releases, but just print a warning for live ebuild - # to keep package installable - [[ ${PV} == "9999" ]] || die - fi -} - -src_prepare() { - default - libsoversion_check - - # Run unconditionally (bug #792627) - eautoreconf - - if [[ ${PV} != "9999" ]]; then - # Set revision number - sed -i "s/\(Release:\)\(.*\)1/\1\2${PR}-gentoo/" META || die "Could not set Gentoo release" - fi - - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_prepare - popd >/dev/null || die - fi - - # prevent errors showing up on zfs-mount stop, #647688 - # openrc will unmount all filesystems anyway. - sed -i "/^ZFS_UNMOUNT=/ s/yes/no/" "etc/default/zfs.in" || die -} - -src_configure() { - use custom-cflags || strip-flags - use minimal || python_setup - - local myconf=( - --bindir="${EPREFIX}/bin" - --enable-shared - --enable-sysvinit - --localstatedir="${EPREFIX}/var" - --sbindir="${EPREFIX}/sbin" - --with-config=user - --with-dracutdir="${EPREFIX}/usr/lib/dracut" - --with-linux="${KV_DIR}" - --with-linux-obj="${KV_OUT_DIR}" - --with-udevdir="$(get_udevdir)" - --with-pamconfigsdir="${EPREFIX}/unwanted_files" - --with-pammoduledir="$(getpam_mod_dir)" - --with-systemdunitdir="$(systemd_get_systemunitdir)" - --with-systemdpresetdir="$(systemd_get_systempresetdir)" - --with-vendor=gentoo - # Building zfs-mount-generator.c on musl breaks as strndupa - # isn't available. But systemd doesn't support musl anyway, so - # just disable building it. - $(use_enable !elibc_musl systemd) - $(use_enable debug) - $(use_enable nls) - $(use_enable pam) - $(use_enable python pyzfs) - --disable-static - $(usex minimal --without-python --with-python="${EPYTHON}") - ) - - econf "${myconf[@]}" -} - -src_compile() { - default - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_compile - popd >/dev/null || die - fi -} - -src_install() { - default - - gen_usr_ldscript -a nvpair uutil zfsbootenv zfs zfs_core zpool - - use pam && { rm -rv "${ED}/unwanted_files" || die ; } - - use test-suite || { rm -r "${ED}"/usr/share/zfs/{test-runner,zfs-tests,runfiles,*sh} || die ; } - - find "${ED}" -name '*.la' -delete || die - - dobashcomp contrib/bash_completion.d/zfs - bashcomp_alias zfs zpool - - # strip executable bit from conf.d file - fperms 0644 /etc/conf.d/zfs - - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_install - popd >/dev/null || die - fi - - # enforce best available python implementation - use minimal || python_fix_shebang "${ED}/bin" -} - -pkg_postinst() { - # we always need userspace utils in sync with zfs-kmod - # so force initrd update for userspace as well, to avoid - # situation when zfs-kmod trigger initrd rebuild before - # userspace component is rebuilt - # KV_* variables are provided by linux-info.eclass - if [[ -z ${ROOT} ]] && use dist-kernel; then - dist-kernel_reinstall_initramfs "${KV_DIR}" "${KV_FULL}" - fi - - if use rootfs; then - if ! has_version sys-kernel/genkernel && ! has_version sys-kernel/dracut; then - elog "Root on zfs requires an initramfs to boot" - elog "The following packages provide one and are tested on a regular basis:" - elog " sys-kernel/dracut ( preferred, module maintained by zfs developers )" - elog " sys-kernel/genkernel" - fi - fi - - if ! use kernel-builtin && [[ ${PV} == "9999" ]]; then - einfo "Adding ${P} to the module database to ensure that the" - einfo "kernel modules and userland utilities stay in sync." - update_moduledb - fi - - if systemd_is_booted || has_version sys-apps/systemd; then - einfo "Please refer to ${EROOT}/$(systemd_get_systempresetdir)/50-zfs.preset" - einfo "for default zfs systemd service configuration" - else - [[ -e "${EROOT}/etc/runlevels/boot/zfs-import" ]] || \ - einfo "You should add zfs-import to the boot runlevel." - [[ -e "${EROOT}/etc/runlevels/boot/zfs-load-key" ]] || \ - einfo "You should add zfs-load-key to the boot runlevel." - [[ -e "${EROOT}/etc/runlevels/boot/zfs-mount" ]]|| \ - einfo "You should add zfs-mount to the boot runlevel." - [[ -e "${EROOT}/etc/runlevels/default/zfs-share" ]] || \ - einfo "You should add zfs-share to the default runlevel." - [[ -e "${EROOT}/etc/runlevels/default/zfs-zed" ]] || \ - einfo "You should add zfs-zed to the default runlevel." - fi -} - -pkg_postrm() { - if ! use kernel-builtin && [[ ${PV} == "9999" ]]; then - remove_moduledb - fi -} diff --git a/files/zfs/3510.2.6/overlay/sys-fs/zfs/zfs-2.1.9.ebuild b/files/zfs/3510.2.6/overlay/sys-fs/zfs/zfs-2.1.9.ebuild deleted file mode 100644 index 2930846..0000000 --- a/files/zfs/3510.2.6/overlay/sys-fs/zfs/zfs-2.1.9.ebuild +++ /dev/null @@ -1,326 +0,0 @@ -# Copyright 1999-2023 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -DISTUTILS_OPTIONAL=1 -PYTHON_COMPAT=( python3_{9..11} ) - -inherit autotools bash-completion-r1 dist-kernel-utils distutils-r1 flag-o-matic linux-info pam systemd udev usr-ldscript - -DESCRIPTION="Userland utilities for ZFS Linux kernel module" -HOMEPAGE="https://github.com/openzfs/zfs" - -if [[ ${PV} == "9999" ]]; then - inherit git-r3 linux-mod - 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_P="${P/_rc/-rc}" - SRC_URI="https://github.com/openzfs/${PN}/releases/download/${MY_P}/${MY_P}.tar.gz" - SRC_URI+=" verify-sig? ( https://github.com/openzfs/${PN}/releases/download/${MY_P}/${MY_P}.tar.gz.asc )" - S="${WORKDIR}/${P%_rc?}" - - if [[ ${PV} != *_rc* ]]; then - KEYWORDS="amd64 arm64 ppc64 ~riscv ~sparc" - fi -fi - -LICENSE="BSD-2 CDDL MIT" -# just libzfs soname major for now. -# possible candidates: libuutil, libzpool, libnvpair. Those do not provide stable abi, but are considered. -# see libsoversion_check() below as well -SLOT="0/5" -IUSE="custom-cflags debug dist-kernel kernel-builtin minimal nls pam python +rootfs selinux test-suite" - -DEPEND=" - net-libs/libtirpc:= - sys-apps/util-linux - sys-libs/zlib - virtual/libudev:= - dev-libs/openssl:0= - !minimal? ( ${PYTHON_DEPS} ) - pam? ( sys-libs/pam ) - python? ( - virtual/python-cffi[${PYTHON_USEDEP}] - ) -" - -BDEPEND="app-alternatives/awk - virtual/pkgconfig - nls? ( sys-devel/gettext ) - python? ( - dev-python/setuptools[${PYTHON_USEDEP}] - || ( - dev-python/packaging[${PYTHON_USEDEP}] - dev-python/distlib[${PYTHON_USEDEP}] - ) - ) -" - -if [[ ${PV} != "9999" ]] ; then - BDEPEND+=" verify-sig? ( sec-keys/openpgp-keys-openzfs )" -fi - -# awk is used for some scripts, completions, and the Dracut module -RDEPEND="${DEPEND} - !kernel-builtin? ( ~sys-fs/zfs-kmod-${PV}:= ) - !prefix? ( virtual/udev ) - sys-fs/udev-init-scripts - app-alternatives/awk - dist-kernel? ( virtual/dist-kernel:= ) - rootfs? ( - app-arch/cpio - app-misc/pax-utils - ) - selinux? ( sec-policy/selinux-zfs ) - test-suite? ( - app-shells/ksh - sys-apps/kmod[tools] - sys-apps/util-linux - sys-devel/bc - sys-block/parted - sys-fs/lsscsi - sys-fs/mdadm - sys-process/procps - ) -" - -# PDEPEND in this form is needed to trick portage suggest -# enabling dist-kernel if only 1 package have it set, without suggesting to disable -PDEPEND="dist-kernel? ( ~sys-fs/zfs-kmod-${PV}[dist-kernel] )" - -REQUIRED_USE=" - !minimal? ( ${PYTHON_REQUIRED_USE} ) - python? ( !minimal ) - test-suite? ( !minimal ) -" - -RESTRICT="test" - -PATCHES=( - # bug #854333 - "${FILESDIR}"/2.1.5-r2-dracut-non-root.patch - - "${FILESDIR}"/2.1.5-dracut-zfs-missing.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() { - if use kernel_linux; then - linux-info_pkg_setup - - if ! linux_config_exists; then - ewarn "Cannot check the linux kernel configuration." - else - if use test-suite; then - if linux_chkconfig_present BLK_DEV_LOOP; then - eerror "The ZFS test suite requires loop device support enabled." - eerror "Please enable it:" - eerror " CONFIG_BLK_DEV_LOOP=y" - eerror "in /usr/src/linux/.config or" - eerror " Device Drivers --->" - eerror " Block devices --->" - eerror " [X] Loopback device support" - fi - fi - fi - fi -} - -libsoversion_check() { - local bugurl libzfs_sover - bugurl="https://bugs.gentoo.org/enter_bug.cgi?form_name=enter_bug&product=Gentoo+Linux&component=Current+packages" - - libzfs_sover="$(grep 'libzfs_la_LDFLAGS += -version-info' lib/libzfs/Makefile.am \ - | grep -Eo '[0-9]+:[0-9]+:[0-9]+')" - libzfs_sover="${libzfs_sover%%:*}" - - if [[ ${libzfs_sover} -ne $(ver_cut 2 ${SLOT}) ]]; then - echo - eerror "BUG BUG BUG BUG BUG BUG BUG BUG" - eerror "ebuild subslot does not match libzfs soversion!" - eerror "libzfs soversion: ${libzfs_sover}" - eerror "ebuild value: $(ver_cut 2 ${SLOT})" - eerror "This is a bug in the ebuild, please use the following URL to report it" - eerror "${bugurl}&short_desc=${CATEGORY}%2F${P}+update+subslot" - echo - # we want to abort for releases, but just print a warning for live ebuild - # to keep package installable - [[ ${PV} == "9999" ]] || die - fi -} - -src_unpack() { - if use verify-sig ; then - # Needed for downloaded patch (which is unsigned, which is fine) - verify-sig_verify_detached "${DISTDIR}"/${MY_P}.tar.gz{,.asc} - fi - - default -} - -src_prepare() { - default - libsoversion_check - - # Run unconditionally (bug #792627) - eautoreconf - - if [[ ${PV} != "9999" ]]; then - # Set revision number - sed -i "s/\(Release:\)\(.*\)1/\1\2${PR}-gentoo/" META || die "Could not set Gentoo release" - fi - - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_prepare - popd >/dev/null || die - fi - - # prevent errors showing up on zfs-mount stop, #647688 - # openrc will unmount all filesystems anyway. - sed -i "/^ZFS_UNMOUNT=/ s/yes/no/" "etc/default/zfs.in" || die -} - -src_configure() { - use custom-cflags || strip-flags - use minimal || python_setup - - # All the same issue: - # Segfaults w/ GCC 12 and 'zfs send' - # bug #856373 - # https://github.com/openzfs/zfs/issues/13620 - # https://github.com/openzfs/zfs/issues/13605 - append-flags -fno-tree-vectorize - - local myconf=( - --bindir="${EPREFIX}/bin" - --enable-shared - --enable-sysvinit - --localstatedir="${EPREFIX}/var" - --sbindir="${EPREFIX}/sbin" - --with-config=user - --with-dracutdir="${EPREFIX}/usr/lib/dracut" - --with-linux="${KV_DIR}" - --with-linux-obj="${KV_OUT_DIR}" - --with-udevdir="$(get_udevdir)" - --with-pamconfigsdir="${EPREFIX}/unwanted_files" - --with-pammoduledir="$(getpam_mod_dir)" - --with-systemdunitdir="$(systemd_get_systemunitdir)" - --with-systemdpresetdir="$(systemd_get_systempresetdir)" - --with-vendor=gentoo - # Building zfs-mount-generator.c on musl breaks as strndupa - # isn't available. But systemd doesn't support musl anyway, so - # just disable building it. - $(use_enable !elibc_musl systemd) - $(use_enable debug) - $(use_enable nls) - $(use_enable pam) - $(use_enable python pyzfs) - --disable-static - $(usex minimal --without-python --with-python="${EPYTHON}") - ) - - econf "${myconf[@]}" -} - -src_compile() { - default - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_compile - popd >/dev/null || die - fi -} - -src_install() { - default - - gen_usr_ldscript -a nvpair uutil zfsbootenv zfs zfs_core zpool - - use pam && { rm -rv "${ED}/unwanted_files" || die ; } - - use test-suite || { rm -r "${ED}"/usr/share/zfs/{test-runner,zfs-tests,runfiles,*sh} || die ; } - - find "${ED}" -name '*.la' -delete || die - - dobashcomp contrib/bash_completion.d/zfs - bashcomp_alias zfs zpool - - # strip executable bit from conf.d file - fperms 0644 /etc/conf.d/zfs - - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_install - popd >/dev/null || die - fi - - # enforce best available python implementation - use minimal || python_fix_shebang "${ED}/bin" -} - -pkg_postinst() { - udev_reload - - # we always need userspace utils in sync with zfs-kmod - # so force initrd update for userspace as well, to avoid - # situation when zfs-kmod trigger initrd rebuild before - # userspace component is rebuilt - # KV_* variables are provided by linux-info.eclass - if [[ -z ${ROOT} ]] && use dist-kernel; then - dist-kernel_reinstall_initramfs "${KV_DIR}" "${KV_FULL}" - fi - - if use rootfs; then - if ! has_version sys-kernel/genkernel && ! has_version sys-kernel/dracut; then - elog "Root on zfs requires an initramfs to boot" - elog "The following packages provide one and are tested on a regular basis:" - elog " sys-kernel/dracut ( preferred, module maintained by zfs developers )" - elog " sys-kernel/genkernel" - fi - fi - - if ! use kernel-builtin && [[ ${PV} == "9999" ]]; then - einfo "Adding ${P} to the module database to ensure that the" - einfo "kernel modules and userland utilities stay in sync." - update_moduledb - fi - - if systemd_is_booted || has_version sys-apps/systemd; then - einfo "Please refer to ${EROOT}/$(systemd_get_systempresetdir)/50-zfs.preset" - einfo "for default zfs systemd service configuration" - else - [[ -e "${EROOT}/etc/runlevels/boot/zfs-import" ]] || \ - einfo "You should add zfs-import to the boot runlevel." - [[ -e "${EROOT}/etc/runlevels/boot/zfs-load-key" ]] || \ - einfo "You should add zfs-load-key to the boot runlevel." - [[ -e "${EROOT}/etc/runlevels/boot/zfs-mount" ]]|| \ - einfo "You should add zfs-mount to the boot runlevel." - [[ -e "${EROOT}/etc/runlevels/default/zfs-share" ]] || \ - einfo "You should add zfs-share to the default runlevel." - [[ -e "${EROOT}/etc/runlevels/default/zfs-zed" ]] || \ - einfo "You should add zfs-zed to the default runlevel." - fi -} - -pkg_postrm() { - udev_reload - - if ! use kernel-builtin && [[ ${PV} == "9999" ]]; then - remove_moduledb - fi -} diff --git a/files/zfs/3510.2.6/overlay/sys-fs/zfs/zfs-2.2.0_rc3.ebuild b/files/zfs/3510.2.6/overlay/sys-fs/zfs/zfs-2.2.0_rc3.ebuild deleted file mode 100644 index e9d67dd..0000000 --- a/files/zfs/3510.2.6/overlay/sys-fs/zfs/zfs-2.2.0_rc3.ebuild +++ /dev/null @@ -1,306 +0,0 @@ -# Copyright 1999-2023 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -DISTUTILS_OPTIONAL=1 -DISTUTILS_USE_PEP517=setuptools -PYTHON_COMPAT=( python3_{10..11} ) - -inherit autotools bash-completion-r1 dist-kernel-utils distutils-r1 flag-o-matic linux-info pam systemd udev usr-ldscript - -DESCRIPTION="Userland utilities for ZFS Linux kernel module" -HOMEPAGE="https://github.com/openzfs/zfs" - -if [[ ${PV} == "9999" ]]; then - inherit git-r3 linux-mod - 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_P="${P/_rc/-rc}" - SRC_URI="https://github.com/openzfs/${PN}/releases/download/${MY_P}/${MY_P}.tar.gz" - SRC_URI+=" verify-sig? ( https://github.com/openzfs/${PN}/releases/download/${MY_P}/${MY_P}.tar.gz.asc )" - S="${WORKDIR}/${MY_P}" - - if [[ ${PV} != *_rc* ]]; then - KEYWORDS="~amd64 ~arm64 ~ppc64 ~riscv ~sparc" - fi -fi - -LICENSE="BSD-2 CDDL MIT" -# just libzfs soname major for now. -# possible candidates: libuutil, libzpool, libnvpair. Those do not provide stable abi, but are considered. -# see libsoversion_check() below as well -SLOT="0/5" -IUSE="custom-cflags debug dist-kernel kernel-builtin minimal nls pam python +rootfs selinux test-suite" - -DEPEND=" - dev-libs/openssl:= - net-libs/libtirpc:= - sys-apps/util-linux - sys-libs/zlib - virtual/libudev:= - !minimal? ( ${PYTHON_DEPS} ) - pam? ( sys-libs/pam ) - python? ( - $(python_gen_cond_dep 'dev-python/cffi[${PYTHON_USEDEP}]' 'python*') - ) -" - -BDEPEND=" - app-alternatives/awk - virtual/pkgconfig - nls? ( sys-devel/gettext ) - python? ( - ${DISTUTILS_DEPS} - || ( - dev-python/packaging[${PYTHON_USEDEP}] - dev-python/distlib[${PYTHON_USEDEP}] - ) - ) -" - -if [[ ${PV} != "9999" ]] ; then - BDEPEND+=" verify-sig? ( sec-keys/openpgp-keys-openzfs )" -fi - -# awk is used for some scripts, completions, and the Dracut module -RDEPEND=" - ${DEPEND} - !kernel-builtin? ( ~sys-fs/zfs-kmod-${PV}:= ) - !prefix? ( virtual/udev ) - app-alternatives/awk - sys-fs/udev-init-scripts - dist-kernel? ( virtual/dist-kernel:= ) - rootfs? ( - app-arch/cpio - app-misc/pax-utils - ) - selinux? ( sec-policy/selinux-zfs ) - test-suite? ( - app-shells/ksh - sys-apps/kmod[tools] - sys-apps/util-linux - sys-devel/bc - sys-block/parted - sys-fs/lsscsi - sys-fs/mdadm - sys-process/procps - ) -" - -# PDEPEND in this form is needed to trick portage suggest -# enabling dist-kernel if only 1 package have it set, without suggesting to disable -PDEPEND="dist-kernel? ( ~sys-fs/zfs-kmod-${PV}[dist-kernel] )" - -REQUIRED_USE=" - !minimal? ( ${PYTHON_REQUIRED_USE} ) - python? ( !minimal ) - test-suite? ( !minimal ) -" - -RESTRICT="test" - -PATCHES=( - "${FILESDIR}"/2.1.5-dracut-zfs-missing.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() { - if use kernel_linux; then - linux-info_pkg_setup - - if ! linux_config_exists; then - ewarn "Cannot check the linux kernel configuration." - else - if use test-suite; then - if linux_chkconfig_present BLK_DEV_LOOP; then - eerror "The ZFS test suite requires loop device support enabled." - eerror "Please enable it:" - eerror " CONFIG_BLK_DEV_LOOP=y" - eerror "in /usr/src/linux/.config or" - eerror " Device Drivers --->" - eerror " Block devices --->" - eerror " [X] Loopback device support" - fi - fi - fi - fi -} - -libsoversion_check() { - local bugurl libzfs_sover - bugurl="https://bugs.gentoo.org/enter_bug.cgi?form_name=enter_bug&product=Gentoo+Linux&component=Current+packages" - - libzfs_sover="$(grep 'libzfs_la_LDFLAGS += -version-info' lib/libzfs/Makefile.am \ - | grep -Eo '[0-9]+:[0-9]+:[0-9]+')" - libzfs_sover="${libzfs_sover%%:*}" - - if [[ ${libzfs_sover} -ne $(ver_cut 2 ${SLOT}) ]]; then - echo - eerror "BUG BUG BUG BUG BUG BUG BUG BUG" - eerror "ebuild subslot does not match libzfs soversion!" - eerror "libzfs soversion: ${libzfs_sover}" - eerror "ebuild value: $(ver_cut 2 ${SLOT})" - eerror "This is a bug in the ebuild, please use the following URL to report it" - eerror "${bugurl}&short_desc=${CATEGORY}%2F${P}+update+subslot" - echo - # we want to abort for releases, but just print a warning for live ebuild - # to keep package installable - [[ ${PV} == "9999" ]] || die - fi -} - -src_prepare() { - default - libsoversion_check - - # Run unconditionally (bug #792627) - eautoreconf - - if [[ ${PV} != "9999" ]]; then - # Set revision number - sed -i "s/\(Release:\)\(.*\)1/\1\2${PR}-gentoo/" META || die "Could not set Gentoo release" - fi - - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_prepare - popd >/dev/null || die - fi - - # Tries to use /etc/conf.d which we reserve for OpenRC - sed -i -e '/EnvironmentFile/d' etc/systemd/system/zfs*.in || die - - # prevent errors showing up on zfs-mount stop, #647688 - # openrc will unmount all filesystems anyway. - sed -i "/^ZFS_UNMOUNT=/ s/yes/no/" "etc/default/zfs.in" || die -} - -src_configure() { - use custom-cflags || strip-flags - use minimal || python_setup - - local myconf=( - --bindir="${EPREFIX}/bin" - --enable-shared - --enable-sysvinit - --localstatedir="${EPREFIX}/var" - --sbindir="${EPREFIX}/sbin" - --with-config=user - --with-dracutdir="${EPREFIX}/usr/lib/dracut" - --with-linux="${KV_DIR}" - --with-linux-obj="${KV_OUT_DIR}" - --with-udevdir="$(get_udevdir)" - --with-pamconfigsdir="${EPREFIX}/unwanted_files" - --with-pammoduledir="$(getpam_mod_dir)" - --with-systemdunitdir="$(systemd_get_systemunitdir)" - --with-systemdpresetdir="$(systemd_get_systempresetdir)" - --with-vendor=gentoo - # Building zfs-mount-generator.c on musl breaks as strndupa - # isn't available. But systemd doesn't support musl anyway, so - # just disable building it. - # UPDATE: it has been fixed since, - # https://github.com/openzfs/zfs/commit/1f19826c9ac85835cbde61a7439d9d1fefe43a4a - # but we still leave it as this for now. - $(use_enable !elibc_musl systemd) - $(use_enable debug) - $(use_enable nls) - $(use_enable pam) - $(use_enable python pyzfs) - --disable-static - $(usex minimal --without-python --with-python="${EPYTHON}") - ) - - econf "${myconf[@]}" -} - -src_compile() { - default - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_compile - popd >/dev/null || die - fi -} - -src_install() { - default - - gen_usr_ldscript -a nvpair uutil zfsbootenv zfs zfs_core zpool - - use pam && { rm -rv "${ED}/unwanted_files" || die ; } - - use test-suite || { rm -r "${ED}"/usr/share/zfs/{test-runner,zfs-tests,runfiles,*sh} || die ; } - - find "${ED}" -name '*.la' -delete || die - - dobashcomp contrib/bash_completion.d/zfs - bashcomp_alias zfs zpool - - # strip executable bit from conf.d file - fperms 0644 /etc/conf.d/zfs - - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_install - popd >/dev/null || die - fi - - # enforce best available python implementation - use minimal || python_fix_shebang "${ED}/bin" -} - -pkg_postinst() { - udev_reload - - # we always need userspace utils in sync with zfs-kmod - # so force initrd update for userspace as well, to avoid - # situation when zfs-kmod trigger initrd rebuild before - # userspace component is rebuilt - # KV_* variables are provided by linux-info.eclass - if [[ -z ${ROOT} ]] && use dist-kernel; then - dist-kernel_reinstall_initramfs "${KV_DIR}" "${KV_FULL}" - fi - - if use rootfs; then - if ! has_version sys-kernel/genkernel && ! has_version sys-kernel/dracut; then - elog "Root on zfs requires an initramfs to boot" - elog "The following packages provide one and are tested on a regular basis:" - elog " sys-kernel/dracut ( preferred, module maintained by zfs developers )" - elog " sys-kernel/genkernel" - fi - fi - - if systemd_is_booted || has_version sys-apps/systemd; then - einfo "Please refer to ${EROOT}/$(systemd_get_systempresetdir)/50-zfs.preset" - einfo "for default zfs systemd service configuration" - else - [[ -e "${EROOT}/etc/runlevels/boot/zfs-import" ]] || \ - einfo "You should add zfs-import to the boot runlevel." - [[ -e "${EROOT}/etc/runlevels/boot/zfs-load-key" ]] || \ - einfo "You should add zfs-load-key to the boot runlevel." - [[ -e "${EROOT}/etc/runlevels/boot/zfs-mount" ]]|| \ - einfo "You should add zfs-mount to the boot runlevel." - [[ -e "${EROOT}/etc/runlevels/default/zfs-share" ]] || \ - einfo "You should add zfs-share to the default runlevel." - [[ -e "${EROOT}/etc/runlevels/default/zfs-zed" ]] || \ - einfo "You should add zfs-zed to the default runlevel." - fi -} - -pkg_postrm() { - udev_reload -} diff --git a/files/zfs/3510.2.6/overlay/sys-fs/zfs/zfs-9999.ebuild b/files/zfs/3510.2.6/overlay/sys-fs/zfs/zfs-9999.ebuild deleted file mode 100644 index e9d67dd..0000000 --- a/files/zfs/3510.2.6/overlay/sys-fs/zfs/zfs-9999.ebuild +++ /dev/null @@ -1,306 +0,0 @@ -# Copyright 1999-2023 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -DISTUTILS_OPTIONAL=1 -DISTUTILS_USE_PEP517=setuptools -PYTHON_COMPAT=( python3_{10..11} ) - -inherit autotools bash-completion-r1 dist-kernel-utils distutils-r1 flag-o-matic linux-info pam systemd udev usr-ldscript - -DESCRIPTION="Userland utilities for ZFS Linux kernel module" -HOMEPAGE="https://github.com/openzfs/zfs" - -if [[ ${PV} == "9999" ]]; then - inherit git-r3 linux-mod - 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_P="${P/_rc/-rc}" - SRC_URI="https://github.com/openzfs/${PN}/releases/download/${MY_P}/${MY_P}.tar.gz" - SRC_URI+=" verify-sig? ( https://github.com/openzfs/${PN}/releases/download/${MY_P}/${MY_P}.tar.gz.asc )" - S="${WORKDIR}/${MY_P}" - - if [[ ${PV} != *_rc* ]]; then - KEYWORDS="~amd64 ~arm64 ~ppc64 ~riscv ~sparc" - fi -fi - -LICENSE="BSD-2 CDDL MIT" -# just libzfs soname major for now. -# possible candidates: libuutil, libzpool, libnvpair. Those do not provide stable abi, but are considered. -# see libsoversion_check() below as well -SLOT="0/5" -IUSE="custom-cflags debug dist-kernel kernel-builtin minimal nls pam python +rootfs selinux test-suite" - -DEPEND=" - dev-libs/openssl:= - net-libs/libtirpc:= - sys-apps/util-linux - sys-libs/zlib - virtual/libudev:= - !minimal? ( ${PYTHON_DEPS} ) - pam? ( sys-libs/pam ) - python? ( - $(python_gen_cond_dep 'dev-python/cffi[${PYTHON_USEDEP}]' 'python*') - ) -" - -BDEPEND=" - app-alternatives/awk - virtual/pkgconfig - nls? ( sys-devel/gettext ) - python? ( - ${DISTUTILS_DEPS} - || ( - dev-python/packaging[${PYTHON_USEDEP}] - dev-python/distlib[${PYTHON_USEDEP}] - ) - ) -" - -if [[ ${PV} != "9999" ]] ; then - BDEPEND+=" verify-sig? ( sec-keys/openpgp-keys-openzfs )" -fi - -# awk is used for some scripts, completions, and the Dracut module -RDEPEND=" - ${DEPEND} - !kernel-builtin? ( ~sys-fs/zfs-kmod-${PV}:= ) - !prefix? ( virtual/udev ) - app-alternatives/awk - sys-fs/udev-init-scripts - dist-kernel? ( virtual/dist-kernel:= ) - rootfs? ( - app-arch/cpio - app-misc/pax-utils - ) - selinux? ( sec-policy/selinux-zfs ) - test-suite? ( - app-shells/ksh - sys-apps/kmod[tools] - sys-apps/util-linux - sys-devel/bc - sys-block/parted - sys-fs/lsscsi - sys-fs/mdadm - sys-process/procps - ) -" - -# PDEPEND in this form is needed to trick portage suggest -# enabling dist-kernel if only 1 package have it set, without suggesting to disable -PDEPEND="dist-kernel? ( ~sys-fs/zfs-kmod-${PV}[dist-kernel] )" - -REQUIRED_USE=" - !minimal? ( ${PYTHON_REQUIRED_USE} ) - python? ( !minimal ) - test-suite? ( !minimal ) -" - -RESTRICT="test" - -PATCHES=( - "${FILESDIR}"/2.1.5-dracut-zfs-missing.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() { - if use kernel_linux; then - linux-info_pkg_setup - - if ! linux_config_exists; then - ewarn "Cannot check the linux kernel configuration." - else - if use test-suite; then - if linux_chkconfig_present BLK_DEV_LOOP; then - eerror "The ZFS test suite requires loop device support enabled." - eerror "Please enable it:" - eerror " CONFIG_BLK_DEV_LOOP=y" - eerror "in /usr/src/linux/.config or" - eerror " Device Drivers --->" - eerror " Block devices --->" - eerror " [X] Loopback device support" - fi - fi - fi - fi -} - -libsoversion_check() { - local bugurl libzfs_sover - bugurl="https://bugs.gentoo.org/enter_bug.cgi?form_name=enter_bug&product=Gentoo+Linux&component=Current+packages" - - libzfs_sover="$(grep 'libzfs_la_LDFLAGS += -version-info' lib/libzfs/Makefile.am \ - | grep -Eo '[0-9]+:[0-9]+:[0-9]+')" - libzfs_sover="${libzfs_sover%%:*}" - - if [[ ${libzfs_sover} -ne $(ver_cut 2 ${SLOT}) ]]; then - echo - eerror "BUG BUG BUG BUG BUG BUG BUG BUG" - eerror "ebuild subslot does not match libzfs soversion!" - eerror "libzfs soversion: ${libzfs_sover}" - eerror "ebuild value: $(ver_cut 2 ${SLOT})" - eerror "This is a bug in the ebuild, please use the following URL to report it" - eerror "${bugurl}&short_desc=${CATEGORY}%2F${P}+update+subslot" - echo - # we want to abort for releases, but just print a warning for live ebuild - # to keep package installable - [[ ${PV} == "9999" ]] || die - fi -} - -src_prepare() { - default - libsoversion_check - - # Run unconditionally (bug #792627) - eautoreconf - - if [[ ${PV} != "9999" ]]; then - # Set revision number - sed -i "s/\(Release:\)\(.*\)1/\1\2${PR}-gentoo/" META || die "Could not set Gentoo release" - fi - - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_prepare - popd >/dev/null || die - fi - - # Tries to use /etc/conf.d which we reserve for OpenRC - sed -i -e '/EnvironmentFile/d' etc/systemd/system/zfs*.in || die - - # prevent errors showing up on zfs-mount stop, #647688 - # openrc will unmount all filesystems anyway. - sed -i "/^ZFS_UNMOUNT=/ s/yes/no/" "etc/default/zfs.in" || die -} - -src_configure() { - use custom-cflags || strip-flags - use minimal || python_setup - - local myconf=( - --bindir="${EPREFIX}/bin" - --enable-shared - --enable-sysvinit - --localstatedir="${EPREFIX}/var" - --sbindir="${EPREFIX}/sbin" - --with-config=user - --with-dracutdir="${EPREFIX}/usr/lib/dracut" - --with-linux="${KV_DIR}" - --with-linux-obj="${KV_OUT_DIR}" - --with-udevdir="$(get_udevdir)" - --with-pamconfigsdir="${EPREFIX}/unwanted_files" - --with-pammoduledir="$(getpam_mod_dir)" - --with-systemdunitdir="$(systemd_get_systemunitdir)" - --with-systemdpresetdir="$(systemd_get_systempresetdir)" - --with-vendor=gentoo - # Building zfs-mount-generator.c on musl breaks as strndupa - # isn't available. But systemd doesn't support musl anyway, so - # just disable building it. - # UPDATE: it has been fixed since, - # https://github.com/openzfs/zfs/commit/1f19826c9ac85835cbde61a7439d9d1fefe43a4a - # but we still leave it as this for now. - $(use_enable !elibc_musl systemd) - $(use_enable debug) - $(use_enable nls) - $(use_enable pam) - $(use_enable python pyzfs) - --disable-static - $(usex minimal --without-python --with-python="${EPYTHON}") - ) - - econf "${myconf[@]}" -} - -src_compile() { - default - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_compile - popd >/dev/null || die - fi -} - -src_install() { - default - - gen_usr_ldscript -a nvpair uutil zfsbootenv zfs zfs_core zpool - - use pam && { rm -rv "${ED}/unwanted_files" || die ; } - - use test-suite || { rm -r "${ED}"/usr/share/zfs/{test-runner,zfs-tests,runfiles,*sh} || die ; } - - find "${ED}" -name '*.la' -delete || die - - dobashcomp contrib/bash_completion.d/zfs - bashcomp_alias zfs zpool - - # strip executable bit from conf.d file - fperms 0644 /etc/conf.d/zfs - - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_install - popd >/dev/null || die - fi - - # enforce best available python implementation - use minimal || python_fix_shebang "${ED}/bin" -} - -pkg_postinst() { - udev_reload - - # we always need userspace utils in sync with zfs-kmod - # so force initrd update for userspace as well, to avoid - # situation when zfs-kmod trigger initrd rebuild before - # userspace component is rebuilt - # KV_* variables are provided by linux-info.eclass - if [[ -z ${ROOT} ]] && use dist-kernel; then - dist-kernel_reinstall_initramfs "${KV_DIR}" "${KV_FULL}" - fi - - if use rootfs; then - if ! has_version sys-kernel/genkernel && ! has_version sys-kernel/dracut; then - elog "Root on zfs requires an initramfs to boot" - elog "The following packages provide one and are tested on a regular basis:" - elog " sys-kernel/dracut ( preferred, module maintained by zfs developers )" - elog " sys-kernel/genkernel" - fi - fi - - if systemd_is_booted || has_version sys-apps/systemd; then - einfo "Please refer to ${EROOT}/$(systemd_get_systempresetdir)/50-zfs.preset" - einfo "for default zfs systemd service configuration" - else - [[ -e "${EROOT}/etc/runlevels/boot/zfs-import" ]] || \ - einfo "You should add zfs-import to the boot runlevel." - [[ -e "${EROOT}/etc/runlevels/boot/zfs-load-key" ]] || \ - einfo "You should add zfs-load-key to the boot runlevel." - [[ -e "${EROOT}/etc/runlevels/boot/zfs-mount" ]]|| \ - einfo "You should add zfs-mount to the boot runlevel." - [[ -e "${EROOT}/etc/runlevels/default/zfs-share" ]] || \ - einfo "You should add zfs-share to the default runlevel." - [[ -e "${EROOT}/etc/runlevels/default/zfs-zed" ]] || \ - einfo "You should add zfs-zed to the default runlevel." - fi -} - -pkg_postrm() { - udev_reload -} diff --git a/files/zfs/3510.2.7/overlay/eclass/dist-kernel-utils.eclass b/files/zfs/3510.2.7/overlay/eclass/dist-kernel-utils.eclass deleted file mode 100644 index 6903183..0000000 --- a/files/zfs/3510.2.7/overlay/eclass/dist-kernel-utils.eclass +++ /dev/null @@ -1,201 +0,0 @@ -# Copyright 2020-2023 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -# @ECLASS: dist-kernel-utils.eclass -# @MAINTAINER: -# Distribution Kernel Project -# @AUTHOR: -# Michał Górny -# @SUPPORTED_EAPIS: 7 8 -# @BLURB: Utility functions related to Distribution Kernels -# @DESCRIPTION: -# This eclass provides various utility functions related to Distribution -# Kernels. - -# @ECLASS_VARIABLE: KERNEL_IUSE_SECUREBOOT -# @PRE_INHERIT -# @DEFAULT_UNSET -# @DESCRIPTION: -# If set to a non-null value, inherits secureboot.eclass -# and allows signing of generated kernel images. - -if [[ ! ${_DIST_KERNEL_UTILS} ]]; then - -case ${EAPI} in - 7|8) ;; - *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; -esac - -if [[ ${KERNEL_IUSE_SECUREBOOT} ]]; then - inherit secureboot -fi - -# @FUNCTION: dist-kernel_build_initramfs -# @USAGE: -# @DESCRIPTION: -# Build an initramfs for the kernel. specifies the absolute -# path where initramfs will be created, while specifies -# the kernel version, used to find modules. -# -# Note: while this function uses dracut at the moment, other initramfs -# variants may be supported in the future. -dist-kernel_build_initramfs() { - debug-print-function ${FUNCNAME} "${@}" - - [[ ${#} -eq 2 ]] || die "${FUNCNAME}: invalid arguments" - local output=${1} - local version=${2} - - local rel_image_path=$(dist-kernel_get_image_path) - local image=${output%/*}/${rel_image_path##*/} - - local args=( - --force - # if uefi=yes is used, dracut needs to locate the kernel image - --kernel-image "${image}" - - # positional arguments - "${output}" "${version}" - ) - - ebegin "Building initramfs via dracut" - dracut "${args[@]}" - eend ${?} || die -n "Building initramfs failed" -} - -# @FUNCTION: dist-kernel_get_image_path -# @DESCRIPTION: -# Get relative kernel image path specific to the current ${ARCH}. -dist-kernel_get_image_path() { - case ${ARCH} in - amd64|x86) - echo arch/x86/boot/bzImage - ;; - arm64) - echo arch/arm64/boot/Image.gz - ;; - arm) - echo arch/arm/boot/zImage - ;; - hppa|ppc|ppc64|sparc) - # https://www.kernel.org/doc/html/latest/powerpc/bootwrapper.html - # ./ is required because of ${image_path%/*} - # substitutions in the code - echo ./vmlinux - ;; - riscv) - echo arch/riscv/boot/Image.gz - ;; - *) - die "${FUNCNAME}: unsupported ARCH=${ARCH}" - ;; - esac -} - -# @FUNCTION: dist-kernel_install_kernel -# @USAGE: -# @DESCRIPTION: -# Install kernel using installkernel tool. specifies -# the kernel version, full path to the image, -# full path to System.map. -dist-kernel_install_kernel() { - debug-print-function ${FUNCNAME} "${@}" - - [[ ${#} -eq 3 ]] || die "${FUNCNAME}: invalid arguments" - local version=${1} - local image=${2} - local map=${3} - - # if dracut is used in uefi=yes mode, initrd will actually - # be a combined kernel+initramfs UEFI executable. we can easily - # recognize it by PE magic (vs cpio for a regular initramfs) - local initrd=${image%/*}/initrd - local magic - [[ -s ${initrd} ]] && read -n 2 magic < "${initrd}" - if [[ ${magic} == MZ ]]; then - einfo "Combined UEFI kernel+initramfs executable found" - # install the combined executable in place of kernel - image=${initrd%/*}/uki.efi - mv "${initrd}" "${image}" || die - # We moved the generated initrd, prevent dracut from running again - # https://github.com/dracutdevs/dracut/pull/2405 - shopt -s nullglob - local plugins=() - for file in "${EROOT}"/etc/kernel/install.d/*.install; do - plugins+=( "${file}" ) - done - for file in "${EROOT}"/usr/lib/kernel/install.d/*.install; do - if ! has "${file##*/}" 50-dracut.install 51-dracut-rescue.install "${plugins[@]##*/}"; then - plugins+=( "${file}" ) - fi - done - shopt -u nullglob - export KERNEL_INSTALL_PLUGINS="${KERNEL_INSTALL_PLUGINS} ${plugins[@]}" - fi - - if [[ ${KERNEL_IUSE_SECUREBOOT} ]]; then - # Kernel-install requires uki's are named uki.efi, sign in-place - secureboot_sign_efi_file "${image}" "${image}" - fi - - ebegin "Installing the kernel via installkernel" - # note: .config is taken relatively to System.map; - # initrd relatively to bzImage - installkernel "${version}" "${image}" "${map}" - eend ${?} || die -n "Installing the kernel failed" -} - -# @FUNCTION: dist-kernel_reinstall_initramfs -# @USAGE: -# @DESCRIPTION: -# Rebuild and install initramfs for the specified dist-kernel. -# is the kernel source directory (${KV_DIR} from linux-info), -# while is the full kernel version (${KV_FULL}). -# The function will determine whether is actually -# a dist-kernel, and whether initramfs was used. -# -# This function is to be used in pkg_postinst() of ebuilds installing -# kernel modules that are included in the initramfs. -dist-kernel_reinstall_initramfs() { - debug-print-function ${FUNCNAME} "${@}" - - [[ ${#} -eq 2 ]] || die "${FUNCNAME}: invalid arguments" - local kernel_dir=${1} - local ver=${2} - - local image_path=${kernel_dir}/$(dist-kernel_get_image_path) - local initramfs_path=${image_path%/*}/initrd - if [[ ! -f ${image_path} ]]; then - eerror "Kernel install missing, image not found:" - eerror " ${image_path}" - eerror "Initramfs will not be updated. Please reinstall your kernel." - return - fi - if [[ ! -f ${initramfs_path} && ! -f ${initramfs_path%/*}/uki.efi ]]; then - einfo "No initramfs or uki found at ${image_path}" - return - fi - - dist-kernel_build_initramfs "${initramfs_path}" "${ver}" - dist-kernel_install_kernel "${ver}" "${image_path}" \ - "${kernel_dir}/System.map" -} - -# @FUNCTION: dist-kernel_PV_to_KV -# @USAGE: -# @DESCRIPTION: -# Convert a Gentoo-style ebuild version to kernel "x.y.z[-rcN]" version. -dist-kernel_PV_to_KV() { - debug-print-function ${FUNCNAME} "${@}" - - [[ ${#} -ne 1 ]] && die "${FUNCNAME}: invalid arguments" - local pv=${1} - - local kv=${pv%%_*} - [[ -z $(ver_cut 3- "${kv}") ]] && kv+=".0" - [[ ${pv} == *_* ]] && kv+=-${pv#*_} - echo "${kv}" -} - -_DIST_KERNEL_UTILS=1 -fi diff --git a/files/zfs/3510.2.7/overlay/metadata/layout.conf b/files/zfs/3510.2.7/overlay/metadata/layout.conf deleted file mode 100644 index e85e826..0000000 --- a/files/zfs/3510.2.7/overlay/metadata/layout.conf +++ /dev/null @@ -1,4 +0,0 @@ -masters = portage-stable -thin-manifests = true -sign-commits = false -sign-manifests = false diff --git a/files/zfs/3510.2.7/overlay/profiles/repo_name b/files/zfs/3510.2.7/overlay/profiles/repo_name deleted file mode 100644 index e0f34db..0000000 --- a/files/zfs/3510.2.7/overlay/profiles/repo_name +++ /dev/null @@ -1 +0,0 @@ -zfs-overlay diff --git a/files/zfs/3510.2.7/overlay/sys-fs/udev-init-scripts/Manifest b/files/zfs/3510.2.7/overlay/sys-fs/udev-init-scripts/Manifest deleted file mode 100644 index 838b43a..0000000 --- a/files/zfs/3510.2.7/overlay/sys-fs/udev-init-scripts/Manifest +++ /dev/null @@ -1,2 +0,0 @@ -DIST udev-init-scripts-34.tar.gz 3660 BLAKE2B 954b003c78b31649fef69213a5424098f40e17e7ed11f4ec1443247950ea60db8536f37ca603caa06e5c9f8bab07b5ac3cb8c9435144532a97ff04836c24da49 SHA512 ed48bcd0815e235b2b3fa38f857cd97f164aac7c6ea805be87890eb06a0d52064bd733da240c6e2a34c8c73e10fd047b5e53096de06f17bc81d8266d70c0cc9d -DIST udev-init-scripts-35.tar.gz 3666 BLAKE2B fddae466428605ea930519e8a47e0ea91f89f9eacc1fd97c137d175142125b12c3d045aec68db35a463de444ac6d8c037cca55f9628f10576c968259d566a9e4 SHA512 da9d2093149967e2e1b9bc7190ddfd55a87c9ae2177e3216f7cb2694fc9b64037eb6f2599ad8a4b7594ef32ced88fbb319c92904bc72a81ea5404945f8a8378a diff --git a/files/zfs/3510.2.7/overlay/sys-fs/udev-init-scripts/metadata.xml b/files/zfs/3510.2.7/overlay/sys-fs/udev-init-scripts/metadata.xml deleted file mode 100644 index 31123d0..0000000 --- a/files/zfs/3510.2.7/overlay/sys-fs/udev-init-scripts/metadata.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - systemd@gentoo.org - - diff --git a/files/zfs/3510.2.7/overlay/sys-fs/udev-init-scripts/udev-init-scripts-34.ebuild b/files/zfs/3510.2.7/overlay/sys-fs/udev-init-scripts/udev-init-scripts-34.ebuild deleted file mode 100644 index 26fa347..0000000 --- a/files/zfs/3510.2.7/overlay/sys-fs/udev-init-scripts/udev-init-scripts-34.ebuild +++ /dev/null @@ -1,50 +0,0 @@ -# Copyright 1999-2021 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 -OLD_PN=udev-gentoo-scripts -OLD_P=${OLD_PN}-${PV} - -if [ "${PV}" = "9999" ]; then - EGIT_REPO_URI="git://anongit.gentoo.org/proj/${OLD_PN}.git" - inherit git-r3 -else - SRC_URI="https://gitweb.gentoo.org/proj/${OLD_PN}.git/snapshot/${OLD_P}.tar.gz -> ${P}.tar.gz" - S="${WORKDIR}/${OLD_P}" - KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86" -fi - -DESCRIPTION="udev startup scripts for openrc" -HOMEPAGE="https://wiki.gentoo.org/wiki/No_homepage" - -LICENSE="GPL-2" -SLOT="0" - -RESTRICT="test" - -RDEPEND=">=virtual/udev-217 - ! -Date: Fri, 18 Dec 2020 11:35:07 -0800 -Subject: [PATCH] copy-builtin: handle missing .gitignore - -acfc4944d0d6db114db9f2bb5401251c5bd767b6 broke copy-builtin in -release tarballs, because those do not contain .gitignore file. -Adding -f to rm call will make it return 0 even if file does not exist. - -Signed-off-by: Georgy Yakovlev ---- - copy-builtin | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/copy-builtin b/copy-builtin -index 84f469fef02..6a6eb1f3695 100755 ---- a/copy-builtin -+++ b/copy-builtin -@@ -36,7 +36,7 @@ rm -rf "$KERNEL_DIR/include/zfs" "$KERNEL_DIR/fs/zfs" - cp --recursive include "$KERNEL_DIR/include/zfs" - cp --recursive module "$KERNEL_DIR/fs/zfs" - cp zfs_config.h "$KERNEL_DIR/include/zfs/" --rm "$KERNEL_DIR/include/zfs/.gitignore" -+rm -f "$KERNEL_DIR/include/zfs/.gitignore" - - for MODULE in "${MODULES[@]}" - do diff --git a/files/zfs/3510.2.7/overlay/sys-fs/zfs-kmod/files/2.1.4-ZERO_RANGE.patch b/files/zfs/3510.2.7/overlay/sys-fs/zfs-kmod/files/2.1.4-ZERO_RANGE.patch deleted file mode 100644 index 338b142..0000000 --- a/files/zfs/3510.2.7/overlay/sys-fs/zfs-kmod/files/2.1.4-ZERO_RANGE.patch +++ /dev/null @@ -1,304 +0,0 @@ -https://github.com/openzfs/zfs/commit/c220771a47e4206fb43e6849957657c9504b1b14 -https://github.com/openzfs/zfs/issues/13329 - -From c220771a47e4206fb43e6849957657c9504b1b14 Mon Sep 17 00:00:00 2001 -From: Rich Ercolani <214141+rincebrain@users.noreply.github.com> -Date: Wed, 20 Apr 2022 19:07:03 -0400 -Subject: [PATCH] Corrected oversight in ZERO_RANGE behavior - -It turns out, no, in fact, ZERO_RANGE and PUNCH_HOLE do -have differing semantics in some ways - in particular, -one requires KEEP_SIZE, and the other does not. - -Also added a zero-range test to catch this, corrected a flaw -that made the punch-hole test succeed vacuously, and a typo -in file_write. - -Reviewed-by: Brian Behlendorf -Signed-off-by: Rich Ercolani -Closes #13329 -Closes #13338 ---- a/module/os/linux/zfs/zpl_file.c -+++ b/module/os/linux/zfs/zpl_file.c -@@ -781,11 +781,13 @@ zpl_fallocate_common(struct inode *ip, int mode, loff_t offset, loff_t len) - if (mode & (test_mode)) { - flock64_t bf; - -- if (offset > olen) -- goto out_unmark; -+ if (mode & FALLOC_FL_KEEP_SIZE) { -+ if (offset > olen) -+ goto out_unmark; - -- if (offset + len > olen) -- len = olen - offset; -+ if (offset + len > olen) -+ len = olen - offset; -+ } - bf.l_type = F_WRLCK; - bf.l_whence = SEEK_SET; - bf.l_start = offset; ---- a/tests/runfiles/linux.run -+++ b/tests/runfiles/linux.run -@@ -94,7 +94,7 @@ tests = ['events_001_pos', 'events_002_pos', 'zed_rc_filter', 'zed_fd_spill'] - tags = ['functional', 'events'] - - [tests/functional/fallocate:Linux] --tests = ['fallocate_prealloc'] -+tests = ['fallocate_prealloc', 'fallocate_zero-range'] - tags = ['functional', 'fallocate'] - - [tests/functional/fault:Linux] ---- a/tests/zfs-tests/cmd/file_write/file_write.c -+++ b/tests/zfs-tests/cmd/file_write/file_write.c -@@ -251,7 +251,7 @@ usage(char *prog) - "\t[-s offset] [-c write_count] [-d data]\n\n" - "Where [data] equal to zero causes chars " - "0->%d to be repeated throughout, or [data]\n" -- "equal to 'R' for psudorandom data.\n", -+ "equal to 'R' for pseudorandom data.\n", - prog, DATA_RANGE); - - exit(1); ---- a/tests/zfs-tests/include/libtest.shlib -+++ b/tests/zfs-tests/include/libtest.shlib -@@ -4236,6 +4236,22 @@ function punch_hole # offset length file - esac - } - -+function zero_range # offset length file -+{ -+ typeset offset=$1 -+ typeset length=$2 -+ typeset file=$3 -+ -+ case "$UNAME" in -+ Linux) -+ fallocate --zero-range --offset $offset --length $length "$file" -+ ;; -+ *) -+ false -+ ;; -+ esac -+} -+ - # - # Wait for the specified arcstat to reach non-zero quiescence. - # If echo is 1 echo the value after reaching quiescence, otherwise ---- a/tests/zfs-tests/tests/functional/fallocate/Makefile.am -+++ b/tests/zfs-tests/tests/functional/fallocate/Makefile.am -@@ -3,4 +3,5 @@ dist_pkgdata_SCRIPTS = \ - setup.ksh \ - cleanup.ksh \ - fallocate_prealloc.ksh \ -- fallocate_punch-hole.ksh -+ fallocate_punch-hole.ksh \ -+ fallocate_zero-range.ksh ---- a/tests/zfs-tests/tests/functional/fallocate/fallocate_punch-hole.ksh -+++ b/tests/zfs-tests/tests/functional/fallocate/fallocate_punch-hole.ksh -@@ -60,13 +60,17 @@ function cleanup - [[ -e $TESTDIR ]] && log_must rm -f $FILE - } - --function check_disk_size -+function check_reported_size - { - typeset expected_size=$1 - -- disk_size=$(du $TESTDIR/file | awk '{print $1}') -- if [ $disk_size -ne $expected_size ]; then -- log_fail "Incorrect size: $disk_size != $expected_size" -+ if ! [ -e "${FILE}" ]; then -+ log_fail "$FILE does not exist" -+ fi -+ -+ reported_size=$(du "${FILE}" | awk '{print $1}') -+ if [ "$reported_size" != "$expected_size" ]; then -+ log_fail "Incorrect reported size: $reported_size != $expected_size" - fi - } - -@@ -74,9 +78,9 @@ function check_apparent_size - { - typeset expected_size=$1 - -- apparent_size=$(stat_size) -- if [ $apparent_size -ne $expected_size ]; then -- log_fail "Incorrect size: $apparent_size != $expected_size" -+ apparent_size=$(stat_size "${FILE}") -+ if [ "$apparent_size" != "$expected_size" ]; then -+ log_fail "Incorrect apparent size: $apparent_size != $expected_size" - fi - } - -@@ -86,25 +90,30 @@ log_onexit cleanup - - # Create a dense file and check it is the correct size. - log_must file_write -o create -f $FILE -b $BLKSZ -c 8 --log_must check_disk_size $((131072 * 8)) -+sync_pool $TESTPOOL -+log_must check_reported_size 1027 - - # Punch a hole for the first full block. - log_must punch_hole 0 $BLKSZ $FILE --log_must check_disk_size $((131072 * 7)) -+sync_pool $TESTPOOL -+log_must check_reported_size 899 - - # Partially punch a hole in the second block. - log_must punch_hole $BLKSZ $((BLKSZ / 2)) $FILE --log_must check_disk_size $((131072 * 7)) -+sync_pool $TESTPOOL -+log_must check_reported_size 899 - --# Punch a hole which overlaps the third and forth block. -+# Punch a hole which overlaps the third and fourth block. - log_must punch_hole $(((BLKSZ * 2) + (BLKSZ / 2))) $((BLKSZ)) $FILE --log_must check_disk_size $((131072 * 7)) -+sync_pool $TESTPOOL -+log_must check_reported_size 899 - - # Punch a hole from the fifth block past the end of file. The apparent - # file size should not change since --keep-size is implied. - apparent_size=$(stat_size $FILE) - log_must punch_hole $((BLKSZ * 4)) $((BLKSZ * 10)) $FILE --log_must check_disk_size $((131072 * 4)) -+sync_pool $TESTPOOL -+log_must check_reported_size 387 - log_must check_apparent_size $apparent_size - - log_pass "Ensure holes can be punched in files making them sparse" ---- /dev/null -+++ b/tests/zfs-tests/tests/functional/fallocate/fallocate_zero-range.ksh -@@ -0,0 +1,119 @@ -+#!/bin/ksh -p -+# -+# CDDL HEADER START -+# -+# The contents of this file are subject to the terms of the -+# Common Development and Distribution License (the "License"). -+# You may not use this file except in compliance with the License. -+# -+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE -+# or http://www.opensolaris.org/os/licensing. -+# See the License for the specific language governing permissions -+# and limitations under the License. -+# -+# When distributing Covered Code, include this CDDL HEADER in each -+# file and include the License file at usr/src/OPENSOLARIS.LICENSE. -+# If applicable, add the following below this CDDL HEADER, with the -+# fields enclosed by brackets "[]" replaced with your own identifying -+# information: Portions Copyright [yyyy] [name of copyright owner] -+# -+# CDDL HEADER END -+# -+ -+# -+# Copyright (c) 2020 by Lawrence Livermore National Security, LLC. -+# Copyright (c) 2021 by The FreeBSD Foundation. -+# -+ -+. $STF_SUITE/include/libtest.shlib -+ -+# -+# DESCRIPTION: -+# Test FALLOC_FL_ZERO_RANGE functionality -+# -+# STRATEGY: -+# 1. Create a dense file -+# 2. Zero various ranges in the file and verify the result. -+# -+ -+verify_runnable "global" -+ -+if is_freebsd; then -+ log_unsupported "FreeBSD does not implement an analogue to ZERO_RANGE." -+fi -+ -+FILE=$TESTDIR/$TESTFILE0 -+BLKSZ=$(get_prop recordsize $TESTPOOL) -+ -+function cleanup -+{ -+ [[ -e $TESTDIR ]] && log_must rm -f $FILE -+} -+ -+# Helpfully, this function expects kilobytes, and check_apparent_size expects bytes. -+function check_reported_size -+{ -+ typeset expected_size=$1 -+ -+ if ! [ -e "${FILE}" ]; then -+ log_fail "$FILE does not exist" -+ fi -+ -+ reported_size=$(du "${FILE}" | awk '{print $1}') -+ if [ "$reported_size" != "$expected_size" ]; then -+ log_fail "Incorrect reported size: $reported_size != $expected_size" -+ fi -+} -+ -+function check_apparent_size -+{ -+ typeset expected_size=$1 -+ -+ apparent_size=$(stat_size "${FILE}") -+ if [ "$apparent_size" != "$expected_size" ]; then -+ log_fail "Incorrect apparent size: $apparent_size != $expected_size" -+ fi -+} -+ -+log_assert "Ensure ranges can be zeroed in files" -+ -+log_onexit cleanup -+ -+# Create a dense file and check it is the correct size. -+log_must file_write -o create -f $FILE -b $BLKSZ -c 8 -+sync_pool $TESTPOOL -+log_must check_reported_size 1027 -+ -+# Zero a range covering the first full block. -+log_must zero_range 0 $BLKSZ $FILE -+sync_pool $TESTPOOL -+log_must check_reported_size 899 -+ -+# Partially zero a range in the second block. -+log_must zero_range $BLKSZ $((BLKSZ / 2)) $FILE -+sync_pool $TESTPOOL -+log_must check_reported_size 899 -+ -+# Zero range which overlaps the third and fourth block. -+log_must zero_range $(((BLKSZ * 2) + (BLKSZ / 2))) $((BLKSZ)) $FILE -+sync_pool $TESTPOOL -+log_must check_reported_size 899 -+ -+# Zero range from the fifth block past the end of file, with --keep-size. -+# The apparent file size must not change, since we did specify --keep-size. -+apparent_size=$(stat_size $FILE) -+log_must fallocate --keep-size --zero-range --offset $((BLKSZ * 4)) --length $((BLKSZ * 10)) "$FILE" -+sync_pool $TESTPOOL -+log_must check_reported_size 387 -+log_must check_apparent_size $apparent_size -+ -+# Zero range from the fifth block past the end of file. The apparent -+# file size should change since --keep-size is not implied, unlike -+# with PUNCH_HOLE. -+apparent_size=$(stat_size $FILE) -+log_must zero_range $((BLKSZ * 4)) $((BLKSZ * 10)) $FILE -+sync_pool $TESTPOOL -+log_must check_reported_size 387 -+log_must check_apparent_size $((BLKSZ * 14)) -+ -+log_pass "Ensure ranges can be zeroed in files" ---- a/tests/zfs-tests/tests/functional/fallocate/setup.ksh -+++ b/tests/zfs-tests/tests/functional/fallocate/setup.ksh -@@ -26,4 +26,7 @@ - . $STF_SUITE/include/libtest.shlib - - DISK=${DISKS%% *} --default_setup $DISK -+default_setup_noexit $DISK -+log_must zfs set compression=off $TESTPOOL -+log_pass -+ - diff --git a/files/zfs/3510.2.7/overlay/sys-fs/zfs-kmod/files/zfs-kmod-2.1.11-gentoo.patch b/files/zfs/3510.2.7/overlay/sys-fs/zfs-kmod/files/zfs-kmod-2.1.11-gentoo.patch deleted file mode 100644 index 53c5f27..0000000 --- a/files/zfs/3510.2.7/overlay/sys-fs/zfs-kmod/files/zfs-kmod-2.1.11-gentoo.patch +++ /dev/null @@ -1,24 +0,0 @@ -Hack to pass the full linux-mod-r1 toolchain to make during ./configure. -Not needed at build time given can pass it normally then. - -Eclass has workarounds, compiler/version matching, and its own set of -user variables which creates disparity between ebuilds if not used. - -For the (normal) alternative: KERNEL_{CC,LD} alone is insufficient, -but combining with KERNEL_LLVM=1 when CC_IS_CLANG will allow it -to work for *most* people (will likely still need KERNEL_LD from -linux-mod-r1, or ThinLTO kernels may fail with sandbox violations). - -Note KERNEL_* also cause failure if they contain spaces. - -https://bugs.gentoo.org/865157 ---- a/config/kernel.m4 -+++ b/config/kernel.m4 -@@ -646,6 +646,5 @@ - AC_TRY_COMMAND([ - KBUILD_MODPOST_NOFINAL="$5" KBUILD_MODPOST_WARN="$6" -- make modules -k -j$TEST_JOBS ${KERNEL_CC:+CC=$KERNEL_CC} -- ${KERNEL_LD:+LD=$KERNEL_LD} ${KERNEL_LLVM:+LLVM=$KERNEL_LLVM} -+ make modules -k -j$TEST_JOBS '${GENTOO_MAKEARGS_EVAL}' - CONFIG_MODULES=y CFLAGS_MODULE=-DCONFIG_MODULES - -C $LINUX_OBJ $ARCH_UM M=$PWD/$1 >$1/build.log 2>&1]) diff --git a/files/zfs/3510.2.7/overlay/sys-fs/zfs-kmod/metadata.xml b/files/zfs/3510.2.7/overlay/sys-fs/zfs-kmod/metadata.xml deleted file mode 100644 index 7e27782..0000000 --- a/files/zfs/3510.2.7/overlay/sys-fs/zfs-kmod/metadata.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - gyakovlev@gentoo.org - Georgy Yakovlev - - - sam@gentoo.org - Sam James - - - Prevents upgrading to an unsupported kernel version when combined with USE=dist-kernel - Pull dependencies and check kernel options required for root-on-zfs - - - https://github.com/openzfs/zfs/issues - https://openzfs.github.io/openzfs-docs - openzfs/zfs - - diff --git a/files/zfs/3510.2.7/overlay/sys-fs/zfs-kmod/zfs-kmod-0.8.6.ebuild b/files/zfs/3510.2.7/overlay/sys-fs/zfs-kmod/zfs-kmod-0.8.6.ebuild deleted file mode 100644 index f3bf1e8..0000000 --- a/files/zfs/3510.2.7/overlay/sys-fs/zfs-kmod/zfs-kmod-0.8.6.ebuild +++ /dev/null @@ -1,212 +0,0 @@ -# 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 - SRC_URI="https://github.com/openzfs/zfs/releases/download/zfs-${PV}/zfs-${PV}.tar.gz" - KEYWORDS="amd64 arm64 ppc64" - S="${WORKDIR}/zfs-${PV}" - ZFS_KERNEL_COMPAT="5.9" - - # 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))" -fi - -LICENSE="CDDL debug? ( GPL-2+ )" -SLOT="0/${PVR}" -IUSE="custom-cflags debug +rootfs" - -DEPEND="" - -RDEPEND="${DEPEND} - !sys-kernel/spl -" - -BDEPEND=" - dev-lang/perl - virtual/awk - dist-kernel? ( added by KBUILD - ) - - emake "${myemakeargs[@]}" install - - einstalldocs -} - -pkg_postinst() { - linux-mod_pkg_postinst - - # Remove old modules - if [[ -d "${EROOT}/lib/modules/${KV_FULL}/addon/zfs" ]]; then - ewarn "${PN} now installs modules in ${EROOT}/lib/modules/${KV_FULL}/extra/zfs" - ewarn "Old modules were detected in ${EROOT}/lib/modules/${KV_FULL}/addon/zfs" - ewarn "Automatically removing old modules to avoid problems." - rm -r "${EROOT}/lib/modules/${KV_FULL}/addon/zfs" || die "Cannot remove modules" - rmdir --ignore-fail-on-non-empty "${EROOT}/lib/modules/${KV_FULL}/addon" - fi - - 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 - - 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 newpool that is backward compatible wih GRUB2, use " - ewarn - ewarn "zpool create -d -o feature@async_destroy=enabled " - ewarn " -o feature@empty_bpobj=enabled -o feature@lz4_compress=enabled" - ewarn " -o feature@spacemap_histogram=enabled" - ewarn " -o feature@enabled_txg=enabled " - ewarn " -o feature@extensible_dataset=enabled -o feature@bookmarks=enabled" - ewarn " ..." - ewarn - ewarn "GRUB2 support will be updated as soon as either the GRUB2" - ewarn "developers do a tag or the Gentoo developers find time to backport" - ewarn "support from GRUB2 HEAD." -} diff --git a/files/zfs/3510.2.7/overlay/sys-fs/zfs-kmod/zfs-kmod-2.0.7.ebuild b/files/zfs/3510.2.7/overlay/sys-fs/zfs-kmod/zfs-kmod-2.0.7.ebuild deleted file mode 100644 index 154ef60..0000000 --- a/files/zfs/3510.2.7/overlay/sys-fs/zfs-kmod/zfs-kmod-2.0.7.ebuild +++ /dev/null @@ -1,212 +0,0 @@ -# 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" - 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? ( sec-keys/openpgp-keys-openzfs ) - dist-kernel? ( 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 OpenZFS. To" - ewarn "create a newpool that is backward compatible wih GRUB2, use " - ewarn - ewarn "zpool create -d -o feature@async_destroy=enabled " - ewarn " -o feature@empty_bpobj=enabled -o feature@lz4_compress=enabled" - ewarn " -o feature@spacemap_histogram=enabled" - ewarn " -o feature@enabled_txg=enabled " - ewarn " -o feature@extensible_dataset=enabled -o feature@bookmarks=enabled" - ewarn " ..." - ewarn - ewarn "GRUB2 support will be updated as soon as either the GRUB2" - ewarn "developers do a tag or the Gentoo developers find time to backport" - ewarn "support from GRUB2 HEAD." - fi -} diff --git a/files/zfs/3510.2.7/overlay/sys-fs/zfs-kmod/zfs-kmod-2.1.11-r1.ebuild b/files/zfs/3510.2.7/overlay/sys-fs/zfs-kmod/zfs-kmod-2.1.11-r1.ebuild deleted file mode 100644 index 7bf3eba..0000000 --- a/files/zfs/3510.2.7/overlay/sys-fs/zfs-kmod/zfs-kmod-2.1.11-r1.ebuild +++ /dev/null @@ -1,177 +0,0 @@ -# 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-r1 multiprocessing - -DESCRIPTION="Linux ZFS kernel module for sys-fs/zfs" -HOMEPAGE="https://github.com/openzfs/zfs" - -MODULES_KERNEL_MAX=6.2 -MODULES_KERNEL_MIN=3.10 - -if [[ ${PV} == 9999 ]] ; then - EGIT_REPO_URI="https://github.com/openzfs/zfs.git" - inherit git-r3 - unset MODULES_KERNEL_MAX -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="${MODULES_KERNEL_MAX}" - # 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" -RESTRICT="test" - -BDEPEND=" - dev-lang/perl - app-alternatives/awk -" - -if [[ ${PV} != 9999 ]] ; then - BDEPEND+=" verify-sig? ( sec-keys/openpgp-keys-openzfs )" - - IUSE+=" +dist-kernel-cap" - RDEPEND=" - dist-kernel-cap? ( dist-kernel? ( - 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? ( 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? ( sec-keys/openpgp-keys-openzfs ) - dist-kernel? ( 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 OpenZFS. To" - ewarn "create a newpool 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 -} diff --git a/files/zfs/3510.2.7/overlay/sys-fs/zfs-kmod/zfs-kmod-2.1.4-r1.ebuild b/files/zfs/3510.2.7/overlay/sys-fs/zfs-kmod/zfs-kmod-2.1.4-r1.ebuild deleted file mode 100644 index a861d60..0000000 --- a/files/zfs/3510.2.7/overlay/sys-fs/zfs-kmod/zfs-kmod-2.1.4-r1.ebuild +++ /dev/null @@ -1,209 +0,0 @@ -# Copyright 1999-2022 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.17" - - # 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? ( sec-keys/openpgp-keys-openzfs ) - dist-kernel? ( 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? ( sec-keys/openpgp-keys-openzfs ) - dist-kernel? ( 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? ( 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" -RESTRICT="test" - -BDEPEND=" - app-alternatives/awk - dev-lang/perl -" - -if [[ ${PV} != 9999 ]] ; then - BDEPEND+=" verify-sig? ( sec-keys/openpgp-keys-openzfs )" - - IUSE+=" +dist-kernel-cap" - RDEPEND=" - dist-kernel-cap? ( dist-kernel? ( - 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" -RESTRICT="test" - -BDEPEND=" - app-alternatives/awk - dev-lang/perl -" - -if [[ ${PV} != 9999 ]] ; then - BDEPEND+=" verify-sig? ( sec-keys/openpgp-keys-openzfs )" - - IUSE+=" +dist-kernel-cap" - RDEPEND=" - dist-kernel-cap? ( dist-kernel? ( - -Date: Sat, 22 May 2021 22:27:39 -0700 -Subject: [PATCH 1/2] systemd: add weekly and monthly scrub timers - -timers can be enabled as follows: - -systemctl enable zfs-scrub-weekly@rpool.timer --now -systemctl enable zfs-scrub-monthly@datapool.timer --now - -Each timer will pull in zfs-scrub@${poolname}.service, which is not -schedule-specific. - -Signed-off-by: Georgy Yakovlev ---- - etc/systemd/system/.gitignore | 1 + - etc/systemd/system/Makefile.am | 5 ++++- - etc/systemd/system/zfs-scrub-monthly@.timer.in | 12 ++++++++++++ - etc/systemd/system/zfs-scrub-weekly@.timer.in | 12 ++++++++++++ - etc/systemd/system/zfs-scrub@.service.in | 14 ++++++++++++++ - 5 files changed, 43 insertions(+), 1 deletion(-) - create mode 100644 etc/systemd/system/zfs-scrub-monthly@.timer.in - create mode 100644 etc/systemd/system/zfs-scrub-weekly@.timer.in - create mode 100644 etc/systemd/system/zfs-scrub@.service.in - -diff --git a/etc/systemd/system/Makefile.am b/etc/systemd/system/Makefile.am -index c374a52ac..5e65e1db4 100644 ---- a/etc/systemd/system/Makefile.am -+++ b/etc/systemd/system/Makefile.am -@@ -12,7 +12,10 @@ systemdunit_DATA = \ - zfs-volume-wait.service \ - zfs-import.target \ - zfs-volumes.target \ -- zfs.target -+ zfs.target \ -+ zfs-scrub-monthly@.timer \ -+ zfs-scrub-weekly@.timer \ -+ zfs-scrub@.service - - SUBSTFILES += $(systemdpreset_DATA) $(systemdunit_DATA) - -diff --git a/etc/systemd/system/zfs-scrub-monthly@.timer.in b/etc/systemd/system/zfs-scrub-monthly@.timer.in -new file mode 100644 -index 000000000..903068468 ---- /dev/null -+++ b/etc/systemd/system/zfs-scrub-monthly@.timer.in -@@ -0,0 +1,12 @@ -+[Unit] -+Description=Monthly zpool scrub timer for %i -+Documentation=man:zpool-scrub(8) -+ -+[Timer] -+OnCalendar=monthly -+Persistent=true -+RandomizedDelaySec=1h -+Unit=zfs-scrub@%i.service -+ -+[Install] -+WantedBy=timers.target -diff --git a/etc/systemd/system/zfs-scrub-weekly@.timer.in b/etc/systemd/system/zfs-scrub-weekly@.timer.in -new file mode 100644 -index 000000000..ede699500 ---- /dev/null -+++ b/etc/systemd/system/zfs-scrub-weekly@.timer.in -@@ -0,0 +1,12 @@ -+[Unit] -+Description=Weekly zpool scrub timer for %i -+Documentation=man:zpool-scrub(8) -+ -+[Timer] -+OnCalendar=weekly -+Persistent=true -+RandomizedDelaySec=1h -+Unit=zfs-scrub@%i.service -+ -+[Install] -+WantedBy=timers.target -diff --git a/etc/systemd/system/zfs-scrub@.service.in b/etc/systemd/system/zfs-scrub@.service.in -new file mode 100644 -index 000000000..c04ac292a ---- /dev/null -+++ b/etc/systemd/system/zfs-scrub@.service.in -@@ -0,0 +1,14 @@ -+[Unit] -+Description=zpool scrub on %i -+Documentation=man:zpool-scrub(8) -+Requires=zfs.target -+After=zfs.target -+ConditionACPower=true -+ConditionPathIsDirectory=/sys/module/zfs -+ -+[Service] -+ExecStart=/bin/sh -c '\ -+if @sbindir@/zpool status %i | grep "scrub in progress"; then\ -+exec @sbindir@/zpool wait -t scrub %i;\ -+else exec @sbindir@/zpool scrub -w %i; fi' -+ExecStop=-/bin/sh -c '@sbindir@/zpool scrub -p %i 2>/dev/null || true' --- -2.34.1 diff --git a/files/zfs/3510.2.7/overlay/sys-fs/zfs/files/2.1.2-musl-tests.patch b/files/zfs/3510.2.7/overlay/sys-fs/zfs/files/2.1.2-musl-tests.patch deleted file mode 100644 index 3d2c563..0000000 --- a/files/zfs/3510.2.7/overlay/sys-fs/zfs/files/2.1.2-musl-tests.patch +++ /dev/null @@ -1,58 +0,0 @@ -From 123c87b3c2d75636da79f57a4b0ed60d2a3133a8 Mon Sep 17 00:00:00 2001 -From: Georgy Yakovlev -Date: Mon, 20 Dec 2021 12:25:11 -0800 -Subject: [PATCH] zfs-test/mmap_seek: fix build on musl - -it needs linux/fs.h for SEEK_DATA and friends - -without linux/fs.h: - -``` -mmap_seek.c -mmap_seek.c: In function 'seek_data': -mmap_seek.c:37:40: error: 'SEEK_DATA' undeclared (first use in this function); -did you mean 'SEEK_SET'? - 37 | off_t data_offset = lseek(fd, offset, SEEK_DATA); -``` - -also it needs sys/sysmacros.h for P2ROUNDUP -without it: - -``` -mmap_seek.c: In function 'main': -mmap_seek.c:122:19: warning: -implicit declaration of function 'P2ROUNDUP' [-Wimplicit-function-declaration] - 122 | seek_hole(fd, 0, P2ROUNDUP(file_size / 2, block_size)); - | ^~~~~~~~~ -powerpc64-gentoo-linux-musl/bin/ld: mmap_seek.o: in function `main': -mmap_seek.c:(.text.startup+0x1b8): undefined reference to `P2ROUNDUP' -powerpc64-gentoo-linux-musl/bin/ld: mmap_seek.c:(.text.startup+0x1d8): - undefined reference to `P2ROUNDUP' -powerpc64-gentoo-linux-musl/bin/ld: mmap_seek.c:(.text.startup+0x21c): - undefined reference to `P2ROUNDUP' -collect2: error: ld returned 1 exit status -make[5]: *** [Makefile:754: mmap_seek] Error 1 -``` - -Closes: https://github.com/openzfs/zfs/pull/12891 -Signed-off-by: Georgy Yakovlev ---- - tests/zfs-tests/cmd/mmap_seek/mmap_seek.c | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/tests/zfs-tests/cmd/mmap_seek/mmap_seek.c b/tests/zfs-tests/cmd/mmap_seek/mmap_seek.c -index f476e1dba9a..bb36527aafe 100644 ---- a/tests/zfs-tests/cmd/mmap_seek/mmap_seek.c -+++ b/tests/zfs-tests/cmd/mmap_seek/mmap_seek.c -@@ -29,7 +29,11 @@ - #include - #include - #include -+#include - #include -+#ifdef __linux__ -+#include -+#endif - - static void - seek_data(int fd, off_t offset, off_t expected) diff --git a/files/zfs/3510.2.7/overlay/sys-fs/zfs/files/2.1.2-openrc-vendor.patch b/files/zfs/3510.2.7/overlay/sys-fs/zfs/files/2.1.2-openrc-vendor.patch deleted file mode 100644 index abe222a..0000000 --- a/files/zfs/3510.2.7/overlay/sys-fs/zfs/files/2.1.2-openrc-vendor.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 6ef28c526ba7199a3740407d764b6505618ca8ba Mon Sep 17 00:00:00 2001 -From: Peter Levine -Date: Fri, 29 Oct 2021 18:34:37 -0400 -Subject: [PATCH] Set DEFAULT_INIT_SHELL to /sbin/openrc-run for Gentoo and - Alpine - -Gentoo and Alpine always set the rc init scripts' shebang to -#!/sbin/openrc-run, whether or not openrc is installed. - -Reviewed-by: Brian Behlendorf -Signed-off-by: Peter Levine -Closes #12683 -Closes #12692 ---- - config/zfs-build.m4 | 14 +++++--------- - 1 file changed, 5 insertions(+), 9 deletions(-) - -diff --git a/config/zfs-build.m4 b/config/zfs-build.m4 -index 27041c054c2..ec4a2026bf5 100644 ---- a/config/zfs-build.m4 -+++ b/config/zfs-build.m4 -@@ -564,15 +564,11 @@ AC_DEFUN([ZFS_AC_DEFAULT_PACKAGE], [ - *) DEFAULT_INIT_SCRIPT=lsb ;; - esac - -- # On gentoo, it's possible that OpenRC isn't installed. Check if -- # /sbin/openrc-run exists, and if not, fall back to generic defaults. -- -- DEFAULT_INIT_SHELL="/bin/sh" -- AS_IF([test "$DEFAULT_INIT_SCRIPT" = "openrc"], [ -- AS_IF([test -x "/sbin/openrc-run"], -- [DEFAULT_INIT_SHELL="/sbin/openrc-run"], -- [DEFAULT_INIT_SCRIPT=lsb]) -- ]) -+ case "$VENDOR" in -+ gentoo) DEFAULT_INIT_SHELL="/sbin/openrc-run";; -+ alpine) DEFAULT_INIT_SHELL="/sbin/openrc-run";; -+ *) DEFAULT_INIT_SHELL="/bin/sh" ;; -+ esac - - AC_MSG_RESULT([$DEFAULT_INIT_SCRIPT:$DEFAULT_INIT_SHELL]) - AC_SUBST(DEFAULT_INIT_SCRIPT) diff --git a/files/zfs/3510.2.7/overlay/sys-fs/zfs/files/2.1.2-scrub-timers.patch b/files/zfs/3510.2.7/overlay/sys-fs/zfs/files/2.1.2-scrub-timers.patch deleted file mode 100644 index f1c5b56..0000000 --- a/files/zfs/3510.2.7/overlay/sys-fs/zfs/files/2.1.2-scrub-timers.patch +++ /dev/null @@ -1,147 +0,0 @@ -From 2c9844d159024d4c742d24639a218213fb53d537 Mon Sep 17 00:00:00 2001 -From: Georgy Yakovlev -Date: Sat, 22 May 2021 22:27:39 -0700 -Subject: [PATCH 1/2] systemd: add weekly and monthly scrub timers - -timers can be enabled as follows: - -systemctl enable zfs-scrub-weekly@rpool.timer --now -systemctl enable zfs-scrub-monthly@datapool.timer --now - -Each timer will pull in zfs-scrub@${poolname}.service, which is not -schedule-specific. - -Signed-off-by: Georgy Yakovlev ---- - etc/systemd/system/.gitignore | 1 + - etc/systemd/system/Makefile.am | 5 ++++- - etc/systemd/system/zfs-scrub-monthly@.timer.in | 12 ++++++++++++ - etc/systemd/system/zfs-scrub-weekly@.timer.in | 12 ++++++++++++ - etc/systemd/system/zfs-scrub@.service.in | 14 ++++++++++++++ - 5 files changed, 43 insertions(+), 1 deletion(-) - create mode 100644 etc/systemd/system/zfs-scrub-monthly@.timer.in - create mode 100644 etc/systemd/system/zfs-scrub-weekly@.timer.in - create mode 100644 etc/systemd/system/zfs-scrub@.service.in - -diff --git a/etc/systemd/system/Makefile.am b/etc/systemd/system/Makefile.am -index c374a52ac..5e65e1db4 100644 ---- a/etc/systemd/system/Makefile.am -+++ b/etc/systemd/system/Makefile.am -@@ -12,7 +12,10 @@ systemdunit_DATA = \ - zfs-volume-wait.service \ - zfs-import.target \ - zfs-volumes.target \ -- zfs.target -+ zfs.target \ -+ zfs-scrub-monthly@.timer \ -+ zfs-scrub-weekly@.timer \ -+ zfs-scrub@.service - - SUBSTFILES += $(systemdpreset_DATA) $(systemdunit_DATA) - -diff --git a/etc/systemd/system/zfs-scrub-monthly@.timer.in b/etc/systemd/system/zfs-scrub-monthly@.timer.in -new file mode 100644 -index 000000000..903068468 ---- /dev/null -+++ b/etc/systemd/system/zfs-scrub-monthly@.timer.in -@@ -0,0 +1,12 @@ -+[Unit] -+Description=Monthly zpool scrub timer for %i -+Documentation=man:zpool-scrub(8) -+ -+[Timer] -+OnCalendar=monthly -+Persistent=true -+RandomizedDelaySec=1h -+Unit=zfs-scrub@%i.service -+ -+[Install] -+WantedBy=timers.target -diff --git a/etc/systemd/system/zfs-scrub-weekly@.timer.in b/etc/systemd/system/zfs-scrub-weekly@.timer.in -new file mode 100644 -index 000000000..ede699500 ---- /dev/null -+++ b/etc/systemd/system/zfs-scrub-weekly@.timer.in -@@ -0,0 +1,12 @@ -+[Unit] -+Description=Weekly zpool scrub timer for %i -+Documentation=man:zpool-scrub(8) -+ -+[Timer] -+OnCalendar=weekly -+Persistent=true -+RandomizedDelaySec=1h -+Unit=zfs-scrub@%i.service -+ -+[Install] -+WantedBy=timers.target -diff --git a/etc/systemd/system/zfs-scrub@.service.in b/etc/systemd/system/zfs-scrub@.service.in -new file mode 100644 -index 000000000..c04ac292a ---- /dev/null -+++ b/etc/systemd/system/zfs-scrub@.service.in -@@ -0,0 +1,14 @@ -+[Unit] -+Description=zpool scrub on %i -+Documentation=man:zpool-scrub(8) -+Requires=zfs.target -+After=zfs.target -+ConditionACPower=true -+ConditionPathIsDirectory=/sys/module/zfs -+ -+[Service] -+ExecStart=/bin/sh -c '\ -+if @sbindir@/zpool status %i | grep "scrub in progress"; then\ -+exec @sbindir@/zpool wait -t scrub %i;\ -+else exec @sbindir@/zpool scrub -w %i; fi' -+ExecStop=-/bin/sh -c '@sbindir@/zpool scrub -p %i 2>/dev/null || true' --- -2.34.1 - -From 4bac4eae0345fb322337b66a9b4923e9f3f52b0f Mon Sep 17 00:00:00 2001 -From: Georgy Yakovlev -Date: Fri, 29 Oct 2021 21:40:50 -0700 -Subject: [PATCH 2/2] zpool-scrub.8: add PERIODIC SCRUB section - -Signed-off-by: Georgy Yakovlev ---- - man/man8/zpool-scrub.8 | 21 +++++++++++++++++++++ - 1 file changed, 21 insertions(+) - -diff --git a/man/man8/zpool-scrub.8 b/man/man8/zpool-scrub.8 -index 768f71539..69ae825b6 100644 ---- a/man/man8/zpool-scrub.8 -+++ b/man/man8/zpool-scrub.8 -@@ -116,8 +116,29 @@ scanned at 100M/s, and 68.4M of that file data has been - scrubbed sequentially at 10.0M/s. - .El - .El -+.Sh PERIODIC SCRUB -+On machines using systemd, scrub timers can be enabled on per-pool basis. -+.Nm weekly -+and -+.Nm monthly -+timer units are provided. -+.Bl -tag -width Ds -+.It Xo -+.Xc -+.Nm systemctl -+.Cm enable -+.Cm zfs-scrub-\fIweekly\fB@\fIrpool\fB.timer -+.Cm --now -+.It Xo -+.Xc -+.Nm systemctl -+.Cm enable -+.Cm zfs-scrub-\fImonthly\fB@\fIotherpool\fB.timer -+.Cm --now -+.El - . - .Sh SEE ALSO -+.Xr systemd.timer 5 , - .Xr zpool-iostat 8 , - .Xr zpool-resilver 8 , - .Xr zpool-status 8 --- -2.34.1 - diff --git a/files/zfs/3510.2.7/overlay/sys-fs/zfs/files/2.1.5-dracut-zfs-missing.patch b/files/zfs/3510.2.7/overlay/sys-fs/zfs/files/2.1.5-dracut-zfs-missing.patch deleted file mode 100644 index 077bcd5..0000000 --- a/files/zfs/3510.2.7/overlay/sys-fs/zfs/files/2.1.5-dracut-zfs-missing.patch +++ /dev/null @@ -1,14 +0,0 @@ -https://github.com/openzfs/zfs/commit/ebbfc6cb853d2d2f3f0671362d5ff5588be39e9d -https://github.com/openzfs/zfs/issues/13595 ---- b/contrib/dracut/90zfs/module-setup.sh.in -+++ a/contrib/dracut/90zfs/module-setup.sh.in -@@ -19,7 +19,7 @@ - } - - installkernel() { -+ instmods zfs -- instmods -c zfs - } - - install() { - diff --git a/files/zfs/3510.2.7/overlay/sys-fs/zfs/files/2.1.5-r2-dracut-non-root.patch b/files/zfs/3510.2.7/overlay/sys-fs/zfs/files/2.1.5-r2-dracut-non-root.patch deleted file mode 100644 index a9c6130..0000000 --- a/files/zfs/3510.2.7/overlay/sys-fs/zfs/files/2.1.5-r2-dracut-non-root.patch +++ /dev/null @@ -1,60 +0,0 @@ -https://github.com/openzfs/zfs/commit/eefe83eaa68f7cb4a49c580dd940d3688e42c849 -https://bugs.gentoo.org/854333 - -From eefe83eaa68f7cb4a49c580dd940d3688e42c849 Mon Sep 17 00:00:00 2001 -From: Toyam Cox -Date: Thu, 30 Jun 2022 13:47:58 -0400 -Subject: [PATCH] dracut: fix boot on non-zfs-root systems - -Simply prevent overwriting root until it needs to be overwritten. - -Dracut could change this value before this module is called, but won't -change the kernel command line. - -Reviewed-by: Andrew J. Hesford -Signed-off-by: Toyam Cox -Closes #13592 ---- - contrib/dracut/90zfs/zfs-lib.sh.in | 10 +++++----- - 1 file changed, 5 insertions(+), 5 deletions(-) - -diff --git a/contrib/dracut/90zfs/zfs-lib.sh.in b/contrib/dracut/90zfs/zfs-lib.sh.in -index e44673c2d75..3a43e514d6f 100755 ---- a/contrib/dracut/90zfs/zfs-lib.sh.in -+++ b/contrib/dracut/90zfs/zfs-lib.sh.in -@@ -88,11 +88,11 @@ decode_root_args() { - return - fi - -- root=$(getarg root=) -+ xroot=$(getarg root=) - rootfstype=$(getarg rootfstype=) - - # shellcheck disable=SC2249 -- case "$root" in -+ case "$xroot" in - ""|zfs|zfs:|zfs:AUTO) - root=zfs:AUTO - rootfstype=zfs -@@ -100,7 +100,7 @@ decode_root_args() { - ;; - - ZFS=*|zfs:*) -- root="${root#zfs:}" -+ root="${xroot#zfs:}" - root="${root#ZFS=}" - root=$(echo "$root" | tr '+' ' ') - rootfstype=zfs -@@ -109,9 +109,9 @@ decode_root_args() { - esac - - if [ "$rootfstype" = "zfs" ]; then -- case "$root" in -+ case "$xroot" in - "") root=zfs:AUTO ;; -- *) root=$(echo "$root" | tr '+' ' ') ;; -+ *) root=$(echo "$xroot" | tr '+' ' ') ;; - esac - return 0 - fi - diff --git a/files/zfs/3510.2.7/overlay/sys-fs/zfs/files/bash-completion-sudo.patch b/files/zfs/3510.2.7/overlay/sys-fs/zfs/files/bash-completion-sudo.patch deleted file mode 100644 index 8ae9d25..0000000 --- a/files/zfs/3510.2.7/overlay/sys-fs/zfs/files/bash-completion-sudo.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 3829d0b867f6aa4bde8798147dee74a86435d12c Mon Sep 17 00:00:00 2001 -From: Georgy Yakovlev -Date: Fri, 22 Mar 2019 22:04:40 -0700 -Subject: [PATCH] contrib/bash_completion.d/zfs: remove sudo reference - ---- - contrib/bash_completion.d/zfs | 10 +++++----- - 1 file changed, 5 insertions(+), 5 deletions(-) - -diff --git a/contrib/bash_completion.d/zfs b/contrib/bash_completion.d/zfs -index 914db43c..b1aded36 100644 ---- a/contrib/bash_completion.d/zfs -+++ b/contrib/bash_completion.d/zfs -@@ -21,13 +21,13 @@ - # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - # OTHER DEALINGS IN THE SOFTWARE. - --if [[ -w /dev/zfs ]]; then -+#if [[ -w /dev/zfs ]]; then - __ZFS_CMD="zfs" - __ZPOOL_CMD="zpool" --else -- __ZFS_CMD="sudo zfs" -- __ZPOOL_CMD="sudo zpool" --fi -+#else -+# __ZFS_CMD="sudo zfs" -+# __ZPOOL_CMD="sudo zpool" -+#fi - - __zfs_get_commands() - { --- -2.21.0 - diff --git a/files/zfs/3510.2.7/overlay/sys-fs/zfs/metadata.xml b/files/zfs/3510.2.7/overlay/sys-fs/zfs/metadata.xml deleted file mode 100644 index 8518b15..0000000 --- a/files/zfs/3510.2.7/overlay/sys-fs/zfs/metadata.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - - - gyakovlev@gentoo.org - Georgy Yakovlev - - - sam@gentoo.org - Sam James - - - Disable dependency on sys-fs/zfs-kmod under the assumption that ZFS is part of the kernel source tree - Don't install python scripts (arcstat, dbufstat etc) and avoid dependency on dev-lang/python - Install zfs_key pam module, for automatically loading zfs encryption keys for home datasets - Enable dependencies required for booting off a pool containing a rootfs - Install regression test suite - - - https://github.com/openzfs/zfs/issues - https://openzfs.github.io/openzfs-docs - openzfs/zfs - - - OpenZFS is an advanced file system and volume manager which was originally developed - for Solaris and is now maintained by the OpenZFS community - - It includes the functionality of both traditional file systems and volume manager. - It has many advanced features including: - * Protection against data corruption. Integrity checking for both data and metadata. - * Continuous integrity verification and automatic “self-healing” repair - * Data redundancy with mirroring, RAID-Z1/2/3 [and DRAID] - * Support for high storage capacities — up to 256 trillion yobibytes (2^128 bytes) - * Space-saving with transparent compression using LZ4, GZIP or ZSTD - * Hardware-accelerated native encryption - * Efficient storage with snapshots and copy-on-write clones - * Efficient local or remote replication — send only changed blocks with ZFS send and receive - - The OpenZFS project brings together developers from the Linux, FreeBSD, illumos, MacOS, and Windows platforms. - OpenZFS is supported by a wide range of companies. - - diff --git a/files/zfs/3510.2.7/overlay/sys-fs/zfs/zfs-0.8.6-r2.ebuild b/files/zfs/3510.2.7/overlay/sys-fs/zfs/zfs-0.8.6-r2.ebuild deleted file mode 100644 index 46403d3..0000000 --- a/files/zfs/3510.2.7/overlay/sys-fs/zfs/zfs-0.8.6-r2.ebuild +++ /dev/null @@ -1,245 +0,0 @@ -# Copyright 1999-2022 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -DISTUTILS_OPTIONAL=1 -PYTHON_COMPAT=( python3_{7,8,9} ) - -inherit autotools bash-completion-r1 dist-kernel-utils distutils-r1 flag-o-matic linux-info systemd udev usr-ldscript - -DESCRIPTION="Userland utilities for ZFS Linux kernel module" -HOMEPAGE="https://github.com/openzfs/zfs" - -if [[ ${PV} == "9999" ]] ; then - inherit git-r3 linux-mod - EGIT_REPO_URI="https://github.com/openzfs/zfs.git" -else - SRC_URI="https://github.com/openzfs/${PN}/releases/download/${P}/${P}.tar.gz" - KEYWORDS="amd64 arm64 ppc64" -fi - -LICENSE="BSD-2 CDDL MIT" -SLOT="0/2" # just libzfs soname major for now. possible candidates: libuutil, libzpool, libnvpair -IUSE="custom-cflags debug dist-kernel kernel-builtin minimal nls pam python +rootfs test-suite" - -DEPEND=" - net-libs/libtirpc:= - sys-apps/util-linux - sys-libs/zlib - virtual/awk - virtual/libudev:= - dev-libs/openssl:0= - !minimal? ( ${PYTHON_DEPS} ) - python? ( - virtual/python-cffi[${PYTHON_USEDEP}] - ) -" - -BDEPEND="virtual/awk - virtual/pkgconfig - nls? ( sys-devel/gettext ) - python? ( - dev-python/setuptools[${PYTHON_USEDEP}] - ) -" - -RDEPEND="${DEPEND} - !kernel-builtin? ( ~sys-fs/zfs-kmod-${PV}:= ) - !prefix? ( virtual/udev ) - sys-fs/udev-init-scripts - virtual/awk - dist-kernel? ( virtual/dist-kernel:= ) - rootfs? ( - app-arch/cpio - app-misc/pax-utils - !" - eerror " Block devices --->" - eerror " [X] Loopback device support" - fi - fi - fi - fi -} - -src_prepare() { - default - - if [[ ${PV} == "9999" ]]; then - eautoreconf - else - # Set revision number - sed -i "s/\(Release:\)\(.*\)1/\1\2${PR}-gentoo/" META || die "Could not set Gentoo release" - fi - - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_prepare - popd >/dev/null || die - fi - - # prevent errors showing up on zfs-mount stop, #647688 - # openrc will unmount all filesystems anyway. - sed -i "/^ZFS_UNMOUNT=/ s/yes/no/" "etc/default/zfs.in" || die -} - -src_configure() { - use custom-cflags || strip-flags - use minimal || python_setup - - local myconf=( - --bindir="${EPREFIX}/bin" - --enable-shared - --enable-systemd - --enable-sysvinit - --localstatedir="${EPREFIX}/var" - --sbindir="${EPREFIX}/sbin" - --with-config=user - --with-dracutdir="${EPREFIX}/usr/lib/dracut" - --with-linux="${KV_DIR}" - --with-linux-obj="${KV_OUT_DIR}" - --with-udevdir="$(get_udevdir)" - --with-systemdunitdir="$(systemd_get_systemunitdir)" - --with-systemdpresetdir="$(systemd_get_systempresetdir)" - $(use_enable debug) - $(use_enable nls) - $(use_enable python pyzfs) - --disable-static - $(usex minimal --without-python --with-python="${EPYTHON}") - ) - - CONFIG_SHELL="${EPREFIX}/bin/bash" econf "${myconf[@]}" -} - -src_compile() { - default - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_compile - popd >/dev/null || die - fi -} - -src_install() { - default - - gen_usr_ldscript -a uutil nvpair zpool zfs zfs_core - - use test-suite || rm -rf "${ED}/usr/share/zfs" - - find "${ED}/" -name '*.la' -delete || die - - dobashcomp contrib/bash_completion.d/zfs - bashcomp_alias zfs zpool - - # strip executable bit from conf.d file - fperms 0644 /etc/conf.d/zfs - - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_install - popd >/dev/null || die - fi - - # enforce best available python implementation - use minimal || python_fix_shebang "${ED}/bin" -} - -pkg_postinst() { - # we always need userspace utils in sync with zfs-kmod - # so force initrd update for userspace as well, to avoid - # situation when zfs-kmod trigger initrd rebuild before - # userspace component is rebuilt - # KV_* variables are provided by linux-info.eclass - if [[ -z ${ROOT} ]] && use dist-kernel; then - dist-kernel_reinstall_initramfs "${KV_DIR}" "${KV_FULL}" - fi - - if use rootfs; then - if ! has_version sys-kernel/genkernel && ! has_version sys-kernel/dracut; then - elog "root on zfs requires initramfs to boot" - elog "the following packages known to provide one and tested on regular basis:" - elog " sys-kernel/dracut ( preferred, module maintained by zfs developers )" - elog " sys-kernel/genkernel" - fi - fi - - if ! use kernel-builtin && [[ ${PV} = "9999" ]]; then - einfo "Adding ${P} to the module database to ensure that the" - einfo "kernel modules and userland utilities stay in sync." - update_moduledb - fi - - if systemd_is_booted || has_version sys-apps/systemd; then - einfo "Please refer to ${EROOT}/$(systemd_get_systempresetdir)/50-zfs.preset" - einfo "for default zfs systemd service configuration" - else - [[ -e "${EROOT}/etc/runlevels/boot/zfs-import" ]] || \ - einfo "You should add zfs-import to the boot runlevel." - [[ -e "${EROOT}/etc/runlevels/boot/zfs-mount" ]]|| \ - einfo "You should add zfs-mount to the boot runlevel." - [[ -e "${EROOT}/etc/runlevels/default/zfs-share" ]] || \ - einfo "You should add zfs-share to the default runlevel." - [[ -e "${EROOT}/etc/runlevels/default/zfs-zed" ]] || \ - einfo "You should add zfs-zed to the default runlevel." - fi -} - -pkg_postrm() { - if ! use kernel-builtin && [[ ${PV} == "9999" ]]; then - remove_moduledb - fi -} diff --git a/files/zfs/3510.2.7/overlay/sys-fs/zfs/zfs-2.0.7.ebuild b/files/zfs/3510.2.7/overlay/sys-fs/zfs/zfs-2.0.7.ebuild deleted file mode 100644 index e4ff7ef..0000000 --- a/files/zfs/3510.2.7/overlay/sys-fs/zfs/zfs-2.0.7.ebuild +++ /dev/null @@ -1,302 +0,0 @@ -# Copyright 1999-2022 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -DISTUTILS_OPTIONAL=1 -PYTHON_COMPAT=( python3_{8..10} ) - -inherit autotools bash-completion-r1 dist-kernel-utils distutils-r1 flag-o-matic linux-info pam systemd udev usr-ldscript - -DESCRIPTION="Userland utilities for ZFS Linux kernel module" -HOMEPAGE="https://github.com/openzfs/zfs" - -if [[ ${PV} == "9999" ]]; then - inherit git-r3 linux-mod - 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_P="${P/_rc/-rc}" - SRC_URI="https://github.com/openzfs/${PN}/releases/download/${MY_P}/${MY_P}.tar.gz" - SRC_URI+=" verify-sig? ( https://github.com/openzfs/${PN}/releases/download/${MY_P}/${MY_P}.tar.gz.asc )" - S="${WORKDIR}/${P%_rc?}" - - if [[ ${PV} != *_rc* ]]; then - KEYWORDS="amd64 arm64 ppc64" - fi -fi - -LICENSE="BSD-2 CDDL MIT" -# just libzfs soname major for now. -# possible candidates: libuutil, libzpool, libnvpair. Those do not provide stable abi, but are considered. -# see libsoversion_check() below as well -SLOT="0/4" -IUSE="custom-cflags debug dist-kernel kernel-builtin minimal nls pam python +rootfs test-suite" - -DEPEND=" - net-libs/libtirpc:= - sys-apps/util-linux - sys-libs/zlib - virtual/libudev:= - dev-libs/openssl:0= - !minimal? ( ${PYTHON_DEPS} ) - pam? ( sys-libs/pam ) - python? ( - virtual/python-cffi[${PYTHON_USEDEP}] - ) -" - -BDEPEND="virtual/awk - virtual/pkgconfig - nls? ( sys-devel/gettext ) - python? ( - dev-python/setuptools[${PYTHON_USEDEP}] - || ( - dev-python/packaging[${PYTHON_USEDEP}] - dev-python/distlib[${PYTHON_USEDEP}] - ) - ) -" - -if [[ ${PV} != "9999" ]] ; then - BDEPEND+=" verify-sig? ( sec-keys/openpgp-keys-openzfs )" -fi - -# awk is used for some scripts, completions, and the Dracut module -RDEPEND="${DEPEND} - !kernel-builtin? ( ~sys-fs/zfs-kmod-${PV}:= ) - !prefix? ( virtual/udev ) - sys-fs/udev-init-scripts - virtual/awk - dist-kernel? ( virtual/dist-kernel:= ) - rootfs? ( - app-arch/cpio - app-misc/pax-utils - !" - eerror " Block devices --->" - eerror " [X] Loopback device support" - fi - fi - fi - fi -} - -libsoversion_check() { - - local bugurl libzfs_sover - bugurl="https://bugs.gentoo.org/enter_bug.cgi?form_name=enter_bug&product=Gentoo+Linux&component=Current+packages" - - libzfs_sover="$(grep 'libzfs_la_LDFLAGS += -version-info' lib/libzfs/Makefile.am \ - | grep -Eo '[0-9]+:[0-9]+:[0-9]+')" - libzfs_sover="${libzfs_sover%%:*}" - - if [[ ${libzfs_sover} -ne $(ver_cut 2 ${SLOT}) ]]; then - echo - eerror "BUG BUG BUG BUG BUG BUG BUG BUG" - eerror "ebuild subslot does not match libzfs soversion!" - eerror "libzfs soversion: ${libzfs_sover}" - eerror "ebuild value: $(ver_cut 2 ${SLOT})" - eerror "This is a bug in the ebuild, please use the following URL to report it" - eerror "${bugurl}&short_desc=${CATEGORY}%2F${P}+update+subslot" - echo - # we want to abort for releases, but just print a warning for live ebuild - # to keep package installable - [[ ${PV} == "9999" ]] || die - fi -} - -src_prepare() { - default - libsoversion_check - - # Run unconditionally (bug #792627) - eautoreconf - - if [[ ${PV} != "9999" ]]; then - # Set revision number - sed -i "s/\(Release:\)\(.*\)1/\1\2${PR}-gentoo/" META || die "Could not set Gentoo release" - fi - - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_prepare - popd >/dev/null || die - fi - - # prevent errors showing up on zfs-mount stop, #647688 - # openrc will unmount all filesystems anyway. - sed -i "/^ZFS_UNMOUNT=/ s/yes/no/" "etc/default/zfs.in" || die -} - -src_configure() { - use custom-cflags || strip-flags - use minimal || python_setup - - local myconf=( - --bindir="${EPREFIX}/bin" - --enable-shared - --enable-systemd - --enable-sysvinit - --localstatedir="${EPREFIX}/var" - --sbindir="${EPREFIX}/sbin" - --with-config=user - --with-dracutdir="${EPREFIX}/usr/lib/dracut" - --with-linux="${KV_DIR}" - --with-linux-obj="${KV_OUT_DIR}" - --with-udevdir="$(get_udevdir)" - --with-pamconfigsdir="${EPREFIX}/unwanted_files" - --with-pammoduledir="$(getpam_mod_dir)" - --with-systemdunitdir="$(systemd_get_systemunitdir)" - --with-systemdpresetdir="$(systemd_get_systempresetdir)" - --with-vendor=gentoo - $(use_enable debug) - $(use_enable nls) - $(use_enable pam) - $(use_enable python pyzfs) - --disable-static - $(usex minimal --without-python --with-python="${EPYTHON}") - ) - - econf "${myconf[@]}" -} - -src_compile() { - default - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_compile - popd >/dev/null || die - fi -} - -src_install() { - default - - gen_usr_ldscript -a nvpair uutil zfsbootenv zfs zfs_core zpool - - use pam && { rm -rv "${ED}/unwanted_files" || die ; } - - use test-suite || { rm -r "${ED}/usr/share/zfs" || die ; } - - find "${ED}" -name '*.la' -delete || die - - dobashcomp contrib/bash_completion.d/zfs - bashcomp_alias zfs zpool - - # strip executable bit from conf.d file - fperms 0644 /etc/conf.d/zfs - - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_install - popd >/dev/null || die - fi - - # enforce best available python implementation - use minimal || python_fix_shebang "${ED}/bin" -} - -pkg_postinst() { - # we always need userspace utils in sync with zfs-kmod - # so force initrd update for userspace as well, to avoid - # situation when zfs-kmod trigger initrd rebuild before - # userspace component is rebuilt - # KV_* variables are provided by linux-info.eclass - if [[ -z ${ROOT} ]] && use dist-kernel; then - dist-kernel_reinstall_initramfs "${KV_DIR}" "${KV_FULL}" - fi - - if use rootfs; then - if ! has_version sys-kernel/genkernel && ! has_version sys-kernel/dracut; then - elog "Root on zfs requires an initramfs to boot" - elog "The following packages provide one and are tested on a regular basis:" - elog " sys-kernel/dracut ( preferred, module maintained by zfs developers )" - elog " sys-kernel/genkernel" - fi - fi - - if ! use kernel-builtin && [[ ${PV} == "9999" ]]; then - einfo "Adding ${P} to the module database to ensure that the" - einfo "kernel modules and userland utilities stay in sync." - update_moduledb - fi - - if systemd_is_booted || has_version sys-apps/systemd; then - einfo "Please refer to ${EROOT}/$(systemd_get_systempresetdir)/50-zfs.preset" - einfo "for default zfs systemd service configuration" - else - [[ -e "${EROOT}/etc/runlevels/boot/zfs-import" ]] || \ - einfo "You should add zfs-import to the boot runlevel." - [[ -e "${EROOT}/etc/runlevels/boot/zfs-mount" ]]|| \ - einfo "You should add zfs-mount to the boot runlevel." - [[ -e "${EROOT}/etc/runlevels/default/zfs-share" ]] || \ - einfo "You should add zfs-share to the default runlevel." - [[ -e "${EROOT}/etc/runlevels/default/zfs-zed" ]] || \ - einfo "You should add zfs-zed to the default runlevel." - fi -} - -pkg_postrm() { - if ! use kernel-builtin && [[ ${PV} == "9999" ]]; then - remove_moduledb - fi -} diff --git a/files/zfs/3510.2.7/overlay/sys-fs/zfs/zfs-2.1.11.ebuild b/files/zfs/3510.2.7/overlay/sys-fs/zfs/zfs-2.1.11.ebuild deleted file mode 100644 index c67dc48..0000000 --- a/files/zfs/3510.2.7/overlay/sys-fs/zfs/zfs-2.1.11.ebuild +++ /dev/null @@ -1,320 +0,0 @@ -# Copyright 1999-2023 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -DISTUTILS_OPTIONAL=1 -PYTHON_COMPAT=( python3_{9..11} ) - -inherit autotools bash-completion-r1 dist-kernel-utils distutils-r1 flag-o-matic linux-info pam systemd udev usr-ldscript - -DESCRIPTION="Userland utilities for ZFS Linux kernel module" -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_P="${P/_rc/-rc}" - SRC_URI="https://github.com/openzfs/${PN}/releases/download/${MY_P}/${MY_P}.tar.gz" - SRC_URI+=" verify-sig? ( https://github.com/openzfs/${PN}/releases/download/${MY_P}/${MY_P}.tar.gz.asc )" - S="${WORKDIR}/${P%_rc?}" - - if [[ ${PV} != *_rc* ]]; then - KEYWORDS="amd64 arm64 ppc64 ~riscv ~sparc" - fi -fi - -LICENSE="BSD-2 CDDL MIT" -# just libzfs soname major for now. -# possible candidates: libuutil, libzpool, libnvpair. Those do not provide stable abi, but are considered. -# see libsoversion_check() below as well -SLOT="0/5" -IUSE="custom-cflags debug dist-kernel kernel-builtin minimal nls pam python +rootfs selinux test-suite" - -DEPEND=" - net-libs/libtirpc:= - sys-apps/util-linux - sys-libs/zlib - virtual/libudev:= - dev-libs/openssl:0= - !minimal? ( ${PYTHON_DEPS} ) - pam? ( sys-libs/pam ) - python? ( - virtual/python-cffi[${PYTHON_USEDEP}] - ) -" - -BDEPEND="app-alternatives/awk - virtual/pkgconfig - nls? ( sys-devel/gettext ) - python? ( - dev-python/setuptools[${PYTHON_USEDEP}] - || ( - dev-python/packaging[${PYTHON_USEDEP}] - dev-python/distlib[${PYTHON_USEDEP}] - ) - ) -" - -if [[ ${PV} != "9999" ]] ; then - BDEPEND+=" verify-sig? ( sec-keys/openpgp-keys-openzfs )" -fi - -# awk is used for some scripts, completions, and the Dracut module -RDEPEND="${DEPEND} - !kernel-builtin? ( ~sys-fs/zfs-kmod-${PV}:= ) - !prefix? ( virtual/udev ) - sys-fs/udev-init-scripts - app-alternatives/awk - dist-kernel? ( virtual/dist-kernel:= ) - rootfs? ( - app-arch/cpio - app-misc/pax-utils - ) - selinux? ( sec-policy/selinux-zfs ) - test-suite? ( - app-shells/ksh - sys-apps/kmod[tools] - sys-apps/util-linux - sys-devel/bc - sys-block/parted - sys-fs/lsscsi - sys-fs/mdadm - sys-process/procps - ) -" - -# PDEPEND in this form is needed to trick portage suggest -# enabling dist-kernel if only 1 package have it set, without suggesting to disable -PDEPEND="dist-kernel? ( ~sys-fs/zfs-kmod-${PV}[dist-kernel] )" - -REQUIRED_USE=" - !minimal? ( ${PYTHON_REQUIRED_USE} ) - python? ( !minimal ) - test-suite? ( !minimal ) -" - -RESTRICT="test" - -PATCHES=( - # bug #854333 - "${FILESDIR}"/2.1.5-r2-dracut-non-root.patch - - "${FILESDIR}"/2.1.5-dracut-zfs-missing.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() { - if use kernel_linux; then - linux-info_pkg_setup - - if ! linux_config_exists; then - ewarn "Cannot check the linux kernel configuration." - else - if use test-suite; then - if linux_chkconfig_present BLK_DEV_LOOP; then - eerror "The ZFS test suite requires loop device support enabled." - eerror "Please enable it:" - eerror " CONFIG_BLK_DEV_LOOP=y" - eerror "in /usr/src/linux/.config or" - eerror " Device Drivers --->" - eerror " Block devices --->" - eerror " [X] Loopback device support" - fi - fi - fi - fi -} - -libsoversion_check() { - local bugurl libzfs_sover - bugurl="https://bugs.gentoo.org/enter_bug.cgi?form_name=enter_bug&product=Gentoo+Linux&component=Current+packages" - - libzfs_sover="$(grep 'libzfs_la_LDFLAGS += -version-info' lib/libzfs/Makefile.am \ - | grep -Eo '[0-9]+:[0-9]+:[0-9]+')" - libzfs_sover="${libzfs_sover%%:*}" - - if [[ ${libzfs_sover} -ne $(ver_cut 2 ${SLOT}) ]]; then - echo - eerror "BUG BUG BUG BUG BUG BUG BUG BUG" - eerror "ebuild subslot does not match libzfs soversion!" - eerror "libzfs soversion: ${libzfs_sover}" - eerror "ebuild value: $(ver_cut 2 ${SLOT})" - eerror "This is a bug in the ebuild, please use the following URL to report it" - eerror "${bugurl}&short_desc=${CATEGORY}%2F${P}+update+subslot" - echo - # we want to abort for releases, but just print a warning for live ebuild - # to keep package installable - [[ ${PV} == "9999" ]] || die - fi -} - -src_unpack() { - if use verify-sig ; then - # Needed for downloaded patch (which is unsigned, which is fine) - verify-sig_verify_detached "${DISTDIR}"/${MY_P}.tar.gz{,.asc} - fi - - default -} - -src_prepare() { - default - libsoversion_check - - # Run unconditionally (bug #792627) - eautoreconf - - if [[ ${PV} != "9999" ]]; then - # Set revision number - sed -i "s/\(Release:\)\(.*\)1/\1\2${PR}-gentoo/" META || die "Could not set Gentoo release" - fi - - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_prepare - popd >/dev/null || die - fi - - # prevent errors showing up on zfs-mount stop, #647688 - # openrc will unmount all filesystems anyway. - sed -i "/^ZFS_UNMOUNT=/ s/yes/no/" "etc/default/zfs.in" || die -} - -src_configure() { - use custom-cflags || strip-flags - use minimal || python_setup - - # All the same issue: - # Segfaults w/ GCC 12 and 'zfs send' - # bug #856373 - # https://github.com/openzfs/zfs/issues/13620 - # https://github.com/openzfs/zfs/issues/13605 - append-flags -fno-tree-vectorize - - local myconf=( - --bindir="${EPREFIX}/bin" - --enable-shared - --enable-sysvinit - --localstatedir="${EPREFIX}/var" - --sbindir="${EPREFIX}/sbin" - --with-config=user - --with-dracutdir="${EPREFIX}/usr/lib/dracut" - --with-linux="${KV_DIR}" - --with-linux-obj="${KV_OUT_DIR}" - --with-udevdir="$(get_udevdir)" - --with-pamconfigsdir="${EPREFIX}/unwanted_files" - --with-pammoduledir="$(getpam_mod_dir)" - --with-systemdunitdir="$(systemd_get_systemunitdir)" - --with-systemdpresetdir="$(systemd_get_systempresetdir)" - --with-vendor=gentoo - # Building zfs-mount-generator.c on musl breaks as strndupa - # isn't available. But systemd doesn't support musl anyway, so - # just disable building it. - $(use_enable !elibc_musl systemd) - $(use_enable debug) - $(use_enable nls) - $(use_enable pam) - $(use_enable python pyzfs) - --disable-static - $(usex minimal --without-python --with-python="${EPYTHON}") - ) - - econf "${myconf[@]}" -} - -src_compile() { - default - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_compile - popd >/dev/null || die - fi -} - -src_install() { - default - - gen_usr_ldscript -a nvpair uutil zfsbootenv zfs zfs_core zpool - - use pam && { rm -rv "${ED}/unwanted_files" || die ; } - - use test-suite || { rm -r "${ED}"/usr/share/zfs/{test-runner,zfs-tests,runfiles,*sh} || die ; } - - find "${ED}" -name '*.la' -delete || die - - dobashcomp contrib/bash_completion.d/zfs - bashcomp_alias zfs zpool - - # strip executable bit from conf.d file - fperms 0644 /etc/conf.d/zfs - - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_install - popd >/dev/null || die - fi - - # enforce best available python implementation - use minimal || python_fix_shebang "${ED}/bin" -} - -pkg_postinst() { - udev_reload - - # we always need userspace utils in sync with zfs-kmod - # so force initrd update for userspace as well, to avoid - # situation when zfs-kmod trigger initrd rebuild before - # userspace component is rebuilt - # KV_* variables are provided by linux-info.eclass - if [[ -z ${ROOT} ]] && use dist-kernel; then - dist-kernel_reinstall_initramfs "${KV_DIR}" "${KV_FULL}" - fi - - if use rootfs; then - if ! has_version sys-kernel/genkernel && ! has_version sys-kernel/dracut; then - elog "Root on zfs requires an initramfs to boot" - elog "The following packages provide one and are tested on a regular basis:" - elog " sys-kernel/dracut ( preferred, module maintained by zfs developers )" - elog " sys-kernel/genkernel" - fi - fi - - if systemd_is_booted || has_version sys-apps/systemd; then - einfo "Please refer to ${EROOT}/$(systemd_get_systempresetdir)/50-zfs.preset" - einfo "for default zfs systemd service configuration" - else - [[ -e "${EROOT}/etc/runlevels/boot/zfs-import" ]] || \ - einfo "You should add zfs-import to the boot runlevel." - [[ -e "${EROOT}/etc/runlevels/boot/zfs-load-key" ]] || \ - einfo "You should add zfs-load-key to the boot runlevel." - [[ -e "${EROOT}/etc/runlevels/boot/zfs-mount" ]]|| \ - einfo "You should add zfs-mount to the boot runlevel." - [[ -e "${EROOT}/etc/runlevels/default/zfs-share" ]] || \ - einfo "You should add zfs-share to the default runlevel." - [[ -e "${EROOT}/etc/runlevels/default/zfs-zed" ]] || \ - einfo "You should add zfs-zed to the default runlevel." - fi -} - -pkg_postrm() { - udev_reload - - if ! use kernel-builtin && [[ ${PV} == "9999" ]]; then - remove_moduledb - fi -} diff --git a/files/zfs/3510.2.7/overlay/sys-fs/zfs/zfs-2.1.2-r1.ebuild b/files/zfs/3510.2.7/overlay/sys-fs/zfs/zfs-2.1.2-r1.ebuild deleted file mode 100644 index d119026..0000000 --- a/files/zfs/3510.2.7/overlay/sys-fs/zfs/zfs-2.1.2-r1.ebuild +++ /dev/null @@ -1,303 +0,0 @@ -# Copyright 1999-2022 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -DISTUTILS_OPTIONAL=1 -PYTHON_COMPAT=( python3_{8,9,10} ) - -inherit autotools bash-completion-r1 dist-kernel-utils distutils-r1 flag-o-matic linux-info pam systemd udev usr-ldscript - -DESCRIPTION="Userland utilities for ZFS Linux kernel module" -HOMEPAGE="https://github.com/openzfs/zfs" - -if [[ ${PV} == "9999" ]]; then - inherit git-r3 linux-mod - 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_P="${P/_rc/-rc}" - SRC_URI="https://github.com/openzfs/${PN}/releases/download/${MY_P}/${MY_P}.tar.gz" - SRC_URI+=" verify-sig? ( https://github.com/openzfs/${PN}/releases/download/${MY_P}/${MY_P}.tar.gz.asc )" - S="${WORKDIR}/${P%_rc?}" - - if [[ ${PV} != *_rc* ]]; then - KEYWORDS="amd64 arm64 ppc64 ~riscv" - fi -fi - -LICENSE="BSD-2 CDDL MIT" -# just libzfs soname major for now. -# possible candidates: libuutil, libzpool, libnvpair. Those do not provide stable abi, but are considered. -# see libsoversion_check() below as well -SLOT="0/5" -IUSE="custom-cflags debug dist-kernel kernel-builtin minimal nls pam python +rootfs test-suite" - -DEPEND=" - net-libs/libtirpc:= - sys-apps/util-linux - sys-libs/zlib - virtual/libudev:= - dev-libs/openssl:0= - !minimal? ( ${PYTHON_DEPS} ) - pam? ( sys-libs/pam ) - python? ( - virtual/python-cffi[${PYTHON_USEDEP}] - ) -" - -BDEPEND="virtual/awk - virtual/pkgconfig - nls? ( sys-devel/gettext ) - python? ( - dev-python/setuptools[${PYTHON_USEDEP}] - || ( - dev-python/packaging[${PYTHON_USEDEP}] - dev-python/distlib[${PYTHON_USEDEP}] - ) - ) -" - -if [[ ${PV} != "9999" ]] ; then - BDEPEND+=" verify-sig? ( sec-keys/openpgp-keys-openzfs )" -fi - -# awk is used for some scripts, completions, and the Dracut module -RDEPEND="${DEPEND} - !kernel-builtin? ( ~sys-fs/zfs-kmod-${PV}:= ) - !prefix? ( virtual/udev ) - sys-fs/udev-init-scripts - virtual/awk - dist-kernel? ( virtual/dist-kernel:= ) - rootfs? ( - app-arch/cpio - app-misc/pax-utils - !" - eerror " Block devices --->" - eerror " [X] Loopback device support" - fi - fi - fi - fi -} - -libsoversion_check() { - local bugurl libzfs_sover - bugurl="https://bugs.gentoo.org/enter_bug.cgi?form_name=enter_bug&product=Gentoo+Linux&component=Current+packages" - - libzfs_sover="$(grep 'libzfs_la_LDFLAGS += -version-info' lib/libzfs/Makefile.am \ - | grep -Eo '[0-9]+:[0-9]+:[0-9]+')" - libzfs_sover="${libzfs_sover%%:*}" - - if [[ ${libzfs_sover} -ne $(ver_cut 2 ${SLOT}) ]]; then - echo - eerror "BUG BUG BUG BUG BUG BUG BUG BUG" - eerror "ebuild subslot does not match libzfs soversion!" - eerror "libzfs soversion: ${libzfs_sover}" - eerror "ebuild value: $(ver_cut 2 ${SLOT})" - eerror "This is a bug in the ebuild, please use the following URL to report it" - eerror "${bugurl}&short_desc=${CATEGORY}%2F${P}+update+subslot" - echo - # we want to abort for releases, but just print a warning for live ebuild - # to keep package installable - [[ ${PV} == "9999" ]] || die - fi -} - -src_prepare() { - default - libsoversion_check - - # Run unconditionally (bug #792627) - eautoreconf - - if [[ ${PV} != "9999" ]]; then - # Set revision number - sed -i "s/\(Release:\)\(.*\)1/\1\2${PR}-gentoo/" META || die "Could not set Gentoo release" - fi - - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_prepare - popd >/dev/null || die - fi - - # prevent errors showing up on zfs-mount stop, #647688 - # openrc will unmount all filesystems anyway. - sed -i "/^ZFS_UNMOUNT=/ s/yes/no/" "etc/default/zfs.in" || die -} - -src_configure() { - use custom-cflags || strip-flags - use minimal || python_setup - - local myconf=( - --bindir="${EPREFIX}/bin" - --enable-shared - --enable-sysvinit - --localstatedir="${EPREFIX}/var" - --sbindir="${EPREFIX}/sbin" - --with-config=user - --with-dracutdir="${EPREFIX}/usr/lib/dracut" - --with-linux="${KV_DIR}" - --with-linux-obj="${KV_OUT_DIR}" - --with-udevdir="$(get_udevdir)" - --with-pamconfigsdir="${EPREFIX}/unwanted_files" - --with-pammoduledir="$(getpam_mod_dir)" - --with-systemdunitdir="$(systemd_get_systemunitdir)" - --with-systemdpresetdir="$(systemd_get_systempresetdir)" - --with-vendor=gentoo - # Building zfs-mount-generator.c on musl breaks as strndupa - # isn't available. But systemd doesn't support musl anyway, so - # just disable building it. - $(use_enable !elibc_musl systemd) - $(use_enable debug) - $(use_enable nls) - $(use_enable pam) - $(use_enable python pyzfs) - --disable-static - $(usex minimal --without-python --with-python="${EPYTHON}") - ) - - econf "${myconf[@]}" -} - -src_compile() { - default - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_compile - popd >/dev/null || die - fi -} - -src_install() { - default - - gen_usr_ldscript -a nvpair uutil zfsbootenv zfs zfs_core zpool - - use pam && { rm -rv "${ED}/unwanted_files" || die ; } - - use test-suite || { rm -r "${ED}"/usr/share/zfs/{test-runner,zfs-tests,runfiles,*sh} || die ; } - - find "${ED}" -name '*.la' -delete || die - - dobashcomp contrib/bash_completion.d/zfs - bashcomp_alias zfs zpool - - # strip executable bit from conf.d file - fperms 0644 /etc/conf.d/zfs - - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_install - popd >/dev/null || die - fi - - # enforce best available python implementation - use minimal || python_fix_shebang "${ED}/bin" -} - -pkg_postinst() { - # we always need userspace utils in sync with zfs-kmod - # so force initrd update for userspace as well, to avoid - # situation when zfs-kmod trigger initrd rebuild before - # userspace component is rebuilt - # KV_* variables are provided by linux-info.eclass - if [[ -z ${ROOT} ]] && use dist-kernel; then - dist-kernel_reinstall_initramfs "${KV_DIR}" "${KV_FULL}" - fi - - if use rootfs; then - if ! has_version sys-kernel/genkernel && ! has_version sys-kernel/dracut; then - elog "Root on zfs requires an initramfs to boot" - elog "The following packages provide one and are tested on a regular basis:" - elog " sys-kernel/dracut ( preferred, module maintained by zfs developers )" - elog " sys-kernel/genkernel" - fi - fi - - if ! use kernel-builtin && [[ ${PV} == "9999" ]]; then - einfo "Adding ${P} to the module database to ensure that the" - einfo "kernel modules and userland utilities stay in sync." - update_moduledb - fi - - if systemd_is_booted || has_version sys-apps/systemd; then - einfo "Please refer to ${EROOT}/$(systemd_get_systempresetdir)/50-zfs.preset" - einfo "for default zfs systemd service configuration" - else - [[ -e "${EROOT}/etc/runlevels/boot/zfs-import" ]] || \ - einfo "You should add zfs-import to the boot runlevel." - [[ -e "${EROOT}/etc/runlevels/boot/zfs-mount" ]]|| \ - einfo "You should add zfs-mount to the boot runlevel." - [[ -e "${EROOT}/etc/runlevels/default/zfs-share" ]] || \ - einfo "You should add zfs-share to the default runlevel." - [[ -e "${EROOT}/etc/runlevels/default/zfs-zed" ]] || \ - einfo "You should add zfs-zed to the default runlevel." - fi -} - -pkg_postrm() { - if ! use kernel-builtin && [[ ${PV} == "9999" ]]; then - remove_moduledb - fi -} diff --git a/files/zfs/3510.2.7/overlay/sys-fs/zfs/zfs-2.1.4.ebuild b/files/zfs/3510.2.7/overlay/sys-fs/zfs/zfs-2.1.4.ebuild deleted file mode 100644 index f5e9ee0..0000000 --- a/files/zfs/3510.2.7/overlay/sys-fs/zfs/zfs-2.1.4.ebuild +++ /dev/null @@ -1,300 +0,0 @@ -# Copyright 1999-2022 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -DISTUTILS_OPTIONAL=1 -PYTHON_COMPAT=( python3_{8,9,10} ) - -inherit autotools bash-completion-r1 dist-kernel-utils distutils-r1 flag-o-matic linux-info pam systemd udev usr-ldscript - -DESCRIPTION="Userland utilities for ZFS Linux kernel module" -HOMEPAGE="https://github.com/openzfs/zfs" - -if [[ ${PV} == "9999" ]]; then - inherit git-r3 linux-mod - 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_P="${P/_rc/-rc}" - SRC_URI="https://github.com/openzfs/${PN}/releases/download/${MY_P}/${MY_P}.tar.gz" - SRC_URI+=" verify-sig? ( https://github.com/openzfs/${PN}/releases/download/${MY_P}/${MY_P}.tar.gz.asc )" - S="${WORKDIR}/${P%_rc?}" - - # 2.1.3 unkeyworded briefly for some testing - if [[ ${PV} != *_rc* ]]; then - KEYWORDS="amd64 ~arm64 ppc64 ~riscv" - fi -fi - -LICENSE="BSD-2 CDDL MIT" -# just libzfs soname major for now. -# possible candidates: libuutil, libzpool, libnvpair. Those do not provide stable abi, but are considered. -# see libsoversion_check() below as well -SLOT="0/5" -IUSE="custom-cflags debug dist-kernel kernel-builtin +minimal nls pam python rootfs test-suite" - -DEPEND=" - net-libs/libtirpc:= - sys-apps/util-linux - sys-libs/zlib - virtual/libudev:= - dev-libs/openssl:0= - !minimal? ( ${PYTHON_DEPS} ) - pam? ( sys-libs/pam ) - python? ( - virtual/python-cffi[${PYTHON_USEDEP}] - ) -" - -BDEPEND="virtual/awk - virtual/pkgconfig - nls? ( sys-devel/gettext ) - python? ( - dev-python/setuptools[${PYTHON_USEDEP}] - || ( - dev-python/packaging[${PYTHON_USEDEP}] - dev-python/distlib[${PYTHON_USEDEP}] - ) - ) -" - -if [[ ${PV} != "9999" ]] ; then - BDEPEND+=" verify-sig? ( sec-keys/openpgp-keys-openzfs )" -fi - -# awk is used for some scripts, completions, and the Dracut module -RDEPEND="${DEPEND} - !kernel-builtin? ( ~sys-fs/zfs-kmod-${PV}:= ) - !prefix? ( virtual/udev ) - sys-fs/udev-init-scripts - virtual/awk - dist-kernel? ( virtual/dist-kernel:= ) - rootfs? ( - app-arch/cpio - app-misc/pax-utils - !" - eerror " Block devices --->" - eerror " [X] Loopback device support" - fi - fi - fi - fi -} - -libsoversion_check() { - local bugurl libzfs_sover - bugurl="https://bugs.gentoo.org/enter_bug.cgi?form_name=enter_bug&product=Gentoo+Linux&component=Current+packages" - - libzfs_sover="$(grep 'libzfs_la_LDFLAGS += -version-info' lib/libzfs/Makefile.am \ - | grep -Eo '[0-9]+:[0-9]+:[0-9]+')" - libzfs_sover="${libzfs_sover%%:*}" - - if [[ ${libzfs_sover} -ne $(ver_cut 2 ${SLOT}) ]]; then - echo - eerror "BUG BUG BUG BUG BUG BUG BUG BUG" - eerror "ebuild subslot does not match libzfs soversion!" - eerror "libzfs soversion: ${libzfs_sover}" - eerror "ebuild value: $(ver_cut 2 ${SLOT})" - eerror "This is a bug in the ebuild, please use the following URL to report it" - eerror "${bugurl}&short_desc=${CATEGORY}%2F${P}+update+subslot" - echo - # we want to abort for releases, but just print a warning for live ebuild - # to keep package installable - [[ ${PV} == "9999" ]] || die - fi -} - -src_prepare() { - default - libsoversion_check - - # Run unconditionally (bug #792627) - eautoreconf - - if [[ ${PV} != "9999" ]]; then - # Set revision number - sed -i "s/\(Release:\)\(.*\)1/\1\2${PR}-gentoo/" META || die "Could not set Gentoo release" - fi - - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_prepare - popd >/dev/null || die - fi - - # prevent errors showing up on zfs-mount stop, #647688 - # openrc will unmount all filesystems anyway. - sed -i "/^ZFS_UNMOUNT=/ s/yes/no/" "etc/default/zfs.in" || die -} - -src_configure() { - use custom-cflags || strip-flags - use minimal || python_setup - - local myconf=( - --bindir="${EPREFIX}/bin" - --enable-shared - --enable-sysvinit - --localstatedir="${EPREFIX}/var" - --sbindir="${EPREFIX}/sbin" - --with-config=user - --with-dracutdir="${EPREFIX}/usr/lib/dracut" - --with-linux="${KV_DIR}" - --with-linux-obj="${KV_OUT_DIR}" - --with-udevdir="$(get_udevdir)" - --with-pamconfigsdir="${EPREFIX}/unwanted_files" - --with-pammoduledir="$(getpam_mod_dir)" - --with-systemdunitdir="$(systemd_get_systemunitdir)" - --with-systemdpresetdir="$(systemd_get_systempresetdir)" - --with-vendor=gentoo - # Building zfs-mount-generator.c on musl breaks as strndupa - # isn't available. But systemd doesn't support musl anyway, so - # just disable building it. - $(use_enable !elibc_musl systemd) - $(use_enable debug) - $(use_enable nls) - $(use_enable pam) - $(use_enable python pyzfs) - --disable-static - $(usex minimal --without-python --with-python="${EPYTHON}") - ) - - econf "${myconf[@]}" -} - -src_compile() { - default - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_compile - popd >/dev/null || die - fi -} - -src_install() { - default - - gen_usr_ldscript -a nvpair uutil zfsbootenv zfs zfs_core zpool - - use pam && { rm -rv "${ED}/unwanted_files" || die ; } - - use test-suite || { rm -r "${ED}"/usr/share/zfs/{test-runner,zfs-tests,runfiles,*sh} || die ; } - - find "${ED}" -name '*.la' -delete || die - - dobashcomp contrib/bash_completion.d/zfs - bashcomp_alias zfs zpool - - # strip executable bit from conf.d file - fperms 0644 /etc/conf.d/zfs - - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_install - popd >/dev/null || die - fi - - # enforce best available python implementation - use minimal || python_fix_shebang "${ED}/bin" -} - -pkg_postinst() { - # we always need userspace utils in sync with zfs-kmod - # so force initrd update for userspace as well, to avoid - # situation when zfs-kmod trigger initrd rebuild before - # userspace component is rebuilt - # KV_* variables are provided by linux-info.eclass - if [[ -z ${ROOT} ]] && use dist-kernel; then - dist-kernel_reinstall_initramfs "${KV_DIR}" "${KV_FULL}" - fi - - if use rootfs; then - if ! has_version sys-kernel/genkernel && ! has_version sys-kernel/dracut; then - elog "Root on zfs requires an initramfs to boot" - elog "The following packages provide one and are tested on a regular basis:" - elog " sys-kernel/dracut ( preferred, module maintained by zfs developers )" - elog " sys-kernel/genkernel" - fi - fi - - if ! use kernel-builtin && [[ ${PV} == "9999" ]]; then - einfo "Adding ${P} to the module database to ensure that the" - einfo "kernel modules and userland utilities stay in sync." - update_moduledb - fi - - if systemd_is_booted || has_version sys-apps/systemd; then - einfo "Please refer to ${EROOT}/$(systemd_get_systempresetdir)/50-zfs.preset" - einfo "for default zfs systemd service configuration" - else - [[ -e "${EROOT}/etc/runlevels/boot/zfs-import" ]] || \ - einfo "You should add zfs-import to the boot runlevel." - [[ -e "${EROOT}/etc/runlevels/boot/zfs-load-key" ]] || \ - einfo "You should add zfs-load-key to the boot runlevel." - [[ -e "${EROOT}/etc/runlevels/boot/zfs-mount" ]]|| \ - einfo "You should add zfs-mount to the boot runlevel." - [[ -e "${EROOT}/etc/runlevels/default/zfs-share" ]] || \ - einfo "You should add zfs-share to the default runlevel." - [[ -e "${EROOT}/etc/runlevels/default/zfs-zed" ]] || \ - einfo "You should add zfs-zed to the default runlevel." - fi -} - -pkg_postrm() { - if ! use kernel-builtin && [[ ${PV} == "9999" ]]; then - remove_moduledb - fi -} diff --git a/files/zfs/3510.2.7/overlay/sys-fs/zfs/zfs-2.1.9.ebuild b/files/zfs/3510.2.7/overlay/sys-fs/zfs/zfs-2.1.9.ebuild deleted file mode 100644 index 2930846..0000000 --- a/files/zfs/3510.2.7/overlay/sys-fs/zfs/zfs-2.1.9.ebuild +++ /dev/null @@ -1,326 +0,0 @@ -# Copyright 1999-2023 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -DISTUTILS_OPTIONAL=1 -PYTHON_COMPAT=( python3_{9..11} ) - -inherit autotools bash-completion-r1 dist-kernel-utils distutils-r1 flag-o-matic linux-info pam systemd udev usr-ldscript - -DESCRIPTION="Userland utilities for ZFS Linux kernel module" -HOMEPAGE="https://github.com/openzfs/zfs" - -if [[ ${PV} == "9999" ]]; then - inherit git-r3 linux-mod - 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_P="${P/_rc/-rc}" - SRC_URI="https://github.com/openzfs/${PN}/releases/download/${MY_P}/${MY_P}.tar.gz" - SRC_URI+=" verify-sig? ( https://github.com/openzfs/${PN}/releases/download/${MY_P}/${MY_P}.tar.gz.asc )" - S="${WORKDIR}/${P%_rc?}" - - if [[ ${PV} != *_rc* ]]; then - KEYWORDS="amd64 arm64 ppc64 ~riscv ~sparc" - fi -fi - -LICENSE="BSD-2 CDDL MIT" -# just libzfs soname major for now. -# possible candidates: libuutil, libzpool, libnvpair. Those do not provide stable abi, but are considered. -# see libsoversion_check() below as well -SLOT="0/5" -IUSE="custom-cflags debug dist-kernel kernel-builtin minimal nls pam python +rootfs selinux test-suite" - -DEPEND=" - net-libs/libtirpc:= - sys-apps/util-linux - sys-libs/zlib - virtual/libudev:= - dev-libs/openssl:0= - !minimal? ( ${PYTHON_DEPS} ) - pam? ( sys-libs/pam ) - python? ( - virtual/python-cffi[${PYTHON_USEDEP}] - ) -" - -BDEPEND="app-alternatives/awk - virtual/pkgconfig - nls? ( sys-devel/gettext ) - python? ( - dev-python/setuptools[${PYTHON_USEDEP}] - || ( - dev-python/packaging[${PYTHON_USEDEP}] - dev-python/distlib[${PYTHON_USEDEP}] - ) - ) -" - -if [[ ${PV} != "9999" ]] ; then - BDEPEND+=" verify-sig? ( sec-keys/openpgp-keys-openzfs )" -fi - -# awk is used for some scripts, completions, and the Dracut module -RDEPEND="${DEPEND} - !kernel-builtin? ( ~sys-fs/zfs-kmod-${PV}:= ) - !prefix? ( virtual/udev ) - sys-fs/udev-init-scripts - app-alternatives/awk - dist-kernel? ( virtual/dist-kernel:= ) - rootfs? ( - app-arch/cpio - app-misc/pax-utils - ) - selinux? ( sec-policy/selinux-zfs ) - test-suite? ( - app-shells/ksh - sys-apps/kmod[tools] - sys-apps/util-linux - sys-devel/bc - sys-block/parted - sys-fs/lsscsi - sys-fs/mdadm - sys-process/procps - ) -" - -# PDEPEND in this form is needed to trick portage suggest -# enabling dist-kernel if only 1 package have it set, without suggesting to disable -PDEPEND="dist-kernel? ( ~sys-fs/zfs-kmod-${PV}[dist-kernel] )" - -REQUIRED_USE=" - !minimal? ( ${PYTHON_REQUIRED_USE} ) - python? ( !minimal ) - test-suite? ( !minimal ) -" - -RESTRICT="test" - -PATCHES=( - # bug #854333 - "${FILESDIR}"/2.1.5-r2-dracut-non-root.patch - - "${FILESDIR}"/2.1.5-dracut-zfs-missing.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() { - if use kernel_linux; then - linux-info_pkg_setup - - if ! linux_config_exists; then - ewarn "Cannot check the linux kernel configuration." - else - if use test-suite; then - if linux_chkconfig_present BLK_DEV_LOOP; then - eerror "The ZFS test suite requires loop device support enabled." - eerror "Please enable it:" - eerror " CONFIG_BLK_DEV_LOOP=y" - eerror "in /usr/src/linux/.config or" - eerror " Device Drivers --->" - eerror " Block devices --->" - eerror " [X] Loopback device support" - fi - fi - fi - fi -} - -libsoversion_check() { - local bugurl libzfs_sover - bugurl="https://bugs.gentoo.org/enter_bug.cgi?form_name=enter_bug&product=Gentoo+Linux&component=Current+packages" - - libzfs_sover="$(grep 'libzfs_la_LDFLAGS += -version-info' lib/libzfs/Makefile.am \ - | grep -Eo '[0-9]+:[0-9]+:[0-9]+')" - libzfs_sover="${libzfs_sover%%:*}" - - if [[ ${libzfs_sover} -ne $(ver_cut 2 ${SLOT}) ]]; then - echo - eerror "BUG BUG BUG BUG BUG BUG BUG BUG" - eerror "ebuild subslot does not match libzfs soversion!" - eerror "libzfs soversion: ${libzfs_sover}" - eerror "ebuild value: $(ver_cut 2 ${SLOT})" - eerror "This is a bug in the ebuild, please use the following URL to report it" - eerror "${bugurl}&short_desc=${CATEGORY}%2F${P}+update+subslot" - echo - # we want to abort for releases, but just print a warning for live ebuild - # to keep package installable - [[ ${PV} == "9999" ]] || die - fi -} - -src_unpack() { - if use verify-sig ; then - # Needed for downloaded patch (which is unsigned, which is fine) - verify-sig_verify_detached "${DISTDIR}"/${MY_P}.tar.gz{,.asc} - fi - - default -} - -src_prepare() { - default - libsoversion_check - - # Run unconditionally (bug #792627) - eautoreconf - - if [[ ${PV} != "9999" ]]; then - # Set revision number - sed -i "s/\(Release:\)\(.*\)1/\1\2${PR}-gentoo/" META || die "Could not set Gentoo release" - fi - - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_prepare - popd >/dev/null || die - fi - - # prevent errors showing up on zfs-mount stop, #647688 - # openrc will unmount all filesystems anyway. - sed -i "/^ZFS_UNMOUNT=/ s/yes/no/" "etc/default/zfs.in" || die -} - -src_configure() { - use custom-cflags || strip-flags - use minimal || python_setup - - # All the same issue: - # Segfaults w/ GCC 12 and 'zfs send' - # bug #856373 - # https://github.com/openzfs/zfs/issues/13620 - # https://github.com/openzfs/zfs/issues/13605 - append-flags -fno-tree-vectorize - - local myconf=( - --bindir="${EPREFIX}/bin" - --enable-shared - --enable-sysvinit - --localstatedir="${EPREFIX}/var" - --sbindir="${EPREFIX}/sbin" - --with-config=user - --with-dracutdir="${EPREFIX}/usr/lib/dracut" - --with-linux="${KV_DIR}" - --with-linux-obj="${KV_OUT_DIR}" - --with-udevdir="$(get_udevdir)" - --with-pamconfigsdir="${EPREFIX}/unwanted_files" - --with-pammoduledir="$(getpam_mod_dir)" - --with-systemdunitdir="$(systemd_get_systemunitdir)" - --with-systemdpresetdir="$(systemd_get_systempresetdir)" - --with-vendor=gentoo - # Building zfs-mount-generator.c on musl breaks as strndupa - # isn't available. But systemd doesn't support musl anyway, so - # just disable building it. - $(use_enable !elibc_musl systemd) - $(use_enable debug) - $(use_enable nls) - $(use_enable pam) - $(use_enable python pyzfs) - --disable-static - $(usex minimal --without-python --with-python="${EPYTHON}") - ) - - econf "${myconf[@]}" -} - -src_compile() { - default - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_compile - popd >/dev/null || die - fi -} - -src_install() { - default - - gen_usr_ldscript -a nvpair uutil zfsbootenv zfs zfs_core zpool - - use pam && { rm -rv "${ED}/unwanted_files" || die ; } - - use test-suite || { rm -r "${ED}"/usr/share/zfs/{test-runner,zfs-tests,runfiles,*sh} || die ; } - - find "${ED}" -name '*.la' -delete || die - - dobashcomp contrib/bash_completion.d/zfs - bashcomp_alias zfs zpool - - # strip executable bit from conf.d file - fperms 0644 /etc/conf.d/zfs - - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_install - popd >/dev/null || die - fi - - # enforce best available python implementation - use minimal || python_fix_shebang "${ED}/bin" -} - -pkg_postinst() { - udev_reload - - # we always need userspace utils in sync with zfs-kmod - # so force initrd update for userspace as well, to avoid - # situation when zfs-kmod trigger initrd rebuild before - # userspace component is rebuilt - # KV_* variables are provided by linux-info.eclass - if [[ -z ${ROOT} ]] && use dist-kernel; then - dist-kernel_reinstall_initramfs "${KV_DIR}" "${KV_FULL}" - fi - - if use rootfs; then - if ! has_version sys-kernel/genkernel && ! has_version sys-kernel/dracut; then - elog "Root on zfs requires an initramfs to boot" - elog "The following packages provide one and are tested on a regular basis:" - elog " sys-kernel/dracut ( preferred, module maintained by zfs developers )" - elog " sys-kernel/genkernel" - fi - fi - - if ! use kernel-builtin && [[ ${PV} == "9999" ]]; then - einfo "Adding ${P} to the module database to ensure that the" - einfo "kernel modules and userland utilities stay in sync." - update_moduledb - fi - - if systemd_is_booted || has_version sys-apps/systemd; then - einfo "Please refer to ${EROOT}/$(systemd_get_systempresetdir)/50-zfs.preset" - einfo "for default zfs systemd service configuration" - else - [[ -e "${EROOT}/etc/runlevels/boot/zfs-import" ]] || \ - einfo "You should add zfs-import to the boot runlevel." - [[ -e "${EROOT}/etc/runlevels/boot/zfs-load-key" ]] || \ - einfo "You should add zfs-load-key to the boot runlevel." - [[ -e "${EROOT}/etc/runlevels/boot/zfs-mount" ]]|| \ - einfo "You should add zfs-mount to the boot runlevel." - [[ -e "${EROOT}/etc/runlevels/default/zfs-share" ]] || \ - einfo "You should add zfs-share to the default runlevel." - [[ -e "${EROOT}/etc/runlevels/default/zfs-zed" ]] || \ - einfo "You should add zfs-zed to the default runlevel." - fi -} - -pkg_postrm() { - udev_reload - - if ! use kernel-builtin && [[ ${PV} == "9999" ]]; then - remove_moduledb - fi -} diff --git a/files/zfs/3510.2.7/overlay/sys-fs/zfs/zfs-2.2.0_rc3.ebuild b/files/zfs/3510.2.7/overlay/sys-fs/zfs/zfs-2.2.0_rc3.ebuild deleted file mode 100644 index e9d67dd..0000000 --- a/files/zfs/3510.2.7/overlay/sys-fs/zfs/zfs-2.2.0_rc3.ebuild +++ /dev/null @@ -1,306 +0,0 @@ -# Copyright 1999-2023 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -DISTUTILS_OPTIONAL=1 -DISTUTILS_USE_PEP517=setuptools -PYTHON_COMPAT=( python3_{10..11} ) - -inherit autotools bash-completion-r1 dist-kernel-utils distutils-r1 flag-o-matic linux-info pam systemd udev usr-ldscript - -DESCRIPTION="Userland utilities for ZFS Linux kernel module" -HOMEPAGE="https://github.com/openzfs/zfs" - -if [[ ${PV} == "9999" ]]; then - inherit git-r3 linux-mod - 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_P="${P/_rc/-rc}" - SRC_URI="https://github.com/openzfs/${PN}/releases/download/${MY_P}/${MY_P}.tar.gz" - SRC_URI+=" verify-sig? ( https://github.com/openzfs/${PN}/releases/download/${MY_P}/${MY_P}.tar.gz.asc )" - S="${WORKDIR}/${MY_P}" - - if [[ ${PV} != *_rc* ]]; then - KEYWORDS="~amd64 ~arm64 ~ppc64 ~riscv ~sparc" - fi -fi - -LICENSE="BSD-2 CDDL MIT" -# just libzfs soname major for now. -# possible candidates: libuutil, libzpool, libnvpair. Those do not provide stable abi, but are considered. -# see libsoversion_check() below as well -SLOT="0/5" -IUSE="custom-cflags debug dist-kernel kernel-builtin minimal nls pam python +rootfs selinux test-suite" - -DEPEND=" - dev-libs/openssl:= - net-libs/libtirpc:= - sys-apps/util-linux - sys-libs/zlib - virtual/libudev:= - !minimal? ( ${PYTHON_DEPS} ) - pam? ( sys-libs/pam ) - python? ( - $(python_gen_cond_dep 'dev-python/cffi[${PYTHON_USEDEP}]' 'python*') - ) -" - -BDEPEND=" - app-alternatives/awk - virtual/pkgconfig - nls? ( sys-devel/gettext ) - python? ( - ${DISTUTILS_DEPS} - || ( - dev-python/packaging[${PYTHON_USEDEP}] - dev-python/distlib[${PYTHON_USEDEP}] - ) - ) -" - -if [[ ${PV} != "9999" ]] ; then - BDEPEND+=" verify-sig? ( sec-keys/openpgp-keys-openzfs )" -fi - -# awk is used for some scripts, completions, and the Dracut module -RDEPEND=" - ${DEPEND} - !kernel-builtin? ( ~sys-fs/zfs-kmod-${PV}:= ) - !prefix? ( virtual/udev ) - app-alternatives/awk - sys-fs/udev-init-scripts - dist-kernel? ( virtual/dist-kernel:= ) - rootfs? ( - app-arch/cpio - app-misc/pax-utils - ) - selinux? ( sec-policy/selinux-zfs ) - test-suite? ( - app-shells/ksh - sys-apps/kmod[tools] - sys-apps/util-linux - sys-devel/bc - sys-block/parted - sys-fs/lsscsi - sys-fs/mdadm - sys-process/procps - ) -" - -# PDEPEND in this form is needed to trick portage suggest -# enabling dist-kernel if only 1 package have it set, without suggesting to disable -PDEPEND="dist-kernel? ( ~sys-fs/zfs-kmod-${PV}[dist-kernel] )" - -REQUIRED_USE=" - !minimal? ( ${PYTHON_REQUIRED_USE} ) - python? ( !minimal ) - test-suite? ( !minimal ) -" - -RESTRICT="test" - -PATCHES=( - "${FILESDIR}"/2.1.5-dracut-zfs-missing.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() { - if use kernel_linux; then - linux-info_pkg_setup - - if ! linux_config_exists; then - ewarn "Cannot check the linux kernel configuration." - else - if use test-suite; then - if linux_chkconfig_present BLK_DEV_LOOP; then - eerror "The ZFS test suite requires loop device support enabled." - eerror "Please enable it:" - eerror " CONFIG_BLK_DEV_LOOP=y" - eerror "in /usr/src/linux/.config or" - eerror " Device Drivers --->" - eerror " Block devices --->" - eerror " [X] Loopback device support" - fi - fi - fi - fi -} - -libsoversion_check() { - local bugurl libzfs_sover - bugurl="https://bugs.gentoo.org/enter_bug.cgi?form_name=enter_bug&product=Gentoo+Linux&component=Current+packages" - - libzfs_sover="$(grep 'libzfs_la_LDFLAGS += -version-info' lib/libzfs/Makefile.am \ - | grep -Eo '[0-9]+:[0-9]+:[0-9]+')" - libzfs_sover="${libzfs_sover%%:*}" - - if [[ ${libzfs_sover} -ne $(ver_cut 2 ${SLOT}) ]]; then - echo - eerror "BUG BUG BUG BUG BUG BUG BUG BUG" - eerror "ebuild subslot does not match libzfs soversion!" - eerror "libzfs soversion: ${libzfs_sover}" - eerror "ebuild value: $(ver_cut 2 ${SLOT})" - eerror "This is a bug in the ebuild, please use the following URL to report it" - eerror "${bugurl}&short_desc=${CATEGORY}%2F${P}+update+subslot" - echo - # we want to abort for releases, but just print a warning for live ebuild - # to keep package installable - [[ ${PV} == "9999" ]] || die - fi -} - -src_prepare() { - default - libsoversion_check - - # Run unconditionally (bug #792627) - eautoreconf - - if [[ ${PV} != "9999" ]]; then - # Set revision number - sed -i "s/\(Release:\)\(.*\)1/\1\2${PR}-gentoo/" META || die "Could not set Gentoo release" - fi - - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_prepare - popd >/dev/null || die - fi - - # Tries to use /etc/conf.d which we reserve for OpenRC - sed -i -e '/EnvironmentFile/d' etc/systemd/system/zfs*.in || die - - # prevent errors showing up on zfs-mount stop, #647688 - # openrc will unmount all filesystems anyway. - sed -i "/^ZFS_UNMOUNT=/ s/yes/no/" "etc/default/zfs.in" || die -} - -src_configure() { - use custom-cflags || strip-flags - use minimal || python_setup - - local myconf=( - --bindir="${EPREFIX}/bin" - --enable-shared - --enable-sysvinit - --localstatedir="${EPREFIX}/var" - --sbindir="${EPREFIX}/sbin" - --with-config=user - --with-dracutdir="${EPREFIX}/usr/lib/dracut" - --with-linux="${KV_DIR}" - --with-linux-obj="${KV_OUT_DIR}" - --with-udevdir="$(get_udevdir)" - --with-pamconfigsdir="${EPREFIX}/unwanted_files" - --with-pammoduledir="$(getpam_mod_dir)" - --with-systemdunitdir="$(systemd_get_systemunitdir)" - --with-systemdpresetdir="$(systemd_get_systempresetdir)" - --with-vendor=gentoo - # Building zfs-mount-generator.c on musl breaks as strndupa - # isn't available. But systemd doesn't support musl anyway, so - # just disable building it. - # UPDATE: it has been fixed since, - # https://github.com/openzfs/zfs/commit/1f19826c9ac85835cbde61a7439d9d1fefe43a4a - # but we still leave it as this for now. - $(use_enable !elibc_musl systemd) - $(use_enable debug) - $(use_enable nls) - $(use_enable pam) - $(use_enable python pyzfs) - --disable-static - $(usex minimal --without-python --with-python="${EPYTHON}") - ) - - econf "${myconf[@]}" -} - -src_compile() { - default - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_compile - popd >/dev/null || die - fi -} - -src_install() { - default - - gen_usr_ldscript -a nvpair uutil zfsbootenv zfs zfs_core zpool - - use pam && { rm -rv "${ED}/unwanted_files" || die ; } - - use test-suite || { rm -r "${ED}"/usr/share/zfs/{test-runner,zfs-tests,runfiles,*sh} || die ; } - - find "${ED}" -name '*.la' -delete || die - - dobashcomp contrib/bash_completion.d/zfs - bashcomp_alias zfs zpool - - # strip executable bit from conf.d file - fperms 0644 /etc/conf.d/zfs - - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_install - popd >/dev/null || die - fi - - # enforce best available python implementation - use minimal || python_fix_shebang "${ED}/bin" -} - -pkg_postinst() { - udev_reload - - # we always need userspace utils in sync with zfs-kmod - # so force initrd update for userspace as well, to avoid - # situation when zfs-kmod trigger initrd rebuild before - # userspace component is rebuilt - # KV_* variables are provided by linux-info.eclass - if [[ -z ${ROOT} ]] && use dist-kernel; then - dist-kernel_reinstall_initramfs "${KV_DIR}" "${KV_FULL}" - fi - - if use rootfs; then - if ! has_version sys-kernel/genkernel && ! has_version sys-kernel/dracut; then - elog "Root on zfs requires an initramfs to boot" - elog "The following packages provide one and are tested on a regular basis:" - elog " sys-kernel/dracut ( preferred, module maintained by zfs developers )" - elog " sys-kernel/genkernel" - fi - fi - - if systemd_is_booted || has_version sys-apps/systemd; then - einfo "Please refer to ${EROOT}/$(systemd_get_systempresetdir)/50-zfs.preset" - einfo "for default zfs systemd service configuration" - else - [[ -e "${EROOT}/etc/runlevels/boot/zfs-import" ]] || \ - einfo "You should add zfs-import to the boot runlevel." - [[ -e "${EROOT}/etc/runlevels/boot/zfs-load-key" ]] || \ - einfo "You should add zfs-load-key to the boot runlevel." - [[ -e "${EROOT}/etc/runlevels/boot/zfs-mount" ]]|| \ - einfo "You should add zfs-mount to the boot runlevel." - [[ -e "${EROOT}/etc/runlevels/default/zfs-share" ]] || \ - einfo "You should add zfs-share to the default runlevel." - [[ -e "${EROOT}/etc/runlevels/default/zfs-zed" ]] || \ - einfo "You should add zfs-zed to the default runlevel." - fi -} - -pkg_postrm() { - udev_reload -} diff --git a/files/zfs/3510.2.7/overlay/sys-fs/zfs/zfs-9999.ebuild b/files/zfs/3510.2.7/overlay/sys-fs/zfs/zfs-9999.ebuild deleted file mode 100644 index e9d67dd..0000000 --- a/files/zfs/3510.2.7/overlay/sys-fs/zfs/zfs-9999.ebuild +++ /dev/null @@ -1,306 +0,0 @@ -# Copyright 1999-2023 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -DISTUTILS_OPTIONAL=1 -DISTUTILS_USE_PEP517=setuptools -PYTHON_COMPAT=( python3_{10..11} ) - -inherit autotools bash-completion-r1 dist-kernel-utils distutils-r1 flag-o-matic linux-info pam systemd udev usr-ldscript - -DESCRIPTION="Userland utilities for ZFS Linux kernel module" -HOMEPAGE="https://github.com/openzfs/zfs" - -if [[ ${PV} == "9999" ]]; then - inherit git-r3 linux-mod - 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_P="${P/_rc/-rc}" - SRC_URI="https://github.com/openzfs/${PN}/releases/download/${MY_P}/${MY_P}.tar.gz" - SRC_URI+=" verify-sig? ( https://github.com/openzfs/${PN}/releases/download/${MY_P}/${MY_P}.tar.gz.asc )" - S="${WORKDIR}/${MY_P}" - - if [[ ${PV} != *_rc* ]]; then - KEYWORDS="~amd64 ~arm64 ~ppc64 ~riscv ~sparc" - fi -fi - -LICENSE="BSD-2 CDDL MIT" -# just libzfs soname major for now. -# possible candidates: libuutil, libzpool, libnvpair. Those do not provide stable abi, but are considered. -# see libsoversion_check() below as well -SLOT="0/5" -IUSE="custom-cflags debug dist-kernel kernel-builtin minimal nls pam python +rootfs selinux test-suite" - -DEPEND=" - dev-libs/openssl:= - net-libs/libtirpc:= - sys-apps/util-linux - sys-libs/zlib - virtual/libudev:= - !minimal? ( ${PYTHON_DEPS} ) - pam? ( sys-libs/pam ) - python? ( - $(python_gen_cond_dep 'dev-python/cffi[${PYTHON_USEDEP}]' 'python*') - ) -" - -BDEPEND=" - app-alternatives/awk - virtual/pkgconfig - nls? ( sys-devel/gettext ) - python? ( - ${DISTUTILS_DEPS} - || ( - dev-python/packaging[${PYTHON_USEDEP}] - dev-python/distlib[${PYTHON_USEDEP}] - ) - ) -" - -if [[ ${PV} != "9999" ]] ; then - BDEPEND+=" verify-sig? ( sec-keys/openpgp-keys-openzfs )" -fi - -# awk is used for some scripts, completions, and the Dracut module -RDEPEND=" - ${DEPEND} - !kernel-builtin? ( ~sys-fs/zfs-kmod-${PV}:= ) - !prefix? ( virtual/udev ) - app-alternatives/awk - sys-fs/udev-init-scripts - dist-kernel? ( virtual/dist-kernel:= ) - rootfs? ( - app-arch/cpio - app-misc/pax-utils - ) - selinux? ( sec-policy/selinux-zfs ) - test-suite? ( - app-shells/ksh - sys-apps/kmod[tools] - sys-apps/util-linux - sys-devel/bc - sys-block/parted - sys-fs/lsscsi - sys-fs/mdadm - sys-process/procps - ) -" - -# PDEPEND in this form is needed to trick portage suggest -# enabling dist-kernel if only 1 package have it set, without suggesting to disable -PDEPEND="dist-kernel? ( ~sys-fs/zfs-kmod-${PV}[dist-kernel] )" - -REQUIRED_USE=" - !minimal? ( ${PYTHON_REQUIRED_USE} ) - python? ( !minimal ) - test-suite? ( !minimal ) -" - -RESTRICT="test" - -PATCHES=( - "${FILESDIR}"/2.1.5-dracut-zfs-missing.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() { - if use kernel_linux; then - linux-info_pkg_setup - - if ! linux_config_exists; then - ewarn "Cannot check the linux kernel configuration." - else - if use test-suite; then - if linux_chkconfig_present BLK_DEV_LOOP; then - eerror "The ZFS test suite requires loop device support enabled." - eerror "Please enable it:" - eerror " CONFIG_BLK_DEV_LOOP=y" - eerror "in /usr/src/linux/.config or" - eerror " Device Drivers --->" - eerror " Block devices --->" - eerror " [X] Loopback device support" - fi - fi - fi - fi -} - -libsoversion_check() { - local bugurl libzfs_sover - bugurl="https://bugs.gentoo.org/enter_bug.cgi?form_name=enter_bug&product=Gentoo+Linux&component=Current+packages" - - libzfs_sover="$(grep 'libzfs_la_LDFLAGS += -version-info' lib/libzfs/Makefile.am \ - | grep -Eo '[0-9]+:[0-9]+:[0-9]+')" - libzfs_sover="${libzfs_sover%%:*}" - - if [[ ${libzfs_sover} -ne $(ver_cut 2 ${SLOT}) ]]; then - echo - eerror "BUG BUG BUG BUG BUG BUG BUG BUG" - eerror "ebuild subslot does not match libzfs soversion!" - eerror "libzfs soversion: ${libzfs_sover}" - eerror "ebuild value: $(ver_cut 2 ${SLOT})" - eerror "This is a bug in the ebuild, please use the following URL to report it" - eerror "${bugurl}&short_desc=${CATEGORY}%2F${P}+update+subslot" - echo - # we want to abort for releases, but just print a warning for live ebuild - # to keep package installable - [[ ${PV} == "9999" ]] || die - fi -} - -src_prepare() { - default - libsoversion_check - - # Run unconditionally (bug #792627) - eautoreconf - - if [[ ${PV} != "9999" ]]; then - # Set revision number - sed -i "s/\(Release:\)\(.*\)1/\1\2${PR}-gentoo/" META || die "Could not set Gentoo release" - fi - - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_prepare - popd >/dev/null || die - fi - - # Tries to use /etc/conf.d which we reserve for OpenRC - sed -i -e '/EnvironmentFile/d' etc/systemd/system/zfs*.in || die - - # prevent errors showing up on zfs-mount stop, #647688 - # openrc will unmount all filesystems anyway. - sed -i "/^ZFS_UNMOUNT=/ s/yes/no/" "etc/default/zfs.in" || die -} - -src_configure() { - use custom-cflags || strip-flags - use minimal || python_setup - - local myconf=( - --bindir="${EPREFIX}/bin" - --enable-shared - --enable-sysvinit - --localstatedir="${EPREFIX}/var" - --sbindir="${EPREFIX}/sbin" - --with-config=user - --with-dracutdir="${EPREFIX}/usr/lib/dracut" - --with-linux="${KV_DIR}" - --with-linux-obj="${KV_OUT_DIR}" - --with-udevdir="$(get_udevdir)" - --with-pamconfigsdir="${EPREFIX}/unwanted_files" - --with-pammoduledir="$(getpam_mod_dir)" - --with-systemdunitdir="$(systemd_get_systemunitdir)" - --with-systemdpresetdir="$(systemd_get_systempresetdir)" - --with-vendor=gentoo - # Building zfs-mount-generator.c on musl breaks as strndupa - # isn't available. But systemd doesn't support musl anyway, so - # just disable building it. - # UPDATE: it has been fixed since, - # https://github.com/openzfs/zfs/commit/1f19826c9ac85835cbde61a7439d9d1fefe43a4a - # but we still leave it as this for now. - $(use_enable !elibc_musl systemd) - $(use_enable debug) - $(use_enable nls) - $(use_enable pam) - $(use_enable python pyzfs) - --disable-static - $(usex minimal --without-python --with-python="${EPYTHON}") - ) - - econf "${myconf[@]}" -} - -src_compile() { - default - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_compile - popd >/dev/null || die - fi -} - -src_install() { - default - - gen_usr_ldscript -a nvpair uutil zfsbootenv zfs zfs_core zpool - - use pam && { rm -rv "${ED}/unwanted_files" || die ; } - - use test-suite || { rm -r "${ED}"/usr/share/zfs/{test-runner,zfs-tests,runfiles,*sh} || die ; } - - find "${ED}" -name '*.la' -delete || die - - dobashcomp contrib/bash_completion.d/zfs - bashcomp_alias zfs zpool - - # strip executable bit from conf.d file - fperms 0644 /etc/conf.d/zfs - - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_install - popd >/dev/null || die - fi - - # enforce best available python implementation - use minimal || python_fix_shebang "${ED}/bin" -} - -pkg_postinst() { - udev_reload - - # we always need userspace utils in sync with zfs-kmod - # so force initrd update for userspace as well, to avoid - # situation when zfs-kmod trigger initrd rebuild before - # userspace component is rebuilt - # KV_* variables are provided by linux-info.eclass - if [[ -z ${ROOT} ]] && use dist-kernel; then - dist-kernel_reinstall_initramfs "${KV_DIR}" "${KV_FULL}" - fi - - if use rootfs; then - if ! has_version sys-kernel/genkernel && ! has_version sys-kernel/dracut; then - elog "Root on zfs requires an initramfs to boot" - elog "The following packages provide one and are tested on a regular basis:" - elog " sys-kernel/dracut ( preferred, module maintained by zfs developers )" - elog " sys-kernel/genkernel" - fi - fi - - if systemd_is_booted || has_version sys-apps/systemd; then - einfo "Please refer to ${EROOT}/$(systemd_get_systempresetdir)/50-zfs.preset" - einfo "for default zfs systemd service configuration" - else - [[ -e "${EROOT}/etc/runlevels/boot/zfs-import" ]] || \ - einfo "You should add zfs-import to the boot runlevel." - [[ -e "${EROOT}/etc/runlevels/boot/zfs-load-key" ]] || \ - einfo "You should add zfs-load-key to the boot runlevel." - [[ -e "${EROOT}/etc/runlevels/boot/zfs-mount" ]]|| \ - einfo "You should add zfs-mount to the boot runlevel." - [[ -e "${EROOT}/etc/runlevels/default/zfs-share" ]] || \ - einfo "You should add zfs-share to the default runlevel." - [[ -e "${EROOT}/etc/runlevels/default/zfs-zed" ]] || \ - einfo "You should add zfs-zed to the default runlevel." - fi -} - -pkg_postrm() { - udev_reload -} diff --git a/files/zfs/3602.2.0/overlay/eclass/dist-kernel-utils.eclass b/files/zfs/3602.2.0/overlay/eclass/dist-kernel-utils.eclass deleted file mode 100644 index 6903183..0000000 --- a/files/zfs/3602.2.0/overlay/eclass/dist-kernel-utils.eclass +++ /dev/null @@ -1,201 +0,0 @@ -# Copyright 2020-2023 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -# @ECLASS: dist-kernel-utils.eclass -# @MAINTAINER: -# Distribution Kernel Project -# @AUTHOR: -# Michał Górny -# @SUPPORTED_EAPIS: 7 8 -# @BLURB: Utility functions related to Distribution Kernels -# @DESCRIPTION: -# This eclass provides various utility functions related to Distribution -# Kernels. - -# @ECLASS_VARIABLE: KERNEL_IUSE_SECUREBOOT -# @PRE_INHERIT -# @DEFAULT_UNSET -# @DESCRIPTION: -# If set to a non-null value, inherits secureboot.eclass -# and allows signing of generated kernel images. - -if [[ ! ${_DIST_KERNEL_UTILS} ]]; then - -case ${EAPI} in - 7|8) ;; - *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; -esac - -if [[ ${KERNEL_IUSE_SECUREBOOT} ]]; then - inherit secureboot -fi - -# @FUNCTION: dist-kernel_build_initramfs -# @USAGE: -# @DESCRIPTION: -# Build an initramfs for the kernel. specifies the absolute -# path where initramfs will be created, while specifies -# the kernel version, used to find modules. -# -# Note: while this function uses dracut at the moment, other initramfs -# variants may be supported in the future. -dist-kernel_build_initramfs() { - debug-print-function ${FUNCNAME} "${@}" - - [[ ${#} -eq 2 ]] || die "${FUNCNAME}: invalid arguments" - local output=${1} - local version=${2} - - local rel_image_path=$(dist-kernel_get_image_path) - local image=${output%/*}/${rel_image_path##*/} - - local args=( - --force - # if uefi=yes is used, dracut needs to locate the kernel image - --kernel-image "${image}" - - # positional arguments - "${output}" "${version}" - ) - - ebegin "Building initramfs via dracut" - dracut "${args[@]}" - eend ${?} || die -n "Building initramfs failed" -} - -# @FUNCTION: dist-kernel_get_image_path -# @DESCRIPTION: -# Get relative kernel image path specific to the current ${ARCH}. -dist-kernel_get_image_path() { - case ${ARCH} in - amd64|x86) - echo arch/x86/boot/bzImage - ;; - arm64) - echo arch/arm64/boot/Image.gz - ;; - arm) - echo arch/arm/boot/zImage - ;; - hppa|ppc|ppc64|sparc) - # https://www.kernel.org/doc/html/latest/powerpc/bootwrapper.html - # ./ is required because of ${image_path%/*} - # substitutions in the code - echo ./vmlinux - ;; - riscv) - echo arch/riscv/boot/Image.gz - ;; - *) - die "${FUNCNAME}: unsupported ARCH=${ARCH}" - ;; - esac -} - -# @FUNCTION: dist-kernel_install_kernel -# @USAGE: -# @DESCRIPTION: -# Install kernel using installkernel tool. specifies -# the kernel version, full path to the image, -# full path to System.map. -dist-kernel_install_kernel() { - debug-print-function ${FUNCNAME} "${@}" - - [[ ${#} -eq 3 ]] || die "${FUNCNAME}: invalid arguments" - local version=${1} - local image=${2} - local map=${3} - - # if dracut is used in uefi=yes mode, initrd will actually - # be a combined kernel+initramfs UEFI executable. we can easily - # recognize it by PE magic (vs cpio for a regular initramfs) - local initrd=${image%/*}/initrd - local magic - [[ -s ${initrd} ]] && read -n 2 magic < "${initrd}" - if [[ ${magic} == MZ ]]; then - einfo "Combined UEFI kernel+initramfs executable found" - # install the combined executable in place of kernel - image=${initrd%/*}/uki.efi - mv "${initrd}" "${image}" || die - # We moved the generated initrd, prevent dracut from running again - # https://github.com/dracutdevs/dracut/pull/2405 - shopt -s nullglob - local plugins=() - for file in "${EROOT}"/etc/kernel/install.d/*.install; do - plugins+=( "${file}" ) - done - for file in "${EROOT}"/usr/lib/kernel/install.d/*.install; do - if ! has "${file##*/}" 50-dracut.install 51-dracut-rescue.install "${plugins[@]##*/}"; then - plugins+=( "${file}" ) - fi - done - shopt -u nullglob - export KERNEL_INSTALL_PLUGINS="${KERNEL_INSTALL_PLUGINS} ${plugins[@]}" - fi - - if [[ ${KERNEL_IUSE_SECUREBOOT} ]]; then - # Kernel-install requires uki's are named uki.efi, sign in-place - secureboot_sign_efi_file "${image}" "${image}" - fi - - ebegin "Installing the kernel via installkernel" - # note: .config is taken relatively to System.map; - # initrd relatively to bzImage - installkernel "${version}" "${image}" "${map}" - eend ${?} || die -n "Installing the kernel failed" -} - -# @FUNCTION: dist-kernel_reinstall_initramfs -# @USAGE: -# @DESCRIPTION: -# Rebuild and install initramfs for the specified dist-kernel. -# is the kernel source directory (${KV_DIR} from linux-info), -# while is the full kernel version (${KV_FULL}). -# The function will determine whether is actually -# a dist-kernel, and whether initramfs was used. -# -# This function is to be used in pkg_postinst() of ebuilds installing -# kernel modules that are included in the initramfs. -dist-kernel_reinstall_initramfs() { - debug-print-function ${FUNCNAME} "${@}" - - [[ ${#} -eq 2 ]] || die "${FUNCNAME}: invalid arguments" - local kernel_dir=${1} - local ver=${2} - - local image_path=${kernel_dir}/$(dist-kernel_get_image_path) - local initramfs_path=${image_path%/*}/initrd - if [[ ! -f ${image_path} ]]; then - eerror "Kernel install missing, image not found:" - eerror " ${image_path}" - eerror "Initramfs will not be updated. Please reinstall your kernel." - return - fi - if [[ ! -f ${initramfs_path} && ! -f ${initramfs_path%/*}/uki.efi ]]; then - einfo "No initramfs or uki found at ${image_path}" - return - fi - - dist-kernel_build_initramfs "${initramfs_path}" "${ver}" - dist-kernel_install_kernel "${ver}" "${image_path}" \ - "${kernel_dir}/System.map" -} - -# @FUNCTION: dist-kernel_PV_to_KV -# @USAGE: -# @DESCRIPTION: -# Convert a Gentoo-style ebuild version to kernel "x.y.z[-rcN]" version. -dist-kernel_PV_to_KV() { - debug-print-function ${FUNCNAME} "${@}" - - [[ ${#} -ne 1 ]] && die "${FUNCNAME}: invalid arguments" - local pv=${1} - - local kv=${pv%%_*} - [[ -z $(ver_cut 3- "${kv}") ]] && kv+=".0" - [[ ${pv} == *_* ]] && kv+=-${pv#*_} - echo "${kv}" -} - -_DIST_KERNEL_UTILS=1 -fi diff --git a/files/zfs/3602.2.0/overlay/eclass/linux-mod-r1.eclass b/files/zfs/3602.2.0/overlay/eclass/linux-mod-r1.eclass deleted file mode 100644 index 2a3dde6..0000000 --- a/files/zfs/3602.2.0/overlay/eclass/linux-mod-r1.eclass +++ /dev/null @@ -1,1252 +0,0 @@ -# Copyright 2023 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -# @ECLASS: linux-mod-r1.eclass -# @MAINTAINER: -# Ionen Wolkens -# Gentoo Kernel project -# @AUTHOR: -# Ionen Wolkens -# @SUPPORTED_EAPIS: 8 -# @PROVIDES: linux-info -# @BLURB: Functions for installing out-of-tree Linux kernel modules -# @DESCRIPTION: -# See the linux-mod-r1_src_compile function documentation for in-depth -# usage, and see the example further down for a quick overview. -# -# @SUBSECTION linux-mod -> linux-mod-r1 migration notes -# 0. Define a src_compile if missing, local variables below go there. -# 1. MODULE_NAMES="name(libdir:srcdir:objdir)" -# BUILD_TARGETS="target" -# -> local modlist=( name=libdir:srcdir:objdir:target(s) ) -# - try without :target first, it is now almost always unnecessary -# - srcdir defaults to the current directory, and note that paths -# can be relative to that (should typically *not* pass ${S}) -# 2. BUILD_PARAMS and/or BUILD_FIXES -# -> local modargs=( VAR="${KV_OUT_DIR}" ... ) -# - CC/LD and similar are unneeded, always passed (V=1 too) -# - eval (aka eval "${BUILD_PARAMS}") is /not/ used for this anymore -# 3. s/linux-mod_/linux-mod-r1/g -# 4. _preinst+_postrm can be dropped, keep linux-mod-r1_pkg_postinst -# 5. linux-mod-r1_src_install now runs einstalldocs, adjust as needed -# 6. if *not* using linux-mod-r1_src_compile/install, then refer to -# the eclass' 2nd example and ensure using modules_post_process -# 7. If any, clang<->gcc switching custom workarounds can be dropped -# 8. See MODULES_KERNEL_MAX/_MIN if had or need kernel version checks. -# -# Not an exhaustive list, verify that no installed files are missing -# after. Look for "command not found" errors in the build log too. -# -# Revision bumps are not strictly needed to migrate unless want to -# keep the old as fallback for regressions, kernel upgrades or the -# new IUSE=+strip will typically cause rebuilds either way. -# -# @EXAMPLE: -# -# If source directory S had a layout such as: -# - Makefile (builds a gentoo.ko in current directory) -# - gamepad/Makefile (want to install to kernel/drivers/hid) -# - gamepad/obj/ (the built gamepad.ko ends up here) -# -# ...and the Makefile uses the NIH_SOURCE variable to find where the -# kernel build directory is (aka KV_OUT_DIR, see linux-info.eclass) -# -# then: -# -# @CODE -# CONFIG_CHECK="INPUT_FF_MEMLESS" # gamepad needs it to rumble -# MODULES_KERNEL_MIN=5.4 # needs features introduced in 5.4 -# -# src_compile() { -# local modlist=( -# gentoo -# gamepad=kernel/drivers/hid:gamepad:gamepad/obj -# ) -# local modargs=( NIH_SOURCE="${KV_OUT_DIR}" ) -# -# linux-mod-r1_src_compile -# } -# @CODE -# -# Alternatively, if using the package's build system directly is -# more convenient, a typical example could be: -# -# @CODE -# src_compile() { -# MODULES_MAKEARGS+=( -# NIH_KDIR="${KV_OUT_DIR}" -# NIH_KSRC="${KV_DIR}" -# ) -# -# emake "${MODULES_MAKEARGS[@]}" -# } -# -# src_install() { -# emake "${MODULES_MAKEARGS[@]}" DESTDIR="${ED}" install -# modules_post_process # strip->sign->compress -# -# einstalldocs -# } -# @CODE -# -# Some extra make variables may be of interest: -# - INSTALL_MOD_PATH: sometime used as DESTDIR -# - INSTALL_MOD_DIR: equivalent to linux_moduleinto -# -# MODULES_MAKEARGS is set by the eclass to handle toolchain and, -# when installing, also attempts to disable automatic stripping, -# compression, signing, and depmod to let the eclass handle it. -# -# linux_domodule can alternatively be used to install a single module. -# -# (remember to ensure that linux-mod-r1_pkg_postinst is ran for depmod) - -case ${EAPI} in - 8) ;; - *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; -esac - -if [[ ! ${_LINUX_MOD_R1_ECLASS} ]]; then -_LINUX_MOD_R1_ECLASS=1 - -inherit edo linux-info multiprocessing toolchain-funcs - -IUSE="dist-kernel modules-sign +strip ${MODULES_OPTIONAL_IUSE}" - -RDEPEND=" - sys-apps/kmod[tools] - dist-kernel? ( virtual/dist-kernel:= ) -" -DEPEND=" - virtual/linux-sources -" -BDEPEND=" - sys-apps/kmod[tools] - modules-sign? ( - dev-libs/openssl - virtual/pkgconfig - ) -" -IDEPEND=" - sys-apps/kmod[tools] -" - -if [[ -n ${MODULES_OPTIONAL_IUSE} ]]; then - : "${MODULES_OPTIONAL_IUSE#+}? ( | )" - RDEPEND=${_/|/${RDEPEND}} DEPEND=${_/|/${DEPEND}} \ - BDEPEND=${_/|/${BDEPEND}} IDEPEND=${_/|/${IDEPEND}} -fi - -# @ECLASS_VARIABLE: KERNEL_CHOST -# @USER_VARIABLE -# @DEFAULT_UNSET -# @DESCRIPTION: -# Can be set to the CHOST value to use when selecting the toolchain -# for building kernel modules. This is similar to setting the kernel -# build system's CROSS_COMPILE variable minus the trailing dash. -# -# If this does not auto-select the desired toolchain, finer control -# can be achieved by setting the not directly documented (but valid) -# variables: -# -# KERNEL_{CC,CXX,LD,AR,NM,OBJCOPY,OBJDUMP,READELF,STRIP} -# -# If in doubt, do not set any of this. -# -# Default if unset: auto-detection, typically same as the current CHOST - -# @ECLASS_VARIABLE: MODULES_EXTRA_EMAKE -# @USER_VARIABLE -# @DEFAULT_UNSET -# @DESCRIPTION: -# Extra arguments to pass to emake when building modules. -# Can contain arguments with quoted spaces, e.g. -# @CODE -# ..._EMAKE="KCFLAGS='-fzomg-optimize -fsuper-strict-aliasing' ..." -# @CODE - -# @ECLASS_VARIABLE: MODULES_I_WANT_FULL_CONTROL -# @USER_VARIABLE -# @DEFAULT_UNSET -# @DESCRIPTION: -# When set to a non-empty value, disables passing most of the eclass' -# toolchain defaults to emake when building modules. Basic eclass -# requirements, ebuilds' modargs, and users' MODULES_EXTRA_EMAKE are -# still used. -# -# Primarily intended for expert users with modified kernel Makefiles -# that want the Makefile's values to be used by default. -# -# May want to look at KERNEL_CHOST before considering this. - -# @ECLASS_VARIABLE: MODULES_SIGN_HASH -# @USER_VARIABLE -# @DEFAULT_UNSET -# @DESCRIPTION: -# Used with USE=modules-sign. Can be set to hash algorithm to use -# during signature generation. -# -# Rather than set this, it is recommended to select using the kernel's -# configuration to ensure proper support (e.g. CONFIG_MODULE_SIG_SHA256), -# and then it will be auto-detected here. -# -# Valid values: sha512,sha384,sha256,sha224,sha1 -# -# Default if unset: kernel CONFIG_MODULE_SIG_HASH's value - -# @ECLASS_VARIABLE: MODULES_SIGN_KEY -# @USER_VARIABLE -# @DEFAULT_UNSET -# @DESCRIPTION: -# Used with USE=modules-sign. Can be set to the path of the private -# key in PEM format to use, or a PKCS#11 URI. -# -# If path is relative (e.g. "certs/name.pem"), it is assumed to be -# relative to the kernel build directory being used. -# -# If the key requires a passphrase or PIN, the used kernel sign-file -# utility recognizes the KBUILD_SIGN_PIN environment variable. Be -# warned that the package manager may store this value in binary -# packages, database files, temporary files, and possibly logs. This -# eclass unsets the variable after use to mitigate the issue (notably -# for shared binary packages), but use this with care. -# -# Default if unset: kernel CONFIG_MODULE_SIG_KEY's value which itself -# defaults to certs/signing_key.pem - -# @ECLASS_VARIABLE: MODULES_SIGN_CERT -# @USER_VARIABLE -# @DESCRIPTION: -# Used with USE=modules-sign. Can be set to the path of the X.509 -# public key certificate to use. -# -# If path is relative (e.g. "certs/name.x509"), it is assumed to be -# relative to the kernel build directory being used. -: "${MODULES_SIGN_CERT:=certs/signing_key.x509}" - -# @ECLASS_VARIABLE: MODULES_KERNEL_MAX -# @DEFAULT_UNSET -# @DESCRIPTION: -# If set to a kernel version (format: 1, 1.2, or 1.2.3), will print a -# warning if the used version is greater than (ver_test -gt) to this -# value using the same amount of version components (i.e. MAX=1.2 -# allows 1.2.3, but MAX=1.2.2 does not). -# -# This should *only* be used for modules that are known to break -# frequently on kernel upgrades. If setting this to a non-LTS kernel, -# then should also take care to test and update this value regularly -# with new major kernel releases not to let the warning become stale -# and ignored by users. -# -# Not fatal to allow users to try or self-patch easily, but the (large) -# warning is difficult to miss. If need a fatal check for more serious -# issues (e.g. runtime filesystem corruption), please do it manually. -# -# This is intended to reduce the amount of bug reports for recurring -# expected issues that can be easily mitigated by using LTS kernels -# and waiting for new releases. -# -# If used, must be set before linux-mod-r1_pkg_setup is called. - -# @ECLASS_VARIABLE: MODULES_KERNEL_MIN -# @DEFAULT_UNSET -# @DESCRIPTION: -# If set to a kernel version (format: 1, 1.2, or 1.2.3), will abort if -# the used version is less than (ver_test -lt) this value. -# -# Should only be used if known broken, or if upstream recommends a sane -# minimum. Not particularly necessary for kernels that are no longer -# in the tree. -# -# If used, must be set before linux-mod-r1_pkg_setup is called. - -# @ECLASS_VARIABLE: MODULES_OPTIONAL_IUSE -# @PRE_INHERIT -# @DEFAULT_UNSET -# @DESCRIPTION: -# May contain a single flag to be added to IUSE optionally prefixed -# with a + sign to enable it by default. Doing so makes *all* of -# linux-mod-r1's functions and dependencies a no-op unless the flag -# is enabled. This includes phases, e.g. linux-mod-r1_pkg_setup will -# not process CONFIG_CHECK unless the flag is set. -# -# The typical recommended value is "+modules" (global IUSE). -# -# Note that modules being optional can be useful even if user space -# tools require them (e.g. installing in a chroot or prefix when the -# modules are loaded on the host, saves setting up linux sources). -# However, if tools are non-trivial to build, it may be preferable -# to split into two packages than use this variable due to requiring -# rebuilds every kernel upgrades. - -# @ECLASS_VARIABLE: MODULES_MAKEARGS -# @OUTPUT_VARIABLE -# @DESCRIPTION: -# Will be set after linux-mod-r1_pkg_setup has been called. Contains -# arguments that should be passed to emake when building or installing -# modules. -# -# Modifying this variable is acceptable (e.g. to append kernel source -# arguments) but, if using linux-mod-r1_src_compile, setting modargs -# is the intended method seen as cleaner and less error-prone. - -# @FUNCTION: linux-mod-r1_pkg_setup -# @DESCRIPTION: -# Required before using other functions from this eclass, and will: -# 1. run linux-info_pkg_setup (see linux-info.eclass) -# -> implies processing CONFIG_CHECK, and providing KV_ variables -# (MODULES and TRIM_UNUSED_KSYMS are always checked) -# 2. prepare toolchain to match the kernel -# -> sets KERNEL_{CHOST,CC,CXX,LD,AR,NM,OBJCOPY,OBJDUMP,READELF,STRIP} -# -> also sets MODULES_MAKEARGS array with, e.g. CC="${KERNEL_CC}" -# (normally these should not be used directly, for custom builds) -# 3. perform various sanity checks to fail early on issues -linux-mod-r1_pkg_setup() { - debug-print-function ${FUNCNAME[0]} "${@}" - [[ ${MERGE_TYPE} != binary ]] || return 0 - _MODULES_GLOBAL[ran:pkg_setup]=1 - _modules_check_function ${#} 0 0 || return 0 - _modules_check_migration - - _modules_prepare_kernel - _modules_prepare_sign - _modules_prepare_toolchain - - _modules_set_makeargs - - _modules_sanity_gccplugins -} - -# @FUNCTION: linux-mod-r1_src_compile -# @DESCRIPTION: -# Builds modules, see the eclass' example for a quick overview. -# Uses the variables modlist and modargs as described below: -# -# * local modlist=( ... ) - list of modules to build, set as: -# -# module-name=install-dir:source-dir:build-dir:make-target -# -# > module-name: Resulting name, aka .ko (required). -# -# > install-dir: Kernel modules sub-directory to install the module -# to (/lib/modules/version//name.ko). Will be used when -# run linux-mod-r1_src_install. May want to consider the values of -# INSTALL_MOD_DIR(Makefile) or DEST_MODULE_LOCATION(dkms.conf) if it -# exists, but it can be anything. -# -> Default: extra -# -# Warning: Changing this location may leave stale modules until a -# kernel upgrade as the package manager does not typically delete -# old modules and only does overwrite on rebuilds. -# -# > source-dir: Directory containing the Makefile to build the module. -# Path can be relative to the current directory or absolute. -# -> Default: current directory -# -# > build-dir: Directory that will hold the built module-name.ko. -# -> Default: same as source-dir's value -# -# > make-target: Almost always unneeded but, if defaults are not right, -# then can specify the Makefile's target(s) to build the module/extras. -# Multiple targets can be used with spaces, e.g. :"first second". -# -> Default: specially tries modules, module, .ko, default, -# all, empty target, and runs the first found usable -# -# Missing elements results in defaults being used, e.g. this is valid: -# modlist=( name1 name2=:source name3=install::build ) -# -# * local modargs=( ... ) - extra arguments to pass to emake -# -# Makefile should notably be inspected for which variable it uses -# to find the kernel's build directory then, e.g. KDIR="${KV_OUT_DIR}" -# as appropriate. Note that typically want to pass KV_OUT_DIR(build) -# rather than KV_DIR(sources) if not both. This allows users to do -# out-of-source kernel builds and still build modules. -# -# Passing common toolchain variables such as CC or LD is not needed -# here as they are passed by default. -# -# --- -# -# Allowed to be called multiple times with a different modlist if need -# different make arguments per modules or intermediate steps -- albeit, -# if atypical, may want to build manually (see eclass' example). -linux-mod-r1_src_compile() { - debug-print-function ${FUNCNAME[0]} "${@}" - _modules_check_function ${#} 0 0 || return 0 - - [[ ${modlist@a} == *a* && ${#modlist[@]} -gt 0 ]] || - die "${FUNCNAME[0]} was called without a 'modlist' array" - - # run this again to verify built files access with src_compile's user - _modules_sanity_kernelbuilt - - local -a emakeargs=( "${MODULES_MAKEARGS[@]}" ) - [[ ${modargs@a} == *a* ]] && emakeargs+=( "${modargs[@]}" ) - - local -A built=() - local build mod name target - for mod in "${modlist[@]}"; do - # note modlist was not made an associative array ([name]=) to preserve - # ordering, but is still using = to improve readability - name=${mod%%=*} - [[ -n ${name} && ${name} != *:* ]] || die "invalid mod entry '${mod}'" - - # 0:install-dir 1:source-dir 2:build-dir 3:make-target(s) - mod=${mod#"${name}"} - IFS=: read -ra mod <<<"${mod#=}" - [[ ${#mod[@]} -le 4 ]] || die "too many ':' in ${name}'s modlist" - - [[ ${mod[1]:=${PWD}} != /* ]] && mod[1]=${PWD}/${mod[1]} - [[ ${mod[2]:=${mod[1]}} != /* ]] && mod[2]=${PWD}/${mod[2]} - _MODULES_INSTALL[${mod[2]}/${name}.ko]=${mod[0]:-extra} - - pushd "${mod[1]}" >/dev/null || die - - if [[ -z ${mod[3]} ]]; then - # guess between commonly used targets if none given, fallback to - # an empty target without trying to see the error output - for target in module{s,} "${name}".ko default all; do - nonfatal emake "${emakeargs[@]}" -q "${target}" &>/dev/null - if [[ ${?} -eq 1 ]]; then - mod[3]=${target} - break - fi - done - fi - - # sometime modules are all from same source dir and built all at once, - # make will not rebuild either way but can skip the unnecessary noise - build= - for target in ${mod[3]:-&}; do - if ! has "${target}" ${built[${mod[1]}]}; then - build=1 - built[${mod[1]}]+=" ${target} " - fi - done - - if [[ ${build} ]]; then - einfo "Building ${name} module in ${mod[1]} ..." - - # allow word splitting for rare cases of multiple targets - emake "${emakeargs[@]}" ${mod[3]} - else - einfo "Building ${name} module in ${mod[1]} ... already done." - fi - - popd >/dev/null || die - done -} - -# @FUNCTION: linux-mod-r1_src_install -# @DESCRIPTION: -# Installs modules built by linux-mod-r1_src_compile using -# linux_domodule, then runs modules_post_process and einstalldocs. -linux-mod-r1_src_install() { - debug-print-function ${FUNCNAME[0]} "${@}" - _modules_check_function ${#} 0 0 || return 0 - - (( ${#_MODULES_INSTALL[@]} )) || - die "${FUNCNAME[0]} was called without running linux-mod-r1_src_compile" - - ( - for mod in "${!_MODULES_INSTALL[@]}"; do - linux_moduleinto "${_MODULES_INSTALL[${mod}]}" - linux_domodule "${mod}" - done - ) - - modules_post_process - - einstalldocs -} - -# @FUNCTION: linux-mod-r1_pkg_postinst -# @DESCRIPTION: -# Updates module dependencies using depmod. -linux-mod-r1_pkg_postinst() { - debug-print-function ${FUNCNAME[0]} "${@}" - _modules_check_function ${#} 0 0 || return 0 - - _modules_update_depmod - - # post_process ensures modules were installed and that the eclass' USE - # are likely not no-ops (unfortunately postinst itself may be missed) - [[ -v _MODULES_GLOBAL[ran:post_process] ]] || - eqawarn "QA Notice: neither linux-mod-r1_src_install nor modules_post_process were used" -} - -# @FUNCTION: linux_domodule -# @USAGE: ... -# @DESCRIPTION: -# Installs Linux modules (.ko files). -# -# See also linux_moduleinto. -linux_domodule() { - debug-print-function ${FUNCNAME[0]} "${@}" - _modules_check_function ${#} 1 '' "..." || return 0 - ( - # linux-mod-r0 formerly supported INSTALL_MOD_PATH (bug #642240), but - # this been judged messy to integrate consistently as not everything - # uses this function and build systems sometime mix it with DESTDIR - # (try ROOT if need to install somewhere else instead) - insinto "/lib/modules/${KV_FULL}/${_MODULES_GLOBAL[moduleinto]:-extra}" - doins "${@}" - ) -} - -# @FUNCTION: linux_moduleinto -# @USAGE: -# @DESCRIPTION: -# Directory to install modules into when calling linux_domodule. -# Relative to kernel modules path as in: -# ${ED}/lib/modules/${KV_FULL}/ -# -# Can contain subdirectories, e.g. kernel/fs. -# -# If not called, defaults to "extra". On the kernel build system, -# this is like setting INSTALL_MOD_DIR which has the same default -# for external modules. -linux_moduleinto() { - debug-print-function ${FUNCNAME[0]} "${@}" - _modules_check_function ${#} 1 1 "" || return 0 - _MODULES_GLOBAL[moduleinto]=${1} -} - -# @FUNCTION: modules_post_process -# @USAGE: [] -# @DESCRIPTION: -# Strip, sign, verify, and compress all .ko modules found under -# . Should typically *not* be called directly as it will -# be run by linux-mod-r1_src_install. This is intended for use -# when modules were installed some other way. -# -# should exist under ${ED}. -# Defaults to /lib/modules/${KV_FULL}. -# -# Filenames may change due to compression, so any operations on -# these should be performed prior. -# -# Warning: This will abort if no modules are found, which can happen -# if modules were unexpectedly pre-compressed possibly due to using -# make install without passing MODULES_MAKEARGS to disable it. -modules_post_process() { - debug-print-function ${FUNCNAME[0]} "${@}" - _modules_check_function ${#} 0 1 '[]' || return 0 - [[ ${EBUILD_PHASE} == install ]] || - die "${FUNCNAME[0]} can only be called in the src_install phase" - - local path=${ED}${1-/lib/modules/${KV_FULL}} - local -a mods - [[ -d ${path} ]] && mapfile -td '' mods < <( - find "${path}" -type f -name '*.ko' -print0 || die - ) - (( ${#mods[@]} )) || - die "${FUNCNAME[0]} was called with no installed modules under ${path}" - - # TODO?: find way for sane use with dracut (its 90kernel-modules-extra - # parses depmod.d files directly and assumes should include its modules - # which can lead to unnecessarily increased size or stale modules) -# _modules_process_depmod.d "${mods[@]#"${path}/"}" - - _modules_process_strip "${mods[@]}" - _modules_process_sign "${mods[@]}" - _modules_sanity_modversion "${mods[@]}" # after strip/sign in case broke it - _modules_process_compress "${mods[@]}" - - _MODULES_GLOBAL[ran:post_process]=1 -} - -# @ECLASS_VARIABLE: _MODULES_GLOBAL -# @INTERNAL -# @DESCRIPTION: -# General use associative array to avoid defining separate globals. -declare -gA _MODULES_GLOBAL=() - -# @ECLASS_VARIABLE: _MODULES_INSTALL -# @INTERNAL -# @DESCRIPTION: -# List of modules from linux-mod-r1_src_compile to be installed. -declare -gA _MODULES_INSTALL=() - -# @FUNCTION: _modules_check_function -# @USAGE: [ []] -# @RETURN: 0 or 1 if caller should do nothing -# @INTERNAL -# @DESCRIPTION: -# Checks for MODULES_OPTIONAL_IUSE, and aborts if amount of arguments -# does not add up or if it was called before linux-mod-r1_pkg_setup. -_modules_check_function() { - [[ -z ${MODULES_OPTIONAL_IUSE} ]] || - use "${MODULES_OPTIONAL_IUSE#+}" || return 1 - - [[ ${#} == 0 || ${1} -ge ${2} && ( ! ${3} || ${1} -le ${3} ) ]] || - die "Usage: ${FUNCNAME[1]} ${4-(no arguments)}" - - [[ -v _MODULES_GLOBAL[ran:pkg_setup] ]] || - die "${FUNCNAME[1]} was called without running linux-mod-r1_pkg_setup" -} - -# @FUNCTION: _modules_check_migration -# @INTERNAL -# @DESCRIPTION: -# Aborts if see obsolete variables from the linux-mod-r0 eclass being -# used, likely due to an incomplete migration. This function should -# eventually be removed after linux-mod-r0 is @DEAD not to fail for -# nothing if users happen to have these in their environment given the -# naming for some is a bit generic. -_modules_check_migration() { - _modules_check_var() { - [[ -z ${!1} ]] || - die "${1} is obsolete, see ${2} in linux-mod-r1 eclass docs" - } - # the 'I' on this one is notably sneaky and could silently be ignored - _modules_check_var MODULES_OPTIONAL_USE MODULES_OPTIONAL_IUSE - _modules_check_var MODULES_OPTIONAL_USE_IUSE_DEFAULT MODULES_OPTIONAL_IUSE - _modules_check_var BUILD_PARAMS modargs - _modules_check_var BUILD_TARGETS modlist - _modules_check_var MODULE_NAMES modlist - [[ -z ${!MODULESD_*} ]] || - die "MODULESD_* variables are no longer supported, replace by handcrafted .conf files if needed" - - # Ignored variables: - # - BUILD_FIXES: seen in some ebuilds but was undocumented and linux-info - # still sets it preventing from blocking it entirely - # - ECONF_PARAMS: documented but was a no-op in linux-mod too -} - -# @FUNCTION: _modules_prepare_kernel -# @INTERNAL -# @DESCRIPTION: -# Handles linux-info bits to provide usable sources, KV_ variables, -# and CONFIG_CHECK use. -_modules_prepare_kernel() { - get_version - - # linux-info allows skipping checks if SKIP_KERNEL_CHECK is set and - # then require_configured_kernel will not abort, but no sources means - # 100% failure for building modules and so just abort now (the proper - # way to allow skipping sources here is MODULES_OPTIONAL_IUSE) - [[ -n ${KV_FULL} ]] || - die "kernel sources are required to build kernel modules" - - require_configured_kernel - - _modules_sanity_kernelbuilt - _modules_sanity_kernelversion - - # note: modules-specific check_modules_supported could probably be - # removed from linux-info in the future as this is a sufficient check - local CONFIG_CHECK="${CONFIG_CHECK} MODULES" - - # kernel will not typically know about symbols we use (bug #591832), - # but stay non-fatal if kernel has an exception list set (bug #759238) - # note: possible to bypass either way with CHECKCONFIG_DONOTHING=1 - if [[ $(linux_chkconfig_string UNUSED_KSYMS_WHITELIST) == \"+(?)\" ]]; then - CONFIG_CHECK+=" ~!TRIM_UNUSED_KSYMS" - else - CONFIG_CHECK+=" !TRIM_UNUSED_KSYMS" - fi - - linux-info_pkg_setup -} - -# @FUNCTION: _modules_prepare_sign -# @INTERNAL -# @DESCRIPTION: -# Determines arguments to pass to sign-file (hash/keys), and performs -# basic sanity checks to abort early if signing does not look possible. -_modules_prepare_sign() { - use modules-sign || return 0 - - _modules_sign_die() { - eerror "USE=modules-sign requires additional configuration, please see the" - eerror "kernel[1] documentation and the linux-mod-r1 eclass[2] user variables." - eerror "[1] https://www.kernel.org/doc/html/v${KV_MAJOR}.${KV_MINOR}/admin-guide/module-signing.html" - eerror "[2] https://devmanual.gentoo.org/eclass-reference/linux-mod-r1.eclass/index.html" - die "USE=modules-sign is set but ${*}" - } - - linux_chkconfig_present MODULE_SIG || - _modules_sign_die "CONFIG_MODULE_SIG is not set in the kernel" - - if [[ -z ${MODULES_SIGN_HASH} ]]; then - : "$(linux_chkconfig_string MODULE_SIG_HASH)" - MODULES_SIGN_HASH=${_//\"} - [[ -n ${MODULES_SIGN_HASH} ]] || - _modules_sign_die "CONFIG_MODULE_SIG_HASH is not set in the kernel" - fi - - if [[ -z ${MODULES_SIGN_KEY} ]]; then - : "$(linux_chkconfig_string MODULE_SIG_KEY)" - MODULES_SIGN_KEY=${_//\"} - [[ -n ${MODULES_SIGN_KEY} ]] || - _modules_sign_die "CONFIG_MODULE_SIG_KEY is not set in the kernel" - fi - - [[ ${MODULES_SIGN_KEY} != @(/|pkcs11:)* ]] && - MODULES_SIGN_KEY=${KV_OUT_DIR}/${MODULES_SIGN_KEY} - [[ ${MODULES_SIGN_CERT} != /* ]] && - MODULES_SIGN_CERT=${KV_OUT_DIR}/${MODULES_SIGN_CERT} - - # assumes users know what they are doing if using a pkcs11 URI - [[ ${MODULES_SIGN_KEY} == pkcs11:* || -f ${MODULES_SIGN_KEY} ]] || - _modules_sign_die "the private key '${MODULES_SIGN_KEY}' was not found" - [[ -f ${MODULES_SIGN_CERT} ]] || - _modules_sign_die "the public key certificate '${MODULES_SIGN_CERT}' was not found" -} - -# @FUNCTION: _modules_prepare_toolchain -# @INTERNAL -# @DESCRIPTION: -# Sets KERNEL_{CC,CXX,LD,AR,NM,OBJCOPY,OBJDUMP,READELF,STRIP} based on -# the kernel configuration and KERNEL_CHOST (also set if missing) that -# *should* be usable to build modules. -# -# Tries to match compiler type (gcc or clang), and major version. Will -# inform if matching was not possible likely due to the compiler being -# uninstalled. Users can set KERNEL_ variables themselves to override. -# -# These variables are normally manipulated by the kernel's LLVM=1 with -# the exception of CXX that is included anyway given *some* out-of-tree -# modules use it, e.g. nvidia-drivers[kernel-open]. -_modules_prepare_toolchain() { - # note that the kernel adds -m32/-m64/-m elf_x86_64/etc... for, e.g. - # toolchains defaulting to x32, but may need automagic here if need - # a different toolchain such as sys-devel/kgcc64 - [[ -z ${KERNEL_CHOST} ]] && linux_chkconfig_present 64BIT && - case ${CHOST} in - # matching kernel-build.eclass, see for details - hppa2.0-*) KERNEL_CHOST=${CHOST/2.0/64};; - esac - - # recognizing KERNEL_CHOST given CROSS_COMPILE seems too generic here, - # but should rarely be necessary unless different userland and kernel - : "${KERNEL_CHOST:=${CHOST}}" - - einfo "Preparing ${KERNEL_CHOST} toolchain for kernel modules (override with KERNEL_CHOST) ..." - - _modules_tc_best() { - [[ -z ${!1} ]] && read -r ${1} < <(type -P -- "${@:2}") - } - - local gccv clangv tool - if linux_chkconfig_present CC_IS_GCC; then - gccv=$(linux_chkconfig_string GCC_VERSION) - gccv=${gccv::2} # major version, will break on gcc-100... - # chost-gcc-ver > chost-gcc > gcc-ver > gcc - _modules_tc_best KERNEL_CC {"${KERNEL_CHOST}-",}gcc{"-${gccv}",} - _modules_tc_best KERNEL_CXX {"${KERNEL_CHOST}-",}g++{"-${gccv}",} - # unknown what was used exactly here, but prefer non-llvm with gcc - for tool in AR NM OBJCOPY OBJDUMP READELF STRIP; do - _modules_tc_best KERNEL_${tool} \ - {"${KERNEL_CHOST}-",}{gcc-,}${tool,,} - done - elif linux_chkconfig_present CC_IS_CLANG; then - clangv=$(linux_chkconfig_string CLANG_VERSION) - clangv=${clangv::2} - # like gcc, but try directories to get same version on all tools - # (not using get_llvm_prefix to avoid conflicts with ebuilds using - # llvm slots for non-modules reasons, e.g. sets llvm_check_deps) - _modules_tc_best KERNEL_CC \ - {"${BROOT}/usr/lib/llvm/${clangv}/bin/",}{"${KERNEL_CHOST}-",}clang{"-${clangv}",} - _modules_tc_best KERNEL_CXX \ - {"${BROOT}/usr/lib/llvm/${clangv}/bin/",}{"${KERNEL_CHOST}-",}clang++{"-${clangv}",} - for tool in AR NM OBJCOPY OBJDUMP READELF STRIP; do - _modules_tc_best KERNEL_${tool} \ - {"${BROOT}/usr/lib/llvm/${clangv}/bin/",}{"${KERNEL_CHOST}-",}{llvm-,}${tool,,} - done - fi - - if linux_chkconfig_present LD_IS_BFD; then - _modules_tc_best KERNEL_LD {"${KERNEL_CHOST}-",}ld.bfd - elif linux_chkconfig_present LD_IS_LLD; then - # also match with clang if it was used - _modules_tc_best KERNEL_LD \ - {${clangv+"${BROOT}/usr/lib/llvm/${clangv}/bin/"},}{"${KERNEL_CHOST}-",}ld.lld - fi - - # if any variables are still empty, fallback to normal defaults - local CHOST=${KERNEL_CHOST} - : "${KERNEL_CC:=$(tc-getCC)}" - : "${KERNEL_CXX:=$(tc-getCXX)}" - : "${KERNEL_LD:=$(tc-getLD)}" - : "${KERNEL_AR:=$(tc-getAR)}" - : "${KERNEL_NM:=$(tc-getNM)}" - : "${KERNEL_OBJCOPY:=$(tc-getOBJCOPY)}" - : "${KERNEL_OBJDUMP:=$(tc-getOBJDUMP)}" - : "${KERNEL_READELF:=$(tc-getREADELF)}" - : "${KERNEL_STRIP:=$(tc-getSTRIP)}" - - # for toolchain-funcs, uses CPP > CC but set both not to make assumptions - local CC=${KERNEL_CC} CPP="${KERNEL_CC} -E" LD=${KERNEL_LD} - - # show results, skip line wrap to avoid standing out too much - einfo "Toolchain picked for kernel modules (override with KERNEL_CC, _LD, ...):"\ - "'${KERNEL_CC}' '${KERNEL_CXX}' '${KERNEL_LD}' '${KERNEL_AR}'"\ - "'${KERNEL_NM}' '${KERNEL_OBJCOPY}' '${KERNEL_OBJDUMP}'"\ - "'${KERNEL_READELF}' '${KERNEL_STRIP}'" - - # hack: kernel adds --thinlto-cache-dir to KBUILD_LDFLAGS with ThinLTO - # resulting in sandbox violations and we cannot safely override that - # variable, using *both* {LDFLAGS_MODULE,ldflags-y}=--thinlto-cache-dir= - # can work but raises concerns about breaking packages that may use these - if linux_chkconfig_present LTO_CLANG_THIN && tc-ld-is-lld; then - KERNEL_LD=${T}/linux-mod-r1_ld.lld - printf '#!/usr/bin/env sh\nexec %s "${@}" --thinlto-cache-dir=\n' \ - "${LD}" > "${KERNEL_LD}" || die - chmod +x -- "${KERNEL_LD}" || die - fi - - # warn if final picked CC type or major version is mismatching, arguably - # should be fatal but not forcing given it is not *always* an issue - local warn - if [[ -v gccv ]]; then - if ! tc-is-gcc; then - warn="gcc-${gccv} but\n '${KERNEL_CC}' is not gcc" - elif [[ $(gcc-major-version) -ne "${gccv}" ]]; then - warn="gcc-${gccv} but\n '${KERNEL_CC}' is gcc-$(gcc-major-version)" - fi - elif [[ -v clangv ]]; then - if ! tc-is-clang; then - warn="clang-${clangv} but\n '${KERNEL_CC}' is not clang" - elif [[ $(clang-major-version) -ne "${clangv}" ]]; then - warn="clang-${clangv} but\n '${KERNEL_CC}' is clang-$(clang-major-version)" - fi - fi - - if [[ -v warn ]]; then - ewarn - ewarn "Warning: kernel ${KV_FULL} is built with ${warn}" - ewarn "This *could* result in build issues or other incompatibilities." - ewarn "It is recommended to either \`make clean\` and rebuild the kernel" - ewarn "with the current toolchain (for distribution kernels, re-installing" - ewarn "will do the same), or set the KERNEL_CC variable to point to the" - ewarn "same compiler. Note that when it is available, auto-selection is" - ewarn "attempted making the latter rarely needed." - ewarn - fi -} - -# @FUNCTION: _modules_process_compress -# @USAGE: ... -# @INTERNAL -# @DESCRIPTION: -# If enabled in the kernel configuration, this compresses the given -# modules using the same format. -_modules_process_compress() { - local -a compress - if linux_chkconfig_present MODULE_COMPRESS_XZ; then - compress=(xz -qT"$(makeopts_jobs)" --memlimit-compress=50%) - elif linux_chkconfig_present MODULE_COMPRESS_GZIP; then - if type -P pigz &>/dev/null; then - compress=(pigz -p"$(makeopts_jobs)") - else - compress=(gzip) - fi - elif linux_chkconfig_present MODULE_COMPRESS_ZSTD; then - compress=(zstd -qT"$(makeopts_jobs)" --rm) - fi - - if [[ -v compress ]]; then - # could fail, assumes have commands that were needed for the kernel - einfo "Compressing modules (matching the kernel configuration) ..." - edob "${compress[@]}" -- "${@}" - fi -} - -# @FUNCTION: _modules_process_depmod.d -# @USAGE: ... -# @INTERNAL -# @DESCRIPTION: -# Generate a depmod.d file to ensure priority if duplicate modules -# exist, such as stale modules in different directories, or to -# override the kernel's own modules. -_modules_process_depmod.d() { - ( - [[ ${SLOT%/*} == 0 ]] && slot= || slot=-${SLOT%/*} - insinto /lib/depmod.d - newins - ${PN}${slot}.conf < <( - echo "# Automatically generated by linux-mod-r1.eclass for ${CATEGORY}/${PN}" - for mod; do - [[ ${mod} =~ ^(.+)/(.+).ko$ ]] && - echo "override ${BASH_REMATCH[2]} ${KV_FULL} ${BASH_REMATCH[1]}" - done - ) - ) -} - -# @FUNCTION: _modules_process_sign -# @USAGE: ... -# @INTERNAL -# @DESCRIPTION: -# Cryptographically signs the given modules when USE=modules-sign is -# enabled. -_modules_process_sign() { - use modules-sign || return 0 - - # scripts/sign-file used to be a perl script but is now written in C, - # and it could either be missing or broken given it links with openssl - # (no subslot rebuilds on kernel sources), trivial to compile regardless - local sign= - if [[ -f ${KV_DIR}/scripts/sign-file.c ]]; then - sign=${T}/linux-mod-r1_sign-file - ( - # unfortunately using the kernel's Makefile is inconvenient (no - # simple build target for this), may need revisiting on changes - einfo "Compiling sign-file ..." - tc-export_build_env - nonfatal edob $(tc-getBUILD_CC) ${BUILD_CFLAGS} ${BUILD_CPPFLAGS} \ - $($(tc-getBUILD_PKG_CONFIG) --cflags libcrypto) \ - ${BUILD_LDFLAGS} -o "${sign}" "${KV_DIR}"/scripts/sign-file.c \ - $($(tc-getBUILD_PKG_CONFIG) --libs libcrypto || echo -lcrypto) - ) || { - einfo "Trying fallback ..." - sign= - } - fi - - if [[ -z ${sign} ]]; then - if [[ -x ${KV_OUT_DIR}/scripts/sign-file ]]; then - sign=${KV_OUT_DIR}/scripts/sign-file # try if built - elif [[ -x ${KV_DIR}/scripts/sign-file ]]; then - sign=${KV_DIR}/scripts/sign-file # old kernel (... -# @INTERNAL -# @DESCRIPTION: -# Strips the given modules of unneeded symbols when USE=strip is -# enabled, and informs the package manager not to regardless. -_modules_process_strip() { - # letting the package manager handle this complicates scenarios - # where we want to either compress the pre-stripped module, or - # sign the module without its signature becoming invalid on merge - dostrip -x "${@#"${ED}"}" - - if use strip; then - einfo "Stripping modules ..." - edob "${KERNEL_STRIP}" --strip-unneeded -- "${@}" - fi -} - -# @FUNCTION: _modules_sanity_gccplugins -# @INTERNAL -# @DESCRIPTION: -# Performs a basic build test to detect GCC plugins mismatch issues -# and, if so, aborts with explanation given it often confuses users. -# -# Using mismatching gcc can sometime work to build modules, but if -# GCC plugins are enabled it will almost always be an error. -# -# Note: may need occasional review to ensure the test still works by: -# enabling a GCC plugin in the kernel, building with older GCC, -# then building a module by setting KERNEL_CC=gcc-. -_modules_sanity_gccplugins() { - linux_chkconfig_present GCC_PLUGINS || return 0 - - local tmp=${T}/linux-mod-r1_gccplugins - mkdir -p -- "${tmp}" || die - - echo "obj-m += test.o" > "${tmp}"/Kbuild || die - :> "${tmp}"/test.c || die - - # always fails, but interested in the stderr messages - local output=$( - cd -- "${KV_OUT_DIR}" && # fwiw skip non-POSIX -C in eclasses - LC_ALL=C nonfatal emake "${MODULES_MAKEARGS[@]}" M="${tmp}" \ - 2>&1 >/dev/null - ) - - if [[ ${output} == *"error: incompatible gcc/plugin version"* ]]; then - eerror "GCC_PLUGINS is enabled in the kernel and plugin version mismatch issues" - eerror "have been detected. Please \`make clean\` and rebuild the kernel using" - eerror "the current version of GCC (or re-install for distribution kernels)." - die "kernel ${KV_FULL} needs to be rebuilt" - fi -} - -# @FUNCTION: _modules_sanity_kernelbuilt -# @INTERNAL -# @DESCRIPTION: -# Checks if the kernel seems fully built by having a Module.symvers -# that is also readable, abort otherwise. -# -# About readability, occasionally users build their kernel as root with -# umask 0077 and then the package manager's user cannot read built files -# leaving them confused. -# -# Given user and access can very between phases (notably src_compile), -# it makes sense to run this check more than once. -# -# Note: -# This is an alternate version of linux-info's check_kernel_built -# which probably will not need to exist there if linux-mod-r0 is -# gone, error it gives is also modules-specific and fits better here. -# -# The old check_kernel_built checks version.h and suggests running -# modules_prepare if missing, but that does not create Module.symvers. -# Nowadays the kernel makes unresolved symbols fatal by default -# meaning that all modules will fail unless KBUILD_MODPOST_WARN=1 -# which seem questionable to support. So rather than version.h, this -# checks and require Module.symvers, and suggests a full build if -# missing (if really must, users can bypass by touching the file). -# nvidia-drivers (for one) further checks this file directly to do -# configure tests that will break badly without. -_modules_sanity_kernelbuilt() { - local symvers=${KV_OUT_DIR}/Module.symvers - - if [[ ! -f ${symvers} ]]; then - eerror "'${symvers}' was not found implying that the" - eerror "linux-${KV_FULL} tree at that location has not been built." - eerror - eerror "Please verify that this is the intended kernel version, then perform" - eerror "a full build[1] (i.e. make && make modules_install && make install)." - eerror - eerror "Alternatively, consider a distribution kernel[2] that does not need" - eerror "these manual steps (e.g. sys-kernel/gentoo-kernel or gentoo-kernel-bin)." - eerror - eerror "[1] https://wiki.gentoo.org/wiki/Kernel/Configuration#Build" - eerror "[2] https://wiki.gentoo.org/wiki/Project:Distribution_Kernel" - die "built kernel sources are required to build kernel modules" - fi - - if [[ ! -r ${symvers} ]]; then - eerror "'${symvers}' exists but cannot be read by the" - eerror "user id(${EUID}) of the package manager, likely implying no world" - eerror "read access permissions:" - eerror - eerror " $(ls -l -- "${symvers}")" - eerror - eerror "Causes may vary, but a common one is building the kernel with a umask" - eerror "value of '0077' rather than the more typical '0022' (run the \`umask\`" - eerror "command to confirm, as root if was building the kernel using it)." - eerror - eerror "Many other files are likely affected and will lead to build failures." - eerror "It is recommended to clean the sources and rebuild with \`umask 0022\`" - eerror "rather than attempt to fix the permissions manually." - die "no read access permission to the generated kernel files" - fi -} - -# @FUNCTION: _modules_sanity_kernelversion -# @INTERNAL -# @DESCRIPTION: -# Prints a warning if the kernel version is greater than to -# MODULES_KERNEL_MAX (while only considering same amount of version -# components), or aborts if it is less than MODULES_KERNEL_MIN -_modules_sanity_kernelversion() { - local kv=${KV_MAJOR}.${KV_MINOR}.${KV_PATCH} - - if [[ -n ${MODULES_KERNEL_MIN} ]] && - ver_test "${kv}" -lt "${MODULES_KERNEL_MIN}" - then - eerror "${P} requires a kernel version of at least >=${MODULES_KERNEL_MIN}," - eerror "but the current kernel is ${KV_FULL}. Please update." - die "kernel ${KV_FULL} is too old" - fi - - if [[ -n ${MODULES_KERNEL_MAX} ]]; then - : "${MODULES_KERNEL_MAX//[^.]/}" - local -i count=${#_} - - if ver_test "$(ver_cut 1-$((count+1)) "${kv}")" \ - -gt "${MODULES_KERNEL_MAX}" - then - # add .x to 1 missing component to make, e.g. <=1.2.x more natural, - # not <1.3 given users sometimes see it as 1.3 support at a glance - local max=${MODULES_KERNEL_MAX} - [[ ${count} -lt 2 ]] && max+=.x - - ewarn - ewarn " *** WARNING *** " - ewarn - ewarn "${PN} is known to break easily with new kernel versions and," - ewarn "with the current kernel (${KV_FULL}), it was either hardly" - ewarn "tested or is known broken. It is recommended to use one of:" - ewarn - # fwiw we do not know what is *actually* used or wanted even with - # the USE, so stay a bit vague and always mention both dist+sources - if use dist-kernel; then - ewarn " <=virtual/dist-kernel-${max} or" - else - ewarn " <=sys-kernel/gentoo-kernel-${max} or" - fi - ewarn " <=sys-kernel/gentoo-sources-${max}" - ewarn - ewarn "or equivalent rather than file downstream bug reports if run into" - ewarn "issues, then wait for upstream fixes and a new release. Ideally," - ewarn "with out-of-tree modules, use an LTS (Long Term Support) kernel" - ewarn "branch[1]. If in doubt, Gentoo's stable kernels are always LTS" - ewarn "and can be easily used even on ~testing systems." - ewarn - ewarn "[1] https://www.kernel.org/category/releases.html" - ewarn - fi - fi -} - -# @FUNCTION: _modules_sanity_modversion -# @USAGE: ... -# @INTERNAL -# @DESCRIPTION: -# Checks if the passed module(s) do not seem obviously broken and the -# builtin versions match ${KV_FULL}, otherwise die with an explanation. -# -# If receive a bug with a version error, an easy way to reproduce is to -# set KERNEL_DIR with the sources of a different kernel version than -# both the ones pointed by /usr/src/linux and `uname -r`. Refer to -# linux-mod-r1_src_compile's modargs in the eclass docs for fixing. -_modules_sanity_modversion() { - local mod ver - for mod; do - # modinfo can read different-arch modules, being fatal *should* be safe - # and serve as a basic sanity check to ensure the module is valid - read -rd ' ' ver < <( - LC_ALL=C modinfo -F vermagic -- "${mod}" || - die "modinfo failed to read module '${mod}' (broken module?)" - ) - [[ -n ${ver} ]] || - die "modinfo found no kernel version in '${mod}' (broken module?)" - - if [[ ${ver} != "${KV_FULL}" ]]; then - eerror "A module seem to have been built for kernel version '${ver}'" - eerror "while it was meant for '${KV_FULL}'. This may indicate an" - eerror "ebuild issue (e.g. used runtime \`uname -r\` kernel rather than" - eerror "the chosen sources). Please report this to the ebuild's maintainer." - die "module and source version mismatch in '${mod}'" - fi - done -} - -# @FUNCTION: _modules_set_makeargs -# @INTERNAL -# @DESCRIPTION: -# Sets the MODULES_MAKEARGS global array. -_modules_set_makeargs() { - MODULES_MAKEARGS=( - ARCH="$(tc-arch-kernel)" - - V=1 - # normally redundant with V, but some custom Makefiles override it - KBUILD_VERBOSE=1 - - # unrealistic when building modules that often have slow releases, - # but note that the kernel will still pass some -Werror=bad-thing - CONFIG_WERROR= - - # these are only needed if using these arguments for installing, lets - # eclass handle strip, sign, compress, and depmod (CONFIG_ should - # have no impact on building, only used by Makefile.modinst) - CONFIG_MODULE_{SIG_ALL,COMPRESS_{GZIP,XZ,ZSTD}}= - DEPMOD=: - STRIP=: - ) - - if [[ ! ${MODULES_I_WANT_FULL_CONTROL} ]]; then - # many of these are unlikely to be useful here, but still trying to be - # complete given never know what out-of-tree modules may use - MODULES_MAKEARGS+=( - # wrt bug #550428, given most toolchain variables are being passed to - # make, setting CROSS in the environment would change very little - # (instead set KERNEL_CHOST which will affect other variables, - # or MODULES_I_WANT_FULL_CONTROL if do not want any of this) - CROSS_COMPILE="${KERNEL_CHOST}-" - - HOSTCC="$(tc-getBUILD_CC)" - HOSTCXX="$(tc-getBUILD_CXX)" - - # fwiw this function is not meant to pollute the environment - HOSTCFLAGS="$(tc-export_build_env; echo "${BUILD_CFLAGS}")" - HOSTCXXFLAGS="$(tc-export_build_env; echo "${BUILD_CXXFLAGS}")" - HOSTLDFLAGS="$(tc-export_build_env; echo "${BUILD_LDFLAGS}")" - - HOSTPKG_CONFIG="$(tc-getBUILD_PKG_CONFIG)" - - CC="${KERNEL_CC}" - CXX="${KERNEL_CXX}" - LD="${KERNEL_LD}" - AR="${KERNEL_AR}" - NM="${KERNEL_NM}" - OBJCOPY="${KERNEL_OBJCOPY}" - OBJDUMP="${KERNEL_OBJDUMP}" - READELF="${KERNEL_READELF}" - ) - fi - - # eval is to handle quoted spaces, die is for syntax errors - eval "MODULES_MAKEARGS+=( ${MODULES_EXTRA_EMAKE} )" || die -} - -# @FUNCTION: _modules_update_depmod -# @INTERNAL -# @DESCRIPTION: -# If possible, update module dependencies using depmod and System.map, -# otherwise prompt user to handle it. System.map may notably no longer -# be available on binary merges. -_modules_update_depmod() { - # prefer /lib/modules' path given it is what depmod operates on, - # and is mostly foolproof when it comes to ROOT (relative symlink) - local map=${EROOT}/lib/modules/${KV_FULL}/build/System.map - - if [[ ! -f ${map} ]]; then - # KV_OUT_DIR may still be right even on a different system, but state - # of (E)ROOT is unknown, e.g. could be from KERNEL_DIR=${OLDROOT}/... - map=${KV_OUT_DIR}/System.map - - # last resort, typical but may not be mounted/readable/installed - [[ ! -f ${map} ]] && - map=${EROOT}/boot/System.map-${KV_FULL} - fi - - einfo "Updating module dependencies for kernel ${KV_FULL} ..." - if [[ -f ${map} ]]; then - local depmodargs=( -ae -F "${map}" "${KV_FULL}" ) - - # for nicer postinst display, keep command shorter if EROOT is unset - [[ ${EROOT} ]] && - depmodargs+=( - -b "${EROOT}" - - # EROOT from -b is not used when looking for configuration - # directories, so pass the whole list from kmod's tools/depmod.c - --config="${EROOT}"/{etc,run,usr/local/lib,lib}/depmod.d - ) - - nonfatal edob depmod "${depmodargs[@]}" && return 0 - else - eerror - eerror "System.map for kernel ${KV_FULL} was not found, may be due to the" - eerror "built kernel sources no longer being available and lacking the fallback:" - eerror - eerror "${EROOT}/boot/System.map-${KV_FULL}" - fi - eerror - eerror "Some modules may not load without updating manually using depmod." -} - -fi - -EXPORT_FUNCTIONS pkg_setup src_compile src_install pkg_postinst diff --git a/files/zfs/3602.2.0/overlay/metadata/layout.conf b/files/zfs/3602.2.0/overlay/metadata/layout.conf deleted file mode 100644 index e85e826..0000000 --- a/files/zfs/3602.2.0/overlay/metadata/layout.conf +++ /dev/null @@ -1,4 +0,0 @@ -masters = portage-stable -thin-manifests = true -sign-commits = false -sign-manifests = false diff --git a/files/zfs/3602.2.0/overlay/profiles/repo_name b/files/zfs/3602.2.0/overlay/profiles/repo_name deleted file mode 100644 index e0f34db..0000000 --- a/files/zfs/3602.2.0/overlay/profiles/repo_name +++ /dev/null @@ -1 +0,0 @@ -zfs-overlay diff --git a/files/zfs/3602.2.0/overlay/sys-fs/udev-init-scripts/Manifest b/files/zfs/3602.2.0/overlay/sys-fs/udev-init-scripts/Manifest deleted file mode 100644 index 838b43a..0000000 --- a/files/zfs/3602.2.0/overlay/sys-fs/udev-init-scripts/Manifest +++ /dev/null @@ -1,2 +0,0 @@ -DIST udev-init-scripts-34.tar.gz 3660 BLAKE2B 954b003c78b31649fef69213a5424098f40e17e7ed11f4ec1443247950ea60db8536f37ca603caa06e5c9f8bab07b5ac3cb8c9435144532a97ff04836c24da49 SHA512 ed48bcd0815e235b2b3fa38f857cd97f164aac7c6ea805be87890eb06a0d52064bd733da240c6e2a34c8c73e10fd047b5e53096de06f17bc81d8266d70c0cc9d -DIST udev-init-scripts-35.tar.gz 3666 BLAKE2B fddae466428605ea930519e8a47e0ea91f89f9eacc1fd97c137d175142125b12c3d045aec68db35a463de444ac6d8c037cca55f9628f10576c968259d566a9e4 SHA512 da9d2093149967e2e1b9bc7190ddfd55a87c9ae2177e3216f7cb2694fc9b64037eb6f2599ad8a4b7594ef32ced88fbb319c92904bc72a81ea5404945f8a8378a diff --git a/files/zfs/3602.2.0/overlay/sys-fs/udev-init-scripts/metadata.xml b/files/zfs/3602.2.0/overlay/sys-fs/udev-init-scripts/metadata.xml deleted file mode 100644 index 31123d0..0000000 --- a/files/zfs/3602.2.0/overlay/sys-fs/udev-init-scripts/metadata.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - systemd@gentoo.org - - diff --git a/files/zfs/3602.2.0/overlay/sys-fs/udev-init-scripts/udev-init-scripts-34.ebuild b/files/zfs/3602.2.0/overlay/sys-fs/udev-init-scripts/udev-init-scripts-34.ebuild deleted file mode 100644 index 26fa347..0000000 --- a/files/zfs/3602.2.0/overlay/sys-fs/udev-init-scripts/udev-init-scripts-34.ebuild +++ /dev/null @@ -1,50 +0,0 @@ -# Copyright 1999-2021 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 -OLD_PN=udev-gentoo-scripts -OLD_P=${OLD_PN}-${PV} - -if [ "${PV}" = "9999" ]; then - EGIT_REPO_URI="git://anongit.gentoo.org/proj/${OLD_PN}.git" - inherit git-r3 -else - SRC_URI="https://gitweb.gentoo.org/proj/${OLD_PN}.git/snapshot/${OLD_P}.tar.gz -> ${P}.tar.gz" - S="${WORKDIR}/${OLD_P}" - KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86" -fi - -DESCRIPTION="udev startup scripts for openrc" -HOMEPAGE="https://wiki.gentoo.org/wiki/No_homepage" - -LICENSE="GPL-2" -SLOT="0" - -RESTRICT="test" - -RDEPEND=">=virtual/udev-217 - !$1/build.log 2>&1]) diff --git a/files/zfs/3602.2.0/overlay/sys-fs/zfs-kmod/metadata.xml b/files/zfs/3602.2.0/overlay/sys-fs/zfs-kmod/metadata.xml deleted file mode 100644 index 7e27782..0000000 --- a/files/zfs/3602.2.0/overlay/sys-fs/zfs-kmod/metadata.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - gyakovlev@gentoo.org - Georgy Yakovlev - - - sam@gentoo.org - Sam James - - - Prevents upgrading to an unsupported kernel version when combined with USE=dist-kernel - Pull dependencies and check kernel options required for root-on-zfs - - - https://github.com/openzfs/zfs/issues - https://openzfs.github.io/openzfs-docs - openzfs/zfs - - diff --git a/files/zfs/3602.2.0/overlay/sys-fs/zfs-kmod/zfs-kmod-2.1.12.ebuild b/files/zfs/3602.2.0/overlay/sys-fs/zfs-kmod/zfs-kmod-2.1.12.ebuild deleted file mode 100644 index 1f9ee3f..0000000 --- a/files/zfs/3602.2.0/overlay/sys-fs/zfs-kmod/zfs-kmod-2.1.12.ebuild +++ /dev/null @@ -1,178 +0,0 @@ -# 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-r1 multiprocessing - -DESCRIPTION="Linux ZFS kernel module for sys-fs/zfs" -HOMEPAGE="https://github.com/openzfs/zfs" - -MODULES_KERNEL_MAX=6.3 -MODULES_KERNEL_MIN=3.10 - -if [[ ${PV} == 9999 ]] ; then - EGIT_REPO_URI="https://github.com/openzfs/zfs.git" - inherit git-r3 - unset MODULES_KERNEL_MAX -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="${MODULES_KERNEL_MAX}" - # 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" -RESTRICT="test" - -BDEPEND=" - dev-lang/perl - app-alternatives/awk -" - -if [[ ${PV} != 9999 ]] ; then - BDEPEND+=" verify-sig? ( sec-keys/openpgp-keys-openzfs )" - - IUSE+=" +dist-kernel-cap" - RDEPEND=" - dist-kernel-cap? ( dist-kernel? ( - 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" -RESTRICT="test" - -BDEPEND=" - dev-lang/perl - app-alternatives/awk -" - -if [[ ${PV} != 9999 ]] ; then - BDEPEND+=" verify-sig? ( sec-keys/openpgp-keys-openzfs )" - - IUSE+=" +dist-kernel-cap" - RDEPEND=" - dist-kernel-cap? ( dist-kernel? ( - 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" -RESTRICT="test" - -BDEPEND=" - app-alternatives/awk - dev-lang/perl -" - -if [[ ${PV} != 9999 ]] ; then - BDEPEND+=" verify-sig? ( sec-keys/openpgp-keys-openzfs )" - - IUSE+=" +dist-kernel-cap" - RDEPEND=" - dist-kernel-cap? ( dist-kernel? ( - 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" -RESTRICT="test" - -BDEPEND=" - app-alternatives/awk - dev-lang/perl -" - -if [[ ${PV} != 9999 ]] ; then - BDEPEND+=" verify-sig? ( sec-keys/openpgp-keys-openzfs )" - - IUSE+=" +dist-kernel-cap" - RDEPEND=" - dist-kernel-cap? ( dist-kernel? ( - -Date: Thu, 30 Jun 2022 13:47:58 -0400 -Subject: [PATCH] dracut: fix boot on non-zfs-root systems - -Simply prevent overwriting root until it needs to be overwritten. - -Dracut could change this value before this module is called, but won't -change the kernel command line. - -Reviewed-by: Andrew J. Hesford -Signed-off-by: Toyam Cox -Closes #13592 ---- - contrib/dracut/90zfs/zfs-lib.sh.in | 10 +++++----- - 1 file changed, 5 insertions(+), 5 deletions(-) - -diff --git a/contrib/dracut/90zfs/zfs-lib.sh.in b/contrib/dracut/90zfs/zfs-lib.sh.in -index e44673c2d75..3a43e514d6f 100755 ---- a/contrib/dracut/90zfs/zfs-lib.sh.in -+++ b/contrib/dracut/90zfs/zfs-lib.sh.in -@@ -88,11 +88,11 @@ decode_root_args() { - return - fi - -- root=$(getarg root=) -+ xroot=$(getarg root=) - rootfstype=$(getarg rootfstype=) - - # shellcheck disable=SC2249 -- case "$root" in -+ case "$xroot" in - ""|zfs|zfs:|zfs:AUTO) - root=zfs:AUTO - rootfstype=zfs -@@ -100,7 +100,7 @@ decode_root_args() { - ;; - - ZFS=*|zfs:*) -- root="${root#zfs:}" -+ root="${xroot#zfs:}" - root="${root#ZFS=}" - root=$(echo "$root" | tr '+' ' ') - rootfstype=zfs -@@ -109,9 +109,9 @@ decode_root_args() { - esac - - if [ "$rootfstype" = "zfs" ]; then -- case "$root" in -+ case "$xroot" in - "") root=zfs:AUTO ;; -- *) root=$(echo "$root" | tr '+' ' ') ;; -+ *) root=$(echo "$xroot" | tr '+' ' ') ;; - esac - return 0 - fi - diff --git a/files/zfs/3602.2.0/overlay/sys-fs/zfs/metadata.xml b/files/zfs/3602.2.0/overlay/sys-fs/zfs/metadata.xml deleted file mode 100644 index 8518b15..0000000 --- a/files/zfs/3602.2.0/overlay/sys-fs/zfs/metadata.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - - - gyakovlev@gentoo.org - Georgy Yakovlev - - - sam@gentoo.org - Sam James - - - Disable dependency on sys-fs/zfs-kmod under the assumption that ZFS is part of the kernel source tree - Don't install python scripts (arcstat, dbufstat etc) and avoid dependency on dev-lang/python - Install zfs_key pam module, for automatically loading zfs encryption keys for home datasets - Enable dependencies required for booting off a pool containing a rootfs - Install regression test suite - - - https://github.com/openzfs/zfs/issues - https://openzfs.github.io/openzfs-docs - openzfs/zfs - - - OpenZFS is an advanced file system and volume manager which was originally developed - for Solaris and is now maintained by the OpenZFS community - - It includes the functionality of both traditional file systems and volume manager. - It has many advanced features including: - * Protection against data corruption. Integrity checking for both data and metadata. - * Continuous integrity verification and automatic “self-healing” repair - * Data redundancy with mirroring, RAID-Z1/2/3 [and DRAID] - * Support for high storage capacities — up to 256 trillion yobibytes (2^128 bytes) - * Space-saving with transparent compression using LZ4, GZIP or ZSTD - * Hardware-accelerated native encryption - * Efficient storage with snapshots and copy-on-write clones - * Efficient local or remote replication — send only changed blocks with ZFS send and receive - - The OpenZFS project brings together developers from the Linux, FreeBSD, illumos, MacOS, and Windows platforms. - OpenZFS is supported by a wide range of companies. - - diff --git a/files/zfs/3602.2.0/overlay/sys-fs/zfs/zfs-2.1.12.ebuild b/files/zfs/3602.2.0/overlay/sys-fs/zfs/zfs-2.1.12.ebuild deleted file mode 100644 index a3aa564..0000000 --- a/files/zfs/3602.2.0/overlay/sys-fs/zfs/zfs-2.1.12.ebuild +++ /dev/null @@ -1,312 +0,0 @@ -# Copyright 1999-2023 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -DISTUTILS_OPTIONAL=1 -DISTUTILS_USE_PEP517=setuptools -PYTHON_COMPAT=( python3_{10..11} ) - -inherit autotools bash-completion-r1 dist-kernel-utils distutils-r1 flag-o-matic linux-info pam systemd udev usr-ldscript - -DESCRIPTION="Userland utilities for ZFS Linux kernel module" -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_P="${P/_rc/-rc}" - SRC_URI="https://github.com/openzfs/${PN}/releases/download/${MY_P}/${MY_P}.tar.gz" - SRC_URI+=" verify-sig? ( https://github.com/openzfs/${PN}/releases/download/${MY_P}/${MY_P}.tar.gz.asc )" - S="${WORKDIR}/${P%_rc?}" - - if [[ ${PV} != *_rc* ]]; then - KEYWORDS="amd64 arm64 ppc64 ~riscv ~sparc" - fi -fi - -LICENSE="BSD-2 CDDL MIT" -# just libzfs soname major for now. -# possible candidates: libuutil, libzpool, libnvpair. Those do not provide stable abi, but are considered. -# see libsoversion_check() below as well -SLOT="0/5" -IUSE="custom-cflags debug dist-kernel kernel-builtin minimal nls pam python +rootfs selinux test-suite" - -DEPEND=" - net-libs/libtirpc:= - sys-apps/util-linux - sys-libs/zlib - virtual/libudev:= - dev-libs/openssl:0= - !minimal? ( ${PYTHON_DEPS} ) - pam? ( sys-libs/pam ) - python? ( - $(python_gen_cond_dep 'dev-python/cffi[${PYTHON_USEDEP}]' 'python*') - ) -" - -BDEPEND="app-alternatives/awk - virtual/pkgconfig - nls? ( sys-devel/gettext ) - python? ( - ${DISTUTILS_DEPS} - || ( - dev-python/packaging[${PYTHON_USEDEP}] - dev-python/distlib[${PYTHON_USEDEP}] - ) - ) -" - -if [[ ${PV} != "9999" ]] ; then - BDEPEND+=" verify-sig? ( sec-keys/openpgp-keys-openzfs )" -fi - -# awk is used for some scripts, completions, and the Dracut module -RDEPEND="${DEPEND} - !kernel-builtin? ( ~sys-fs/zfs-kmod-${PV}:= ) - !prefix? ( virtual/udev ) - sys-fs/udev-init-scripts - app-alternatives/awk - dist-kernel? ( virtual/dist-kernel:= ) - rootfs? ( - app-arch/cpio - app-misc/pax-utils - ) - selinux? ( sec-policy/selinux-zfs ) - test-suite? ( - app-shells/ksh - sys-apps/kmod[tools] - sys-apps/util-linux - sys-devel/bc - sys-block/parted - sys-fs/lsscsi - sys-fs/mdadm - sys-process/procps - ) -" - -# PDEPEND in this form is needed to trick portage suggest -# enabling dist-kernel if only 1 package have it set, without suggesting to disable -PDEPEND="dist-kernel? ( ~sys-fs/zfs-kmod-${PV}[dist-kernel] )" - -REQUIRED_USE=" - !minimal? ( ${PYTHON_REQUIRED_USE} ) - python? ( !minimal ) - test-suite? ( !minimal ) -" - -RESTRICT="test" - -PATCHES=( - # bug #854333 - "${FILESDIR}"/2.1.5-r2-dracut-non-root.patch - - "${FILESDIR}"/2.1.5-dracut-zfs-missing.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() { - if use kernel_linux; then - linux-info_pkg_setup - - if ! linux_config_exists; then - ewarn "Cannot check the linux kernel configuration." - else - if use test-suite; then - if linux_chkconfig_present BLK_DEV_LOOP; then - eerror "The ZFS test suite requires loop device support enabled." - eerror "Please enable it:" - eerror " CONFIG_BLK_DEV_LOOP=y" - eerror "in /usr/src/linux/.config or" - eerror " Device Drivers --->" - eerror " Block devices --->" - eerror " [X] Loopback device support" - fi - fi - fi - fi -} - -libsoversion_check() { - local bugurl libzfs_sover - bugurl="https://bugs.gentoo.org/enter_bug.cgi?form_name=enter_bug&product=Gentoo+Linux&component=Current+packages" - - libzfs_sover="$(grep 'libzfs_la_LDFLAGS += -version-info' lib/libzfs/Makefile.am \ - | grep -Eo '[0-9]+:[0-9]+:[0-9]+')" - libzfs_sover="${libzfs_sover%%:*}" - - if [[ ${libzfs_sover} -ne $(ver_cut 2 ${SLOT}) ]]; then - echo - eerror "BUG BUG BUG BUG BUG BUG BUG BUG" - eerror "ebuild subslot does not match libzfs soversion!" - eerror "libzfs soversion: ${libzfs_sover}" - eerror "ebuild value: $(ver_cut 2 ${SLOT})" - eerror "This is a bug in the ebuild, please use the following URL to report it" - eerror "${bugurl}&short_desc=${CATEGORY}%2F${P}+update+subslot" - echo - # we want to abort for releases, but just print a warning for live ebuild - # to keep package installable - [[ ${PV} == "9999" ]] || die - fi -} - -src_prepare() { - default - libsoversion_check - - # Run unconditionally (bug #792627) - eautoreconf - - if [[ ${PV} != "9999" ]]; then - # Set revision number - sed -i "s/\(Release:\)\(.*\)1/\1\2${PR}-gentoo/" META || die "Could not set Gentoo release" - fi - - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_prepare - popd >/dev/null || die - fi - - # prevent errors showing up on zfs-mount stop, #647688 - # openrc will unmount all filesystems anyway. - sed -i "/^ZFS_UNMOUNT=/ s/yes/no/" "etc/default/zfs.in" || die -} - -src_configure() { - use custom-cflags || strip-flags - use minimal || python_setup - - # All the same issue: - # Segfaults w/ GCC 12 and 'zfs send' - # bug #856373 - # https://github.com/openzfs/zfs/issues/13620 - # https://github.com/openzfs/zfs/issues/13605 - append-flags -fno-tree-vectorize - - local myconf=( - --bindir="${EPREFIX}/bin" - --enable-shared - --enable-sysvinit - --localstatedir="${EPREFIX}/var" - --sbindir="${EPREFIX}/sbin" - --with-config=user - --with-dracutdir="${EPREFIX}/usr/lib/dracut" - --with-linux="${KV_DIR}" - --with-linux-obj="${KV_OUT_DIR}" - --with-udevdir="$(get_udevdir)" - --with-pamconfigsdir="${EPREFIX}/unwanted_files" - --with-pammoduledir="$(getpam_mod_dir)" - --with-systemdunitdir="$(systemd_get_systemunitdir)" - --with-systemdpresetdir="$(systemd_get_systempresetdir)" - --with-vendor=gentoo - # Building zfs-mount-generator.c on musl breaks as strndupa - # isn't available. But systemd doesn't support musl anyway, so - # just disable building it. - # UPDATE: it has been fixed since, - # https://github.com/openzfs/zfs/commit/1f19826c9ac85835cbde61a7439d9d1fefe43a4a - # but we still leave it as this for now. - $(use_enable !elibc_musl systemd) - $(use_enable debug) - $(use_enable nls) - $(use_enable pam) - $(use_enable python pyzfs) - --disable-static - $(usex minimal --without-python --with-python="${EPYTHON}") - ) - - unset am_cv_python_version - econf "${myconf[@]}" -} - -src_compile() { - default - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_compile - popd >/dev/null || die - fi -} - -src_install() { - default - - gen_usr_ldscript -a nvpair uutil zfsbootenv zfs zfs_core zpool - - use pam && { rm -rv "${ED}/unwanted_files" || die ; } - - use test-suite || { rm -r "${ED}"/usr/share/zfs/{test-runner,zfs-tests,runfiles,*sh} || die ; } - - find "${ED}" -name '*.la' -delete || die - - dobashcomp contrib/bash_completion.d/zfs - bashcomp_alias zfs zpool - - # strip executable bit from conf.d file - fperms 0644 /etc/conf.d/zfs - - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_install - popd >/dev/null || die - fi - - # enforce best available python implementation - use minimal || python_fix_shebang "${ED}/bin" -} - -pkg_postinst() { - udev_reload - - # we always need userspace utils in sync with zfs-kmod - # so force initrd update for userspace as well, to avoid - # situation when zfs-kmod trigger initrd rebuild before - # userspace component is rebuilt - # KV_* variables are provided by linux-info.eclass - if [[ -z ${ROOT} ]] && use dist-kernel; then - dist-kernel_reinstall_initramfs "${KV_DIR}" "${KV_FULL}" - fi - - if use rootfs; then - if ! has_version sys-kernel/genkernel && ! has_version sys-kernel/dracut; then - elog "Root on zfs requires an initramfs to boot" - elog "The following packages provide one and are tested on a regular basis:" - elog " sys-kernel/dracut ( preferred, module maintained by zfs developers )" - elog " sys-kernel/genkernel" - fi - fi - - if systemd_is_booted || has_version sys-apps/systemd; then - einfo "Please refer to ${EROOT}/$(systemd_get_systempresetdir)/50-zfs.preset" - einfo "for default zfs systemd service configuration" - else - [[ -e "${EROOT}/etc/runlevels/boot/zfs-import" ]] || \ - einfo "You should add zfs-import to the boot runlevel." - [[ -e "${EROOT}/etc/runlevels/boot/zfs-load-key" ]] || \ - einfo "You should add zfs-load-key to the boot runlevel." - [[ -e "${EROOT}/etc/runlevels/boot/zfs-mount" ]]|| \ - einfo "You should add zfs-mount to the boot runlevel." - [[ -e "${EROOT}/etc/runlevels/default/zfs-share" ]] || \ - einfo "You should add zfs-share to the default runlevel." - [[ -e "${EROOT}/etc/runlevels/default/zfs-zed" ]] || \ - einfo "You should add zfs-zed to the default runlevel." - fi -} - -pkg_postrm() { - udev_reload -} diff --git a/files/zfs/3602.2.0/overlay/sys-fs/zfs/zfs-2.1.13.ebuild b/files/zfs/3602.2.0/overlay/sys-fs/zfs/zfs-2.1.13.ebuild deleted file mode 100644 index 6a174c5..0000000 --- a/files/zfs/3602.2.0/overlay/sys-fs/zfs/zfs-2.1.13.ebuild +++ /dev/null @@ -1,311 +0,0 @@ -# Copyright 1999-2023 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -DISTUTILS_OPTIONAL=1 -DISTUTILS_USE_PEP517=setuptools -PYTHON_COMPAT=( python3_{10..11} ) - -inherit autotools bash-completion-r1 dist-kernel-utils distutils-r1 flag-o-matic linux-info pam systemd udev usr-ldscript - -DESCRIPTION="Userland utilities for ZFS Linux kernel module" -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_P="${P/_rc/-rc}" - SRC_URI="https://github.com/openzfs/${PN}/releases/download/${MY_P}/${MY_P}.tar.gz" - SRC_URI+=" verify-sig? ( https://github.com/openzfs/${PN}/releases/download/${MY_P}/${MY_P}.tar.gz.asc )" - S="${WORKDIR}/${P%_rc?}" - - if [[ ${PV} != *_rc* ]]; then - KEYWORDS="~amd64 ~arm64 ~ppc64 ~riscv ~sparc" - fi -fi - -LICENSE="BSD-2 CDDL MIT" -# just libzfs soname major for now. -# possible candidates: libuutil, libzpool, libnvpair. Those do not provide stable abi, but are considered. -# see libsoversion_check() below as well -SLOT="0/5" -IUSE="custom-cflags debug dist-kernel kernel-builtin minimal nls pam python +rootfs selinux test-suite" - -DEPEND=" - net-libs/libtirpc:= - sys-apps/util-linux - sys-libs/zlib - virtual/libudev:= - dev-libs/openssl:0= - !minimal? ( ${PYTHON_DEPS} ) - pam? ( sys-libs/pam ) - python? ( - $(python_gen_cond_dep 'dev-python/cffi[${PYTHON_USEDEP}]' 'python*') - ) -" - -BDEPEND="app-alternatives/awk - virtual/pkgconfig - nls? ( sys-devel/gettext ) - python? ( - ${DISTUTILS_DEPS} - || ( - dev-python/packaging[${PYTHON_USEDEP}] - dev-python/distlib[${PYTHON_USEDEP}] - ) - ) -" - -if [[ ${PV} != "9999" ]] ; then - BDEPEND+=" verify-sig? ( sec-keys/openpgp-keys-openzfs )" -fi - -# awk is used for some scripts, completions, and the Dracut module -RDEPEND="${DEPEND} - !kernel-builtin? ( ~sys-fs/zfs-kmod-${PV}:= ) - !prefix? ( virtual/udev ) - sys-fs/udev-init-scripts - app-alternatives/awk - dist-kernel? ( virtual/dist-kernel:= ) - rootfs? ( - app-arch/cpio - app-misc/pax-utils - ) - selinux? ( sec-policy/selinux-zfs ) - test-suite? ( - app-shells/ksh - sys-apps/kmod[tools] - sys-apps/util-linux - sys-devel/bc - sys-block/parted - sys-fs/lsscsi - sys-fs/mdadm - sys-process/procps - ) -" - -# PDEPEND in this form is needed to trick portage suggest -# enabling dist-kernel if only 1 package have it set, without suggesting to disable -PDEPEND="dist-kernel? ( ~sys-fs/zfs-kmod-${PV}[dist-kernel] )" - -REQUIRED_USE=" - !minimal? ( ${PYTHON_REQUIRED_USE} ) - python? ( !minimal ) - test-suite? ( !minimal ) -" - -RESTRICT="test" - -PATCHES=( - # bug #854333 - "${FILESDIR}"/2.1.5-r2-dracut-non-root.patch - - "${FILESDIR}"/2.1.5-dracut-zfs-missing.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() { - if use kernel_linux; then - linux-info_pkg_setup - - if ! linux_config_exists; then - ewarn "Cannot check the linux kernel configuration." - else - if use test-suite; then - if linux_chkconfig_present BLK_DEV_LOOP; then - eerror "The ZFS test suite requires loop device support enabled." - eerror "Please enable it:" - eerror " CONFIG_BLK_DEV_LOOP=y" - eerror "in /usr/src/linux/.config or" - eerror " Device Drivers --->" - eerror " Block devices --->" - eerror " [X] Loopback device support" - fi - fi - fi - fi -} - -libsoversion_check() { - local bugurl libzfs_sover - bugurl="https://bugs.gentoo.org/enter_bug.cgi?form_name=enter_bug&product=Gentoo+Linux&component=Current+packages" - - libzfs_sover="$(grep 'libzfs_la_LDFLAGS += -version-info' lib/libzfs/Makefile.am \ - | grep -Eo '[0-9]+:[0-9]+:[0-9]+')" - libzfs_sover="${libzfs_sover%%:*}" - - if [[ ${libzfs_sover} -ne $(ver_cut 2 ${SLOT}) ]]; then - echo - eerror "BUG BUG BUG BUG BUG BUG BUG BUG" - eerror "ebuild subslot does not match libzfs soversion!" - eerror "libzfs soversion: ${libzfs_sover}" - eerror "ebuild value: $(ver_cut 2 ${SLOT})" - eerror "This is a bug in the ebuild, please use the following URL to report it" - eerror "${bugurl}&short_desc=${CATEGORY}%2F${P}+update+subslot" - echo - # we want to abort for releases, but just print a warning for live ebuild - # to keep package installable - [[ ${PV} == "9999" ]] || die - fi -} - -src_prepare() { - default - libsoversion_check - - # Run unconditionally (bug #792627) - eautoreconf - - if [[ ${PV} != "9999" ]]; then - # Set revision number - sed -i "s/\(Release:\)\(.*\)1/\1\2${PR}-gentoo/" META || die "Could not set Gentoo release" - fi - - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_prepare - popd >/dev/null || die - fi - - # prevent errors showing up on zfs-mount stop, #647688 - # openrc will unmount all filesystems anyway. - sed -i "/^ZFS_UNMOUNT=/ s/yes/no/" "etc/default/zfs.in" || die -} - -src_configure() { - use custom-cflags || strip-flags - use minimal || python_setup - - # All the same issue: - # Segfaults w/ GCC 12 and 'zfs send' - # bug #856373 - # https://github.com/openzfs/zfs/issues/13620 - # https://github.com/openzfs/zfs/issues/13605 - append-flags -fno-tree-vectorize - - local myconf=( - --bindir="${EPREFIX}/bin" - --enable-shared - --enable-sysvinit - --localstatedir="${EPREFIX}/var" - --sbindir="${EPREFIX}/sbin" - --with-config=user - --with-dracutdir="${EPREFIX}/usr/lib/dracut" - --with-linux="${KV_DIR}" - --with-linux-obj="${KV_OUT_DIR}" - --with-udevdir="$(get_udevdir)" - --with-pamconfigsdir="${EPREFIX}/unwanted_files" - --with-pammoduledir="$(getpam_mod_dir)" - --with-systemdunitdir="$(systemd_get_systemunitdir)" - --with-systemdpresetdir="$(systemd_get_systempresetdir)" - --with-vendor=gentoo - # Building zfs-mount-generator.c on musl breaks as strndupa - # isn't available. But systemd doesn't support musl anyway, so - # just disable building it. - # UPDATE: it has been fixed since, - # https://github.com/openzfs/zfs/commit/1f19826c9ac85835cbde61a7439d9d1fefe43a4a - # but we still leave it as this for now. - $(use_enable !elibc_musl systemd) - $(use_enable debug) - $(use_enable nls) - $(use_enable pam) - $(use_enable python pyzfs) - --disable-static - $(usex minimal --without-python --with-python="${EPYTHON}") - ) - - econf "${myconf[@]}" -} - -src_compile() { - default - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_compile - popd >/dev/null || die - fi -} - -src_install() { - default - - gen_usr_ldscript -a nvpair uutil zfsbootenv zfs zfs_core zpool - - use pam && { rm -rv "${ED}/unwanted_files" || die ; } - - use test-suite || { rm -r "${ED}"/usr/share/zfs/{test-runner,zfs-tests,runfiles,*sh} || die ; } - - find "${ED}" -name '*.la' -delete || die - - dobashcomp contrib/bash_completion.d/zfs - bashcomp_alias zfs zpool - - # strip executable bit from conf.d file - fperms 0644 /etc/conf.d/zfs - - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_install - popd >/dev/null || die - fi - - # enforce best available python implementation - use minimal || python_fix_shebang "${ED}/bin" -} - -pkg_postinst() { - udev_reload - - # we always need userspace utils in sync with zfs-kmod - # so force initrd update for userspace as well, to avoid - # situation when zfs-kmod trigger initrd rebuild before - # userspace component is rebuilt - # KV_* variables are provided by linux-info.eclass - if [[ -z ${ROOT} ]] && use dist-kernel; then - dist-kernel_reinstall_initramfs "${KV_DIR}" "${KV_FULL}" - fi - - if use rootfs; then - if ! has_version sys-kernel/genkernel && ! has_version sys-kernel/dracut; then - elog "Root on zfs requires an initramfs to boot" - elog "The following packages provide one and are tested on a regular basis:" - elog " sys-kernel/dracut ( preferred, module maintained by zfs developers )" - elog " sys-kernel/genkernel" - fi - fi - - if systemd_is_booted || has_version sys-apps/systemd; then - einfo "Please refer to ${EROOT}/$(systemd_get_systempresetdir)/50-zfs.preset" - einfo "for default zfs systemd service configuration" - else - [[ -e "${EROOT}/etc/runlevels/boot/zfs-import" ]] || \ - einfo "You should add zfs-import to the boot runlevel." - [[ -e "${EROOT}/etc/runlevels/boot/zfs-load-key" ]] || \ - einfo "You should add zfs-load-key to the boot runlevel." - [[ -e "${EROOT}/etc/runlevels/boot/zfs-mount" ]]|| \ - einfo "You should add zfs-mount to the boot runlevel." - [[ -e "${EROOT}/etc/runlevels/default/zfs-share" ]] || \ - einfo "You should add zfs-share to the default runlevel." - [[ -e "${EROOT}/etc/runlevels/default/zfs-zed" ]] || \ - einfo "You should add zfs-zed to the default runlevel." - fi -} - -pkg_postrm() { - udev_reload -} diff --git a/files/zfs/3602.2.0/overlay/sys-fs/zfs/zfs-2.2.0.ebuild b/files/zfs/3602.2.0/overlay/sys-fs/zfs/zfs-2.2.0.ebuild deleted file mode 100644 index ce76355..0000000 --- a/files/zfs/3602.2.0/overlay/sys-fs/zfs/zfs-2.2.0.ebuild +++ /dev/null @@ -1,306 +0,0 @@ -# Copyright 1999-2023 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -DISTUTILS_OPTIONAL=1 -DISTUTILS_USE_PEP517=setuptools -PYTHON_COMPAT=( python3_{10..11} ) - -inherit autotools bash-completion-r1 dist-kernel-utils distutils-r1 flag-o-matic linux-info pam systemd udev usr-ldscript - -DESCRIPTION="Userland utilities for ZFS Linux kernel module" -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_P="${P/_rc/-rc}" - SRC_URI="https://github.com/openzfs/${PN}/releases/download/${MY_P}/${MY_P}.tar.gz" - SRC_URI+=" verify-sig? ( https://github.com/openzfs/${PN}/releases/download/${MY_P}/${MY_P}.tar.gz.asc )" - S="${WORKDIR}/${MY_P}" - - if [[ ${PV} != *_rc* ]]; then - KEYWORDS="~amd64 ~arm64 ~ppc64 ~riscv ~sparc" - fi -fi - -LICENSE="BSD-2 CDDL MIT" -# just libzfs soname major for now. -# possible candidates: libuutil, libzpool, libnvpair. Those do not provide stable abi, but are considered. -# see libsoversion_check() below as well -SLOT="0/5" -IUSE="custom-cflags debug dist-kernel kernel-builtin minimal nls pam python +rootfs selinux test-suite" - -DEPEND=" - dev-libs/openssl:= - net-libs/libtirpc:= - sys-apps/util-linux - sys-libs/zlib - virtual/libudev:= - !minimal? ( ${PYTHON_DEPS} ) - pam? ( sys-libs/pam ) - python? ( - $(python_gen_cond_dep 'dev-python/cffi[${PYTHON_USEDEP}]' 'python*') - ) -" - -BDEPEND=" - app-alternatives/awk - virtual/pkgconfig - nls? ( sys-devel/gettext ) - python? ( - ${DISTUTILS_DEPS} - || ( - dev-python/packaging[${PYTHON_USEDEP}] - dev-python/distlib[${PYTHON_USEDEP}] - ) - ) -" - -if [[ ${PV} != "9999" ]] ; then - BDEPEND+=" verify-sig? ( sec-keys/openpgp-keys-openzfs )" -fi - -# awk is used for some scripts, completions, and the Dracut module -RDEPEND=" - ${DEPEND} - !kernel-builtin? ( ~sys-fs/zfs-kmod-${PV}:= ) - !prefix? ( virtual/udev ) - app-alternatives/awk - sys-fs/udev-init-scripts - dist-kernel? ( virtual/dist-kernel:= ) - rootfs? ( - app-arch/cpio - app-misc/pax-utils - ) - selinux? ( sec-policy/selinux-zfs ) - test-suite? ( - app-shells/ksh - sys-apps/kmod[tools] - sys-apps/util-linux - sys-devel/bc - sys-block/parted - sys-fs/lsscsi - sys-fs/mdadm - sys-process/procps - ) -" - -# PDEPEND in this form is needed to trick portage suggest -# enabling dist-kernel if only 1 package have it set, without suggesting to disable -PDEPEND="dist-kernel? ( ~sys-fs/zfs-kmod-${PV}[dist-kernel] )" - -REQUIRED_USE=" - !minimal? ( ${PYTHON_REQUIRED_USE} ) - python? ( !minimal ) - test-suite? ( !minimal ) -" - -RESTRICT="test" - -PATCHES=( - "${FILESDIR}"/2.1.5-dracut-zfs-missing.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() { - if use kernel_linux; then - linux-info_pkg_setup - - if ! linux_config_exists; then - ewarn "Cannot check the linux kernel configuration." - else - if use test-suite; then - if linux_chkconfig_present BLK_DEV_LOOP; then - eerror "The ZFS test suite requires loop device support enabled." - eerror "Please enable it:" - eerror " CONFIG_BLK_DEV_LOOP=y" - eerror "in /usr/src/linux/.config or" - eerror " Device Drivers --->" - eerror " Block devices --->" - eerror " [X] Loopback device support" - fi - fi - fi - fi -} - -libsoversion_check() { - local bugurl libzfs_sover - bugurl="https://bugs.gentoo.org/enter_bug.cgi?form_name=enter_bug&product=Gentoo+Linux&component=Current+packages" - - libzfs_sover="$(grep 'libzfs_la_LDFLAGS += -version-info' lib/libzfs/Makefile.am \ - | grep -Eo '[0-9]+:[0-9]+:[0-9]+')" - libzfs_sover="${libzfs_sover%%:*}" - - if [[ ${libzfs_sover} -ne $(ver_cut 2 ${SLOT}) ]]; then - echo - eerror "BUG BUG BUG BUG BUG BUG BUG BUG" - eerror "ebuild subslot does not match libzfs soversion!" - eerror "libzfs soversion: ${libzfs_sover}" - eerror "ebuild value: $(ver_cut 2 ${SLOT})" - eerror "This is a bug in the ebuild, please use the following URL to report it" - eerror "${bugurl}&short_desc=${CATEGORY}%2F${P}+update+subslot" - echo - # we want to abort for releases, but just print a warning for live ebuild - # to keep package installable - [[ ${PV} == "9999" ]] || die - fi -} - -src_prepare() { - default - libsoversion_check - - # Run unconditionally (bug #792627) - eautoreconf - - if [[ ${PV} != "9999" ]]; then - # Set revision number - sed -i "s/\(Release:\)\(.*\)1/\1\2${PR}-gentoo/" META || die "Could not set Gentoo release" - fi - - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_prepare - popd >/dev/null || die - fi - - # Tries to use /etc/conf.d which we reserve for OpenRC - sed -i -e '/EnvironmentFile/d' etc/systemd/system/zfs*.in || die - - # prevent errors showing up on zfs-mount stop, #647688 - # openrc will unmount all filesystems anyway. - sed -i "/^ZFS_UNMOUNT=/ s/yes/no/" "etc/default/zfs.in" || die -} - -src_configure() { - use custom-cflags || strip-flags - use minimal || python_setup - - local myconf=( - --bindir="${EPREFIX}/bin" - --enable-shared - --enable-sysvinit - --localstatedir="${EPREFIX}/var" - --sbindir="${EPREFIX}/sbin" - --with-config=user - --with-dracutdir="${EPREFIX}/usr/lib/dracut" - --with-linux="${KV_DIR}" - --with-linux-obj="${KV_OUT_DIR}" - --with-udevdir="$(get_udevdir)" - --with-pamconfigsdir="${EPREFIX}/unwanted_files" - --with-pammoduledir="$(getpam_mod_dir)" - --with-systemdunitdir="$(systemd_get_systemunitdir)" - --with-systemdpresetdir="$(systemd_get_systempresetdir)" - --with-vendor=gentoo - # Building zfs-mount-generator.c on musl breaks as strndupa - # isn't available. But systemd doesn't support musl anyway, so - # just disable building it. - # UPDATE: it has been fixed since, - # https://github.com/openzfs/zfs/commit/1f19826c9ac85835cbde61a7439d9d1fefe43a4a - # but we still leave it as this for now. - $(use_enable !elibc_musl systemd) - $(use_enable debug) - $(use_enable nls) - $(use_enable pam) - $(use_enable python pyzfs) - --disable-static - $(usex minimal --without-python --with-python="${EPYTHON}") - ) - - econf "${myconf[@]}" -} - -src_compile() { - default - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_compile - popd >/dev/null || die - fi -} - -src_install() { - default - - gen_usr_ldscript -a nvpair uutil zfsbootenv zfs zfs_core zpool - - use pam && { rm -rv "${ED}/unwanted_files" || die ; } - - use test-suite || { rm -r "${ED}"/usr/share/zfs/{test-runner,zfs-tests,runfiles,*sh} || die ; } - - find "${ED}" -name '*.la' -delete || die - - dobashcomp contrib/bash_completion.d/zfs - bashcomp_alias zfs zpool - - # strip executable bit from conf.d file - fperms 0644 /etc/conf.d/zfs - - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_install - popd >/dev/null || die - fi - - # enforce best available python implementation - use minimal || python_fix_shebang "${ED}/bin" -} - -pkg_postinst() { - udev_reload - - # we always need userspace utils in sync with zfs-kmod - # so force initrd update for userspace as well, to avoid - # situation when zfs-kmod trigger initrd rebuild before - # userspace component is rebuilt - # KV_* variables are provided by linux-info.eclass - if [[ -z ${ROOT} ]] && use dist-kernel; then - dist-kernel_reinstall_initramfs "${KV_DIR}" "${KV_FULL}" - fi - - if use rootfs; then - if ! has_version sys-kernel/genkernel && ! has_version sys-kernel/dracut; then - elog "Root on zfs requires an initramfs to boot" - elog "The following packages provide one and are tested on a regular basis:" - elog " sys-kernel/dracut ( preferred, module maintained by zfs developers )" - elog " sys-kernel/genkernel" - fi - fi - - if systemd_is_booted || has_version sys-apps/systemd; then - einfo "Please refer to ${EROOT}/$(systemd_get_systempresetdir)/50-zfs.preset" - einfo "for default zfs systemd service configuration" - else - [[ -e "${EROOT}/etc/runlevels/boot/zfs-import" ]] || \ - einfo "You should add zfs-import to the boot runlevel." - [[ -e "${EROOT}/etc/runlevels/boot/zfs-load-key" ]] || \ - einfo "You should add zfs-load-key to the boot runlevel." - [[ -e "${EROOT}/etc/runlevels/boot/zfs-mount" ]]|| \ - einfo "You should add zfs-mount to the boot runlevel." - [[ -e "${EROOT}/etc/runlevels/default/zfs-share" ]] || \ - einfo "You should add zfs-share to the default runlevel." - [[ -e "${EROOT}/etc/runlevels/default/zfs-zed" ]] || \ - einfo "You should add zfs-zed to the default runlevel." - fi -} - -pkg_postrm() { - udev_reload -} diff --git a/files/zfs/3602.2.0/overlay/sys-fs/zfs/zfs-9999.ebuild b/files/zfs/3602.2.0/overlay/sys-fs/zfs/zfs-9999.ebuild deleted file mode 100644 index ce76355..0000000 --- a/files/zfs/3602.2.0/overlay/sys-fs/zfs/zfs-9999.ebuild +++ /dev/null @@ -1,306 +0,0 @@ -# Copyright 1999-2023 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -DISTUTILS_OPTIONAL=1 -DISTUTILS_USE_PEP517=setuptools -PYTHON_COMPAT=( python3_{10..11} ) - -inherit autotools bash-completion-r1 dist-kernel-utils distutils-r1 flag-o-matic linux-info pam systemd udev usr-ldscript - -DESCRIPTION="Userland utilities for ZFS Linux kernel module" -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_P="${P/_rc/-rc}" - SRC_URI="https://github.com/openzfs/${PN}/releases/download/${MY_P}/${MY_P}.tar.gz" - SRC_URI+=" verify-sig? ( https://github.com/openzfs/${PN}/releases/download/${MY_P}/${MY_P}.tar.gz.asc )" - S="${WORKDIR}/${MY_P}" - - if [[ ${PV} != *_rc* ]]; then - KEYWORDS="~amd64 ~arm64 ~ppc64 ~riscv ~sparc" - fi -fi - -LICENSE="BSD-2 CDDL MIT" -# just libzfs soname major for now. -# possible candidates: libuutil, libzpool, libnvpair. Those do not provide stable abi, but are considered. -# see libsoversion_check() below as well -SLOT="0/5" -IUSE="custom-cflags debug dist-kernel kernel-builtin minimal nls pam python +rootfs selinux test-suite" - -DEPEND=" - dev-libs/openssl:= - net-libs/libtirpc:= - sys-apps/util-linux - sys-libs/zlib - virtual/libudev:= - !minimal? ( ${PYTHON_DEPS} ) - pam? ( sys-libs/pam ) - python? ( - $(python_gen_cond_dep 'dev-python/cffi[${PYTHON_USEDEP}]' 'python*') - ) -" - -BDEPEND=" - app-alternatives/awk - virtual/pkgconfig - nls? ( sys-devel/gettext ) - python? ( - ${DISTUTILS_DEPS} - || ( - dev-python/packaging[${PYTHON_USEDEP}] - dev-python/distlib[${PYTHON_USEDEP}] - ) - ) -" - -if [[ ${PV} != "9999" ]] ; then - BDEPEND+=" verify-sig? ( sec-keys/openpgp-keys-openzfs )" -fi - -# awk is used for some scripts, completions, and the Dracut module -RDEPEND=" - ${DEPEND} - !kernel-builtin? ( ~sys-fs/zfs-kmod-${PV}:= ) - !prefix? ( virtual/udev ) - app-alternatives/awk - sys-fs/udev-init-scripts - dist-kernel? ( virtual/dist-kernel:= ) - rootfs? ( - app-arch/cpio - app-misc/pax-utils - ) - selinux? ( sec-policy/selinux-zfs ) - test-suite? ( - app-shells/ksh - sys-apps/kmod[tools] - sys-apps/util-linux - sys-devel/bc - sys-block/parted - sys-fs/lsscsi - sys-fs/mdadm - sys-process/procps - ) -" - -# PDEPEND in this form is needed to trick portage suggest -# enabling dist-kernel if only 1 package have it set, without suggesting to disable -PDEPEND="dist-kernel? ( ~sys-fs/zfs-kmod-${PV}[dist-kernel] )" - -REQUIRED_USE=" - !minimal? ( ${PYTHON_REQUIRED_USE} ) - python? ( !minimal ) - test-suite? ( !minimal ) -" - -RESTRICT="test" - -PATCHES=( - "${FILESDIR}"/2.1.5-dracut-zfs-missing.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() { - if use kernel_linux; then - linux-info_pkg_setup - - if ! linux_config_exists; then - ewarn "Cannot check the linux kernel configuration." - else - if use test-suite; then - if linux_chkconfig_present BLK_DEV_LOOP; then - eerror "The ZFS test suite requires loop device support enabled." - eerror "Please enable it:" - eerror " CONFIG_BLK_DEV_LOOP=y" - eerror "in /usr/src/linux/.config or" - eerror " Device Drivers --->" - eerror " Block devices --->" - eerror " [X] Loopback device support" - fi - fi - fi - fi -} - -libsoversion_check() { - local bugurl libzfs_sover - bugurl="https://bugs.gentoo.org/enter_bug.cgi?form_name=enter_bug&product=Gentoo+Linux&component=Current+packages" - - libzfs_sover="$(grep 'libzfs_la_LDFLAGS += -version-info' lib/libzfs/Makefile.am \ - | grep -Eo '[0-9]+:[0-9]+:[0-9]+')" - libzfs_sover="${libzfs_sover%%:*}" - - if [[ ${libzfs_sover} -ne $(ver_cut 2 ${SLOT}) ]]; then - echo - eerror "BUG BUG BUG BUG BUG BUG BUG BUG" - eerror "ebuild subslot does not match libzfs soversion!" - eerror "libzfs soversion: ${libzfs_sover}" - eerror "ebuild value: $(ver_cut 2 ${SLOT})" - eerror "This is a bug in the ebuild, please use the following URL to report it" - eerror "${bugurl}&short_desc=${CATEGORY}%2F${P}+update+subslot" - echo - # we want to abort for releases, but just print a warning for live ebuild - # to keep package installable - [[ ${PV} == "9999" ]] || die - fi -} - -src_prepare() { - default - libsoversion_check - - # Run unconditionally (bug #792627) - eautoreconf - - if [[ ${PV} != "9999" ]]; then - # Set revision number - sed -i "s/\(Release:\)\(.*\)1/\1\2${PR}-gentoo/" META || die "Could not set Gentoo release" - fi - - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_prepare - popd >/dev/null || die - fi - - # Tries to use /etc/conf.d which we reserve for OpenRC - sed -i -e '/EnvironmentFile/d' etc/systemd/system/zfs*.in || die - - # prevent errors showing up on zfs-mount stop, #647688 - # openrc will unmount all filesystems anyway. - sed -i "/^ZFS_UNMOUNT=/ s/yes/no/" "etc/default/zfs.in" || die -} - -src_configure() { - use custom-cflags || strip-flags - use minimal || python_setup - - local myconf=( - --bindir="${EPREFIX}/bin" - --enable-shared - --enable-sysvinit - --localstatedir="${EPREFIX}/var" - --sbindir="${EPREFIX}/sbin" - --with-config=user - --with-dracutdir="${EPREFIX}/usr/lib/dracut" - --with-linux="${KV_DIR}" - --with-linux-obj="${KV_OUT_DIR}" - --with-udevdir="$(get_udevdir)" - --with-pamconfigsdir="${EPREFIX}/unwanted_files" - --with-pammoduledir="$(getpam_mod_dir)" - --with-systemdunitdir="$(systemd_get_systemunitdir)" - --with-systemdpresetdir="$(systemd_get_systempresetdir)" - --with-vendor=gentoo - # Building zfs-mount-generator.c on musl breaks as strndupa - # isn't available. But systemd doesn't support musl anyway, so - # just disable building it. - # UPDATE: it has been fixed since, - # https://github.com/openzfs/zfs/commit/1f19826c9ac85835cbde61a7439d9d1fefe43a4a - # but we still leave it as this for now. - $(use_enable !elibc_musl systemd) - $(use_enable debug) - $(use_enable nls) - $(use_enable pam) - $(use_enable python pyzfs) - --disable-static - $(usex minimal --without-python --with-python="${EPYTHON}") - ) - - econf "${myconf[@]}" -} - -src_compile() { - default - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_compile - popd >/dev/null || die - fi -} - -src_install() { - default - - gen_usr_ldscript -a nvpair uutil zfsbootenv zfs zfs_core zpool - - use pam && { rm -rv "${ED}/unwanted_files" || die ; } - - use test-suite || { rm -r "${ED}"/usr/share/zfs/{test-runner,zfs-tests,runfiles,*sh} || die ; } - - find "${ED}" -name '*.la' -delete || die - - dobashcomp contrib/bash_completion.d/zfs - bashcomp_alias zfs zpool - - # strip executable bit from conf.d file - fperms 0644 /etc/conf.d/zfs - - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_install - popd >/dev/null || die - fi - - # enforce best available python implementation - use minimal || python_fix_shebang "${ED}/bin" -} - -pkg_postinst() { - udev_reload - - # we always need userspace utils in sync with zfs-kmod - # so force initrd update for userspace as well, to avoid - # situation when zfs-kmod trigger initrd rebuild before - # userspace component is rebuilt - # KV_* variables are provided by linux-info.eclass - if [[ -z ${ROOT} ]] && use dist-kernel; then - dist-kernel_reinstall_initramfs "${KV_DIR}" "${KV_FULL}" - fi - - if use rootfs; then - if ! has_version sys-kernel/genkernel && ! has_version sys-kernel/dracut; then - elog "Root on zfs requires an initramfs to boot" - elog "The following packages provide one and are tested on a regular basis:" - elog " sys-kernel/dracut ( preferred, module maintained by zfs developers )" - elog " sys-kernel/genkernel" - fi - fi - - if systemd_is_booted || has_version sys-apps/systemd; then - einfo "Please refer to ${EROOT}/$(systemd_get_systempresetdir)/50-zfs.preset" - einfo "for default zfs systemd service configuration" - else - [[ -e "${EROOT}/etc/runlevels/boot/zfs-import" ]] || \ - einfo "You should add zfs-import to the boot runlevel." - [[ -e "${EROOT}/etc/runlevels/boot/zfs-load-key" ]] || \ - einfo "You should add zfs-load-key to the boot runlevel." - [[ -e "${EROOT}/etc/runlevels/boot/zfs-mount" ]]|| \ - einfo "You should add zfs-mount to the boot runlevel." - [[ -e "${EROOT}/etc/runlevels/default/zfs-share" ]] || \ - einfo "You should add zfs-share to the default runlevel." - [[ -e "${EROOT}/etc/runlevels/default/zfs-zed" ]] || \ - einfo "You should add zfs-zed to the default runlevel." - fi -} - -pkg_postrm() { - udev_reload -} diff --git a/files/zfs/3602.2.1/overlay/dev-python/ensurepip-pip/Manifest b/files/zfs/3602.2.1/overlay/dev-python/ensurepip-pip/Manifest deleted file mode 100644 index e93f5de..0000000 --- a/files/zfs/3602.2.1/overlay/dev-python/ensurepip-pip/Manifest +++ /dev/null @@ -1 +0,0 @@ -DIST pip-23.2.1-py3-none-any.whl 2086091 BLAKE2B 0a35bf4ba589f07e3c800d8f835e4bcdcd433976db83f91c86e12a2316b0b1c7de7120b248d70fe8b5587c28bb3c6e7bc633c64cdfb65a1f18f87a9e7a423181 SHA512 016a8cbd09384f1a9a44cb0e8274df75a8bcb2f3966bb5d708c62145289efaa5db98f75256c97e4f8046735ce2e529fbb076f284a46cdb716e89a75660200ad9 diff --git a/files/zfs/3602.2.1/overlay/dev-python/ensurepip-pip/ensurepip-pip-23.2.1.ebuild b/files/zfs/3602.2.1/overlay/dev-python/ensurepip-pip/ensurepip-pip-23.2.1.ebuild deleted file mode 100644 index 4e55e33..0000000 --- a/files/zfs/3602.2.1/overlay/dev-python/ensurepip-pip/ensurepip-pip-23.2.1.ebuild +++ /dev/null @@ -1,24 +0,0 @@ -# Copyright 2022-2023 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -inherit pypi - -DESCRIPTION="Shared pip wheel for ensurepip Python module" -HOMEPAGE="https://pypi.org/project/pip/" -SRC_URI="$(pypi_wheel_url "${PN#ensurepip-}")" -S=${DISTDIR} - -LICENSE="Apache-2.0 BSD BSD-2 ISC LGPL-2.1+ MIT MPL-2.0 PSF-2" -SLOT="0" -KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris" - -RDEPEND=" - ! - - - - python@gentoo.org - - - - pip - - diff --git a/files/zfs/3602.2.1/overlay/dev-python/ensurepip-wheels/ensurepip-wheels-100.ebuild b/files/zfs/3602.2.1/overlay/dev-python/ensurepip-wheels/ensurepip-wheels-100.ebuild deleted file mode 100644 index d532659..0000000 --- a/files/zfs/3602.2.1/overlay/dev-python/ensurepip-wheels/ensurepip-wheels-100.ebuild +++ /dev/null @@ -1,16 +0,0 @@ -# Copyright 2022-2023 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -DESCRIPTION="Shared wheels for ensurepip Python module" -HOMEPAGE="https://wiki.gentoo.org/wiki/No_homepage" - -LICENSE="metapackage" -SLOT="0" -KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris" - -RDEPEND=" - dev-python/ensurepip-pip - dev-python/ensurepip-setuptools -" diff --git a/files/zfs/3602.2.1/overlay/dev-python/ensurepip-wheels/metadata.xml b/files/zfs/3602.2.1/overlay/dev-python/ensurepip-wheels/metadata.xml deleted file mode 100644 index 7d42167..0000000 --- a/files/zfs/3602.2.1/overlay/dev-python/ensurepip-wheels/metadata.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - python@gentoo.org - - - diff --git a/files/zfs/3602.2.1/overlay/eclass/dist-kernel-utils.eclass b/files/zfs/3602.2.1/overlay/eclass/dist-kernel-utils.eclass deleted file mode 100644 index 6903183..0000000 --- a/files/zfs/3602.2.1/overlay/eclass/dist-kernel-utils.eclass +++ /dev/null @@ -1,201 +0,0 @@ -# Copyright 2020-2023 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -# @ECLASS: dist-kernel-utils.eclass -# @MAINTAINER: -# Distribution Kernel Project -# @AUTHOR: -# Michał Górny -# @SUPPORTED_EAPIS: 7 8 -# @BLURB: Utility functions related to Distribution Kernels -# @DESCRIPTION: -# This eclass provides various utility functions related to Distribution -# Kernels. - -# @ECLASS_VARIABLE: KERNEL_IUSE_SECUREBOOT -# @PRE_INHERIT -# @DEFAULT_UNSET -# @DESCRIPTION: -# If set to a non-null value, inherits secureboot.eclass -# and allows signing of generated kernel images. - -if [[ ! ${_DIST_KERNEL_UTILS} ]]; then - -case ${EAPI} in - 7|8) ;; - *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; -esac - -if [[ ${KERNEL_IUSE_SECUREBOOT} ]]; then - inherit secureboot -fi - -# @FUNCTION: dist-kernel_build_initramfs -# @USAGE: -# @DESCRIPTION: -# Build an initramfs for the kernel. specifies the absolute -# path where initramfs will be created, while specifies -# the kernel version, used to find modules. -# -# Note: while this function uses dracut at the moment, other initramfs -# variants may be supported in the future. -dist-kernel_build_initramfs() { - debug-print-function ${FUNCNAME} "${@}" - - [[ ${#} -eq 2 ]] || die "${FUNCNAME}: invalid arguments" - local output=${1} - local version=${2} - - local rel_image_path=$(dist-kernel_get_image_path) - local image=${output%/*}/${rel_image_path##*/} - - local args=( - --force - # if uefi=yes is used, dracut needs to locate the kernel image - --kernel-image "${image}" - - # positional arguments - "${output}" "${version}" - ) - - ebegin "Building initramfs via dracut" - dracut "${args[@]}" - eend ${?} || die -n "Building initramfs failed" -} - -# @FUNCTION: dist-kernel_get_image_path -# @DESCRIPTION: -# Get relative kernel image path specific to the current ${ARCH}. -dist-kernel_get_image_path() { - case ${ARCH} in - amd64|x86) - echo arch/x86/boot/bzImage - ;; - arm64) - echo arch/arm64/boot/Image.gz - ;; - arm) - echo arch/arm/boot/zImage - ;; - hppa|ppc|ppc64|sparc) - # https://www.kernel.org/doc/html/latest/powerpc/bootwrapper.html - # ./ is required because of ${image_path%/*} - # substitutions in the code - echo ./vmlinux - ;; - riscv) - echo arch/riscv/boot/Image.gz - ;; - *) - die "${FUNCNAME}: unsupported ARCH=${ARCH}" - ;; - esac -} - -# @FUNCTION: dist-kernel_install_kernel -# @USAGE: -# @DESCRIPTION: -# Install kernel using installkernel tool. specifies -# the kernel version, full path to the image, -# full path to System.map. -dist-kernel_install_kernel() { - debug-print-function ${FUNCNAME} "${@}" - - [[ ${#} -eq 3 ]] || die "${FUNCNAME}: invalid arguments" - local version=${1} - local image=${2} - local map=${3} - - # if dracut is used in uefi=yes mode, initrd will actually - # be a combined kernel+initramfs UEFI executable. we can easily - # recognize it by PE magic (vs cpio for a regular initramfs) - local initrd=${image%/*}/initrd - local magic - [[ -s ${initrd} ]] && read -n 2 magic < "${initrd}" - if [[ ${magic} == MZ ]]; then - einfo "Combined UEFI kernel+initramfs executable found" - # install the combined executable in place of kernel - image=${initrd%/*}/uki.efi - mv "${initrd}" "${image}" || die - # We moved the generated initrd, prevent dracut from running again - # https://github.com/dracutdevs/dracut/pull/2405 - shopt -s nullglob - local plugins=() - for file in "${EROOT}"/etc/kernel/install.d/*.install; do - plugins+=( "${file}" ) - done - for file in "${EROOT}"/usr/lib/kernel/install.d/*.install; do - if ! has "${file##*/}" 50-dracut.install 51-dracut-rescue.install "${plugins[@]##*/}"; then - plugins+=( "${file}" ) - fi - done - shopt -u nullglob - export KERNEL_INSTALL_PLUGINS="${KERNEL_INSTALL_PLUGINS} ${plugins[@]}" - fi - - if [[ ${KERNEL_IUSE_SECUREBOOT} ]]; then - # Kernel-install requires uki's are named uki.efi, sign in-place - secureboot_sign_efi_file "${image}" "${image}" - fi - - ebegin "Installing the kernel via installkernel" - # note: .config is taken relatively to System.map; - # initrd relatively to bzImage - installkernel "${version}" "${image}" "${map}" - eend ${?} || die -n "Installing the kernel failed" -} - -# @FUNCTION: dist-kernel_reinstall_initramfs -# @USAGE: -# @DESCRIPTION: -# Rebuild and install initramfs for the specified dist-kernel. -# is the kernel source directory (${KV_DIR} from linux-info), -# while is the full kernel version (${KV_FULL}). -# The function will determine whether is actually -# a dist-kernel, and whether initramfs was used. -# -# This function is to be used in pkg_postinst() of ebuilds installing -# kernel modules that are included in the initramfs. -dist-kernel_reinstall_initramfs() { - debug-print-function ${FUNCNAME} "${@}" - - [[ ${#} -eq 2 ]] || die "${FUNCNAME}: invalid arguments" - local kernel_dir=${1} - local ver=${2} - - local image_path=${kernel_dir}/$(dist-kernel_get_image_path) - local initramfs_path=${image_path%/*}/initrd - if [[ ! -f ${image_path} ]]; then - eerror "Kernel install missing, image not found:" - eerror " ${image_path}" - eerror "Initramfs will not be updated. Please reinstall your kernel." - return - fi - if [[ ! -f ${initramfs_path} && ! -f ${initramfs_path%/*}/uki.efi ]]; then - einfo "No initramfs or uki found at ${image_path}" - return - fi - - dist-kernel_build_initramfs "${initramfs_path}" "${ver}" - dist-kernel_install_kernel "${ver}" "${image_path}" \ - "${kernel_dir}/System.map" -} - -# @FUNCTION: dist-kernel_PV_to_KV -# @USAGE: -# @DESCRIPTION: -# Convert a Gentoo-style ebuild version to kernel "x.y.z[-rcN]" version. -dist-kernel_PV_to_KV() { - debug-print-function ${FUNCNAME} "${@}" - - [[ ${#} -ne 1 ]] && die "${FUNCNAME}: invalid arguments" - local pv=${1} - - local kv=${pv%%_*} - [[ -z $(ver_cut 3- "${kv}") ]] && kv+=".0" - [[ ${pv} == *_* ]] && kv+=-${pv#*_} - echo "${kv}" -} - -_DIST_KERNEL_UTILS=1 -fi diff --git a/files/zfs/3602.2.1/overlay/eclass/linux-mod-r1.eclass b/files/zfs/3602.2.1/overlay/eclass/linux-mod-r1.eclass deleted file mode 100644 index 2a3dde6..0000000 --- a/files/zfs/3602.2.1/overlay/eclass/linux-mod-r1.eclass +++ /dev/null @@ -1,1252 +0,0 @@ -# Copyright 2023 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -# @ECLASS: linux-mod-r1.eclass -# @MAINTAINER: -# Ionen Wolkens -# Gentoo Kernel project -# @AUTHOR: -# Ionen Wolkens -# @SUPPORTED_EAPIS: 8 -# @PROVIDES: linux-info -# @BLURB: Functions for installing out-of-tree Linux kernel modules -# @DESCRIPTION: -# See the linux-mod-r1_src_compile function documentation for in-depth -# usage, and see the example further down for a quick overview. -# -# @SUBSECTION linux-mod -> linux-mod-r1 migration notes -# 0. Define a src_compile if missing, local variables below go there. -# 1. MODULE_NAMES="name(libdir:srcdir:objdir)" -# BUILD_TARGETS="target" -# -> local modlist=( name=libdir:srcdir:objdir:target(s) ) -# - try without :target first, it is now almost always unnecessary -# - srcdir defaults to the current directory, and note that paths -# can be relative to that (should typically *not* pass ${S}) -# 2. BUILD_PARAMS and/or BUILD_FIXES -# -> local modargs=( VAR="${KV_OUT_DIR}" ... ) -# - CC/LD and similar are unneeded, always passed (V=1 too) -# - eval (aka eval "${BUILD_PARAMS}") is /not/ used for this anymore -# 3. s/linux-mod_/linux-mod-r1/g -# 4. _preinst+_postrm can be dropped, keep linux-mod-r1_pkg_postinst -# 5. linux-mod-r1_src_install now runs einstalldocs, adjust as needed -# 6. if *not* using linux-mod-r1_src_compile/install, then refer to -# the eclass' 2nd example and ensure using modules_post_process -# 7. If any, clang<->gcc switching custom workarounds can be dropped -# 8. See MODULES_KERNEL_MAX/_MIN if had or need kernel version checks. -# -# Not an exhaustive list, verify that no installed files are missing -# after. Look for "command not found" errors in the build log too. -# -# Revision bumps are not strictly needed to migrate unless want to -# keep the old as fallback for regressions, kernel upgrades or the -# new IUSE=+strip will typically cause rebuilds either way. -# -# @EXAMPLE: -# -# If source directory S had a layout such as: -# - Makefile (builds a gentoo.ko in current directory) -# - gamepad/Makefile (want to install to kernel/drivers/hid) -# - gamepad/obj/ (the built gamepad.ko ends up here) -# -# ...and the Makefile uses the NIH_SOURCE variable to find where the -# kernel build directory is (aka KV_OUT_DIR, see linux-info.eclass) -# -# then: -# -# @CODE -# CONFIG_CHECK="INPUT_FF_MEMLESS" # gamepad needs it to rumble -# MODULES_KERNEL_MIN=5.4 # needs features introduced in 5.4 -# -# src_compile() { -# local modlist=( -# gentoo -# gamepad=kernel/drivers/hid:gamepad:gamepad/obj -# ) -# local modargs=( NIH_SOURCE="${KV_OUT_DIR}" ) -# -# linux-mod-r1_src_compile -# } -# @CODE -# -# Alternatively, if using the package's build system directly is -# more convenient, a typical example could be: -# -# @CODE -# src_compile() { -# MODULES_MAKEARGS+=( -# NIH_KDIR="${KV_OUT_DIR}" -# NIH_KSRC="${KV_DIR}" -# ) -# -# emake "${MODULES_MAKEARGS[@]}" -# } -# -# src_install() { -# emake "${MODULES_MAKEARGS[@]}" DESTDIR="${ED}" install -# modules_post_process # strip->sign->compress -# -# einstalldocs -# } -# @CODE -# -# Some extra make variables may be of interest: -# - INSTALL_MOD_PATH: sometime used as DESTDIR -# - INSTALL_MOD_DIR: equivalent to linux_moduleinto -# -# MODULES_MAKEARGS is set by the eclass to handle toolchain and, -# when installing, also attempts to disable automatic stripping, -# compression, signing, and depmod to let the eclass handle it. -# -# linux_domodule can alternatively be used to install a single module. -# -# (remember to ensure that linux-mod-r1_pkg_postinst is ran for depmod) - -case ${EAPI} in - 8) ;; - *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; -esac - -if [[ ! ${_LINUX_MOD_R1_ECLASS} ]]; then -_LINUX_MOD_R1_ECLASS=1 - -inherit edo linux-info multiprocessing toolchain-funcs - -IUSE="dist-kernel modules-sign +strip ${MODULES_OPTIONAL_IUSE}" - -RDEPEND=" - sys-apps/kmod[tools] - dist-kernel? ( virtual/dist-kernel:= ) -" -DEPEND=" - virtual/linux-sources -" -BDEPEND=" - sys-apps/kmod[tools] - modules-sign? ( - dev-libs/openssl - virtual/pkgconfig - ) -" -IDEPEND=" - sys-apps/kmod[tools] -" - -if [[ -n ${MODULES_OPTIONAL_IUSE} ]]; then - : "${MODULES_OPTIONAL_IUSE#+}? ( | )" - RDEPEND=${_/|/${RDEPEND}} DEPEND=${_/|/${DEPEND}} \ - BDEPEND=${_/|/${BDEPEND}} IDEPEND=${_/|/${IDEPEND}} -fi - -# @ECLASS_VARIABLE: KERNEL_CHOST -# @USER_VARIABLE -# @DEFAULT_UNSET -# @DESCRIPTION: -# Can be set to the CHOST value to use when selecting the toolchain -# for building kernel modules. This is similar to setting the kernel -# build system's CROSS_COMPILE variable minus the trailing dash. -# -# If this does not auto-select the desired toolchain, finer control -# can be achieved by setting the not directly documented (but valid) -# variables: -# -# KERNEL_{CC,CXX,LD,AR,NM,OBJCOPY,OBJDUMP,READELF,STRIP} -# -# If in doubt, do not set any of this. -# -# Default if unset: auto-detection, typically same as the current CHOST - -# @ECLASS_VARIABLE: MODULES_EXTRA_EMAKE -# @USER_VARIABLE -# @DEFAULT_UNSET -# @DESCRIPTION: -# Extra arguments to pass to emake when building modules. -# Can contain arguments with quoted spaces, e.g. -# @CODE -# ..._EMAKE="KCFLAGS='-fzomg-optimize -fsuper-strict-aliasing' ..." -# @CODE - -# @ECLASS_VARIABLE: MODULES_I_WANT_FULL_CONTROL -# @USER_VARIABLE -# @DEFAULT_UNSET -# @DESCRIPTION: -# When set to a non-empty value, disables passing most of the eclass' -# toolchain defaults to emake when building modules. Basic eclass -# requirements, ebuilds' modargs, and users' MODULES_EXTRA_EMAKE are -# still used. -# -# Primarily intended for expert users with modified kernel Makefiles -# that want the Makefile's values to be used by default. -# -# May want to look at KERNEL_CHOST before considering this. - -# @ECLASS_VARIABLE: MODULES_SIGN_HASH -# @USER_VARIABLE -# @DEFAULT_UNSET -# @DESCRIPTION: -# Used with USE=modules-sign. Can be set to hash algorithm to use -# during signature generation. -# -# Rather than set this, it is recommended to select using the kernel's -# configuration to ensure proper support (e.g. CONFIG_MODULE_SIG_SHA256), -# and then it will be auto-detected here. -# -# Valid values: sha512,sha384,sha256,sha224,sha1 -# -# Default if unset: kernel CONFIG_MODULE_SIG_HASH's value - -# @ECLASS_VARIABLE: MODULES_SIGN_KEY -# @USER_VARIABLE -# @DEFAULT_UNSET -# @DESCRIPTION: -# Used with USE=modules-sign. Can be set to the path of the private -# key in PEM format to use, or a PKCS#11 URI. -# -# If path is relative (e.g. "certs/name.pem"), it is assumed to be -# relative to the kernel build directory being used. -# -# If the key requires a passphrase or PIN, the used kernel sign-file -# utility recognizes the KBUILD_SIGN_PIN environment variable. Be -# warned that the package manager may store this value in binary -# packages, database files, temporary files, and possibly logs. This -# eclass unsets the variable after use to mitigate the issue (notably -# for shared binary packages), but use this with care. -# -# Default if unset: kernel CONFIG_MODULE_SIG_KEY's value which itself -# defaults to certs/signing_key.pem - -# @ECLASS_VARIABLE: MODULES_SIGN_CERT -# @USER_VARIABLE -# @DESCRIPTION: -# Used with USE=modules-sign. Can be set to the path of the X.509 -# public key certificate to use. -# -# If path is relative (e.g. "certs/name.x509"), it is assumed to be -# relative to the kernel build directory being used. -: "${MODULES_SIGN_CERT:=certs/signing_key.x509}" - -# @ECLASS_VARIABLE: MODULES_KERNEL_MAX -# @DEFAULT_UNSET -# @DESCRIPTION: -# If set to a kernel version (format: 1, 1.2, or 1.2.3), will print a -# warning if the used version is greater than (ver_test -gt) to this -# value using the same amount of version components (i.e. MAX=1.2 -# allows 1.2.3, but MAX=1.2.2 does not). -# -# This should *only* be used for modules that are known to break -# frequently on kernel upgrades. If setting this to a non-LTS kernel, -# then should also take care to test and update this value regularly -# with new major kernel releases not to let the warning become stale -# and ignored by users. -# -# Not fatal to allow users to try or self-patch easily, but the (large) -# warning is difficult to miss. If need a fatal check for more serious -# issues (e.g. runtime filesystem corruption), please do it manually. -# -# This is intended to reduce the amount of bug reports for recurring -# expected issues that can be easily mitigated by using LTS kernels -# and waiting for new releases. -# -# If used, must be set before linux-mod-r1_pkg_setup is called. - -# @ECLASS_VARIABLE: MODULES_KERNEL_MIN -# @DEFAULT_UNSET -# @DESCRIPTION: -# If set to a kernel version (format: 1, 1.2, or 1.2.3), will abort if -# the used version is less than (ver_test -lt) this value. -# -# Should only be used if known broken, or if upstream recommends a sane -# minimum. Not particularly necessary for kernels that are no longer -# in the tree. -# -# If used, must be set before linux-mod-r1_pkg_setup is called. - -# @ECLASS_VARIABLE: MODULES_OPTIONAL_IUSE -# @PRE_INHERIT -# @DEFAULT_UNSET -# @DESCRIPTION: -# May contain a single flag to be added to IUSE optionally prefixed -# with a + sign to enable it by default. Doing so makes *all* of -# linux-mod-r1's functions and dependencies a no-op unless the flag -# is enabled. This includes phases, e.g. linux-mod-r1_pkg_setup will -# not process CONFIG_CHECK unless the flag is set. -# -# The typical recommended value is "+modules" (global IUSE). -# -# Note that modules being optional can be useful even if user space -# tools require them (e.g. installing in a chroot or prefix when the -# modules are loaded on the host, saves setting up linux sources). -# However, if tools are non-trivial to build, it may be preferable -# to split into two packages than use this variable due to requiring -# rebuilds every kernel upgrades. - -# @ECLASS_VARIABLE: MODULES_MAKEARGS -# @OUTPUT_VARIABLE -# @DESCRIPTION: -# Will be set after linux-mod-r1_pkg_setup has been called. Contains -# arguments that should be passed to emake when building or installing -# modules. -# -# Modifying this variable is acceptable (e.g. to append kernel source -# arguments) but, if using linux-mod-r1_src_compile, setting modargs -# is the intended method seen as cleaner and less error-prone. - -# @FUNCTION: linux-mod-r1_pkg_setup -# @DESCRIPTION: -# Required before using other functions from this eclass, and will: -# 1. run linux-info_pkg_setup (see linux-info.eclass) -# -> implies processing CONFIG_CHECK, and providing KV_ variables -# (MODULES and TRIM_UNUSED_KSYMS are always checked) -# 2. prepare toolchain to match the kernel -# -> sets KERNEL_{CHOST,CC,CXX,LD,AR,NM,OBJCOPY,OBJDUMP,READELF,STRIP} -# -> also sets MODULES_MAKEARGS array with, e.g. CC="${KERNEL_CC}" -# (normally these should not be used directly, for custom builds) -# 3. perform various sanity checks to fail early on issues -linux-mod-r1_pkg_setup() { - debug-print-function ${FUNCNAME[0]} "${@}" - [[ ${MERGE_TYPE} != binary ]] || return 0 - _MODULES_GLOBAL[ran:pkg_setup]=1 - _modules_check_function ${#} 0 0 || return 0 - _modules_check_migration - - _modules_prepare_kernel - _modules_prepare_sign - _modules_prepare_toolchain - - _modules_set_makeargs - - _modules_sanity_gccplugins -} - -# @FUNCTION: linux-mod-r1_src_compile -# @DESCRIPTION: -# Builds modules, see the eclass' example for a quick overview. -# Uses the variables modlist and modargs as described below: -# -# * local modlist=( ... ) - list of modules to build, set as: -# -# module-name=install-dir:source-dir:build-dir:make-target -# -# > module-name: Resulting name, aka .ko (required). -# -# > install-dir: Kernel modules sub-directory to install the module -# to (/lib/modules/version//name.ko). Will be used when -# run linux-mod-r1_src_install. May want to consider the values of -# INSTALL_MOD_DIR(Makefile) or DEST_MODULE_LOCATION(dkms.conf) if it -# exists, but it can be anything. -# -> Default: extra -# -# Warning: Changing this location may leave stale modules until a -# kernel upgrade as the package manager does not typically delete -# old modules and only does overwrite on rebuilds. -# -# > source-dir: Directory containing the Makefile to build the module. -# Path can be relative to the current directory or absolute. -# -> Default: current directory -# -# > build-dir: Directory that will hold the built module-name.ko. -# -> Default: same as source-dir's value -# -# > make-target: Almost always unneeded but, if defaults are not right, -# then can specify the Makefile's target(s) to build the module/extras. -# Multiple targets can be used with spaces, e.g. :"first second". -# -> Default: specially tries modules, module, .ko, default, -# all, empty target, and runs the first found usable -# -# Missing elements results in defaults being used, e.g. this is valid: -# modlist=( name1 name2=:source name3=install::build ) -# -# * local modargs=( ... ) - extra arguments to pass to emake -# -# Makefile should notably be inspected for which variable it uses -# to find the kernel's build directory then, e.g. KDIR="${KV_OUT_DIR}" -# as appropriate. Note that typically want to pass KV_OUT_DIR(build) -# rather than KV_DIR(sources) if not both. This allows users to do -# out-of-source kernel builds and still build modules. -# -# Passing common toolchain variables such as CC or LD is not needed -# here as they are passed by default. -# -# --- -# -# Allowed to be called multiple times with a different modlist if need -# different make arguments per modules or intermediate steps -- albeit, -# if atypical, may want to build manually (see eclass' example). -linux-mod-r1_src_compile() { - debug-print-function ${FUNCNAME[0]} "${@}" - _modules_check_function ${#} 0 0 || return 0 - - [[ ${modlist@a} == *a* && ${#modlist[@]} -gt 0 ]] || - die "${FUNCNAME[0]} was called without a 'modlist' array" - - # run this again to verify built files access with src_compile's user - _modules_sanity_kernelbuilt - - local -a emakeargs=( "${MODULES_MAKEARGS[@]}" ) - [[ ${modargs@a} == *a* ]] && emakeargs+=( "${modargs[@]}" ) - - local -A built=() - local build mod name target - for mod in "${modlist[@]}"; do - # note modlist was not made an associative array ([name]=) to preserve - # ordering, but is still using = to improve readability - name=${mod%%=*} - [[ -n ${name} && ${name} != *:* ]] || die "invalid mod entry '${mod}'" - - # 0:install-dir 1:source-dir 2:build-dir 3:make-target(s) - mod=${mod#"${name}"} - IFS=: read -ra mod <<<"${mod#=}" - [[ ${#mod[@]} -le 4 ]] || die "too many ':' in ${name}'s modlist" - - [[ ${mod[1]:=${PWD}} != /* ]] && mod[1]=${PWD}/${mod[1]} - [[ ${mod[2]:=${mod[1]}} != /* ]] && mod[2]=${PWD}/${mod[2]} - _MODULES_INSTALL[${mod[2]}/${name}.ko]=${mod[0]:-extra} - - pushd "${mod[1]}" >/dev/null || die - - if [[ -z ${mod[3]} ]]; then - # guess between commonly used targets if none given, fallback to - # an empty target without trying to see the error output - for target in module{s,} "${name}".ko default all; do - nonfatal emake "${emakeargs[@]}" -q "${target}" &>/dev/null - if [[ ${?} -eq 1 ]]; then - mod[3]=${target} - break - fi - done - fi - - # sometime modules are all from same source dir and built all at once, - # make will not rebuild either way but can skip the unnecessary noise - build= - for target in ${mod[3]:-&}; do - if ! has "${target}" ${built[${mod[1]}]}; then - build=1 - built[${mod[1]}]+=" ${target} " - fi - done - - if [[ ${build} ]]; then - einfo "Building ${name} module in ${mod[1]} ..." - - # allow word splitting for rare cases of multiple targets - emake "${emakeargs[@]}" ${mod[3]} - else - einfo "Building ${name} module in ${mod[1]} ... already done." - fi - - popd >/dev/null || die - done -} - -# @FUNCTION: linux-mod-r1_src_install -# @DESCRIPTION: -# Installs modules built by linux-mod-r1_src_compile using -# linux_domodule, then runs modules_post_process and einstalldocs. -linux-mod-r1_src_install() { - debug-print-function ${FUNCNAME[0]} "${@}" - _modules_check_function ${#} 0 0 || return 0 - - (( ${#_MODULES_INSTALL[@]} )) || - die "${FUNCNAME[0]} was called without running linux-mod-r1_src_compile" - - ( - for mod in "${!_MODULES_INSTALL[@]}"; do - linux_moduleinto "${_MODULES_INSTALL[${mod}]}" - linux_domodule "${mod}" - done - ) - - modules_post_process - - einstalldocs -} - -# @FUNCTION: linux-mod-r1_pkg_postinst -# @DESCRIPTION: -# Updates module dependencies using depmod. -linux-mod-r1_pkg_postinst() { - debug-print-function ${FUNCNAME[0]} "${@}" - _modules_check_function ${#} 0 0 || return 0 - - _modules_update_depmod - - # post_process ensures modules were installed and that the eclass' USE - # are likely not no-ops (unfortunately postinst itself may be missed) - [[ -v _MODULES_GLOBAL[ran:post_process] ]] || - eqawarn "QA Notice: neither linux-mod-r1_src_install nor modules_post_process were used" -} - -# @FUNCTION: linux_domodule -# @USAGE: ... -# @DESCRIPTION: -# Installs Linux modules (.ko files). -# -# See also linux_moduleinto. -linux_domodule() { - debug-print-function ${FUNCNAME[0]} "${@}" - _modules_check_function ${#} 1 '' "..." || return 0 - ( - # linux-mod-r0 formerly supported INSTALL_MOD_PATH (bug #642240), but - # this been judged messy to integrate consistently as not everything - # uses this function and build systems sometime mix it with DESTDIR - # (try ROOT if need to install somewhere else instead) - insinto "/lib/modules/${KV_FULL}/${_MODULES_GLOBAL[moduleinto]:-extra}" - doins "${@}" - ) -} - -# @FUNCTION: linux_moduleinto -# @USAGE: -# @DESCRIPTION: -# Directory to install modules into when calling linux_domodule. -# Relative to kernel modules path as in: -# ${ED}/lib/modules/${KV_FULL}/ -# -# Can contain subdirectories, e.g. kernel/fs. -# -# If not called, defaults to "extra". On the kernel build system, -# this is like setting INSTALL_MOD_DIR which has the same default -# for external modules. -linux_moduleinto() { - debug-print-function ${FUNCNAME[0]} "${@}" - _modules_check_function ${#} 1 1 "" || return 0 - _MODULES_GLOBAL[moduleinto]=${1} -} - -# @FUNCTION: modules_post_process -# @USAGE: [] -# @DESCRIPTION: -# Strip, sign, verify, and compress all .ko modules found under -# . Should typically *not* be called directly as it will -# be run by linux-mod-r1_src_install. This is intended for use -# when modules were installed some other way. -# -# should exist under ${ED}. -# Defaults to /lib/modules/${KV_FULL}. -# -# Filenames may change due to compression, so any operations on -# these should be performed prior. -# -# Warning: This will abort if no modules are found, which can happen -# if modules were unexpectedly pre-compressed possibly due to using -# make install without passing MODULES_MAKEARGS to disable it. -modules_post_process() { - debug-print-function ${FUNCNAME[0]} "${@}" - _modules_check_function ${#} 0 1 '[]' || return 0 - [[ ${EBUILD_PHASE} == install ]] || - die "${FUNCNAME[0]} can only be called in the src_install phase" - - local path=${ED}${1-/lib/modules/${KV_FULL}} - local -a mods - [[ -d ${path} ]] && mapfile -td '' mods < <( - find "${path}" -type f -name '*.ko' -print0 || die - ) - (( ${#mods[@]} )) || - die "${FUNCNAME[0]} was called with no installed modules under ${path}" - - # TODO?: find way for sane use with dracut (its 90kernel-modules-extra - # parses depmod.d files directly and assumes should include its modules - # which can lead to unnecessarily increased size or stale modules) -# _modules_process_depmod.d "${mods[@]#"${path}/"}" - - _modules_process_strip "${mods[@]}" - _modules_process_sign "${mods[@]}" - _modules_sanity_modversion "${mods[@]}" # after strip/sign in case broke it - _modules_process_compress "${mods[@]}" - - _MODULES_GLOBAL[ran:post_process]=1 -} - -# @ECLASS_VARIABLE: _MODULES_GLOBAL -# @INTERNAL -# @DESCRIPTION: -# General use associative array to avoid defining separate globals. -declare -gA _MODULES_GLOBAL=() - -# @ECLASS_VARIABLE: _MODULES_INSTALL -# @INTERNAL -# @DESCRIPTION: -# List of modules from linux-mod-r1_src_compile to be installed. -declare -gA _MODULES_INSTALL=() - -# @FUNCTION: _modules_check_function -# @USAGE: [ []] -# @RETURN: 0 or 1 if caller should do nothing -# @INTERNAL -# @DESCRIPTION: -# Checks for MODULES_OPTIONAL_IUSE, and aborts if amount of arguments -# does not add up or if it was called before linux-mod-r1_pkg_setup. -_modules_check_function() { - [[ -z ${MODULES_OPTIONAL_IUSE} ]] || - use "${MODULES_OPTIONAL_IUSE#+}" || return 1 - - [[ ${#} == 0 || ${1} -ge ${2} && ( ! ${3} || ${1} -le ${3} ) ]] || - die "Usage: ${FUNCNAME[1]} ${4-(no arguments)}" - - [[ -v _MODULES_GLOBAL[ran:pkg_setup] ]] || - die "${FUNCNAME[1]} was called without running linux-mod-r1_pkg_setup" -} - -# @FUNCTION: _modules_check_migration -# @INTERNAL -# @DESCRIPTION: -# Aborts if see obsolete variables from the linux-mod-r0 eclass being -# used, likely due to an incomplete migration. This function should -# eventually be removed after linux-mod-r0 is @DEAD not to fail for -# nothing if users happen to have these in their environment given the -# naming for some is a bit generic. -_modules_check_migration() { - _modules_check_var() { - [[ -z ${!1} ]] || - die "${1} is obsolete, see ${2} in linux-mod-r1 eclass docs" - } - # the 'I' on this one is notably sneaky and could silently be ignored - _modules_check_var MODULES_OPTIONAL_USE MODULES_OPTIONAL_IUSE - _modules_check_var MODULES_OPTIONAL_USE_IUSE_DEFAULT MODULES_OPTIONAL_IUSE - _modules_check_var BUILD_PARAMS modargs - _modules_check_var BUILD_TARGETS modlist - _modules_check_var MODULE_NAMES modlist - [[ -z ${!MODULESD_*} ]] || - die "MODULESD_* variables are no longer supported, replace by handcrafted .conf files if needed" - - # Ignored variables: - # - BUILD_FIXES: seen in some ebuilds but was undocumented and linux-info - # still sets it preventing from blocking it entirely - # - ECONF_PARAMS: documented but was a no-op in linux-mod too -} - -# @FUNCTION: _modules_prepare_kernel -# @INTERNAL -# @DESCRIPTION: -# Handles linux-info bits to provide usable sources, KV_ variables, -# and CONFIG_CHECK use. -_modules_prepare_kernel() { - get_version - - # linux-info allows skipping checks if SKIP_KERNEL_CHECK is set and - # then require_configured_kernel will not abort, but no sources means - # 100% failure for building modules and so just abort now (the proper - # way to allow skipping sources here is MODULES_OPTIONAL_IUSE) - [[ -n ${KV_FULL} ]] || - die "kernel sources are required to build kernel modules" - - require_configured_kernel - - _modules_sanity_kernelbuilt - _modules_sanity_kernelversion - - # note: modules-specific check_modules_supported could probably be - # removed from linux-info in the future as this is a sufficient check - local CONFIG_CHECK="${CONFIG_CHECK} MODULES" - - # kernel will not typically know about symbols we use (bug #591832), - # but stay non-fatal if kernel has an exception list set (bug #759238) - # note: possible to bypass either way with CHECKCONFIG_DONOTHING=1 - if [[ $(linux_chkconfig_string UNUSED_KSYMS_WHITELIST) == \"+(?)\" ]]; then - CONFIG_CHECK+=" ~!TRIM_UNUSED_KSYMS" - else - CONFIG_CHECK+=" !TRIM_UNUSED_KSYMS" - fi - - linux-info_pkg_setup -} - -# @FUNCTION: _modules_prepare_sign -# @INTERNAL -# @DESCRIPTION: -# Determines arguments to pass to sign-file (hash/keys), and performs -# basic sanity checks to abort early if signing does not look possible. -_modules_prepare_sign() { - use modules-sign || return 0 - - _modules_sign_die() { - eerror "USE=modules-sign requires additional configuration, please see the" - eerror "kernel[1] documentation and the linux-mod-r1 eclass[2] user variables." - eerror "[1] https://www.kernel.org/doc/html/v${KV_MAJOR}.${KV_MINOR}/admin-guide/module-signing.html" - eerror "[2] https://devmanual.gentoo.org/eclass-reference/linux-mod-r1.eclass/index.html" - die "USE=modules-sign is set but ${*}" - } - - linux_chkconfig_present MODULE_SIG || - _modules_sign_die "CONFIG_MODULE_SIG is not set in the kernel" - - if [[ -z ${MODULES_SIGN_HASH} ]]; then - : "$(linux_chkconfig_string MODULE_SIG_HASH)" - MODULES_SIGN_HASH=${_//\"} - [[ -n ${MODULES_SIGN_HASH} ]] || - _modules_sign_die "CONFIG_MODULE_SIG_HASH is not set in the kernel" - fi - - if [[ -z ${MODULES_SIGN_KEY} ]]; then - : "$(linux_chkconfig_string MODULE_SIG_KEY)" - MODULES_SIGN_KEY=${_//\"} - [[ -n ${MODULES_SIGN_KEY} ]] || - _modules_sign_die "CONFIG_MODULE_SIG_KEY is not set in the kernel" - fi - - [[ ${MODULES_SIGN_KEY} != @(/|pkcs11:)* ]] && - MODULES_SIGN_KEY=${KV_OUT_DIR}/${MODULES_SIGN_KEY} - [[ ${MODULES_SIGN_CERT} != /* ]] && - MODULES_SIGN_CERT=${KV_OUT_DIR}/${MODULES_SIGN_CERT} - - # assumes users know what they are doing if using a pkcs11 URI - [[ ${MODULES_SIGN_KEY} == pkcs11:* || -f ${MODULES_SIGN_KEY} ]] || - _modules_sign_die "the private key '${MODULES_SIGN_KEY}' was not found" - [[ -f ${MODULES_SIGN_CERT} ]] || - _modules_sign_die "the public key certificate '${MODULES_SIGN_CERT}' was not found" -} - -# @FUNCTION: _modules_prepare_toolchain -# @INTERNAL -# @DESCRIPTION: -# Sets KERNEL_{CC,CXX,LD,AR,NM,OBJCOPY,OBJDUMP,READELF,STRIP} based on -# the kernel configuration and KERNEL_CHOST (also set if missing) that -# *should* be usable to build modules. -# -# Tries to match compiler type (gcc or clang), and major version. Will -# inform if matching was not possible likely due to the compiler being -# uninstalled. Users can set KERNEL_ variables themselves to override. -# -# These variables are normally manipulated by the kernel's LLVM=1 with -# the exception of CXX that is included anyway given *some* out-of-tree -# modules use it, e.g. nvidia-drivers[kernel-open]. -_modules_prepare_toolchain() { - # note that the kernel adds -m32/-m64/-m elf_x86_64/etc... for, e.g. - # toolchains defaulting to x32, but may need automagic here if need - # a different toolchain such as sys-devel/kgcc64 - [[ -z ${KERNEL_CHOST} ]] && linux_chkconfig_present 64BIT && - case ${CHOST} in - # matching kernel-build.eclass, see for details - hppa2.0-*) KERNEL_CHOST=${CHOST/2.0/64};; - esac - - # recognizing KERNEL_CHOST given CROSS_COMPILE seems too generic here, - # but should rarely be necessary unless different userland and kernel - : "${KERNEL_CHOST:=${CHOST}}" - - einfo "Preparing ${KERNEL_CHOST} toolchain for kernel modules (override with KERNEL_CHOST) ..." - - _modules_tc_best() { - [[ -z ${!1} ]] && read -r ${1} < <(type -P -- "${@:2}") - } - - local gccv clangv tool - if linux_chkconfig_present CC_IS_GCC; then - gccv=$(linux_chkconfig_string GCC_VERSION) - gccv=${gccv::2} # major version, will break on gcc-100... - # chost-gcc-ver > chost-gcc > gcc-ver > gcc - _modules_tc_best KERNEL_CC {"${KERNEL_CHOST}-",}gcc{"-${gccv}",} - _modules_tc_best KERNEL_CXX {"${KERNEL_CHOST}-",}g++{"-${gccv}",} - # unknown what was used exactly here, but prefer non-llvm with gcc - for tool in AR NM OBJCOPY OBJDUMP READELF STRIP; do - _modules_tc_best KERNEL_${tool} \ - {"${KERNEL_CHOST}-",}{gcc-,}${tool,,} - done - elif linux_chkconfig_present CC_IS_CLANG; then - clangv=$(linux_chkconfig_string CLANG_VERSION) - clangv=${clangv::2} - # like gcc, but try directories to get same version on all tools - # (not using get_llvm_prefix to avoid conflicts with ebuilds using - # llvm slots for non-modules reasons, e.g. sets llvm_check_deps) - _modules_tc_best KERNEL_CC \ - {"${BROOT}/usr/lib/llvm/${clangv}/bin/",}{"${KERNEL_CHOST}-",}clang{"-${clangv}",} - _modules_tc_best KERNEL_CXX \ - {"${BROOT}/usr/lib/llvm/${clangv}/bin/",}{"${KERNEL_CHOST}-",}clang++{"-${clangv}",} - for tool in AR NM OBJCOPY OBJDUMP READELF STRIP; do - _modules_tc_best KERNEL_${tool} \ - {"${BROOT}/usr/lib/llvm/${clangv}/bin/",}{"${KERNEL_CHOST}-",}{llvm-,}${tool,,} - done - fi - - if linux_chkconfig_present LD_IS_BFD; then - _modules_tc_best KERNEL_LD {"${KERNEL_CHOST}-",}ld.bfd - elif linux_chkconfig_present LD_IS_LLD; then - # also match with clang if it was used - _modules_tc_best KERNEL_LD \ - {${clangv+"${BROOT}/usr/lib/llvm/${clangv}/bin/"},}{"${KERNEL_CHOST}-",}ld.lld - fi - - # if any variables are still empty, fallback to normal defaults - local CHOST=${KERNEL_CHOST} - : "${KERNEL_CC:=$(tc-getCC)}" - : "${KERNEL_CXX:=$(tc-getCXX)}" - : "${KERNEL_LD:=$(tc-getLD)}" - : "${KERNEL_AR:=$(tc-getAR)}" - : "${KERNEL_NM:=$(tc-getNM)}" - : "${KERNEL_OBJCOPY:=$(tc-getOBJCOPY)}" - : "${KERNEL_OBJDUMP:=$(tc-getOBJDUMP)}" - : "${KERNEL_READELF:=$(tc-getREADELF)}" - : "${KERNEL_STRIP:=$(tc-getSTRIP)}" - - # for toolchain-funcs, uses CPP > CC but set both not to make assumptions - local CC=${KERNEL_CC} CPP="${KERNEL_CC} -E" LD=${KERNEL_LD} - - # show results, skip line wrap to avoid standing out too much - einfo "Toolchain picked for kernel modules (override with KERNEL_CC, _LD, ...):"\ - "'${KERNEL_CC}' '${KERNEL_CXX}' '${KERNEL_LD}' '${KERNEL_AR}'"\ - "'${KERNEL_NM}' '${KERNEL_OBJCOPY}' '${KERNEL_OBJDUMP}'"\ - "'${KERNEL_READELF}' '${KERNEL_STRIP}'" - - # hack: kernel adds --thinlto-cache-dir to KBUILD_LDFLAGS with ThinLTO - # resulting in sandbox violations and we cannot safely override that - # variable, using *both* {LDFLAGS_MODULE,ldflags-y}=--thinlto-cache-dir= - # can work but raises concerns about breaking packages that may use these - if linux_chkconfig_present LTO_CLANG_THIN && tc-ld-is-lld; then - KERNEL_LD=${T}/linux-mod-r1_ld.lld - printf '#!/usr/bin/env sh\nexec %s "${@}" --thinlto-cache-dir=\n' \ - "${LD}" > "${KERNEL_LD}" || die - chmod +x -- "${KERNEL_LD}" || die - fi - - # warn if final picked CC type or major version is mismatching, arguably - # should be fatal but not forcing given it is not *always* an issue - local warn - if [[ -v gccv ]]; then - if ! tc-is-gcc; then - warn="gcc-${gccv} but\n '${KERNEL_CC}' is not gcc" - elif [[ $(gcc-major-version) -ne "${gccv}" ]]; then - warn="gcc-${gccv} but\n '${KERNEL_CC}' is gcc-$(gcc-major-version)" - fi - elif [[ -v clangv ]]; then - if ! tc-is-clang; then - warn="clang-${clangv} but\n '${KERNEL_CC}' is not clang" - elif [[ $(clang-major-version) -ne "${clangv}" ]]; then - warn="clang-${clangv} but\n '${KERNEL_CC}' is clang-$(clang-major-version)" - fi - fi - - if [[ -v warn ]]; then - ewarn - ewarn "Warning: kernel ${KV_FULL} is built with ${warn}" - ewarn "This *could* result in build issues or other incompatibilities." - ewarn "It is recommended to either \`make clean\` and rebuild the kernel" - ewarn "with the current toolchain (for distribution kernels, re-installing" - ewarn "will do the same), or set the KERNEL_CC variable to point to the" - ewarn "same compiler. Note that when it is available, auto-selection is" - ewarn "attempted making the latter rarely needed." - ewarn - fi -} - -# @FUNCTION: _modules_process_compress -# @USAGE: ... -# @INTERNAL -# @DESCRIPTION: -# If enabled in the kernel configuration, this compresses the given -# modules using the same format. -_modules_process_compress() { - local -a compress - if linux_chkconfig_present MODULE_COMPRESS_XZ; then - compress=(xz -qT"$(makeopts_jobs)" --memlimit-compress=50%) - elif linux_chkconfig_present MODULE_COMPRESS_GZIP; then - if type -P pigz &>/dev/null; then - compress=(pigz -p"$(makeopts_jobs)") - else - compress=(gzip) - fi - elif linux_chkconfig_present MODULE_COMPRESS_ZSTD; then - compress=(zstd -qT"$(makeopts_jobs)" --rm) - fi - - if [[ -v compress ]]; then - # could fail, assumes have commands that were needed for the kernel - einfo "Compressing modules (matching the kernel configuration) ..." - edob "${compress[@]}" -- "${@}" - fi -} - -# @FUNCTION: _modules_process_depmod.d -# @USAGE: ... -# @INTERNAL -# @DESCRIPTION: -# Generate a depmod.d file to ensure priority if duplicate modules -# exist, such as stale modules in different directories, or to -# override the kernel's own modules. -_modules_process_depmod.d() { - ( - [[ ${SLOT%/*} == 0 ]] && slot= || slot=-${SLOT%/*} - insinto /lib/depmod.d - newins - ${PN}${slot}.conf < <( - echo "# Automatically generated by linux-mod-r1.eclass for ${CATEGORY}/${PN}" - for mod; do - [[ ${mod} =~ ^(.+)/(.+).ko$ ]] && - echo "override ${BASH_REMATCH[2]} ${KV_FULL} ${BASH_REMATCH[1]}" - done - ) - ) -} - -# @FUNCTION: _modules_process_sign -# @USAGE: ... -# @INTERNAL -# @DESCRIPTION: -# Cryptographically signs the given modules when USE=modules-sign is -# enabled. -_modules_process_sign() { - use modules-sign || return 0 - - # scripts/sign-file used to be a perl script but is now written in C, - # and it could either be missing or broken given it links with openssl - # (no subslot rebuilds on kernel sources), trivial to compile regardless - local sign= - if [[ -f ${KV_DIR}/scripts/sign-file.c ]]; then - sign=${T}/linux-mod-r1_sign-file - ( - # unfortunately using the kernel's Makefile is inconvenient (no - # simple build target for this), may need revisiting on changes - einfo "Compiling sign-file ..." - tc-export_build_env - nonfatal edob $(tc-getBUILD_CC) ${BUILD_CFLAGS} ${BUILD_CPPFLAGS} \ - $($(tc-getBUILD_PKG_CONFIG) --cflags libcrypto) \ - ${BUILD_LDFLAGS} -o "${sign}" "${KV_DIR}"/scripts/sign-file.c \ - $($(tc-getBUILD_PKG_CONFIG) --libs libcrypto || echo -lcrypto) - ) || { - einfo "Trying fallback ..." - sign= - } - fi - - if [[ -z ${sign} ]]; then - if [[ -x ${KV_OUT_DIR}/scripts/sign-file ]]; then - sign=${KV_OUT_DIR}/scripts/sign-file # try if built - elif [[ -x ${KV_DIR}/scripts/sign-file ]]; then - sign=${KV_DIR}/scripts/sign-file # old kernel (... -# @INTERNAL -# @DESCRIPTION: -# Strips the given modules of unneeded symbols when USE=strip is -# enabled, and informs the package manager not to regardless. -_modules_process_strip() { - # letting the package manager handle this complicates scenarios - # where we want to either compress the pre-stripped module, or - # sign the module without its signature becoming invalid on merge - dostrip -x "${@#"${ED}"}" - - if use strip; then - einfo "Stripping modules ..." - edob "${KERNEL_STRIP}" --strip-unneeded -- "${@}" - fi -} - -# @FUNCTION: _modules_sanity_gccplugins -# @INTERNAL -# @DESCRIPTION: -# Performs a basic build test to detect GCC plugins mismatch issues -# and, if so, aborts with explanation given it often confuses users. -# -# Using mismatching gcc can sometime work to build modules, but if -# GCC plugins are enabled it will almost always be an error. -# -# Note: may need occasional review to ensure the test still works by: -# enabling a GCC plugin in the kernel, building with older GCC, -# then building a module by setting KERNEL_CC=gcc-. -_modules_sanity_gccplugins() { - linux_chkconfig_present GCC_PLUGINS || return 0 - - local tmp=${T}/linux-mod-r1_gccplugins - mkdir -p -- "${tmp}" || die - - echo "obj-m += test.o" > "${tmp}"/Kbuild || die - :> "${tmp}"/test.c || die - - # always fails, but interested in the stderr messages - local output=$( - cd -- "${KV_OUT_DIR}" && # fwiw skip non-POSIX -C in eclasses - LC_ALL=C nonfatal emake "${MODULES_MAKEARGS[@]}" M="${tmp}" \ - 2>&1 >/dev/null - ) - - if [[ ${output} == *"error: incompatible gcc/plugin version"* ]]; then - eerror "GCC_PLUGINS is enabled in the kernel and plugin version mismatch issues" - eerror "have been detected. Please \`make clean\` and rebuild the kernel using" - eerror "the current version of GCC (or re-install for distribution kernels)." - die "kernel ${KV_FULL} needs to be rebuilt" - fi -} - -# @FUNCTION: _modules_sanity_kernelbuilt -# @INTERNAL -# @DESCRIPTION: -# Checks if the kernel seems fully built by having a Module.symvers -# that is also readable, abort otherwise. -# -# About readability, occasionally users build their kernel as root with -# umask 0077 and then the package manager's user cannot read built files -# leaving them confused. -# -# Given user and access can very between phases (notably src_compile), -# it makes sense to run this check more than once. -# -# Note: -# This is an alternate version of linux-info's check_kernel_built -# which probably will not need to exist there if linux-mod-r0 is -# gone, error it gives is also modules-specific and fits better here. -# -# The old check_kernel_built checks version.h and suggests running -# modules_prepare if missing, but that does not create Module.symvers. -# Nowadays the kernel makes unresolved symbols fatal by default -# meaning that all modules will fail unless KBUILD_MODPOST_WARN=1 -# which seem questionable to support. So rather than version.h, this -# checks and require Module.symvers, and suggests a full build if -# missing (if really must, users can bypass by touching the file). -# nvidia-drivers (for one) further checks this file directly to do -# configure tests that will break badly without. -_modules_sanity_kernelbuilt() { - local symvers=${KV_OUT_DIR}/Module.symvers - - if [[ ! -f ${symvers} ]]; then - eerror "'${symvers}' was not found implying that the" - eerror "linux-${KV_FULL} tree at that location has not been built." - eerror - eerror "Please verify that this is the intended kernel version, then perform" - eerror "a full build[1] (i.e. make && make modules_install && make install)." - eerror - eerror "Alternatively, consider a distribution kernel[2] that does not need" - eerror "these manual steps (e.g. sys-kernel/gentoo-kernel or gentoo-kernel-bin)." - eerror - eerror "[1] https://wiki.gentoo.org/wiki/Kernel/Configuration#Build" - eerror "[2] https://wiki.gentoo.org/wiki/Project:Distribution_Kernel" - die "built kernel sources are required to build kernel modules" - fi - - if [[ ! -r ${symvers} ]]; then - eerror "'${symvers}' exists but cannot be read by the" - eerror "user id(${EUID}) of the package manager, likely implying no world" - eerror "read access permissions:" - eerror - eerror " $(ls -l -- "${symvers}")" - eerror - eerror "Causes may vary, but a common one is building the kernel with a umask" - eerror "value of '0077' rather than the more typical '0022' (run the \`umask\`" - eerror "command to confirm, as root if was building the kernel using it)." - eerror - eerror "Many other files are likely affected and will lead to build failures." - eerror "It is recommended to clean the sources and rebuild with \`umask 0022\`" - eerror "rather than attempt to fix the permissions manually." - die "no read access permission to the generated kernel files" - fi -} - -# @FUNCTION: _modules_sanity_kernelversion -# @INTERNAL -# @DESCRIPTION: -# Prints a warning if the kernel version is greater than to -# MODULES_KERNEL_MAX (while only considering same amount of version -# components), or aborts if it is less than MODULES_KERNEL_MIN -_modules_sanity_kernelversion() { - local kv=${KV_MAJOR}.${KV_MINOR}.${KV_PATCH} - - if [[ -n ${MODULES_KERNEL_MIN} ]] && - ver_test "${kv}" -lt "${MODULES_KERNEL_MIN}" - then - eerror "${P} requires a kernel version of at least >=${MODULES_KERNEL_MIN}," - eerror "but the current kernel is ${KV_FULL}. Please update." - die "kernel ${KV_FULL} is too old" - fi - - if [[ -n ${MODULES_KERNEL_MAX} ]]; then - : "${MODULES_KERNEL_MAX//[^.]/}" - local -i count=${#_} - - if ver_test "$(ver_cut 1-$((count+1)) "${kv}")" \ - -gt "${MODULES_KERNEL_MAX}" - then - # add .x to 1 missing component to make, e.g. <=1.2.x more natural, - # not <1.3 given users sometimes see it as 1.3 support at a glance - local max=${MODULES_KERNEL_MAX} - [[ ${count} -lt 2 ]] && max+=.x - - ewarn - ewarn " *** WARNING *** " - ewarn - ewarn "${PN} is known to break easily with new kernel versions and," - ewarn "with the current kernel (${KV_FULL}), it was either hardly" - ewarn "tested or is known broken. It is recommended to use one of:" - ewarn - # fwiw we do not know what is *actually* used or wanted even with - # the USE, so stay a bit vague and always mention both dist+sources - if use dist-kernel; then - ewarn " <=virtual/dist-kernel-${max} or" - else - ewarn " <=sys-kernel/gentoo-kernel-${max} or" - fi - ewarn " <=sys-kernel/gentoo-sources-${max}" - ewarn - ewarn "or equivalent rather than file downstream bug reports if run into" - ewarn "issues, then wait for upstream fixes and a new release. Ideally," - ewarn "with out-of-tree modules, use an LTS (Long Term Support) kernel" - ewarn "branch[1]. If in doubt, Gentoo's stable kernels are always LTS" - ewarn "and can be easily used even on ~testing systems." - ewarn - ewarn "[1] https://www.kernel.org/category/releases.html" - ewarn - fi - fi -} - -# @FUNCTION: _modules_sanity_modversion -# @USAGE: ... -# @INTERNAL -# @DESCRIPTION: -# Checks if the passed module(s) do not seem obviously broken and the -# builtin versions match ${KV_FULL}, otherwise die with an explanation. -# -# If receive a bug with a version error, an easy way to reproduce is to -# set KERNEL_DIR with the sources of a different kernel version than -# both the ones pointed by /usr/src/linux and `uname -r`. Refer to -# linux-mod-r1_src_compile's modargs in the eclass docs for fixing. -_modules_sanity_modversion() { - local mod ver - for mod; do - # modinfo can read different-arch modules, being fatal *should* be safe - # and serve as a basic sanity check to ensure the module is valid - read -rd ' ' ver < <( - LC_ALL=C modinfo -F vermagic -- "${mod}" || - die "modinfo failed to read module '${mod}' (broken module?)" - ) - [[ -n ${ver} ]] || - die "modinfo found no kernel version in '${mod}' (broken module?)" - - if [[ ${ver} != "${KV_FULL}" ]]; then - eerror "A module seem to have been built for kernel version '${ver}'" - eerror "while it was meant for '${KV_FULL}'. This may indicate an" - eerror "ebuild issue (e.g. used runtime \`uname -r\` kernel rather than" - eerror "the chosen sources). Please report this to the ebuild's maintainer." - die "module and source version mismatch in '${mod}'" - fi - done -} - -# @FUNCTION: _modules_set_makeargs -# @INTERNAL -# @DESCRIPTION: -# Sets the MODULES_MAKEARGS global array. -_modules_set_makeargs() { - MODULES_MAKEARGS=( - ARCH="$(tc-arch-kernel)" - - V=1 - # normally redundant with V, but some custom Makefiles override it - KBUILD_VERBOSE=1 - - # unrealistic when building modules that often have slow releases, - # but note that the kernel will still pass some -Werror=bad-thing - CONFIG_WERROR= - - # these are only needed if using these arguments for installing, lets - # eclass handle strip, sign, compress, and depmod (CONFIG_ should - # have no impact on building, only used by Makefile.modinst) - CONFIG_MODULE_{SIG_ALL,COMPRESS_{GZIP,XZ,ZSTD}}= - DEPMOD=: - STRIP=: - ) - - if [[ ! ${MODULES_I_WANT_FULL_CONTROL} ]]; then - # many of these are unlikely to be useful here, but still trying to be - # complete given never know what out-of-tree modules may use - MODULES_MAKEARGS+=( - # wrt bug #550428, given most toolchain variables are being passed to - # make, setting CROSS in the environment would change very little - # (instead set KERNEL_CHOST which will affect other variables, - # or MODULES_I_WANT_FULL_CONTROL if do not want any of this) - CROSS_COMPILE="${KERNEL_CHOST}-" - - HOSTCC="$(tc-getBUILD_CC)" - HOSTCXX="$(tc-getBUILD_CXX)" - - # fwiw this function is not meant to pollute the environment - HOSTCFLAGS="$(tc-export_build_env; echo "${BUILD_CFLAGS}")" - HOSTCXXFLAGS="$(tc-export_build_env; echo "${BUILD_CXXFLAGS}")" - HOSTLDFLAGS="$(tc-export_build_env; echo "${BUILD_LDFLAGS}")" - - HOSTPKG_CONFIG="$(tc-getBUILD_PKG_CONFIG)" - - CC="${KERNEL_CC}" - CXX="${KERNEL_CXX}" - LD="${KERNEL_LD}" - AR="${KERNEL_AR}" - NM="${KERNEL_NM}" - OBJCOPY="${KERNEL_OBJCOPY}" - OBJDUMP="${KERNEL_OBJDUMP}" - READELF="${KERNEL_READELF}" - ) - fi - - # eval is to handle quoted spaces, die is for syntax errors - eval "MODULES_MAKEARGS+=( ${MODULES_EXTRA_EMAKE} )" || die -} - -# @FUNCTION: _modules_update_depmod -# @INTERNAL -# @DESCRIPTION: -# If possible, update module dependencies using depmod and System.map, -# otherwise prompt user to handle it. System.map may notably no longer -# be available on binary merges. -_modules_update_depmod() { - # prefer /lib/modules' path given it is what depmod operates on, - # and is mostly foolproof when it comes to ROOT (relative symlink) - local map=${EROOT}/lib/modules/${KV_FULL}/build/System.map - - if [[ ! -f ${map} ]]; then - # KV_OUT_DIR may still be right even on a different system, but state - # of (E)ROOT is unknown, e.g. could be from KERNEL_DIR=${OLDROOT}/... - map=${KV_OUT_DIR}/System.map - - # last resort, typical but may not be mounted/readable/installed - [[ ! -f ${map} ]] && - map=${EROOT}/boot/System.map-${KV_FULL} - fi - - einfo "Updating module dependencies for kernel ${KV_FULL} ..." - if [[ -f ${map} ]]; then - local depmodargs=( -ae -F "${map}" "${KV_FULL}" ) - - # for nicer postinst display, keep command shorter if EROOT is unset - [[ ${EROOT} ]] && - depmodargs+=( - -b "${EROOT}" - - # EROOT from -b is not used when looking for configuration - # directories, so pass the whole list from kmod's tools/depmod.c - --config="${EROOT}"/{etc,run,usr/local/lib,lib}/depmod.d - ) - - nonfatal edob depmod "${depmodargs[@]}" && return 0 - else - eerror - eerror "System.map for kernel ${KV_FULL} was not found, may be due to the" - eerror "built kernel sources no longer being available and lacking the fallback:" - eerror - eerror "${EROOT}/boot/System.map-${KV_FULL}" - fi - eerror - eerror "Some modules may not load without updating manually using depmod." -} - -fi - -EXPORT_FUNCTIONS pkg_setup src_compile src_install pkg_postinst diff --git a/files/zfs/3602.2.1/overlay/metadata/layout.conf b/files/zfs/3602.2.1/overlay/metadata/layout.conf deleted file mode 100644 index e85e826..0000000 --- a/files/zfs/3602.2.1/overlay/metadata/layout.conf +++ /dev/null @@ -1,4 +0,0 @@ -masters = portage-stable -thin-manifests = true -sign-commits = false -sign-manifests = false diff --git a/files/zfs/3602.2.1/overlay/profiles/repo_name b/files/zfs/3602.2.1/overlay/profiles/repo_name deleted file mode 100644 index e0f34db..0000000 --- a/files/zfs/3602.2.1/overlay/profiles/repo_name +++ /dev/null @@ -1 +0,0 @@ -zfs-overlay diff --git a/files/zfs/3602.2.1/overlay/sec-policy/selinux-base-policy/Manifest b/files/zfs/3602.2.1/overlay/sec-policy/selinux-base-policy/Manifest deleted file mode 100644 index 1029253..0000000 --- a/files/zfs/3602.2.1/overlay/sec-policy/selinux-base-policy/Manifest +++ /dev/null @@ -1,3 +0,0 @@ -DIST patchbundle-selinux-base-policy-2.20221101-r3.tar.bz2 444710 BLAKE2B e33cc01a8be5a354e022be1e8bf242883b09b15ead0673f859819f5e668f18773a16527f2e608878e6976695dcb2890c55658e77877e93c716ae0b2dd2ed5a9b SHA512 52e60b22346903a6fead95c9fb348fa1d4037b7dcd3e5781248a7dfc426c8c3fced258fd22762c779a5f436d8be21eaed5425ed36ff99c267daae5e1cb9c8e7f -DIST patchbundle-selinux-base-policy-2.20221101-r4.tar.bz2 457886 BLAKE2B 1e085f9f1739e0640c5eafa70db4c7ec19bca887c682ca2312a457fa57ee3eb176d0c8f16c2f84a1a026669b1240be3ff69066bd825c92fad75dcd2c13739f6c SHA512 da3ba1f076c04746719698aedb3aad48eb7c8a09df95c314b36f7a052538a07d893be413f35f4c34b01c1bf967ebe35ff32c2cea0722fe74a6e089a9d6aa47a6 -DIST refpolicy-2.20221101.tar.bz2 583183 BLAKE2B 783d8af40fd77d7ddb848dba32e91921dd7c1380c094c45b719ada7b15f91aacbb52b410ffa6341f2f705ecbc9674b8570bd4867ce998e944fa0054ffd8bdf74 SHA512 29e5a29d90f714018c88fead2d5006ea90338fb5b7a1e4e98cb2e588c96cd861871d32176f6cc6f7c4e864ce5acae1aeed85d4c706ce2da8168986535baaf3a6 diff --git a/files/zfs/3602.2.1/overlay/sec-policy/selinux-base-policy/metadata.xml b/files/zfs/3602.2.1/overlay/sec-policy/selinux-base-policy/metadata.xml deleted file mode 100644 index 5828cfe..0000000 --- a/files/zfs/3602.2.1/overlay/sec-policy/selinux-base-policy/metadata.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - selinux@gentoo.org - SELinux Team - - - Gentoo SELinux base policy. This contains policy for a system at the end of system installation. - There is no extra policy in this package. - - - Enable support for the unconfined SELinux policy module - - diff --git a/files/zfs/3602.2.1/overlay/sec-policy/selinux-base-policy/selinux-base-policy-2.20221101-r3.ebuild b/files/zfs/3602.2.1/overlay/sec-policy/selinux-base-policy/selinux-base-policy-2.20221101-r3.ebuild deleted file mode 100644 index 5327824..0000000 --- a/files/zfs/3602.2.1/overlay/sec-policy/selinux-base-policy/selinux-base-policy-2.20221101-r3.ebuild +++ /dev/null @@ -1,141 +0,0 @@ -# Copyright 1999-2022 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI="7" - -if [[ ${PV} == 9999* ]]; then - EGIT_REPO_URI="${SELINUX_GIT_REPO:-https://anongit.gentoo.org/git/proj/hardened-refpolicy.git}" - EGIT_BRANCH="${SELINUX_GIT_BRANCH:-master}" - EGIT_CHECKOUT_DIR="${WORKDIR}/refpolicy" - - inherit git-r3 -else - SRC_URI="https://github.com/SELinuxProject/refpolicy/releases/download/RELEASE_${PV/./_}/refpolicy-${PV}.tar.bz2 - https://dev.gentoo.org/~perfinion/patches/${PN}/patchbundle-${PN}-${PVR}.tar.bz2" - KEYWORDS="amd64 arm arm64 ~mips x86" -fi - -HOMEPAGE="https://wiki.gentoo.org/wiki/Project:SELinux" -DESCRIPTION="SELinux policy for core modules" - -IUSE="systemd +unconfined" - -PDEPEND="unconfined? ( sec-policy/selinux-unconfined )" -DEPEND="=sec-policy/selinux-base-${PVR}[systemd?]" -RDEPEND="${DEPEND}" -BDEPEND=" - sys-apps/checkpolicy - sys-devel/m4" - -MODS="application authlogin bootloader clock consoletype cron dmesg fstools getty hostname init iptables libraries locallogin logging lvm miscfiles modutils mount mta netutils nscd portage raid rsync selinuxutil setrans ssh staff storage su sysadm sysnetwork systemd tmpfiles udev userdomain usermanage unprivuser xdg" -DEL_MODS="hotplug" -LICENSE="GPL-2" -SLOT="0" -S="${WORKDIR}/" - -# Code entirely copied from selinux-eclass (cannot inherit due to dependency on -# itself), when reworked reinclude it. Only postinstall (where -b base.pp is -# added) needs to remain then. - -pkg_pretend() { - for i in ${POLICY_TYPES}; do - if [[ "${i}" == "targeted" ]] && ! use unconfined; then - die "If you use POLICY_TYPES=targeted, then USE=unconfined is mandatory." - fi - done -} - -src_prepare() { - local modfiles - - if [[ ${PV} != 9999* ]]; then - einfo "Applying SELinux policy updates ... " - eapply -p0 "${WORKDIR}/0001-full-patch-against-stable-release.patch" - fi - - eapply_user - - # Collect only those files needed for this particular module - for i in ${MODS}; do - modfiles="$(find "${S}"/refpolicy/policy/modules -iname $i.te) $modfiles" - modfiles="$(find "${S}"/refpolicy/policy/modules -iname $i.fc) $modfiles" - done - - for i in ${DEL_MODS}; do - [[ "${MODS}" != *${i}* ]] || die "Duplicate module in MODS and DEL_MODS: ${i}" - done - - for i in ${POLICY_TYPES}; do - mkdir "${S}"/${i} || die "Failed to create directory ${S}/${i}" - cp "${S}"/refpolicy/doc/Makefile.example "${S}"/${i}/Makefile \ - || die "Failed to copy Makefile.example to ${S}/${i}/Makefile" - - cp ${modfiles} "${S}"/${i} \ - || die "Failed to copy the module files to ${S}/${i}" - done -} - -src_compile() { - for i in ${POLICY_TYPES}; do - emake NAME=$i SHAREDIR="${SYSROOT%/}/usr/share/selinux" -C "${S}"/${i} - done -} - -src_install() { - local BASEDIR="/usr/share/selinux" - - for i in ${POLICY_TYPES}; do - for j in ${MODS}; do - einfo "Installing ${i} ${j} policy package" - insinto ${BASEDIR}/${i} - doins "${S}"/${i}/${j}.pp - done - done -} - -pkg_postinst() { - # Set root path and don't load policy into the kernel when cross compiling - local root_opts="" - if [[ "${ROOT}" != "" ]]; then - root_opts="-p ${ROOT} -n" - fi - - # Override the command from the eclass, we need to load in base as well here - local COMMAND="-i base.pp" - if has_version " - - - - selinux@gentoo.org - SELinux Team - - - Gentoo SELinux base policy. This contains policy for a system at the end of system installation. - There is no extra policy in this package. - - - Enable User Based Access Control (UBAC) in the SELinux policy - Enable support for the unconfined SELinux module - Default allow unknown classes in kernels newer than the policy (SELinux policy capability). - - diff --git a/files/zfs/3602.2.1/overlay/sec-policy/selinux-base/selinux-base-2.20221101-r3.ebuild b/files/zfs/3602.2.1/overlay/sec-policy/selinux-base/selinux-base-2.20221101-r3.ebuild deleted file mode 100644 index d38a576..0000000 --- a/files/zfs/3602.2.1/overlay/sec-policy/selinux-base/selinux-base-2.20221101-r3.ebuild +++ /dev/null @@ -1,158 +0,0 @@ -# Copyright 1999-2023 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI="7" - -PYTHON_COMPAT=( python3_{9..11} ) -PYTHON_REQ_USE="xml(+)" -inherit python-any-r1 - -if [[ ${PV} == 9999* ]]; then - EGIT_REPO_URI="${SELINUX_GIT_REPO:-https://anongit.gentoo.org/git/proj/hardened-refpolicy.git}" - EGIT_BRANCH="${SELINUX_GIT_BRANCH:-master}" - EGIT_CHECKOUT_DIR="${WORKDIR}/refpolicy" - - inherit git-r3 -else - SRC_URI="https://github.com/SELinuxProject/refpolicy/releases/download/RELEASE_${PV/./_}/refpolicy-${PV}.tar.bz2 - https://dev.gentoo.org/~perfinion/patches/selinux-base-policy/patchbundle-selinux-base-policy-${PVR}.tar.bz2" - - KEYWORDS="amd64 arm arm64 ~mips x86" -fi - -IUSE="doc +unknown-perms systemd +ubac +unconfined" - -DESCRIPTION="Gentoo base policy for SELinux" -HOMEPAGE="https://wiki.gentoo.org/wiki/Project:SELinux" -LICENSE="GPL-2" -SLOT="0" - -RDEPEND=">=sys-apps/policycoreutils-2.8" -DEPEND="${RDEPEND}" -BDEPEND=" - ${PYTHON_DEPS} - >=sys-apps/checkpolicy-2.8 - sys-devel/m4" - -S=${WORKDIR}/ - -src_prepare() { - if [[ ${PV} != 9999* ]]; then - einfo "Applying SELinux policy updates ... " - eapply -p0 "${WORKDIR}/0001-full-patch-against-stable-release.patch" - fi - - eapply_user - - cd "${S}/refpolicy" || die - emake bare -} - -src_configure() { - [ -z "${POLICY_TYPES}" ] && local POLICY_TYPES="targeted strict mls mcs" - - # Update the SELinux refpolicy capabilities based on the users' USE flags. - if use unknown-perms; then - sed -i -e '/^UNK_PERMS/s/deny/allow/' "${S}/refpolicy/build.conf" \ - || die "Failed to allow Unknown Permissions Handling" - sed -i -e '/^UNK_PERMS/s/deny/allow/' "${S}/refpolicy/Makefile" \ - || die "Failed to allow Unknown Permissions Handling" - fi - - if ! use ubac; then - sed -i -e '/^UBAC/s/y/n/' "${S}/refpolicy/build.conf" \ - || die "Failed to disable User Based Access Control" - fi - - if use systemd; then - sed -i -e '/^SYSTEMD/s/n/y/' "${S}/refpolicy/build.conf" \ - || die "Failed to enable SystemD" - fi - - echo "DISTRO = gentoo" >> "${S}/refpolicy/build.conf" || die - - # Prepare initial configuration - cd "${S}/refpolicy" || die - emake conf - - # Setup the policies based on the types delivered by the end user. - # These types can be "targeted", "strict", "mcs" and "mls". - for i in ${POLICY_TYPES}; do - cp -a "${S}/refpolicy" "${S}/${i}" || die - cd "${S}/${i}" || die - - sed -i -e "/= module/d" "${S}/${i}/policy/modules.conf" || die - - sed -i -e '/^QUIET/s/n/y/' -e "/^NAME/s/refpolicy/$i/" \ - "${S}/${i}/build.conf" || die "build.conf setup failed." - - if [[ "${i}" == "mls" ]] || [[ "${i}" == "mcs" ]]; - then - # MCS/MLS require additional settings - sed -i -e "/^TYPE/s/standard/${i}/" "${S}/${i}/build.conf" \ - || die "failed to set type to mls" - fi - - if [ "${i}" == "targeted" ]; then - sed -i -e '/root/d' -e 's/user_u/unconfined_u/' \ - "${S}/${i}/config/appconfig-standard/seusers" \ - || die "targeted seusers setup failed." - fi - - if [ "${i}" != "targeted" ] && [ "${i}" != "strict" ] && use unconfined; then - sed -i -e '/root/d' -e 's/user_u/unconfined_u/' \ - "${S}/${i}/config/appconfig-${i}/seusers" \ - || die "policy seusers setup failed." - fi - done -} - -src_compile() { - [ -z "${POLICY_TYPES}" ] && local POLICY_TYPES="targeted strict mls mcs" - - for i in ${POLICY_TYPES}; do - cd "${S}/${i}" || die - emake base - if use doc; then - emake html - fi - done -} - -src_install() { - [ -z "${POLICY_TYPES}" ] && local POLICY_TYPES="targeted strict mls mcs" - - for i in ${POLICY_TYPES}; do - cd "${S}/${i}" || die - - emake DESTDIR="${D}" install - emake DESTDIR="${D}" install-headers - - echo "run_init_t" > "${D}/etc/selinux/${i}/contexts/run_init_type" || die - - echo "textrel_shlib_t" >> "${D}/etc/selinux/${i}/contexts/customizable_types" || die - - # libsemanage won't make this on its own - keepdir "/etc/selinux/${i}/policy" - - if use doc; then - docinto ${i}/html - dodoc -r doc/html/*; - fi - - insinto /usr/share/selinux/devel; - doins doc/policy.xml; - - done - - docinto / - dodoc doc/Makefile.example doc/example.{te,fc,if} - - doman man/man8/*.8; - - insinto /etc/selinux - doins "${FILESDIR}/config" - - insinto /usr/share/portage/config/sets - doins "${FILESDIR}/selinux.conf" -} diff --git a/files/zfs/3602.2.1/overlay/sec-policy/selinux-base/selinux-base-2.20221101-r4.ebuild b/files/zfs/3602.2.1/overlay/sec-policy/selinux-base/selinux-base-2.20221101-r4.ebuild deleted file mode 100644 index d38a576..0000000 --- a/files/zfs/3602.2.1/overlay/sec-policy/selinux-base/selinux-base-2.20221101-r4.ebuild +++ /dev/null @@ -1,158 +0,0 @@ -# Copyright 1999-2023 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI="7" - -PYTHON_COMPAT=( python3_{9..11} ) -PYTHON_REQ_USE="xml(+)" -inherit python-any-r1 - -if [[ ${PV} == 9999* ]]; then - EGIT_REPO_URI="${SELINUX_GIT_REPO:-https://anongit.gentoo.org/git/proj/hardened-refpolicy.git}" - EGIT_BRANCH="${SELINUX_GIT_BRANCH:-master}" - EGIT_CHECKOUT_DIR="${WORKDIR}/refpolicy" - - inherit git-r3 -else - SRC_URI="https://github.com/SELinuxProject/refpolicy/releases/download/RELEASE_${PV/./_}/refpolicy-${PV}.tar.bz2 - https://dev.gentoo.org/~perfinion/patches/selinux-base-policy/patchbundle-selinux-base-policy-${PVR}.tar.bz2" - - KEYWORDS="amd64 arm arm64 ~mips x86" -fi - -IUSE="doc +unknown-perms systemd +ubac +unconfined" - -DESCRIPTION="Gentoo base policy for SELinux" -HOMEPAGE="https://wiki.gentoo.org/wiki/Project:SELinux" -LICENSE="GPL-2" -SLOT="0" - -RDEPEND=">=sys-apps/policycoreutils-2.8" -DEPEND="${RDEPEND}" -BDEPEND=" - ${PYTHON_DEPS} - >=sys-apps/checkpolicy-2.8 - sys-devel/m4" - -S=${WORKDIR}/ - -src_prepare() { - if [[ ${PV} != 9999* ]]; then - einfo "Applying SELinux policy updates ... " - eapply -p0 "${WORKDIR}/0001-full-patch-against-stable-release.patch" - fi - - eapply_user - - cd "${S}/refpolicy" || die - emake bare -} - -src_configure() { - [ -z "${POLICY_TYPES}" ] && local POLICY_TYPES="targeted strict mls mcs" - - # Update the SELinux refpolicy capabilities based on the users' USE flags. - if use unknown-perms; then - sed -i -e '/^UNK_PERMS/s/deny/allow/' "${S}/refpolicy/build.conf" \ - || die "Failed to allow Unknown Permissions Handling" - sed -i -e '/^UNK_PERMS/s/deny/allow/' "${S}/refpolicy/Makefile" \ - || die "Failed to allow Unknown Permissions Handling" - fi - - if ! use ubac; then - sed -i -e '/^UBAC/s/y/n/' "${S}/refpolicy/build.conf" \ - || die "Failed to disable User Based Access Control" - fi - - if use systemd; then - sed -i -e '/^SYSTEMD/s/n/y/' "${S}/refpolicy/build.conf" \ - || die "Failed to enable SystemD" - fi - - echo "DISTRO = gentoo" >> "${S}/refpolicy/build.conf" || die - - # Prepare initial configuration - cd "${S}/refpolicy" || die - emake conf - - # Setup the policies based on the types delivered by the end user. - # These types can be "targeted", "strict", "mcs" and "mls". - for i in ${POLICY_TYPES}; do - cp -a "${S}/refpolicy" "${S}/${i}" || die - cd "${S}/${i}" || die - - sed -i -e "/= module/d" "${S}/${i}/policy/modules.conf" || die - - sed -i -e '/^QUIET/s/n/y/' -e "/^NAME/s/refpolicy/$i/" \ - "${S}/${i}/build.conf" || die "build.conf setup failed." - - if [[ "${i}" == "mls" ]] || [[ "${i}" == "mcs" ]]; - then - # MCS/MLS require additional settings - sed -i -e "/^TYPE/s/standard/${i}/" "${S}/${i}/build.conf" \ - || die "failed to set type to mls" - fi - - if [ "${i}" == "targeted" ]; then - sed -i -e '/root/d' -e 's/user_u/unconfined_u/' \ - "${S}/${i}/config/appconfig-standard/seusers" \ - || die "targeted seusers setup failed." - fi - - if [ "${i}" != "targeted" ] && [ "${i}" != "strict" ] && use unconfined; then - sed -i -e '/root/d' -e 's/user_u/unconfined_u/' \ - "${S}/${i}/config/appconfig-${i}/seusers" \ - || die "policy seusers setup failed." - fi - done -} - -src_compile() { - [ -z "${POLICY_TYPES}" ] && local POLICY_TYPES="targeted strict mls mcs" - - for i in ${POLICY_TYPES}; do - cd "${S}/${i}" || die - emake base - if use doc; then - emake html - fi - done -} - -src_install() { - [ -z "${POLICY_TYPES}" ] && local POLICY_TYPES="targeted strict mls mcs" - - for i in ${POLICY_TYPES}; do - cd "${S}/${i}" || die - - emake DESTDIR="${D}" install - emake DESTDIR="${D}" install-headers - - echo "run_init_t" > "${D}/etc/selinux/${i}/contexts/run_init_type" || die - - echo "textrel_shlib_t" >> "${D}/etc/selinux/${i}/contexts/customizable_types" || die - - # libsemanage won't make this on its own - keepdir "/etc/selinux/${i}/policy" - - if use doc; then - docinto ${i}/html - dodoc -r doc/html/*; - fi - - insinto /usr/share/selinux/devel; - doins doc/policy.xml; - - done - - docinto / - dodoc doc/Makefile.example doc/example.{te,fc,if} - - doman man/man8/*.8; - - insinto /etc/selinux - doins "${FILESDIR}/config" - - insinto /usr/share/portage/config/sets - doins "${FILESDIR}/selinux.conf" -} diff --git a/files/zfs/3602.2.1/overlay/sec-policy/selinux-base/selinux-base-9999.ebuild b/files/zfs/3602.2.1/overlay/sec-policy/selinux-base/selinux-base-9999.ebuild deleted file mode 100644 index 1185969..0000000 --- a/files/zfs/3602.2.1/overlay/sec-policy/selinux-base/selinux-base-9999.ebuild +++ /dev/null @@ -1,158 +0,0 @@ -# Copyright 1999-2023 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI="7" - -PYTHON_COMPAT=( python3_{9..11} ) -PYTHON_REQ_USE="xml(+)" -inherit python-any-r1 - -if [[ ${PV} == 9999* ]]; then - EGIT_REPO_URI="${SELINUX_GIT_REPO:-https://anongit.gentoo.org/git/proj/hardened-refpolicy.git}" - EGIT_BRANCH="${SELINUX_GIT_BRANCH:-master}" - EGIT_CHECKOUT_DIR="${WORKDIR}/refpolicy" - - inherit git-r3 -else - SRC_URI="https://github.com/SELinuxProject/refpolicy/releases/download/RELEASE_${PV/./_}/refpolicy-${PV}.tar.bz2 - https://dev.gentoo.org/~perfinion/patches/selinux-base-policy/patchbundle-selinux-base-policy-${PVR}.tar.bz2" - - KEYWORDS="~amd64 ~arm ~arm64 ~mips ~x86" -fi - -IUSE="doc +unknown-perms systemd +ubac +unconfined" - -DESCRIPTION="Gentoo base policy for SELinux" -HOMEPAGE="https://wiki.gentoo.org/wiki/Project:SELinux" -LICENSE="GPL-2" -SLOT="0" - -RDEPEND=">=sys-apps/policycoreutils-2.8" -DEPEND="${RDEPEND}" -BDEPEND=" - ${PYTHON_DEPS} - >=sys-apps/checkpolicy-2.8 - sys-devel/m4" - -S=${WORKDIR}/ - -src_prepare() { - if [[ ${PV} != 9999* ]]; then - einfo "Applying SELinux policy updates ... " - eapply -p0 "${WORKDIR}/0001-full-patch-against-stable-release.patch" - fi - - eapply_user - - cd "${S}/refpolicy" || die - emake bare -} - -src_configure() { - [ -z "${POLICY_TYPES}" ] && local POLICY_TYPES="targeted strict mls mcs" - - # Update the SELinux refpolicy capabilities based on the users' USE flags. - if use unknown-perms; then - sed -i -e '/^UNK_PERMS/s/deny/allow/' "${S}/refpolicy/build.conf" \ - || die "Failed to allow Unknown Permissions Handling" - sed -i -e '/^UNK_PERMS/s/deny/allow/' "${S}/refpolicy/Makefile" \ - || die "Failed to allow Unknown Permissions Handling" - fi - - if ! use ubac; then - sed -i -e '/^UBAC/s/y/n/' "${S}/refpolicy/build.conf" \ - || die "Failed to disable User Based Access Control" - fi - - if use systemd; then - sed -i -e '/^SYSTEMD/s/n/y/' "${S}/refpolicy/build.conf" \ - || die "Failed to enable SystemD" - fi - - echo "DISTRO = gentoo" >> "${S}/refpolicy/build.conf" || die - - # Prepare initial configuration - cd "${S}/refpolicy" || die - emake conf - - # Setup the policies based on the types delivered by the end user. - # These types can be "targeted", "strict", "mcs" and "mls". - for i in ${POLICY_TYPES}; do - cp -a "${S}/refpolicy" "${S}/${i}" || die - cd "${S}/${i}" || die - - sed -i -e "/= module/d" "${S}/${i}/policy/modules.conf" || die - - sed -i -e '/^QUIET/s/n/y/' -e "/^NAME/s/refpolicy/$i/" \ - "${S}/${i}/build.conf" || die "build.conf setup failed." - - if [[ "${i}" == "mls" ]] || [[ "${i}" == "mcs" ]]; - then - # MCS/MLS require additional settings - sed -i -e "/^TYPE/s/standard/${i}/" "${S}/${i}/build.conf" \ - || die "failed to set type to mls" - fi - - if [ "${i}" == "targeted" ]; then - sed -i -e '/root/d' -e 's/user_u/unconfined_u/' \ - "${S}/${i}/config/appconfig-standard/seusers" \ - || die "targeted seusers setup failed." - fi - - if [ "${i}" != "targeted" ] && [ "${i}" != "strict" ] && use unconfined; then - sed -i -e '/root/d' -e 's/user_u/unconfined_u/' \ - "${S}/${i}/config/appconfig-${i}/seusers" \ - || die "policy seusers setup failed." - fi - done -} - -src_compile() { - [ -z "${POLICY_TYPES}" ] && local POLICY_TYPES="targeted strict mls mcs" - - for i in ${POLICY_TYPES}; do - cd "${S}/${i}" || die - emake base - if use doc; then - emake html - fi - done -} - -src_install() { - [ -z "${POLICY_TYPES}" ] && local POLICY_TYPES="targeted strict mls mcs" - - for i in ${POLICY_TYPES}; do - cd "${S}/${i}" || die - - emake DESTDIR="${D}" install - emake DESTDIR="${D}" install-headers - - echo "run_init_t" > "${D}/etc/selinux/${i}/contexts/run_init_type" || die - - echo "textrel_shlib_t" >> "${D}/etc/selinux/${i}/contexts/customizable_types" || die - - # libsemanage won't make this on its own - keepdir "/etc/selinux/${i}/policy" - - if use doc; then - docinto ${i}/html - dodoc -r doc/html/*; - fi - - insinto /usr/share/selinux/devel; - doins doc/policy.xml; - - done - - docinto / - dodoc doc/Makefile.example doc/example.{te,fc,if} - - doman man/man8/*.8; - - insinto /etc/selinux - doins "${FILESDIR}/config" - - insinto /usr/share/portage/config/sets - doins "${FILESDIR}/selinux.conf" -} diff --git a/files/zfs/3602.2.1/overlay/sec-policy/selinux-zfs/Manifest b/files/zfs/3602.2.1/overlay/sec-policy/selinux-zfs/Manifest deleted file mode 100644 index 1029253..0000000 --- a/files/zfs/3602.2.1/overlay/sec-policy/selinux-zfs/Manifest +++ /dev/null @@ -1,3 +0,0 @@ -DIST patchbundle-selinux-base-policy-2.20221101-r3.tar.bz2 444710 BLAKE2B e33cc01a8be5a354e022be1e8bf242883b09b15ead0673f859819f5e668f18773a16527f2e608878e6976695dcb2890c55658e77877e93c716ae0b2dd2ed5a9b SHA512 52e60b22346903a6fead95c9fb348fa1d4037b7dcd3e5781248a7dfc426c8c3fced258fd22762c779a5f436d8be21eaed5425ed36ff99c267daae5e1cb9c8e7f -DIST patchbundle-selinux-base-policy-2.20221101-r4.tar.bz2 457886 BLAKE2B 1e085f9f1739e0640c5eafa70db4c7ec19bca887c682ca2312a457fa57ee3eb176d0c8f16c2f84a1a026669b1240be3ff69066bd825c92fad75dcd2c13739f6c SHA512 da3ba1f076c04746719698aedb3aad48eb7c8a09df95c314b36f7a052538a07d893be413f35f4c34b01c1bf967ebe35ff32c2cea0722fe74a6e089a9d6aa47a6 -DIST refpolicy-2.20221101.tar.bz2 583183 BLAKE2B 783d8af40fd77d7ddb848dba32e91921dd7c1380c094c45b719ada7b15f91aacbb52b410ffa6341f2f705ecbc9674b8570bd4867ce998e944fa0054ffd8bdf74 SHA512 29e5a29d90f714018c88fead2d5006ea90338fb5b7a1e4e98cb2e588c96cd861871d32176f6cc6f7c4e864ce5acae1aeed85d4c706ce2da8168986535baaf3a6 diff --git a/files/zfs/3602.2.1/overlay/sec-policy/selinux-zfs/metadata.xml b/files/zfs/3602.2.1/overlay/sec-policy/selinux-zfs/metadata.xml deleted file mode 100644 index 781bc07..0000000 --- a/files/zfs/3602.2.1/overlay/sec-policy/selinux-zfs/metadata.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - selinux@gentoo.org - SELinux Team - - diff --git a/files/zfs/3602.2.1/overlay/sec-policy/selinux-zfs/selinux-zfs-2.20221101-r3.ebuild b/files/zfs/3602.2.1/overlay/sec-policy/selinux-zfs/selinux-zfs-2.20221101-r3.ebuild deleted file mode 100644 index b782d3a..0000000 --- a/files/zfs/3602.2.1/overlay/sec-policy/selinux-zfs/selinux-zfs-2.20221101-r3.ebuild +++ /dev/null @@ -1,15 +0,0 @@ -# Copyright 1999-2022 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI="7" - -IUSE="" -MODS="zfs" - -inherit selinux-policy-2 - -DESCRIPTION="SELinux policy for zfs" - -if [[ ${PV} != 9999* ]] ; then - KEYWORDS="amd64 arm arm64 ~mips x86" -fi diff --git a/files/zfs/3602.2.1/overlay/sec-policy/selinux-zfs/selinux-zfs-2.20221101-r4.ebuild b/files/zfs/3602.2.1/overlay/sec-policy/selinux-zfs/selinux-zfs-2.20221101-r4.ebuild deleted file mode 100644 index 2eabf7c..0000000 --- a/files/zfs/3602.2.1/overlay/sec-policy/selinux-zfs/selinux-zfs-2.20221101-r4.ebuild +++ /dev/null @@ -1,15 +0,0 @@ -# Copyright 1999-2023 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI="7" - -IUSE="" -MODS="zfs" - -inherit selinux-policy-2 - -DESCRIPTION="SELinux policy for zfs" - -if [[ ${PV} != 9999* ]] ; then - KEYWORDS="amd64 arm arm64 ~mips x86" -fi diff --git a/files/zfs/3602.2.1/overlay/sec-policy/selinux-zfs/selinux-zfs-9999.ebuild b/files/zfs/3602.2.1/overlay/sec-policy/selinux-zfs/selinux-zfs-9999.ebuild deleted file mode 100644 index 7f6f6f3..0000000 --- a/files/zfs/3602.2.1/overlay/sec-policy/selinux-zfs/selinux-zfs-9999.ebuild +++ /dev/null @@ -1,15 +0,0 @@ -# Copyright 1999-2022 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI="7" - -IUSE="" -MODS="zfs" - -inherit selinux-policy-2 - -DESCRIPTION="SELinux policy for zfs" - -if [[ ${PV} != 9999* ]] ; then - KEYWORDS="~amd64 ~arm ~arm64 ~mips ~x86" -fi diff --git a/files/zfs/3602.2.1/overlay/sys-fs/udev-init-scripts/Manifest b/files/zfs/3602.2.1/overlay/sys-fs/udev-init-scripts/Manifest deleted file mode 100644 index 838b43a..0000000 --- a/files/zfs/3602.2.1/overlay/sys-fs/udev-init-scripts/Manifest +++ /dev/null @@ -1,2 +0,0 @@ -DIST udev-init-scripts-34.tar.gz 3660 BLAKE2B 954b003c78b31649fef69213a5424098f40e17e7ed11f4ec1443247950ea60db8536f37ca603caa06e5c9f8bab07b5ac3cb8c9435144532a97ff04836c24da49 SHA512 ed48bcd0815e235b2b3fa38f857cd97f164aac7c6ea805be87890eb06a0d52064bd733da240c6e2a34c8c73e10fd047b5e53096de06f17bc81d8266d70c0cc9d -DIST udev-init-scripts-35.tar.gz 3666 BLAKE2B fddae466428605ea930519e8a47e0ea91f89f9eacc1fd97c137d175142125b12c3d045aec68db35a463de444ac6d8c037cca55f9628f10576c968259d566a9e4 SHA512 da9d2093149967e2e1b9bc7190ddfd55a87c9ae2177e3216f7cb2694fc9b64037eb6f2599ad8a4b7594ef32ced88fbb319c92904bc72a81ea5404945f8a8378a diff --git a/files/zfs/3602.2.1/overlay/sys-fs/udev-init-scripts/metadata.xml b/files/zfs/3602.2.1/overlay/sys-fs/udev-init-scripts/metadata.xml deleted file mode 100644 index 31123d0..0000000 --- a/files/zfs/3602.2.1/overlay/sys-fs/udev-init-scripts/metadata.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - systemd@gentoo.org - - diff --git a/files/zfs/3602.2.1/overlay/sys-fs/udev-init-scripts/udev-init-scripts-34.ebuild b/files/zfs/3602.2.1/overlay/sys-fs/udev-init-scripts/udev-init-scripts-34.ebuild deleted file mode 100644 index 26fa347..0000000 --- a/files/zfs/3602.2.1/overlay/sys-fs/udev-init-scripts/udev-init-scripts-34.ebuild +++ /dev/null @@ -1,50 +0,0 @@ -# Copyright 1999-2021 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 -OLD_PN=udev-gentoo-scripts -OLD_P=${OLD_PN}-${PV} - -if [ "${PV}" = "9999" ]; then - EGIT_REPO_URI="git://anongit.gentoo.org/proj/${OLD_PN}.git" - inherit git-r3 -else - SRC_URI="https://gitweb.gentoo.org/proj/${OLD_PN}.git/snapshot/${OLD_P}.tar.gz -> ${P}.tar.gz" - S="${WORKDIR}/${OLD_P}" - KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86" -fi - -DESCRIPTION="udev startup scripts for openrc" -HOMEPAGE="https://wiki.gentoo.org/wiki/No_homepage" - -LICENSE="GPL-2" -SLOT="0" - -RESTRICT="test" - -RDEPEND=">=virtual/udev-217 - !$1/build.log 2>&1]) diff --git a/files/zfs/3602.2.1/overlay/sys-fs/zfs-kmod/metadata.xml b/files/zfs/3602.2.1/overlay/sys-fs/zfs-kmod/metadata.xml deleted file mode 100644 index 7e27782..0000000 --- a/files/zfs/3602.2.1/overlay/sys-fs/zfs-kmod/metadata.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - gyakovlev@gentoo.org - Georgy Yakovlev - - - sam@gentoo.org - Sam James - - - Prevents upgrading to an unsupported kernel version when combined with USE=dist-kernel - Pull dependencies and check kernel options required for root-on-zfs - - - https://github.com/openzfs/zfs/issues - https://openzfs.github.io/openzfs-docs - openzfs/zfs - - diff --git a/files/zfs/3602.2.1/overlay/sys-fs/zfs-kmod/zfs-kmod-2.1.11-r1.ebuild b/files/zfs/3602.2.1/overlay/sys-fs/zfs-kmod/zfs-kmod-2.1.11-r1.ebuild deleted file mode 100644 index 7bf3eba..0000000 --- a/files/zfs/3602.2.1/overlay/sys-fs/zfs-kmod/zfs-kmod-2.1.11-r1.ebuild +++ /dev/null @@ -1,177 +0,0 @@ -# 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-r1 multiprocessing - -DESCRIPTION="Linux ZFS kernel module for sys-fs/zfs" -HOMEPAGE="https://github.com/openzfs/zfs" - -MODULES_KERNEL_MAX=6.2 -MODULES_KERNEL_MIN=3.10 - -if [[ ${PV} == 9999 ]] ; then - EGIT_REPO_URI="https://github.com/openzfs/zfs.git" - inherit git-r3 - unset MODULES_KERNEL_MAX -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="${MODULES_KERNEL_MAX}" - # 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" -RESTRICT="test" - -BDEPEND=" - dev-lang/perl - app-alternatives/awk -" - -if [[ ${PV} != 9999 ]] ; then - BDEPEND+=" verify-sig? ( sec-keys/openpgp-keys-openzfs )" - - IUSE+=" +dist-kernel-cap" - RDEPEND=" - dist-kernel-cap? ( dist-kernel? ( - 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? ( 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" -RESTRICT="test" - -BDEPEND=" - dev-lang/perl - app-alternatives/awk -" - -if [[ ${PV} != 9999 ]] ; then - BDEPEND+=" verify-sig? ( sec-keys/openpgp-keys-openzfs )" - - IUSE+=" +dist-kernel-cap" - RDEPEND=" - dist-kernel-cap? ( dist-kernel? ( - 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? ( 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" -RESTRICT="test" - -BDEPEND=" - app-alternatives/awk - dev-lang/perl -" - -if [[ ${PV} != 9999 ]] ; then - BDEPEND+=" verify-sig? ( sec-keys/openpgp-keys-openzfs )" - - IUSE+=" +dist-kernel-cap" - RDEPEND=" - dist-kernel-cap? ( dist-kernel? ( - 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" -RESTRICT="test" - -BDEPEND=" - app-alternatives/awk - dev-lang/perl -" - -if [[ ${PV} != 9999 ]] ; then - BDEPEND+=" verify-sig? ( sec-keys/openpgp-keys-openzfs )" - - IUSE+=" +dist-kernel-cap" - RDEPEND=" - dist-kernel-cap? ( dist-kernel? ( - -Date: Thu, 30 Jun 2022 13:47:58 -0400 -Subject: [PATCH] dracut: fix boot on non-zfs-root systems - -Simply prevent overwriting root until it needs to be overwritten. - -Dracut could change this value before this module is called, but won't -change the kernel command line. - -Reviewed-by: Andrew J. Hesford -Signed-off-by: Toyam Cox -Closes #13592 ---- - contrib/dracut/90zfs/zfs-lib.sh.in | 10 +++++----- - 1 file changed, 5 insertions(+), 5 deletions(-) - -diff --git a/contrib/dracut/90zfs/zfs-lib.sh.in b/contrib/dracut/90zfs/zfs-lib.sh.in -index e44673c2d75..3a43e514d6f 100755 ---- a/contrib/dracut/90zfs/zfs-lib.sh.in -+++ b/contrib/dracut/90zfs/zfs-lib.sh.in -@@ -88,11 +88,11 @@ decode_root_args() { - return - fi - -- root=$(getarg root=) -+ xroot=$(getarg root=) - rootfstype=$(getarg rootfstype=) - - # shellcheck disable=SC2249 -- case "$root" in -+ case "$xroot" in - ""|zfs|zfs:|zfs:AUTO) - root=zfs:AUTO - rootfstype=zfs -@@ -100,7 +100,7 @@ decode_root_args() { - ;; - - ZFS=*|zfs:*) -- root="${root#zfs:}" -+ root="${xroot#zfs:}" - root="${root#ZFS=}" - root=$(echo "$root" | tr '+' ' ') - rootfstype=zfs -@@ -109,9 +109,9 @@ decode_root_args() { - esac - - if [ "$rootfstype" = "zfs" ]; then -- case "$root" in -+ case "$xroot" in - "") root=zfs:AUTO ;; -- *) root=$(echo "$root" | tr '+' ' ') ;; -+ *) root=$(echo "$xroot" | tr '+' ' ') ;; - esac - return 0 - fi - diff --git a/files/zfs/3602.2.1/overlay/sys-fs/zfs/metadata.xml b/files/zfs/3602.2.1/overlay/sys-fs/zfs/metadata.xml deleted file mode 100644 index 8518b15..0000000 --- a/files/zfs/3602.2.1/overlay/sys-fs/zfs/metadata.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - - - gyakovlev@gentoo.org - Georgy Yakovlev - - - sam@gentoo.org - Sam James - - - Disable dependency on sys-fs/zfs-kmod under the assumption that ZFS is part of the kernel source tree - Don't install python scripts (arcstat, dbufstat etc) and avoid dependency on dev-lang/python - Install zfs_key pam module, for automatically loading zfs encryption keys for home datasets - Enable dependencies required for booting off a pool containing a rootfs - Install regression test suite - - - https://github.com/openzfs/zfs/issues - https://openzfs.github.io/openzfs-docs - openzfs/zfs - - - OpenZFS is an advanced file system and volume manager which was originally developed - for Solaris and is now maintained by the OpenZFS community - - It includes the functionality of both traditional file systems and volume manager. - It has many advanced features including: - * Protection against data corruption. Integrity checking for both data and metadata. - * Continuous integrity verification and automatic “self-healing” repair - * Data redundancy with mirroring, RAID-Z1/2/3 [and DRAID] - * Support for high storage capacities — up to 256 trillion yobibytes (2^128 bytes) - * Space-saving with transparent compression using LZ4, GZIP or ZSTD - * Hardware-accelerated native encryption - * Efficient storage with snapshots and copy-on-write clones - * Efficient local or remote replication — send only changed blocks with ZFS send and receive - - The OpenZFS project brings together developers from the Linux, FreeBSD, illumos, MacOS, and Windows platforms. - OpenZFS is supported by a wide range of companies. - - diff --git a/files/zfs/3602.2.1/overlay/sys-fs/zfs/zfs-2.1.11.ebuild b/files/zfs/3602.2.1/overlay/sys-fs/zfs/zfs-2.1.11.ebuild deleted file mode 100644 index c67dc48..0000000 --- a/files/zfs/3602.2.1/overlay/sys-fs/zfs/zfs-2.1.11.ebuild +++ /dev/null @@ -1,320 +0,0 @@ -# Copyright 1999-2023 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -DISTUTILS_OPTIONAL=1 -PYTHON_COMPAT=( python3_{9..11} ) - -inherit autotools bash-completion-r1 dist-kernel-utils distutils-r1 flag-o-matic linux-info pam systemd udev usr-ldscript - -DESCRIPTION="Userland utilities for ZFS Linux kernel module" -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_P="${P/_rc/-rc}" - SRC_URI="https://github.com/openzfs/${PN}/releases/download/${MY_P}/${MY_P}.tar.gz" - SRC_URI+=" verify-sig? ( https://github.com/openzfs/${PN}/releases/download/${MY_P}/${MY_P}.tar.gz.asc )" - S="${WORKDIR}/${P%_rc?}" - - if [[ ${PV} != *_rc* ]]; then - KEYWORDS="amd64 arm64 ppc64 ~riscv ~sparc" - fi -fi - -LICENSE="BSD-2 CDDL MIT" -# just libzfs soname major for now. -# possible candidates: libuutil, libzpool, libnvpair. Those do not provide stable abi, but are considered. -# see libsoversion_check() below as well -SLOT="0/5" -IUSE="custom-cflags debug dist-kernel kernel-builtin minimal nls pam python +rootfs selinux test-suite" - -DEPEND=" - net-libs/libtirpc:= - sys-apps/util-linux - sys-libs/zlib - virtual/libudev:= - dev-libs/openssl:0= - !minimal? ( ${PYTHON_DEPS} ) - pam? ( sys-libs/pam ) - python? ( - virtual/python-cffi[${PYTHON_USEDEP}] - ) -" - -BDEPEND="app-alternatives/awk - virtual/pkgconfig - nls? ( sys-devel/gettext ) - python? ( - dev-python/setuptools[${PYTHON_USEDEP}] - || ( - dev-python/packaging[${PYTHON_USEDEP}] - dev-python/distlib[${PYTHON_USEDEP}] - ) - ) -" - -if [[ ${PV} != "9999" ]] ; then - BDEPEND+=" verify-sig? ( sec-keys/openpgp-keys-openzfs )" -fi - -# awk is used for some scripts, completions, and the Dracut module -RDEPEND="${DEPEND} - !kernel-builtin? ( ~sys-fs/zfs-kmod-${PV}:= ) - !prefix? ( virtual/udev ) - sys-fs/udev-init-scripts - app-alternatives/awk - dist-kernel? ( virtual/dist-kernel:= ) - rootfs? ( - app-arch/cpio - app-misc/pax-utils - ) - selinux? ( sec-policy/selinux-zfs ) - test-suite? ( - app-shells/ksh - sys-apps/kmod[tools] - sys-apps/util-linux - sys-devel/bc - sys-block/parted - sys-fs/lsscsi - sys-fs/mdadm - sys-process/procps - ) -" - -# PDEPEND in this form is needed to trick portage suggest -# enabling dist-kernel if only 1 package have it set, without suggesting to disable -PDEPEND="dist-kernel? ( ~sys-fs/zfs-kmod-${PV}[dist-kernel] )" - -REQUIRED_USE=" - !minimal? ( ${PYTHON_REQUIRED_USE} ) - python? ( !minimal ) - test-suite? ( !minimal ) -" - -RESTRICT="test" - -PATCHES=( - # bug #854333 - "${FILESDIR}"/2.1.5-r2-dracut-non-root.patch - - "${FILESDIR}"/2.1.5-dracut-zfs-missing.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() { - if use kernel_linux; then - linux-info_pkg_setup - - if ! linux_config_exists; then - ewarn "Cannot check the linux kernel configuration." - else - if use test-suite; then - if linux_chkconfig_present BLK_DEV_LOOP; then - eerror "The ZFS test suite requires loop device support enabled." - eerror "Please enable it:" - eerror " CONFIG_BLK_DEV_LOOP=y" - eerror "in /usr/src/linux/.config or" - eerror " Device Drivers --->" - eerror " Block devices --->" - eerror " [X] Loopback device support" - fi - fi - fi - fi -} - -libsoversion_check() { - local bugurl libzfs_sover - bugurl="https://bugs.gentoo.org/enter_bug.cgi?form_name=enter_bug&product=Gentoo+Linux&component=Current+packages" - - libzfs_sover="$(grep 'libzfs_la_LDFLAGS += -version-info' lib/libzfs/Makefile.am \ - | grep -Eo '[0-9]+:[0-9]+:[0-9]+')" - libzfs_sover="${libzfs_sover%%:*}" - - if [[ ${libzfs_sover} -ne $(ver_cut 2 ${SLOT}) ]]; then - echo - eerror "BUG BUG BUG BUG BUG BUG BUG BUG" - eerror "ebuild subslot does not match libzfs soversion!" - eerror "libzfs soversion: ${libzfs_sover}" - eerror "ebuild value: $(ver_cut 2 ${SLOT})" - eerror "This is a bug in the ebuild, please use the following URL to report it" - eerror "${bugurl}&short_desc=${CATEGORY}%2F${P}+update+subslot" - echo - # we want to abort for releases, but just print a warning for live ebuild - # to keep package installable - [[ ${PV} == "9999" ]] || die - fi -} - -src_unpack() { - if use verify-sig ; then - # Needed for downloaded patch (which is unsigned, which is fine) - verify-sig_verify_detached "${DISTDIR}"/${MY_P}.tar.gz{,.asc} - fi - - default -} - -src_prepare() { - default - libsoversion_check - - # Run unconditionally (bug #792627) - eautoreconf - - if [[ ${PV} != "9999" ]]; then - # Set revision number - sed -i "s/\(Release:\)\(.*\)1/\1\2${PR}-gentoo/" META || die "Could not set Gentoo release" - fi - - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_prepare - popd >/dev/null || die - fi - - # prevent errors showing up on zfs-mount stop, #647688 - # openrc will unmount all filesystems anyway. - sed -i "/^ZFS_UNMOUNT=/ s/yes/no/" "etc/default/zfs.in" || die -} - -src_configure() { - use custom-cflags || strip-flags - use minimal || python_setup - - # All the same issue: - # Segfaults w/ GCC 12 and 'zfs send' - # bug #856373 - # https://github.com/openzfs/zfs/issues/13620 - # https://github.com/openzfs/zfs/issues/13605 - append-flags -fno-tree-vectorize - - local myconf=( - --bindir="${EPREFIX}/bin" - --enable-shared - --enable-sysvinit - --localstatedir="${EPREFIX}/var" - --sbindir="${EPREFIX}/sbin" - --with-config=user - --with-dracutdir="${EPREFIX}/usr/lib/dracut" - --with-linux="${KV_DIR}" - --with-linux-obj="${KV_OUT_DIR}" - --with-udevdir="$(get_udevdir)" - --with-pamconfigsdir="${EPREFIX}/unwanted_files" - --with-pammoduledir="$(getpam_mod_dir)" - --with-systemdunitdir="$(systemd_get_systemunitdir)" - --with-systemdpresetdir="$(systemd_get_systempresetdir)" - --with-vendor=gentoo - # Building zfs-mount-generator.c on musl breaks as strndupa - # isn't available. But systemd doesn't support musl anyway, so - # just disable building it. - $(use_enable !elibc_musl systemd) - $(use_enable debug) - $(use_enable nls) - $(use_enable pam) - $(use_enable python pyzfs) - --disable-static - $(usex minimal --without-python --with-python="${EPYTHON}") - ) - - econf "${myconf[@]}" -} - -src_compile() { - default - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_compile - popd >/dev/null || die - fi -} - -src_install() { - default - - gen_usr_ldscript -a nvpair uutil zfsbootenv zfs zfs_core zpool - - use pam && { rm -rv "${ED}/unwanted_files" || die ; } - - use test-suite || { rm -r "${ED}"/usr/share/zfs/{test-runner,zfs-tests,runfiles,*sh} || die ; } - - find "${ED}" -name '*.la' -delete || die - - dobashcomp contrib/bash_completion.d/zfs - bashcomp_alias zfs zpool - - # strip executable bit from conf.d file - fperms 0644 /etc/conf.d/zfs - - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_install - popd >/dev/null || die - fi - - # enforce best available python implementation - use minimal || python_fix_shebang "${ED}/bin" -} - -pkg_postinst() { - udev_reload - - # we always need userspace utils in sync with zfs-kmod - # so force initrd update for userspace as well, to avoid - # situation when zfs-kmod trigger initrd rebuild before - # userspace component is rebuilt - # KV_* variables are provided by linux-info.eclass - if [[ -z ${ROOT} ]] && use dist-kernel; then - dist-kernel_reinstall_initramfs "${KV_DIR}" "${KV_FULL}" - fi - - if use rootfs; then - if ! has_version sys-kernel/genkernel && ! has_version sys-kernel/dracut; then - elog "Root on zfs requires an initramfs to boot" - elog "The following packages provide one and are tested on a regular basis:" - elog " sys-kernel/dracut ( preferred, module maintained by zfs developers )" - elog " sys-kernel/genkernel" - fi - fi - - if systemd_is_booted || has_version sys-apps/systemd; then - einfo "Please refer to ${EROOT}/$(systemd_get_systempresetdir)/50-zfs.preset" - einfo "for default zfs systemd service configuration" - else - [[ -e "${EROOT}/etc/runlevels/boot/zfs-import" ]] || \ - einfo "You should add zfs-import to the boot runlevel." - [[ -e "${EROOT}/etc/runlevels/boot/zfs-load-key" ]] || \ - einfo "You should add zfs-load-key to the boot runlevel." - [[ -e "${EROOT}/etc/runlevels/boot/zfs-mount" ]]|| \ - einfo "You should add zfs-mount to the boot runlevel." - [[ -e "${EROOT}/etc/runlevels/default/zfs-share" ]] || \ - einfo "You should add zfs-share to the default runlevel." - [[ -e "${EROOT}/etc/runlevels/default/zfs-zed" ]] || \ - einfo "You should add zfs-zed to the default runlevel." - fi -} - -pkg_postrm() { - udev_reload - - if ! use kernel-builtin && [[ ${PV} == "9999" ]]; then - remove_moduledb - fi -} diff --git a/files/zfs/3602.2.1/overlay/sys-fs/zfs/zfs-2.1.12.ebuild b/files/zfs/3602.2.1/overlay/sys-fs/zfs/zfs-2.1.12.ebuild deleted file mode 100644 index 03acb2c..0000000 --- a/files/zfs/3602.2.1/overlay/sys-fs/zfs/zfs-2.1.12.ebuild +++ /dev/null @@ -1,312 +0,0 @@ -# Copyright 1999-2023 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -DISTUTILS_OPTIONAL=1 -DISTUTILS_USE_PEP517=setuptools -PYTHON_COMPAT=( python3_{10..11} ) - -inherit autotools bash-completion-r1 dist-kernel-utils distutils-r1 flag-o-matic linux-info pam systemd udev usr-ldscript - -DESCRIPTION="Userland utilities for ZFS Linux kernel module" -HOMEPAGE="https://github.com/openzfs/zfs" - -if [[ ${PV} == "9999" ]]; then - inherit git-r3 linux-mod - 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_P="${P/_rc/-rc}" - SRC_URI="https://github.com/openzfs/${PN}/releases/download/${MY_P}/${MY_P}.tar.gz" - SRC_URI+=" verify-sig? ( https://github.com/openzfs/${PN}/releases/download/${MY_P}/${MY_P}.tar.gz.asc )" - S="${WORKDIR}/${P%_rc?}" - - if [[ ${PV} != *_rc* ]]; then - KEYWORDS="amd64 arm64 ppc64 ~riscv ~sparc" - fi -fi - -LICENSE="BSD-2 CDDL MIT" -# just libzfs soname major for now. -# possible candidates: libuutil, libzpool, libnvpair. Those do not provide stable abi, but are considered. -# see libsoversion_check() below as well -SLOT="0/5" -IUSE="custom-cflags debug dist-kernel kernel-builtin minimal nls pam python +rootfs selinux test-suite" - -DEPEND=" - net-libs/libtirpc:= - sys-apps/util-linux - sys-libs/zlib - virtual/libudev:= - dev-libs/openssl:0= - !minimal? ( ${PYTHON_DEPS} ) - pam? ( sys-libs/pam ) - python? ( - $(python_gen_cond_dep 'dev-python/cffi[${PYTHON_USEDEP}]' 'python*') - ) -" - -BDEPEND="app-alternatives/awk - virtual/pkgconfig - nls? ( sys-devel/gettext ) - python? ( - ${DISTUTILS_DEPS} - || ( - dev-python/packaging[${PYTHON_USEDEP}] - dev-python/distlib[${PYTHON_USEDEP}] - ) - ) -" - -if [[ ${PV} != "9999" ]] ; then - BDEPEND+=" verify-sig? ( sec-keys/openpgp-keys-openzfs )" -fi - -# awk is used for some scripts, completions, and the Dracut module -RDEPEND="${DEPEND} - !kernel-builtin? ( ~sys-fs/zfs-kmod-${PV}:= ) - !prefix? ( virtual/udev ) - sys-fs/udev-init-scripts - app-alternatives/awk - dist-kernel? ( virtual/dist-kernel:= ) - rootfs? ( - app-arch/cpio - app-misc/pax-utils - ) - selinux? ( sec-policy/selinux-zfs ) - test-suite? ( - app-shells/ksh - sys-apps/kmod[tools] - sys-apps/util-linux - sys-devel/bc - sys-block/parted - sys-fs/lsscsi - sys-fs/mdadm - sys-process/procps - ) -" - -# PDEPEND in this form is needed to trick portage suggest -# enabling dist-kernel if only 1 package have it set, without suggesting to disable -PDEPEND="dist-kernel? ( ~sys-fs/zfs-kmod-${PV}[dist-kernel] )" - -REQUIRED_USE=" - !minimal? ( ${PYTHON_REQUIRED_USE} ) - python? ( !minimal ) - test-suite? ( !minimal ) -" - -RESTRICT="test" - -PATCHES=( - # bug #854333 - "${FILESDIR}"/2.1.5-r2-dracut-non-root.patch - - "${FILESDIR}"/2.1.5-dracut-zfs-missing.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() { - if use kernel_linux; then - linux-info_pkg_setup - - if ! linux_config_exists; then - ewarn "Cannot check the linux kernel configuration." - else - if use test-suite; then - if linux_chkconfig_present BLK_DEV_LOOP; then - eerror "The ZFS test suite requires loop device support enabled." - eerror "Please enable it:" - eerror " CONFIG_BLK_DEV_LOOP=y" - eerror "in /usr/src/linux/.config or" - eerror " Device Drivers --->" - eerror " Block devices --->" - eerror " [X] Loopback device support" - fi - fi - fi - fi -} - -libsoversion_check() { - local bugurl libzfs_sover - bugurl="https://bugs.gentoo.org/enter_bug.cgi?form_name=enter_bug&product=Gentoo+Linux&component=Current+packages" - - libzfs_sover="$(grep 'libzfs_la_LDFLAGS += -version-info' lib/libzfs/Makefile.am \ - | grep -Eo '[0-9]+:[0-9]+:[0-9]+')" - libzfs_sover="${libzfs_sover%%:*}" - - if [[ ${libzfs_sover} -ne $(ver_cut 2 ${SLOT}) ]]; then - echo - eerror "BUG BUG BUG BUG BUG BUG BUG BUG" - eerror "ebuild subslot does not match libzfs soversion!" - eerror "libzfs soversion: ${libzfs_sover}" - eerror "ebuild value: $(ver_cut 2 ${SLOT})" - eerror "This is a bug in the ebuild, please use the following URL to report it" - eerror "${bugurl}&short_desc=${CATEGORY}%2F${P}+update+subslot" - echo - # we want to abort for releases, but just print a warning for live ebuild - # to keep package installable - [[ ${PV} == "9999" ]] || die - fi -} - -src_prepare() { - default - libsoversion_check - - # Run unconditionally (bug #792627) - eautoreconf - - if [[ ${PV} != "9999" ]]; then - # Set revision number - sed -i "s/\(Release:\)\(.*\)1/\1\2${PR}-gentoo/" META || die "Could not set Gentoo release" - fi - - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_prepare - popd >/dev/null || die - fi - - # prevent errors showing up on zfs-mount stop, #647688 - # openrc will unmount all filesystems anyway. - sed -i "/^ZFS_UNMOUNT=/ s/yes/no/" "etc/default/zfs.in" || die -} - -src_configure() { - use custom-cflags || strip-flags - use minimal || python_setup - - # All the same issue: - # Segfaults w/ GCC 12 and 'zfs send' - # bug #856373 - # https://github.com/openzfs/zfs/issues/13620 - # https://github.com/openzfs/zfs/issues/13605 - append-flags -fno-tree-vectorize - - local myconf=( - --bindir="${EPREFIX}/bin" - --enable-shared - --enable-sysvinit - --localstatedir="${EPREFIX}/var" - --sbindir="${EPREFIX}/sbin" - --with-config=user - --with-dracutdir="${EPREFIX}/usr/lib/dracut" - --with-linux="${KV_DIR}" - --with-linux-obj="${KV_OUT_DIR}" - --with-udevdir="$(get_udevdir)" - --with-pamconfigsdir="${EPREFIX}/unwanted_files" - --with-pammoduledir="$(getpam_mod_dir)" - --with-systemdunitdir="$(systemd_get_systemunitdir)" - --with-systemdpresetdir="$(systemd_get_systempresetdir)" - --with-vendor=gentoo - # Building zfs-mount-generator.c on musl breaks as strndupa - # isn't available. But systemd doesn't support musl anyway, so - # just disable building it. - # UPDATE: it has been fixed since, - # https://github.com/openzfs/zfs/commit/1f19826c9ac85835cbde61a7439d9d1fefe43a4a - # but we still leave it as this for now. - $(use_enable !elibc_musl systemd) - $(use_enable debug) - $(use_enable nls) - $(use_enable pam) - $(use_enable python pyzfs) - --disable-static - $(usex minimal --without-python --with-python="${EPYTHON}") - ) - - unset am_cv_python_version - econf "${myconf[@]}" -} - -src_compile() { - default - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_compile - popd >/dev/null || die - fi -} - -src_install() { - default - - gen_usr_ldscript -a nvpair uutil zfsbootenv zfs zfs_core zpool - - use pam && { rm -rv "${ED}/unwanted_files" || die ; } - - use test-suite || { rm -r "${ED}"/usr/share/zfs/{test-runner,zfs-tests,runfiles,*sh} || die ; } - - find "${ED}" -name '*.la' -delete || die - - dobashcomp contrib/bash_completion.d/zfs - bashcomp_alias zfs zpool - - # strip executable bit from conf.d file - fperms 0644 /etc/conf.d/zfs - - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_install - popd >/dev/null || die - fi - - # enforce best available python implementation - use minimal || python_fix_shebang "${ED}/bin" -} - -pkg_postinst() { - udev_reload - - # we always need userspace utils in sync with zfs-kmod - # so force initrd update for userspace as well, to avoid - # situation when zfs-kmod trigger initrd rebuild before - # userspace component is rebuilt - # KV_* variables are provided by linux-info.eclass - if [[ -z ${ROOT} ]] && use dist-kernel; then - dist-kernel_reinstall_initramfs "${KV_DIR}" "${KV_FULL}" - fi - - if use rootfs; then - if ! has_version sys-kernel/genkernel && ! has_version sys-kernel/dracut; then - elog "Root on zfs requires an initramfs to boot" - elog "The following packages provide one and are tested on a regular basis:" - elog " sys-kernel/dracut ( preferred, module maintained by zfs developers )" - elog " sys-kernel/genkernel" - fi - fi - - if systemd_is_booted || has_version sys-apps/systemd; then - einfo "Please refer to ${EROOT}/$(systemd_get_systempresetdir)/50-zfs.preset" - einfo "for default zfs systemd service configuration" - else - [[ -e "${EROOT}/etc/runlevels/boot/zfs-import" ]] || \ - einfo "You should add zfs-import to the boot runlevel." - [[ -e "${EROOT}/etc/runlevels/boot/zfs-load-key" ]] || \ - einfo "You should add zfs-load-key to the boot runlevel." - [[ -e "${EROOT}/etc/runlevels/boot/zfs-mount" ]]|| \ - einfo "You should add zfs-mount to the boot runlevel." - [[ -e "${EROOT}/etc/runlevels/default/zfs-share" ]] || \ - einfo "You should add zfs-share to the default runlevel." - [[ -e "${EROOT}/etc/runlevels/default/zfs-zed" ]] || \ - einfo "You should add zfs-zed to the default runlevel." - fi -} - -pkg_postrm() { - udev_reload -} diff --git a/files/zfs/3602.2.1/overlay/sys-fs/zfs/zfs-2.1.9.ebuild b/files/zfs/3602.2.1/overlay/sys-fs/zfs/zfs-2.1.9.ebuild deleted file mode 100644 index 2930846..0000000 --- a/files/zfs/3602.2.1/overlay/sys-fs/zfs/zfs-2.1.9.ebuild +++ /dev/null @@ -1,326 +0,0 @@ -# Copyright 1999-2023 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -DISTUTILS_OPTIONAL=1 -PYTHON_COMPAT=( python3_{9..11} ) - -inherit autotools bash-completion-r1 dist-kernel-utils distutils-r1 flag-o-matic linux-info pam systemd udev usr-ldscript - -DESCRIPTION="Userland utilities for ZFS Linux kernel module" -HOMEPAGE="https://github.com/openzfs/zfs" - -if [[ ${PV} == "9999" ]]; then - inherit git-r3 linux-mod - 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_P="${P/_rc/-rc}" - SRC_URI="https://github.com/openzfs/${PN}/releases/download/${MY_P}/${MY_P}.tar.gz" - SRC_URI+=" verify-sig? ( https://github.com/openzfs/${PN}/releases/download/${MY_P}/${MY_P}.tar.gz.asc )" - S="${WORKDIR}/${P%_rc?}" - - if [[ ${PV} != *_rc* ]]; then - KEYWORDS="amd64 arm64 ppc64 ~riscv ~sparc" - fi -fi - -LICENSE="BSD-2 CDDL MIT" -# just libzfs soname major for now. -# possible candidates: libuutil, libzpool, libnvpair. Those do not provide stable abi, but are considered. -# see libsoversion_check() below as well -SLOT="0/5" -IUSE="custom-cflags debug dist-kernel kernel-builtin minimal nls pam python +rootfs selinux test-suite" - -DEPEND=" - net-libs/libtirpc:= - sys-apps/util-linux - sys-libs/zlib - virtual/libudev:= - dev-libs/openssl:0= - !minimal? ( ${PYTHON_DEPS} ) - pam? ( sys-libs/pam ) - python? ( - virtual/python-cffi[${PYTHON_USEDEP}] - ) -" - -BDEPEND="app-alternatives/awk - virtual/pkgconfig - nls? ( sys-devel/gettext ) - python? ( - dev-python/setuptools[${PYTHON_USEDEP}] - || ( - dev-python/packaging[${PYTHON_USEDEP}] - dev-python/distlib[${PYTHON_USEDEP}] - ) - ) -" - -if [[ ${PV} != "9999" ]] ; then - BDEPEND+=" verify-sig? ( sec-keys/openpgp-keys-openzfs )" -fi - -# awk is used for some scripts, completions, and the Dracut module -RDEPEND="${DEPEND} - !kernel-builtin? ( ~sys-fs/zfs-kmod-${PV}:= ) - !prefix? ( virtual/udev ) - sys-fs/udev-init-scripts - app-alternatives/awk - dist-kernel? ( virtual/dist-kernel:= ) - rootfs? ( - app-arch/cpio - app-misc/pax-utils - ) - selinux? ( sec-policy/selinux-zfs ) - test-suite? ( - app-shells/ksh - sys-apps/kmod[tools] - sys-apps/util-linux - sys-devel/bc - sys-block/parted - sys-fs/lsscsi - sys-fs/mdadm - sys-process/procps - ) -" - -# PDEPEND in this form is needed to trick portage suggest -# enabling dist-kernel if only 1 package have it set, without suggesting to disable -PDEPEND="dist-kernel? ( ~sys-fs/zfs-kmod-${PV}[dist-kernel] )" - -REQUIRED_USE=" - !minimal? ( ${PYTHON_REQUIRED_USE} ) - python? ( !minimal ) - test-suite? ( !minimal ) -" - -RESTRICT="test" - -PATCHES=( - # bug #854333 - "${FILESDIR}"/2.1.5-r2-dracut-non-root.patch - - "${FILESDIR}"/2.1.5-dracut-zfs-missing.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() { - if use kernel_linux; then - linux-info_pkg_setup - - if ! linux_config_exists; then - ewarn "Cannot check the linux kernel configuration." - else - if use test-suite; then - if linux_chkconfig_present BLK_DEV_LOOP; then - eerror "The ZFS test suite requires loop device support enabled." - eerror "Please enable it:" - eerror " CONFIG_BLK_DEV_LOOP=y" - eerror "in /usr/src/linux/.config or" - eerror " Device Drivers --->" - eerror " Block devices --->" - eerror " [X] Loopback device support" - fi - fi - fi - fi -} - -libsoversion_check() { - local bugurl libzfs_sover - bugurl="https://bugs.gentoo.org/enter_bug.cgi?form_name=enter_bug&product=Gentoo+Linux&component=Current+packages" - - libzfs_sover="$(grep 'libzfs_la_LDFLAGS += -version-info' lib/libzfs/Makefile.am \ - | grep -Eo '[0-9]+:[0-9]+:[0-9]+')" - libzfs_sover="${libzfs_sover%%:*}" - - if [[ ${libzfs_sover} -ne $(ver_cut 2 ${SLOT}) ]]; then - echo - eerror "BUG BUG BUG BUG BUG BUG BUG BUG" - eerror "ebuild subslot does not match libzfs soversion!" - eerror "libzfs soversion: ${libzfs_sover}" - eerror "ebuild value: $(ver_cut 2 ${SLOT})" - eerror "This is a bug in the ebuild, please use the following URL to report it" - eerror "${bugurl}&short_desc=${CATEGORY}%2F${P}+update+subslot" - echo - # we want to abort for releases, but just print a warning for live ebuild - # to keep package installable - [[ ${PV} == "9999" ]] || die - fi -} - -src_unpack() { - if use verify-sig ; then - # Needed for downloaded patch (which is unsigned, which is fine) - verify-sig_verify_detached "${DISTDIR}"/${MY_P}.tar.gz{,.asc} - fi - - default -} - -src_prepare() { - default - libsoversion_check - - # Run unconditionally (bug #792627) - eautoreconf - - if [[ ${PV} != "9999" ]]; then - # Set revision number - sed -i "s/\(Release:\)\(.*\)1/\1\2${PR}-gentoo/" META || die "Could not set Gentoo release" - fi - - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_prepare - popd >/dev/null || die - fi - - # prevent errors showing up on zfs-mount stop, #647688 - # openrc will unmount all filesystems anyway. - sed -i "/^ZFS_UNMOUNT=/ s/yes/no/" "etc/default/zfs.in" || die -} - -src_configure() { - use custom-cflags || strip-flags - use minimal || python_setup - - # All the same issue: - # Segfaults w/ GCC 12 and 'zfs send' - # bug #856373 - # https://github.com/openzfs/zfs/issues/13620 - # https://github.com/openzfs/zfs/issues/13605 - append-flags -fno-tree-vectorize - - local myconf=( - --bindir="${EPREFIX}/bin" - --enable-shared - --enable-sysvinit - --localstatedir="${EPREFIX}/var" - --sbindir="${EPREFIX}/sbin" - --with-config=user - --with-dracutdir="${EPREFIX}/usr/lib/dracut" - --with-linux="${KV_DIR}" - --with-linux-obj="${KV_OUT_DIR}" - --with-udevdir="$(get_udevdir)" - --with-pamconfigsdir="${EPREFIX}/unwanted_files" - --with-pammoduledir="$(getpam_mod_dir)" - --with-systemdunitdir="$(systemd_get_systemunitdir)" - --with-systemdpresetdir="$(systemd_get_systempresetdir)" - --with-vendor=gentoo - # Building zfs-mount-generator.c on musl breaks as strndupa - # isn't available. But systemd doesn't support musl anyway, so - # just disable building it. - $(use_enable !elibc_musl systemd) - $(use_enable debug) - $(use_enable nls) - $(use_enable pam) - $(use_enable python pyzfs) - --disable-static - $(usex minimal --without-python --with-python="${EPYTHON}") - ) - - econf "${myconf[@]}" -} - -src_compile() { - default - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_compile - popd >/dev/null || die - fi -} - -src_install() { - default - - gen_usr_ldscript -a nvpair uutil zfsbootenv zfs zfs_core zpool - - use pam && { rm -rv "${ED}/unwanted_files" || die ; } - - use test-suite || { rm -r "${ED}"/usr/share/zfs/{test-runner,zfs-tests,runfiles,*sh} || die ; } - - find "${ED}" -name '*.la' -delete || die - - dobashcomp contrib/bash_completion.d/zfs - bashcomp_alias zfs zpool - - # strip executable bit from conf.d file - fperms 0644 /etc/conf.d/zfs - - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_install - popd >/dev/null || die - fi - - # enforce best available python implementation - use minimal || python_fix_shebang "${ED}/bin" -} - -pkg_postinst() { - udev_reload - - # we always need userspace utils in sync with zfs-kmod - # so force initrd update for userspace as well, to avoid - # situation when zfs-kmod trigger initrd rebuild before - # userspace component is rebuilt - # KV_* variables are provided by linux-info.eclass - if [[ -z ${ROOT} ]] && use dist-kernel; then - dist-kernel_reinstall_initramfs "${KV_DIR}" "${KV_FULL}" - fi - - if use rootfs; then - if ! has_version sys-kernel/genkernel && ! has_version sys-kernel/dracut; then - elog "Root on zfs requires an initramfs to boot" - elog "The following packages provide one and are tested on a regular basis:" - elog " sys-kernel/dracut ( preferred, module maintained by zfs developers )" - elog " sys-kernel/genkernel" - fi - fi - - if ! use kernel-builtin && [[ ${PV} == "9999" ]]; then - einfo "Adding ${P} to the module database to ensure that the" - einfo "kernel modules and userland utilities stay in sync." - update_moduledb - fi - - if systemd_is_booted || has_version sys-apps/systemd; then - einfo "Please refer to ${EROOT}/$(systemd_get_systempresetdir)/50-zfs.preset" - einfo "for default zfs systemd service configuration" - else - [[ -e "${EROOT}/etc/runlevels/boot/zfs-import" ]] || \ - einfo "You should add zfs-import to the boot runlevel." - [[ -e "${EROOT}/etc/runlevels/boot/zfs-load-key" ]] || \ - einfo "You should add zfs-load-key to the boot runlevel." - [[ -e "${EROOT}/etc/runlevels/boot/zfs-mount" ]]|| \ - einfo "You should add zfs-mount to the boot runlevel." - [[ -e "${EROOT}/etc/runlevels/default/zfs-share" ]] || \ - einfo "You should add zfs-share to the default runlevel." - [[ -e "${EROOT}/etc/runlevels/default/zfs-zed" ]] || \ - einfo "You should add zfs-zed to the default runlevel." - fi -} - -pkg_postrm() { - udev_reload - - if ! use kernel-builtin && [[ ${PV} == "9999" ]]; then - remove_moduledb - fi -} diff --git a/files/zfs/3602.2.1/overlay/sys-fs/zfs/zfs-2.2.0_rc3.ebuild b/files/zfs/3602.2.1/overlay/sys-fs/zfs/zfs-2.2.0_rc3.ebuild deleted file mode 100644 index e9d67dd..0000000 --- a/files/zfs/3602.2.1/overlay/sys-fs/zfs/zfs-2.2.0_rc3.ebuild +++ /dev/null @@ -1,306 +0,0 @@ -# Copyright 1999-2023 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -DISTUTILS_OPTIONAL=1 -DISTUTILS_USE_PEP517=setuptools -PYTHON_COMPAT=( python3_{10..11} ) - -inherit autotools bash-completion-r1 dist-kernel-utils distutils-r1 flag-o-matic linux-info pam systemd udev usr-ldscript - -DESCRIPTION="Userland utilities for ZFS Linux kernel module" -HOMEPAGE="https://github.com/openzfs/zfs" - -if [[ ${PV} == "9999" ]]; then - inherit git-r3 linux-mod - 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_P="${P/_rc/-rc}" - SRC_URI="https://github.com/openzfs/${PN}/releases/download/${MY_P}/${MY_P}.tar.gz" - SRC_URI+=" verify-sig? ( https://github.com/openzfs/${PN}/releases/download/${MY_P}/${MY_P}.tar.gz.asc )" - S="${WORKDIR}/${MY_P}" - - if [[ ${PV} != *_rc* ]]; then - KEYWORDS="~amd64 ~arm64 ~ppc64 ~riscv ~sparc" - fi -fi - -LICENSE="BSD-2 CDDL MIT" -# just libzfs soname major for now. -# possible candidates: libuutil, libzpool, libnvpair. Those do not provide stable abi, but are considered. -# see libsoversion_check() below as well -SLOT="0/5" -IUSE="custom-cflags debug dist-kernel kernel-builtin minimal nls pam python +rootfs selinux test-suite" - -DEPEND=" - dev-libs/openssl:= - net-libs/libtirpc:= - sys-apps/util-linux - sys-libs/zlib - virtual/libudev:= - !minimal? ( ${PYTHON_DEPS} ) - pam? ( sys-libs/pam ) - python? ( - $(python_gen_cond_dep 'dev-python/cffi[${PYTHON_USEDEP}]' 'python*') - ) -" - -BDEPEND=" - app-alternatives/awk - virtual/pkgconfig - nls? ( sys-devel/gettext ) - python? ( - ${DISTUTILS_DEPS} - || ( - dev-python/packaging[${PYTHON_USEDEP}] - dev-python/distlib[${PYTHON_USEDEP}] - ) - ) -" - -if [[ ${PV} != "9999" ]] ; then - BDEPEND+=" verify-sig? ( sec-keys/openpgp-keys-openzfs )" -fi - -# awk is used for some scripts, completions, and the Dracut module -RDEPEND=" - ${DEPEND} - !kernel-builtin? ( ~sys-fs/zfs-kmod-${PV}:= ) - !prefix? ( virtual/udev ) - app-alternatives/awk - sys-fs/udev-init-scripts - dist-kernel? ( virtual/dist-kernel:= ) - rootfs? ( - app-arch/cpio - app-misc/pax-utils - ) - selinux? ( sec-policy/selinux-zfs ) - test-suite? ( - app-shells/ksh - sys-apps/kmod[tools] - sys-apps/util-linux - sys-devel/bc - sys-block/parted - sys-fs/lsscsi - sys-fs/mdadm - sys-process/procps - ) -" - -# PDEPEND in this form is needed to trick portage suggest -# enabling dist-kernel if only 1 package have it set, without suggesting to disable -PDEPEND="dist-kernel? ( ~sys-fs/zfs-kmod-${PV}[dist-kernel] )" - -REQUIRED_USE=" - !minimal? ( ${PYTHON_REQUIRED_USE} ) - python? ( !minimal ) - test-suite? ( !minimal ) -" - -RESTRICT="test" - -PATCHES=( - "${FILESDIR}"/2.1.5-dracut-zfs-missing.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() { - if use kernel_linux; then - linux-info_pkg_setup - - if ! linux_config_exists; then - ewarn "Cannot check the linux kernel configuration." - else - if use test-suite; then - if linux_chkconfig_present BLK_DEV_LOOP; then - eerror "The ZFS test suite requires loop device support enabled." - eerror "Please enable it:" - eerror " CONFIG_BLK_DEV_LOOP=y" - eerror "in /usr/src/linux/.config or" - eerror " Device Drivers --->" - eerror " Block devices --->" - eerror " [X] Loopback device support" - fi - fi - fi - fi -} - -libsoversion_check() { - local bugurl libzfs_sover - bugurl="https://bugs.gentoo.org/enter_bug.cgi?form_name=enter_bug&product=Gentoo+Linux&component=Current+packages" - - libzfs_sover="$(grep 'libzfs_la_LDFLAGS += -version-info' lib/libzfs/Makefile.am \ - | grep -Eo '[0-9]+:[0-9]+:[0-9]+')" - libzfs_sover="${libzfs_sover%%:*}" - - if [[ ${libzfs_sover} -ne $(ver_cut 2 ${SLOT}) ]]; then - echo - eerror "BUG BUG BUG BUG BUG BUG BUG BUG" - eerror "ebuild subslot does not match libzfs soversion!" - eerror "libzfs soversion: ${libzfs_sover}" - eerror "ebuild value: $(ver_cut 2 ${SLOT})" - eerror "This is a bug in the ebuild, please use the following URL to report it" - eerror "${bugurl}&short_desc=${CATEGORY}%2F${P}+update+subslot" - echo - # we want to abort for releases, but just print a warning for live ebuild - # to keep package installable - [[ ${PV} == "9999" ]] || die - fi -} - -src_prepare() { - default - libsoversion_check - - # Run unconditionally (bug #792627) - eautoreconf - - if [[ ${PV} != "9999" ]]; then - # Set revision number - sed -i "s/\(Release:\)\(.*\)1/\1\2${PR}-gentoo/" META || die "Could not set Gentoo release" - fi - - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_prepare - popd >/dev/null || die - fi - - # Tries to use /etc/conf.d which we reserve for OpenRC - sed -i -e '/EnvironmentFile/d' etc/systemd/system/zfs*.in || die - - # prevent errors showing up on zfs-mount stop, #647688 - # openrc will unmount all filesystems anyway. - sed -i "/^ZFS_UNMOUNT=/ s/yes/no/" "etc/default/zfs.in" || die -} - -src_configure() { - use custom-cflags || strip-flags - use minimal || python_setup - - local myconf=( - --bindir="${EPREFIX}/bin" - --enable-shared - --enable-sysvinit - --localstatedir="${EPREFIX}/var" - --sbindir="${EPREFIX}/sbin" - --with-config=user - --with-dracutdir="${EPREFIX}/usr/lib/dracut" - --with-linux="${KV_DIR}" - --with-linux-obj="${KV_OUT_DIR}" - --with-udevdir="$(get_udevdir)" - --with-pamconfigsdir="${EPREFIX}/unwanted_files" - --with-pammoduledir="$(getpam_mod_dir)" - --with-systemdunitdir="$(systemd_get_systemunitdir)" - --with-systemdpresetdir="$(systemd_get_systempresetdir)" - --with-vendor=gentoo - # Building zfs-mount-generator.c on musl breaks as strndupa - # isn't available. But systemd doesn't support musl anyway, so - # just disable building it. - # UPDATE: it has been fixed since, - # https://github.com/openzfs/zfs/commit/1f19826c9ac85835cbde61a7439d9d1fefe43a4a - # but we still leave it as this for now. - $(use_enable !elibc_musl systemd) - $(use_enable debug) - $(use_enable nls) - $(use_enable pam) - $(use_enable python pyzfs) - --disable-static - $(usex minimal --without-python --with-python="${EPYTHON}") - ) - - econf "${myconf[@]}" -} - -src_compile() { - default - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_compile - popd >/dev/null || die - fi -} - -src_install() { - default - - gen_usr_ldscript -a nvpair uutil zfsbootenv zfs zfs_core zpool - - use pam && { rm -rv "${ED}/unwanted_files" || die ; } - - use test-suite || { rm -r "${ED}"/usr/share/zfs/{test-runner,zfs-tests,runfiles,*sh} || die ; } - - find "${ED}" -name '*.la' -delete || die - - dobashcomp contrib/bash_completion.d/zfs - bashcomp_alias zfs zpool - - # strip executable bit from conf.d file - fperms 0644 /etc/conf.d/zfs - - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_install - popd >/dev/null || die - fi - - # enforce best available python implementation - use minimal || python_fix_shebang "${ED}/bin" -} - -pkg_postinst() { - udev_reload - - # we always need userspace utils in sync with zfs-kmod - # so force initrd update for userspace as well, to avoid - # situation when zfs-kmod trigger initrd rebuild before - # userspace component is rebuilt - # KV_* variables are provided by linux-info.eclass - if [[ -z ${ROOT} ]] && use dist-kernel; then - dist-kernel_reinstall_initramfs "${KV_DIR}" "${KV_FULL}" - fi - - if use rootfs; then - if ! has_version sys-kernel/genkernel && ! has_version sys-kernel/dracut; then - elog "Root on zfs requires an initramfs to boot" - elog "The following packages provide one and are tested on a regular basis:" - elog " sys-kernel/dracut ( preferred, module maintained by zfs developers )" - elog " sys-kernel/genkernel" - fi - fi - - if systemd_is_booted || has_version sys-apps/systemd; then - einfo "Please refer to ${EROOT}/$(systemd_get_systempresetdir)/50-zfs.preset" - einfo "for default zfs systemd service configuration" - else - [[ -e "${EROOT}/etc/runlevels/boot/zfs-import" ]] || \ - einfo "You should add zfs-import to the boot runlevel." - [[ -e "${EROOT}/etc/runlevels/boot/zfs-load-key" ]] || \ - einfo "You should add zfs-load-key to the boot runlevel." - [[ -e "${EROOT}/etc/runlevels/boot/zfs-mount" ]]|| \ - einfo "You should add zfs-mount to the boot runlevel." - [[ -e "${EROOT}/etc/runlevels/default/zfs-share" ]] || \ - einfo "You should add zfs-share to the default runlevel." - [[ -e "${EROOT}/etc/runlevels/default/zfs-zed" ]] || \ - einfo "You should add zfs-zed to the default runlevel." - fi -} - -pkg_postrm() { - udev_reload -} diff --git a/files/zfs/3602.2.1/overlay/sys-fs/zfs/zfs-9999.ebuild b/files/zfs/3602.2.1/overlay/sys-fs/zfs/zfs-9999.ebuild deleted file mode 100644 index e9d67dd..0000000 --- a/files/zfs/3602.2.1/overlay/sys-fs/zfs/zfs-9999.ebuild +++ /dev/null @@ -1,306 +0,0 @@ -# Copyright 1999-2023 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -DISTUTILS_OPTIONAL=1 -DISTUTILS_USE_PEP517=setuptools -PYTHON_COMPAT=( python3_{10..11} ) - -inherit autotools bash-completion-r1 dist-kernel-utils distutils-r1 flag-o-matic linux-info pam systemd udev usr-ldscript - -DESCRIPTION="Userland utilities for ZFS Linux kernel module" -HOMEPAGE="https://github.com/openzfs/zfs" - -if [[ ${PV} == "9999" ]]; then - inherit git-r3 linux-mod - 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_P="${P/_rc/-rc}" - SRC_URI="https://github.com/openzfs/${PN}/releases/download/${MY_P}/${MY_P}.tar.gz" - SRC_URI+=" verify-sig? ( https://github.com/openzfs/${PN}/releases/download/${MY_P}/${MY_P}.tar.gz.asc )" - S="${WORKDIR}/${MY_P}" - - if [[ ${PV} != *_rc* ]]; then - KEYWORDS="~amd64 ~arm64 ~ppc64 ~riscv ~sparc" - fi -fi - -LICENSE="BSD-2 CDDL MIT" -# just libzfs soname major for now. -# possible candidates: libuutil, libzpool, libnvpair. Those do not provide stable abi, but are considered. -# see libsoversion_check() below as well -SLOT="0/5" -IUSE="custom-cflags debug dist-kernel kernel-builtin minimal nls pam python +rootfs selinux test-suite" - -DEPEND=" - dev-libs/openssl:= - net-libs/libtirpc:= - sys-apps/util-linux - sys-libs/zlib - virtual/libudev:= - !minimal? ( ${PYTHON_DEPS} ) - pam? ( sys-libs/pam ) - python? ( - $(python_gen_cond_dep 'dev-python/cffi[${PYTHON_USEDEP}]' 'python*') - ) -" - -BDEPEND=" - app-alternatives/awk - virtual/pkgconfig - nls? ( sys-devel/gettext ) - python? ( - ${DISTUTILS_DEPS} - || ( - dev-python/packaging[${PYTHON_USEDEP}] - dev-python/distlib[${PYTHON_USEDEP}] - ) - ) -" - -if [[ ${PV} != "9999" ]] ; then - BDEPEND+=" verify-sig? ( sec-keys/openpgp-keys-openzfs )" -fi - -# awk is used for some scripts, completions, and the Dracut module -RDEPEND=" - ${DEPEND} - !kernel-builtin? ( ~sys-fs/zfs-kmod-${PV}:= ) - !prefix? ( virtual/udev ) - app-alternatives/awk - sys-fs/udev-init-scripts - dist-kernel? ( virtual/dist-kernel:= ) - rootfs? ( - app-arch/cpio - app-misc/pax-utils - ) - selinux? ( sec-policy/selinux-zfs ) - test-suite? ( - app-shells/ksh - sys-apps/kmod[tools] - sys-apps/util-linux - sys-devel/bc - sys-block/parted - sys-fs/lsscsi - sys-fs/mdadm - sys-process/procps - ) -" - -# PDEPEND in this form is needed to trick portage suggest -# enabling dist-kernel if only 1 package have it set, without suggesting to disable -PDEPEND="dist-kernel? ( ~sys-fs/zfs-kmod-${PV}[dist-kernel] )" - -REQUIRED_USE=" - !minimal? ( ${PYTHON_REQUIRED_USE} ) - python? ( !minimal ) - test-suite? ( !minimal ) -" - -RESTRICT="test" - -PATCHES=( - "${FILESDIR}"/2.1.5-dracut-zfs-missing.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() { - if use kernel_linux; then - linux-info_pkg_setup - - if ! linux_config_exists; then - ewarn "Cannot check the linux kernel configuration." - else - if use test-suite; then - if linux_chkconfig_present BLK_DEV_LOOP; then - eerror "The ZFS test suite requires loop device support enabled." - eerror "Please enable it:" - eerror " CONFIG_BLK_DEV_LOOP=y" - eerror "in /usr/src/linux/.config or" - eerror " Device Drivers --->" - eerror " Block devices --->" - eerror " [X] Loopback device support" - fi - fi - fi - fi -} - -libsoversion_check() { - local bugurl libzfs_sover - bugurl="https://bugs.gentoo.org/enter_bug.cgi?form_name=enter_bug&product=Gentoo+Linux&component=Current+packages" - - libzfs_sover="$(grep 'libzfs_la_LDFLAGS += -version-info' lib/libzfs/Makefile.am \ - | grep -Eo '[0-9]+:[0-9]+:[0-9]+')" - libzfs_sover="${libzfs_sover%%:*}" - - if [[ ${libzfs_sover} -ne $(ver_cut 2 ${SLOT}) ]]; then - echo - eerror "BUG BUG BUG BUG BUG BUG BUG BUG" - eerror "ebuild subslot does not match libzfs soversion!" - eerror "libzfs soversion: ${libzfs_sover}" - eerror "ebuild value: $(ver_cut 2 ${SLOT})" - eerror "This is a bug in the ebuild, please use the following URL to report it" - eerror "${bugurl}&short_desc=${CATEGORY}%2F${P}+update+subslot" - echo - # we want to abort for releases, but just print a warning for live ebuild - # to keep package installable - [[ ${PV} == "9999" ]] || die - fi -} - -src_prepare() { - default - libsoversion_check - - # Run unconditionally (bug #792627) - eautoreconf - - if [[ ${PV} != "9999" ]]; then - # Set revision number - sed -i "s/\(Release:\)\(.*\)1/\1\2${PR}-gentoo/" META || die "Could not set Gentoo release" - fi - - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_prepare - popd >/dev/null || die - fi - - # Tries to use /etc/conf.d which we reserve for OpenRC - sed -i -e '/EnvironmentFile/d' etc/systemd/system/zfs*.in || die - - # prevent errors showing up on zfs-mount stop, #647688 - # openrc will unmount all filesystems anyway. - sed -i "/^ZFS_UNMOUNT=/ s/yes/no/" "etc/default/zfs.in" || die -} - -src_configure() { - use custom-cflags || strip-flags - use minimal || python_setup - - local myconf=( - --bindir="${EPREFIX}/bin" - --enable-shared - --enable-sysvinit - --localstatedir="${EPREFIX}/var" - --sbindir="${EPREFIX}/sbin" - --with-config=user - --with-dracutdir="${EPREFIX}/usr/lib/dracut" - --with-linux="${KV_DIR}" - --with-linux-obj="${KV_OUT_DIR}" - --with-udevdir="$(get_udevdir)" - --with-pamconfigsdir="${EPREFIX}/unwanted_files" - --with-pammoduledir="$(getpam_mod_dir)" - --with-systemdunitdir="$(systemd_get_systemunitdir)" - --with-systemdpresetdir="$(systemd_get_systempresetdir)" - --with-vendor=gentoo - # Building zfs-mount-generator.c on musl breaks as strndupa - # isn't available. But systemd doesn't support musl anyway, so - # just disable building it. - # UPDATE: it has been fixed since, - # https://github.com/openzfs/zfs/commit/1f19826c9ac85835cbde61a7439d9d1fefe43a4a - # but we still leave it as this for now. - $(use_enable !elibc_musl systemd) - $(use_enable debug) - $(use_enable nls) - $(use_enable pam) - $(use_enable python pyzfs) - --disable-static - $(usex minimal --without-python --with-python="${EPYTHON}") - ) - - econf "${myconf[@]}" -} - -src_compile() { - default - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_compile - popd >/dev/null || die - fi -} - -src_install() { - default - - gen_usr_ldscript -a nvpair uutil zfsbootenv zfs zfs_core zpool - - use pam && { rm -rv "${ED}/unwanted_files" || die ; } - - use test-suite || { rm -r "${ED}"/usr/share/zfs/{test-runner,zfs-tests,runfiles,*sh} || die ; } - - find "${ED}" -name '*.la' -delete || die - - dobashcomp contrib/bash_completion.d/zfs - bashcomp_alias zfs zpool - - # strip executable bit from conf.d file - fperms 0644 /etc/conf.d/zfs - - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_install - popd >/dev/null || die - fi - - # enforce best available python implementation - use minimal || python_fix_shebang "${ED}/bin" -} - -pkg_postinst() { - udev_reload - - # we always need userspace utils in sync with zfs-kmod - # so force initrd update for userspace as well, to avoid - # situation when zfs-kmod trigger initrd rebuild before - # userspace component is rebuilt - # KV_* variables are provided by linux-info.eclass - if [[ -z ${ROOT} ]] && use dist-kernel; then - dist-kernel_reinstall_initramfs "${KV_DIR}" "${KV_FULL}" - fi - - if use rootfs; then - if ! has_version sys-kernel/genkernel && ! has_version sys-kernel/dracut; then - elog "Root on zfs requires an initramfs to boot" - elog "The following packages provide one and are tested on a regular basis:" - elog " sys-kernel/dracut ( preferred, module maintained by zfs developers )" - elog " sys-kernel/genkernel" - fi - fi - - if systemd_is_booted || has_version sys-apps/systemd; then - einfo "Please refer to ${EROOT}/$(systemd_get_systempresetdir)/50-zfs.preset" - einfo "for default zfs systemd service configuration" - else - [[ -e "${EROOT}/etc/runlevels/boot/zfs-import" ]] || \ - einfo "You should add zfs-import to the boot runlevel." - [[ -e "${EROOT}/etc/runlevels/boot/zfs-load-key" ]] || \ - einfo "You should add zfs-load-key to the boot runlevel." - [[ -e "${EROOT}/etc/runlevels/boot/zfs-mount" ]]|| \ - einfo "You should add zfs-mount to the boot runlevel." - [[ -e "${EROOT}/etc/runlevels/default/zfs-share" ]] || \ - einfo "You should add zfs-share to the default runlevel." - [[ -e "${EROOT}/etc/runlevels/default/zfs-zed" ]] || \ - einfo "You should add zfs-zed to the default runlevel." - fi -} - -pkg_postrm() { - udev_reload -} diff --git a/files/zfs/3602.2.2/overlay/dev-python/ensurepip-pip/Manifest b/files/zfs/3602.2.2/overlay/dev-python/ensurepip-pip/Manifest deleted file mode 100644 index e93f5de..0000000 --- a/files/zfs/3602.2.2/overlay/dev-python/ensurepip-pip/Manifest +++ /dev/null @@ -1 +0,0 @@ -DIST pip-23.2.1-py3-none-any.whl 2086091 BLAKE2B 0a35bf4ba589f07e3c800d8f835e4bcdcd433976db83f91c86e12a2316b0b1c7de7120b248d70fe8b5587c28bb3c6e7bc633c64cdfb65a1f18f87a9e7a423181 SHA512 016a8cbd09384f1a9a44cb0e8274df75a8bcb2f3966bb5d708c62145289efaa5db98f75256c97e4f8046735ce2e529fbb076f284a46cdb716e89a75660200ad9 diff --git a/files/zfs/3602.2.2/overlay/dev-python/ensurepip-pip/ensurepip-pip-23.2.1.ebuild b/files/zfs/3602.2.2/overlay/dev-python/ensurepip-pip/ensurepip-pip-23.2.1.ebuild deleted file mode 100644 index 4e55e33..0000000 --- a/files/zfs/3602.2.2/overlay/dev-python/ensurepip-pip/ensurepip-pip-23.2.1.ebuild +++ /dev/null @@ -1,24 +0,0 @@ -# Copyright 2022-2023 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -inherit pypi - -DESCRIPTION="Shared pip wheel for ensurepip Python module" -HOMEPAGE="https://pypi.org/project/pip/" -SRC_URI="$(pypi_wheel_url "${PN#ensurepip-}")" -S=${DISTDIR} - -LICENSE="Apache-2.0 BSD BSD-2 ISC LGPL-2.1+ MIT MPL-2.0 PSF-2" -SLOT="0" -KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris" - -RDEPEND=" - ! - - - - python@gentoo.org - - - - pip - - diff --git a/files/zfs/3602.2.2/overlay/dev-python/ensurepip-wheels/ensurepip-wheels-100.ebuild b/files/zfs/3602.2.2/overlay/dev-python/ensurepip-wheels/ensurepip-wheels-100.ebuild deleted file mode 100644 index d532659..0000000 --- a/files/zfs/3602.2.2/overlay/dev-python/ensurepip-wheels/ensurepip-wheels-100.ebuild +++ /dev/null @@ -1,16 +0,0 @@ -# Copyright 2022-2023 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -DESCRIPTION="Shared wheels for ensurepip Python module" -HOMEPAGE="https://wiki.gentoo.org/wiki/No_homepage" - -LICENSE="metapackage" -SLOT="0" -KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris" - -RDEPEND=" - dev-python/ensurepip-pip - dev-python/ensurepip-setuptools -" diff --git a/files/zfs/3602.2.2/overlay/dev-python/ensurepip-wheels/metadata.xml b/files/zfs/3602.2.2/overlay/dev-python/ensurepip-wheels/metadata.xml deleted file mode 100644 index 7d42167..0000000 --- a/files/zfs/3602.2.2/overlay/dev-python/ensurepip-wheels/metadata.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - python@gentoo.org - - - diff --git a/files/zfs/3602.2.2/overlay/eclass/dist-kernel-utils.eclass b/files/zfs/3602.2.2/overlay/eclass/dist-kernel-utils.eclass deleted file mode 100644 index 6903183..0000000 --- a/files/zfs/3602.2.2/overlay/eclass/dist-kernel-utils.eclass +++ /dev/null @@ -1,201 +0,0 @@ -# Copyright 2020-2023 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -# @ECLASS: dist-kernel-utils.eclass -# @MAINTAINER: -# Distribution Kernel Project -# @AUTHOR: -# Michał Górny -# @SUPPORTED_EAPIS: 7 8 -# @BLURB: Utility functions related to Distribution Kernels -# @DESCRIPTION: -# This eclass provides various utility functions related to Distribution -# Kernels. - -# @ECLASS_VARIABLE: KERNEL_IUSE_SECUREBOOT -# @PRE_INHERIT -# @DEFAULT_UNSET -# @DESCRIPTION: -# If set to a non-null value, inherits secureboot.eclass -# and allows signing of generated kernel images. - -if [[ ! ${_DIST_KERNEL_UTILS} ]]; then - -case ${EAPI} in - 7|8) ;; - *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; -esac - -if [[ ${KERNEL_IUSE_SECUREBOOT} ]]; then - inherit secureboot -fi - -# @FUNCTION: dist-kernel_build_initramfs -# @USAGE: -# @DESCRIPTION: -# Build an initramfs for the kernel. specifies the absolute -# path where initramfs will be created, while specifies -# the kernel version, used to find modules. -# -# Note: while this function uses dracut at the moment, other initramfs -# variants may be supported in the future. -dist-kernel_build_initramfs() { - debug-print-function ${FUNCNAME} "${@}" - - [[ ${#} -eq 2 ]] || die "${FUNCNAME}: invalid arguments" - local output=${1} - local version=${2} - - local rel_image_path=$(dist-kernel_get_image_path) - local image=${output%/*}/${rel_image_path##*/} - - local args=( - --force - # if uefi=yes is used, dracut needs to locate the kernel image - --kernel-image "${image}" - - # positional arguments - "${output}" "${version}" - ) - - ebegin "Building initramfs via dracut" - dracut "${args[@]}" - eend ${?} || die -n "Building initramfs failed" -} - -# @FUNCTION: dist-kernel_get_image_path -# @DESCRIPTION: -# Get relative kernel image path specific to the current ${ARCH}. -dist-kernel_get_image_path() { - case ${ARCH} in - amd64|x86) - echo arch/x86/boot/bzImage - ;; - arm64) - echo arch/arm64/boot/Image.gz - ;; - arm) - echo arch/arm/boot/zImage - ;; - hppa|ppc|ppc64|sparc) - # https://www.kernel.org/doc/html/latest/powerpc/bootwrapper.html - # ./ is required because of ${image_path%/*} - # substitutions in the code - echo ./vmlinux - ;; - riscv) - echo arch/riscv/boot/Image.gz - ;; - *) - die "${FUNCNAME}: unsupported ARCH=${ARCH}" - ;; - esac -} - -# @FUNCTION: dist-kernel_install_kernel -# @USAGE: -# @DESCRIPTION: -# Install kernel using installkernel tool. specifies -# the kernel version, full path to the image, -# full path to System.map. -dist-kernel_install_kernel() { - debug-print-function ${FUNCNAME} "${@}" - - [[ ${#} -eq 3 ]] || die "${FUNCNAME}: invalid arguments" - local version=${1} - local image=${2} - local map=${3} - - # if dracut is used in uefi=yes mode, initrd will actually - # be a combined kernel+initramfs UEFI executable. we can easily - # recognize it by PE magic (vs cpio for a regular initramfs) - local initrd=${image%/*}/initrd - local magic - [[ -s ${initrd} ]] && read -n 2 magic < "${initrd}" - if [[ ${magic} == MZ ]]; then - einfo "Combined UEFI kernel+initramfs executable found" - # install the combined executable in place of kernel - image=${initrd%/*}/uki.efi - mv "${initrd}" "${image}" || die - # We moved the generated initrd, prevent dracut from running again - # https://github.com/dracutdevs/dracut/pull/2405 - shopt -s nullglob - local plugins=() - for file in "${EROOT}"/etc/kernel/install.d/*.install; do - plugins+=( "${file}" ) - done - for file in "${EROOT}"/usr/lib/kernel/install.d/*.install; do - if ! has "${file##*/}" 50-dracut.install 51-dracut-rescue.install "${plugins[@]##*/}"; then - plugins+=( "${file}" ) - fi - done - shopt -u nullglob - export KERNEL_INSTALL_PLUGINS="${KERNEL_INSTALL_PLUGINS} ${plugins[@]}" - fi - - if [[ ${KERNEL_IUSE_SECUREBOOT} ]]; then - # Kernel-install requires uki's are named uki.efi, sign in-place - secureboot_sign_efi_file "${image}" "${image}" - fi - - ebegin "Installing the kernel via installkernel" - # note: .config is taken relatively to System.map; - # initrd relatively to bzImage - installkernel "${version}" "${image}" "${map}" - eend ${?} || die -n "Installing the kernel failed" -} - -# @FUNCTION: dist-kernel_reinstall_initramfs -# @USAGE: -# @DESCRIPTION: -# Rebuild and install initramfs for the specified dist-kernel. -# is the kernel source directory (${KV_DIR} from linux-info), -# while is the full kernel version (${KV_FULL}). -# The function will determine whether is actually -# a dist-kernel, and whether initramfs was used. -# -# This function is to be used in pkg_postinst() of ebuilds installing -# kernel modules that are included in the initramfs. -dist-kernel_reinstall_initramfs() { - debug-print-function ${FUNCNAME} "${@}" - - [[ ${#} -eq 2 ]] || die "${FUNCNAME}: invalid arguments" - local kernel_dir=${1} - local ver=${2} - - local image_path=${kernel_dir}/$(dist-kernel_get_image_path) - local initramfs_path=${image_path%/*}/initrd - if [[ ! -f ${image_path} ]]; then - eerror "Kernel install missing, image not found:" - eerror " ${image_path}" - eerror "Initramfs will not be updated. Please reinstall your kernel." - return - fi - if [[ ! -f ${initramfs_path} && ! -f ${initramfs_path%/*}/uki.efi ]]; then - einfo "No initramfs or uki found at ${image_path}" - return - fi - - dist-kernel_build_initramfs "${initramfs_path}" "${ver}" - dist-kernel_install_kernel "${ver}" "${image_path}" \ - "${kernel_dir}/System.map" -} - -# @FUNCTION: dist-kernel_PV_to_KV -# @USAGE: -# @DESCRIPTION: -# Convert a Gentoo-style ebuild version to kernel "x.y.z[-rcN]" version. -dist-kernel_PV_to_KV() { - debug-print-function ${FUNCNAME} "${@}" - - [[ ${#} -ne 1 ]] && die "${FUNCNAME}: invalid arguments" - local pv=${1} - - local kv=${pv%%_*} - [[ -z $(ver_cut 3- "${kv}") ]] && kv+=".0" - [[ ${pv} == *_* ]] && kv+=-${pv#*_} - echo "${kv}" -} - -_DIST_KERNEL_UTILS=1 -fi diff --git a/files/zfs/3602.2.2/overlay/eclass/linux-mod-r1.eclass b/files/zfs/3602.2.2/overlay/eclass/linux-mod-r1.eclass deleted file mode 100644 index 2a3dde6..0000000 --- a/files/zfs/3602.2.2/overlay/eclass/linux-mod-r1.eclass +++ /dev/null @@ -1,1252 +0,0 @@ -# Copyright 2023 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -# @ECLASS: linux-mod-r1.eclass -# @MAINTAINER: -# Ionen Wolkens -# Gentoo Kernel project -# @AUTHOR: -# Ionen Wolkens -# @SUPPORTED_EAPIS: 8 -# @PROVIDES: linux-info -# @BLURB: Functions for installing out-of-tree Linux kernel modules -# @DESCRIPTION: -# See the linux-mod-r1_src_compile function documentation for in-depth -# usage, and see the example further down for a quick overview. -# -# @SUBSECTION linux-mod -> linux-mod-r1 migration notes -# 0. Define a src_compile if missing, local variables below go there. -# 1. MODULE_NAMES="name(libdir:srcdir:objdir)" -# BUILD_TARGETS="target" -# -> local modlist=( name=libdir:srcdir:objdir:target(s) ) -# - try without :target first, it is now almost always unnecessary -# - srcdir defaults to the current directory, and note that paths -# can be relative to that (should typically *not* pass ${S}) -# 2. BUILD_PARAMS and/or BUILD_FIXES -# -> local modargs=( VAR="${KV_OUT_DIR}" ... ) -# - CC/LD and similar are unneeded, always passed (V=1 too) -# - eval (aka eval "${BUILD_PARAMS}") is /not/ used for this anymore -# 3. s/linux-mod_/linux-mod-r1/g -# 4. _preinst+_postrm can be dropped, keep linux-mod-r1_pkg_postinst -# 5. linux-mod-r1_src_install now runs einstalldocs, adjust as needed -# 6. if *not* using linux-mod-r1_src_compile/install, then refer to -# the eclass' 2nd example and ensure using modules_post_process -# 7. If any, clang<->gcc switching custom workarounds can be dropped -# 8. See MODULES_KERNEL_MAX/_MIN if had or need kernel version checks. -# -# Not an exhaustive list, verify that no installed files are missing -# after. Look for "command not found" errors in the build log too. -# -# Revision bumps are not strictly needed to migrate unless want to -# keep the old as fallback for regressions, kernel upgrades or the -# new IUSE=+strip will typically cause rebuilds either way. -# -# @EXAMPLE: -# -# If source directory S had a layout such as: -# - Makefile (builds a gentoo.ko in current directory) -# - gamepad/Makefile (want to install to kernel/drivers/hid) -# - gamepad/obj/ (the built gamepad.ko ends up here) -# -# ...and the Makefile uses the NIH_SOURCE variable to find where the -# kernel build directory is (aka KV_OUT_DIR, see linux-info.eclass) -# -# then: -# -# @CODE -# CONFIG_CHECK="INPUT_FF_MEMLESS" # gamepad needs it to rumble -# MODULES_KERNEL_MIN=5.4 # needs features introduced in 5.4 -# -# src_compile() { -# local modlist=( -# gentoo -# gamepad=kernel/drivers/hid:gamepad:gamepad/obj -# ) -# local modargs=( NIH_SOURCE="${KV_OUT_DIR}" ) -# -# linux-mod-r1_src_compile -# } -# @CODE -# -# Alternatively, if using the package's build system directly is -# more convenient, a typical example could be: -# -# @CODE -# src_compile() { -# MODULES_MAKEARGS+=( -# NIH_KDIR="${KV_OUT_DIR}" -# NIH_KSRC="${KV_DIR}" -# ) -# -# emake "${MODULES_MAKEARGS[@]}" -# } -# -# src_install() { -# emake "${MODULES_MAKEARGS[@]}" DESTDIR="${ED}" install -# modules_post_process # strip->sign->compress -# -# einstalldocs -# } -# @CODE -# -# Some extra make variables may be of interest: -# - INSTALL_MOD_PATH: sometime used as DESTDIR -# - INSTALL_MOD_DIR: equivalent to linux_moduleinto -# -# MODULES_MAKEARGS is set by the eclass to handle toolchain and, -# when installing, also attempts to disable automatic stripping, -# compression, signing, and depmod to let the eclass handle it. -# -# linux_domodule can alternatively be used to install a single module. -# -# (remember to ensure that linux-mod-r1_pkg_postinst is ran for depmod) - -case ${EAPI} in - 8) ;; - *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; -esac - -if [[ ! ${_LINUX_MOD_R1_ECLASS} ]]; then -_LINUX_MOD_R1_ECLASS=1 - -inherit edo linux-info multiprocessing toolchain-funcs - -IUSE="dist-kernel modules-sign +strip ${MODULES_OPTIONAL_IUSE}" - -RDEPEND=" - sys-apps/kmod[tools] - dist-kernel? ( virtual/dist-kernel:= ) -" -DEPEND=" - virtual/linux-sources -" -BDEPEND=" - sys-apps/kmod[tools] - modules-sign? ( - dev-libs/openssl - virtual/pkgconfig - ) -" -IDEPEND=" - sys-apps/kmod[tools] -" - -if [[ -n ${MODULES_OPTIONAL_IUSE} ]]; then - : "${MODULES_OPTIONAL_IUSE#+}? ( | )" - RDEPEND=${_/|/${RDEPEND}} DEPEND=${_/|/${DEPEND}} \ - BDEPEND=${_/|/${BDEPEND}} IDEPEND=${_/|/${IDEPEND}} -fi - -# @ECLASS_VARIABLE: KERNEL_CHOST -# @USER_VARIABLE -# @DEFAULT_UNSET -# @DESCRIPTION: -# Can be set to the CHOST value to use when selecting the toolchain -# for building kernel modules. This is similar to setting the kernel -# build system's CROSS_COMPILE variable minus the trailing dash. -# -# If this does not auto-select the desired toolchain, finer control -# can be achieved by setting the not directly documented (but valid) -# variables: -# -# KERNEL_{CC,CXX,LD,AR,NM,OBJCOPY,OBJDUMP,READELF,STRIP} -# -# If in doubt, do not set any of this. -# -# Default if unset: auto-detection, typically same as the current CHOST - -# @ECLASS_VARIABLE: MODULES_EXTRA_EMAKE -# @USER_VARIABLE -# @DEFAULT_UNSET -# @DESCRIPTION: -# Extra arguments to pass to emake when building modules. -# Can contain arguments with quoted spaces, e.g. -# @CODE -# ..._EMAKE="KCFLAGS='-fzomg-optimize -fsuper-strict-aliasing' ..." -# @CODE - -# @ECLASS_VARIABLE: MODULES_I_WANT_FULL_CONTROL -# @USER_VARIABLE -# @DEFAULT_UNSET -# @DESCRIPTION: -# When set to a non-empty value, disables passing most of the eclass' -# toolchain defaults to emake when building modules. Basic eclass -# requirements, ebuilds' modargs, and users' MODULES_EXTRA_EMAKE are -# still used. -# -# Primarily intended for expert users with modified kernel Makefiles -# that want the Makefile's values to be used by default. -# -# May want to look at KERNEL_CHOST before considering this. - -# @ECLASS_VARIABLE: MODULES_SIGN_HASH -# @USER_VARIABLE -# @DEFAULT_UNSET -# @DESCRIPTION: -# Used with USE=modules-sign. Can be set to hash algorithm to use -# during signature generation. -# -# Rather than set this, it is recommended to select using the kernel's -# configuration to ensure proper support (e.g. CONFIG_MODULE_SIG_SHA256), -# and then it will be auto-detected here. -# -# Valid values: sha512,sha384,sha256,sha224,sha1 -# -# Default if unset: kernel CONFIG_MODULE_SIG_HASH's value - -# @ECLASS_VARIABLE: MODULES_SIGN_KEY -# @USER_VARIABLE -# @DEFAULT_UNSET -# @DESCRIPTION: -# Used with USE=modules-sign. Can be set to the path of the private -# key in PEM format to use, or a PKCS#11 URI. -# -# If path is relative (e.g. "certs/name.pem"), it is assumed to be -# relative to the kernel build directory being used. -# -# If the key requires a passphrase or PIN, the used kernel sign-file -# utility recognizes the KBUILD_SIGN_PIN environment variable. Be -# warned that the package manager may store this value in binary -# packages, database files, temporary files, and possibly logs. This -# eclass unsets the variable after use to mitigate the issue (notably -# for shared binary packages), but use this with care. -# -# Default if unset: kernel CONFIG_MODULE_SIG_KEY's value which itself -# defaults to certs/signing_key.pem - -# @ECLASS_VARIABLE: MODULES_SIGN_CERT -# @USER_VARIABLE -# @DESCRIPTION: -# Used with USE=modules-sign. Can be set to the path of the X.509 -# public key certificate to use. -# -# If path is relative (e.g. "certs/name.x509"), it is assumed to be -# relative to the kernel build directory being used. -: "${MODULES_SIGN_CERT:=certs/signing_key.x509}" - -# @ECLASS_VARIABLE: MODULES_KERNEL_MAX -# @DEFAULT_UNSET -# @DESCRIPTION: -# If set to a kernel version (format: 1, 1.2, or 1.2.3), will print a -# warning if the used version is greater than (ver_test -gt) to this -# value using the same amount of version components (i.e. MAX=1.2 -# allows 1.2.3, but MAX=1.2.2 does not). -# -# This should *only* be used for modules that are known to break -# frequently on kernel upgrades. If setting this to a non-LTS kernel, -# then should also take care to test and update this value regularly -# with new major kernel releases not to let the warning become stale -# and ignored by users. -# -# Not fatal to allow users to try or self-patch easily, but the (large) -# warning is difficult to miss. If need a fatal check for more serious -# issues (e.g. runtime filesystem corruption), please do it manually. -# -# This is intended to reduce the amount of bug reports for recurring -# expected issues that can be easily mitigated by using LTS kernels -# and waiting for new releases. -# -# If used, must be set before linux-mod-r1_pkg_setup is called. - -# @ECLASS_VARIABLE: MODULES_KERNEL_MIN -# @DEFAULT_UNSET -# @DESCRIPTION: -# If set to a kernel version (format: 1, 1.2, or 1.2.3), will abort if -# the used version is less than (ver_test -lt) this value. -# -# Should only be used if known broken, or if upstream recommends a sane -# minimum. Not particularly necessary for kernels that are no longer -# in the tree. -# -# If used, must be set before linux-mod-r1_pkg_setup is called. - -# @ECLASS_VARIABLE: MODULES_OPTIONAL_IUSE -# @PRE_INHERIT -# @DEFAULT_UNSET -# @DESCRIPTION: -# May contain a single flag to be added to IUSE optionally prefixed -# with a + sign to enable it by default. Doing so makes *all* of -# linux-mod-r1's functions and dependencies a no-op unless the flag -# is enabled. This includes phases, e.g. linux-mod-r1_pkg_setup will -# not process CONFIG_CHECK unless the flag is set. -# -# The typical recommended value is "+modules" (global IUSE). -# -# Note that modules being optional can be useful even if user space -# tools require them (e.g. installing in a chroot or prefix when the -# modules are loaded on the host, saves setting up linux sources). -# However, if tools are non-trivial to build, it may be preferable -# to split into two packages than use this variable due to requiring -# rebuilds every kernel upgrades. - -# @ECLASS_VARIABLE: MODULES_MAKEARGS -# @OUTPUT_VARIABLE -# @DESCRIPTION: -# Will be set after linux-mod-r1_pkg_setup has been called. Contains -# arguments that should be passed to emake when building or installing -# modules. -# -# Modifying this variable is acceptable (e.g. to append kernel source -# arguments) but, if using linux-mod-r1_src_compile, setting modargs -# is the intended method seen as cleaner and less error-prone. - -# @FUNCTION: linux-mod-r1_pkg_setup -# @DESCRIPTION: -# Required before using other functions from this eclass, and will: -# 1. run linux-info_pkg_setup (see linux-info.eclass) -# -> implies processing CONFIG_CHECK, and providing KV_ variables -# (MODULES and TRIM_UNUSED_KSYMS are always checked) -# 2. prepare toolchain to match the kernel -# -> sets KERNEL_{CHOST,CC,CXX,LD,AR,NM,OBJCOPY,OBJDUMP,READELF,STRIP} -# -> also sets MODULES_MAKEARGS array with, e.g. CC="${KERNEL_CC}" -# (normally these should not be used directly, for custom builds) -# 3. perform various sanity checks to fail early on issues -linux-mod-r1_pkg_setup() { - debug-print-function ${FUNCNAME[0]} "${@}" - [[ ${MERGE_TYPE} != binary ]] || return 0 - _MODULES_GLOBAL[ran:pkg_setup]=1 - _modules_check_function ${#} 0 0 || return 0 - _modules_check_migration - - _modules_prepare_kernel - _modules_prepare_sign - _modules_prepare_toolchain - - _modules_set_makeargs - - _modules_sanity_gccplugins -} - -# @FUNCTION: linux-mod-r1_src_compile -# @DESCRIPTION: -# Builds modules, see the eclass' example for a quick overview. -# Uses the variables modlist and modargs as described below: -# -# * local modlist=( ... ) - list of modules to build, set as: -# -# module-name=install-dir:source-dir:build-dir:make-target -# -# > module-name: Resulting name, aka .ko (required). -# -# > install-dir: Kernel modules sub-directory to install the module -# to (/lib/modules/version//name.ko). Will be used when -# run linux-mod-r1_src_install. May want to consider the values of -# INSTALL_MOD_DIR(Makefile) or DEST_MODULE_LOCATION(dkms.conf) if it -# exists, but it can be anything. -# -> Default: extra -# -# Warning: Changing this location may leave stale modules until a -# kernel upgrade as the package manager does not typically delete -# old modules and only does overwrite on rebuilds. -# -# > source-dir: Directory containing the Makefile to build the module. -# Path can be relative to the current directory or absolute. -# -> Default: current directory -# -# > build-dir: Directory that will hold the built module-name.ko. -# -> Default: same as source-dir's value -# -# > make-target: Almost always unneeded but, if defaults are not right, -# then can specify the Makefile's target(s) to build the module/extras. -# Multiple targets can be used with spaces, e.g. :"first second". -# -> Default: specially tries modules, module, .ko, default, -# all, empty target, and runs the first found usable -# -# Missing elements results in defaults being used, e.g. this is valid: -# modlist=( name1 name2=:source name3=install::build ) -# -# * local modargs=( ... ) - extra arguments to pass to emake -# -# Makefile should notably be inspected for which variable it uses -# to find the kernel's build directory then, e.g. KDIR="${KV_OUT_DIR}" -# as appropriate. Note that typically want to pass KV_OUT_DIR(build) -# rather than KV_DIR(sources) if not both. This allows users to do -# out-of-source kernel builds and still build modules. -# -# Passing common toolchain variables such as CC or LD is not needed -# here as they are passed by default. -# -# --- -# -# Allowed to be called multiple times with a different modlist if need -# different make arguments per modules or intermediate steps -- albeit, -# if atypical, may want to build manually (see eclass' example). -linux-mod-r1_src_compile() { - debug-print-function ${FUNCNAME[0]} "${@}" - _modules_check_function ${#} 0 0 || return 0 - - [[ ${modlist@a} == *a* && ${#modlist[@]} -gt 0 ]] || - die "${FUNCNAME[0]} was called without a 'modlist' array" - - # run this again to verify built files access with src_compile's user - _modules_sanity_kernelbuilt - - local -a emakeargs=( "${MODULES_MAKEARGS[@]}" ) - [[ ${modargs@a} == *a* ]] && emakeargs+=( "${modargs[@]}" ) - - local -A built=() - local build mod name target - for mod in "${modlist[@]}"; do - # note modlist was not made an associative array ([name]=) to preserve - # ordering, but is still using = to improve readability - name=${mod%%=*} - [[ -n ${name} && ${name} != *:* ]] || die "invalid mod entry '${mod}'" - - # 0:install-dir 1:source-dir 2:build-dir 3:make-target(s) - mod=${mod#"${name}"} - IFS=: read -ra mod <<<"${mod#=}" - [[ ${#mod[@]} -le 4 ]] || die "too many ':' in ${name}'s modlist" - - [[ ${mod[1]:=${PWD}} != /* ]] && mod[1]=${PWD}/${mod[1]} - [[ ${mod[2]:=${mod[1]}} != /* ]] && mod[2]=${PWD}/${mod[2]} - _MODULES_INSTALL[${mod[2]}/${name}.ko]=${mod[0]:-extra} - - pushd "${mod[1]}" >/dev/null || die - - if [[ -z ${mod[3]} ]]; then - # guess between commonly used targets if none given, fallback to - # an empty target without trying to see the error output - for target in module{s,} "${name}".ko default all; do - nonfatal emake "${emakeargs[@]}" -q "${target}" &>/dev/null - if [[ ${?} -eq 1 ]]; then - mod[3]=${target} - break - fi - done - fi - - # sometime modules are all from same source dir and built all at once, - # make will not rebuild either way but can skip the unnecessary noise - build= - for target in ${mod[3]:-&}; do - if ! has "${target}" ${built[${mod[1]}]}; then - build=1 - built[${mod[1]}]+=" ${target} " - fi - done - - if [[ ${build} ]]; then - einfo "Building ${name} module in ${mod[1]} ..." - - # allow word splitting for rare cases of multiple targets - emake "${emakeargs[@]}" ${mod[3]} - else - einfo "Building ${name} module in ${mod[1]} ... already done." - fi - - popd >/dev/null || die - done -} - -# @FUNCTION: linux-mod-r1_src_install -# @DESCRIPTION: -# Installs modules built by linux-mod-r1_src_compile using -# linux_domodule, then runs modules_post_process and einstalldocs. -linux-mod-r1_src_install() { - debug-print-function ${FUNCNAME[0]} "${@}" - _modules_check_function ${#} 0 0 || return 0 - - (( ${#_MODULES_INSTALL[@]} )) || - die "${FUNCNAME[0]} was called without running linux-mod-r1_src_compile" - - ( - for mod in "${!_MODULES_INSTALL[@]}"; do - linux_moduleinto "${_MODULES_INSTALL[${mod}]}" - linux_domodule "${mod}" - done - ) - - modules_post_process - - einstalldocs -} - -# @FUNCTION: linux-mod-r1_pkg_postinst -# @DESCRIPTION: -# Updates module dependencies using depmod. -linux-mod-r1_pkg_postinst() { - debug-print-function ${FUNCNAME[0]} "${@}" - _modules_check_function ${#} 0 0 || return 0 - - _modules_update_depmod - - # post_process ensures modules were installed and that the eclass' USE - # are likely not no-ops (unfortunately postinst itself may be missed) - [[ -v _MODULES_GLOBAL[ran:post_process] ]] || - eqawarn "QA Notice: neither linux-mod-r1_src_install nor modules_post_process were used" -} - -# @FUNCTION: linux_domodule -# @USAGE: ... -# @DESCRIPTION: -# Installs Linux modules (.ko files). -# -# See also linux_moduleinto. -linux_domodule() { - debug-print-function ${FUNCNAME[0]} "${@}" - _modules_check_function ${#} 1 '' "..." || return 0 - ( - # linux-mod-r0 formerly supported INSTALL_MOD_PATH (bug #642240), but - # this been judged messy to integrate consistently as not everything - # uses this function and build systems sometime mix it with DESTDIR - # (try ROOT if need to install somewhere else instead) - insinto "/lib/modules/${KV_FULL}/${_MODULES_GLOBAL[moduleinto]:-extra}" - doins "${@}" - ) -} - -# @FUNCTION: linux_moduleinto -# @USAGE: -# @DESCRIPTION: -# Directory to install modules into when calling linux_domodule. -# Relative to kernel modules path as in: -# ${ED}/lib/modules/${KV_FULL}/ -# -# Can contain subdirectories, e.g. kernel/fs. -# -# If not called, defaults to "extra". On the kernel build system, -# this is like setting INSTALL_MOD_DIR which has the same default -# for external modules. -linux_moduleinto() { - debug-print-function ${FUNCNAME[0]} "${@}" - _modules_check_function ${#} 1 1 "" || return 0 - _MODULES_GLOBAL[moduleinto]=${1} -} - -# @FUNCTION: modules_post_process -# @USAGE: [] -# @DESCRIPTION: -# Strip, sign, verify, and compress all .ko modules found under -# . Should typically *not* be called directly as it will -# be run by linux-mod-r1_src_install. This is intended for use -# when modules were installed some other way. -# -# should exist under ${ED}. -# Defaults to /lib/modules/${KV_FULL}. -# -# Filenames may change due to compression, so any operations on -# these should be performed prior. -# -# Warning: This will abort if no modules are found, which can happen -# if modules were unexpectedly pre-compressed possibly due to using -# make install without passing MODULES_MAKEARGS to disable it. -modules_post_process() { - debug-print-function ${FUNCNAME[0]} "${@}" - _modules_check_function ${#} 0 1 '[]' || return 0 - [[ ${EBUILD_PHASE} == install ]] || - die "${FUNCNAME[0]} can only be called in the src_install phase" - - local path=${ED}${1-/lib/modules/${KV_FULL}} - local -a mods - [[ -d ${path} ]] && mapfile -td '' mods < <( - find "${path}" -type f -name '*.ko' -print0 || die - ) - (( ${#mods[@]} )) || - die "${FUNCNAME[0]} was called with no installed modules under ${path}" - - # TODO?: find way for sane use with dracut (its 90kernel-modules-extra - # parses depmod.d files directly and assumes should include its modules - # which can lead to unnecessarily increased size or stale modules) -# _modules_process_depmod.d "${mods[@]#"${path}/"}" - - _modules_process_strip "${mods[@]}" - _modules_process_sign "${mods[@]}" - _modules_sanity_modversion "${mods[@]}" # after strip/sign in case broke it - _modules_process_compress "${mods[@]}" - - _MODULES_GLOBAL[ran:post_process]=1 -} - -# @ECLASS_VARIABLE: _MODULES_GLOBAL -# @INTERNAL -# @DESCRIPTION: -# General use associative array to avoid defining separate globals. -declare -gA _MODULES_GLOBAL=() - -# @ECLASS_VARIABLE: _MODULES_INSTALL -# @INTERNAL -# @DESCRIPTION: -# List of modules from linux-mod-r1_src_compile to be installed. -declare -gA _MODULES_INSTALL=() - -# @FUNCTION: _modules_check_function -# @USAGE: [ []] -# @RETURN: 0 or 1 if caller should do nothing -# @INTERNAL -# @DESCRIPTION: -# Checks for MODULES_OPTIONAL_IUSE, and aborts if amount of arguments -# does not add up or if it was called before linux-mod-r1_pkg_setup. -_modules_check_function() { - [[ -z ${MODULES_OPTIONAL_IUSE} ]] || - use "${MODULES_OPTIONAL_IUSE#+}" || return 1 - - [[ ${#} == 0 || ${1} -ge ${2} && ( ! ${3} || ${1} -le ${3} ) ]] || - die "Usage: ${FUNCNAME[1]} ${4-(no arguments)}" - - [[ -v _MODULES_GLOBAL[ran:pkg_setup] ]] || - die "${FUNCNAME[1]} was called without running linux-mod-r1_pkg_setup" -} - -# @FUNCTION: _modules_check_migration -# @INTERNAL -# @DESCRIPTION: -# Aborts if see obsolete variables from the linux-mod-r0 eclass being -# used, likely due to an incomplete migration. This function should -# eventually be removed after linux-mod-r0 is @DEAD not to fail for -# nothing if users happen to have these in their environment given the -# naming for some is a bit generic. -_modules_check_migration() { - _modules_check_var() { - [[ -z ${!1} ]] || - die "${1} is obsolete, see ${2} in linux-mod-r1 eclass docs" - } - # the 'I' on this one is notably sneaky and could silently be ignored - _modules_check_var MODULES_OPTIONAL_USE MODULES_OPTIONAL_IUSE - _modules_check_var MODULES_OPTIONAL_USE_IUSE_DEFAULT MODULES_OPTIONAL_IUSE - _modules_check_var BUILD_PARAMS modargs - _modules_check_var BUILD_TARGETS modlist - _modules_check_var MODULE_NAMES modlist - [[ -z ${!MODULESD_*} ]] || - die "MODULESD_* variables are no longer supported, replace by handcrafted .conf files if needed" - - # Ignored variables: - # - BUILD_FIXES: seen in some ebuilds but was undocumented and linux-info - # still sets it preventing from blocking it entirely - # - ECONF_PARAMS: documented but was a no-op in linux-mod too -} - -# @FUNCTION: _modules_prepare_kernel -# @INTERNAL -# @DESCRIPTION: -# Handles linux-info bits to provide usable sources, KV_ variables, -# and CONFIG_CHECK use. -_modules_prepare_kernel() { - get_version - - # linux-info allows skipping checks if SKIP_KERNEL_CHECK is set and - # then require_configured_kernel will not abort, but no sources means - # 100% failure for building modules and so just abort now (the proper - # way to allow skipping sources here is MODULES_OPTIONAL_IUSE) - [[ -n ${KV_FULL} ]] || - die "kernel sources are required to build kernel modules" - - require_configured_kernel - - _modules_sanity_kernelbuilt - _modules_sanity_kernelversion - - # note: modules-specific check_modules_supported could probably be - # removed from linux-info in the future as this is a sufficient check - local CONFIG_CHECK="${CONFIG_CHECK} MODULES" - - # kernel will not typically know about symbols we use (bug #591832), - # but stay non-fatal if kernel has an exception list set (bug #759238) - # note: possible to bypass either way with CHECKCONFIG_DONOTHING=1 - if [[ $(linux_chkconfig_string UNUSED_KSYMS_WHITELIST) == \"+(?)\" ]]; then - CONFIG_CHECK+=" ~!TRIM_UNUSED_KSYMS" - else - CONFIG_CHECK+=" !TRIM_UNUSED_KSYMS" - fi - - linux-info_pkg_setup -} - -# @FUNCTION: _modules_prepare_sign -# @INTERNAL -# @DESCRIPTION: -# Determines arguments to pass to sign-file (hash/keys), and performs -# basic sanity checks to abort early if signing does not look possible. -_modules_prepare_sign() { - use modules-sign || return 0 - - _modules_sign_die() { - eerror "USE=modules-sign requires additional configuration, please see the" - eerror "kernel[1] documentation and the linux-mod-r1 eclass[2] user variables." - eerror "[1] https://www.kernel.org/doc/html/v${KV_MAJOR}.${KV_MINOR}/admin-guide/module-signing.html" - eerror "[2] https://devmanual.gentoo.org/eclass-reference/linux-mod-r1.eclass/index.html" - die "USE=modules-sign is set but ${*}" - } - - linux_chkconfig_present MODULE_SIG || - _modules_sign_die "CONFIG_MODULE_SIG is not set in the kernel" - - if [[ -z ${MODULES_SIGN_HASH} ]]; then - : "$(linux_chkconfig_string MODULE_SIG_HASH)" - MODULES_SIGN_HASH=${_//\"} - [[ -n ${MODULES_SIGN_HASH} ]] || - _modules_sign_die "CONFIG_MODULE_SIG_HASH is not set in the kernel" - fi - - if [[ -z ${MODULES_SIGN_KEY} ]]; then - : "$(linux_chkconfig_string MODULE_SIG_KEY)" - MODULES_SIGN_KEY=${_//\"} - [[ -n ${MODULES_SIGN_KEY} ]] || - _modules_sign_die "CONFIG_MODULE_SIG_KEY is not set in the kernel" - fi - - [[ ${MODULES_SIGN_KEY} != @(/|pkcs11:)* ]] && - MODULES_SIGN_KEY=${KV_OUT_DIR}/${MODULES_SIGN_KEY} - [[ ${MODULES_SIGN_CERT} != /* ]] && - MODULES_SIGN_CERT=${KV_OUT_DIR}/${MODULES_SIGN_CERT} - - # assumes users know what they are doing if using a pkcs11 URI - [[ ${MODULES_SIGN_KEY} == pkcs11:* || -f ${MODULES_SIGN_KEY} ]] || - _modules_sign_die "the private key '${MODULES_SIGN_KEY}' was not found" - [[ -f ${MODULES_SIGN_CERT} ]] || - _modules_sign_die "the public key certificate '${MODULES_SIGN_CERT}' was not found" -} - -# @FUNCTION: _modules_prepare_toolchain -# @INTERNAL -# @DESCRIPTION: -# Sets KERNEL_{CC,CXX,LD,AR,NM,OBJCOPY,OBJDUMP,READELF,STRIP} based on -# the kernel configuration and KERNEL_CHOST (also set if missing) that -# *should* be usable to build modules. -# -# Tries to match compiler type (gcc or clang), and major version. Will -# inform if matching was not possible likely due to the compiler being -# uninstalled. Users can set KERNEL_ variables themselves to override. -# -# These variables are normally manipulated by the kernel's LLVM=1 with -# the exception of CXX that is included anyway given *some* out-of-tree -# modules use it, e.g. nvidia-drivers[kernel-open]. -_modules_prepare_toolchain() { - # note that the kernel adds -m32/-m64/-m elf_x86_64/etc... for, e.g. - # toolchains defaulting to x32, but may need automagic here if need - # a different toolchain such as sys-devel/kgcc64 - [[ -z ${KERNEL_CHOST} ]] && linux_chkconfig_present 64BIT && - case ${CHOST} in - # matching kernel-build.eclass, see for details - hppa2.0-*) KERNEL_CHOST=${CHOST/2.0/64};; - esac - - # recognizing KERNEL_CHOST given CROSS_COMPILE seems too generic here, - # but should rarely be necessary unless different userland and kernel - : "${KERNEL_CHOST:=${CHOST}}" - - einfo "Preparing ${KERNEL_CHOST} toolchain for kernel modules (override with KERNEL_CHOST) ..." - - _modules_tc_best() { - [[ -z ${!1} ]] && read -r ${1} < <(type -P -- "${@:2}") - } - - local gccv clangv tool - if linux_chkconfig_present CC_IS_GCC; then - gccv=$(linux_chkconfig_string GCC_VERSION) - gccv=${gccv::2} # major version, will break on gcc-100... - # chost-gcc-ver > chost-gcc > gcc-ver > gcc - _modules_tc_best KERNEL_CC {"${KERNEL_CHOST}-",}gcc{"-${gccv}",} - _modules_tc_best KERNEL_CXX {"${KERNEL_CHOST}-",}g++{"-${gccv}",} - # unknown what was used exactly here, but prefer non-llvm with gcc - for tool in AR NM OBJCOPY OBJDUMP READELF STRIP; do - _modules_tc_best KERNEL_${tool} \ - {"${KERNEL_CHOST}-",}{gcc-,}${tool,,} - done - elif linux_chkconfig_present CC_IS_CLANG; then - clangv=$(linux_chkconfig_string CLANG_VERSION) - clangv=${clangv::2} - # like gcc, but try directories to get same version on all tools - # (not using get_llvm_prefix to avoid conflicts with ebuilds using - # llvm slots for non-modules reasons, e.g. sets llvm_check_deps) - _modules_tc_best KERNEL_CC \ - {"${BROOT}/usr/lib/llvm/${clangv}/bin/",}{"${KERNEL_CHOST}-",}clang{"-${clangv}",} - _modules_tc_best KERNEL_CXX \ - {"${BROOT}/usr/lib/llvm/${clangv}/bin/",}{"${KERNEL_CHOST}-",}clang++{"-${clangv}",} - for tool in AR NM OBJCOPY OBJDUMP READELF STRIP; do - _modules_tc_best KERNEL_${tool} \ - {"${BROOT}/usr/lib/llvm/${clangv}/bin/",}{"${KERNEL_CHOST}-",}{llvm-,}${tool,,} - done - fi - - if linux_chkconfig_present LD_IS_BFD; then - _modules_tc_best KERNEL_LD {"${KERNEL_CHOST}-",}ld.bfd - elif linux_chkconfig_present LD_IS_LLD; then - # also match with clang if it was used - _modules_tc_best KERNEL_LD \ - {${clangv+"${BROOT}/usr/lib/llvm/${clangv}/bin/"},}{"${KERNEL_CHOST}-",}ld.lld - fi - - # if any variables are still empty, fallback to normal defaults - local CHOST=${KERNEL_CHOST} - : "${KERNEL_CC:=$(tc-getCC)}" - : "${KERNEL_CXX:=$(tc-getCXX)}" - : "${KERNEL_LD:=$(tc-getLD)}" - : "${KERNEL_AR:=$(tc-getAR)}" - : "${KERNEL_NM:=$(tc-getNM)}" - : "${KERNEL_OBJCOPY:=$(tc-getOBJCOPY)}" - : "${KERNEL_OBJDUMP:=$(tc-getOBJDUMP)}" - : "${KERNEL_READELF:=$(tc-getREADELF)}" - : "${KERNEL_STRIP:=$(tc-getSTRIP)}" - - # for toolchain-funcs, uses CPP > CC but set both not to make assumptions - local CC=${KERNEL_CC} CPP="${KERNEL_CC} -E" LD=${KERNEL_LD} - - # show results, skip line wrap to avoid standing out too much - einfo "Toolchain picked for kernel modules (override with KERNEL_CC, _LD, ...):"\ - "'${KERNEL_CC}' '${KERNEL_CXX}' '${KERNEL_LD}' '${KERNEL_AR}'"\ - "'${KERNEL_NM}' '${KERNEL_OBJCOPY}' '${KERNEL_OBJDUMP}'"\ - "'${KERNEL_READELF}' '${KERNEL_STRIP}'" - - # hack: kernel adds --thinlto-cache-dir to KBUILD_LDFLAGS with ThinLTO - # resulting in sandbox violations and we cannot safely override that - # variable, using *both* {LDFLAGS_MODULE,ldflags-y}=--thinlto-cache-dir= - # can work but raises concerns about breaking packages that may use these - if linux_chkconfig_present LTO_CLANG_THIN && tc-ld-is-lld; then - KERNEL_LD=${T}/linux-mod-r1_ld.lld - printf '#!/usr/bin/env sh\nexec %s "${@}" --thinlto-cache-dir=\n' \ - "${LD}" > "${KERNEL_LD}" || die - chmod +x -- "${KERNEL_LD}" || die - fi - - # warn if final picked CC type or major version is mismatching, arguably - # should be fatal but not forcing given it is not *always* an issue - local warn - if [[ -v gccv ]]; then - if ! tc-is-gcc; then - warn="gcc-${gccv} but\n '${KERNEL_CC}' is not gcc" - elif [[ $(gcc-major-version) -ne "${gccv}" ]]; then - warn="gcc-${gccv} but\n '${KERNEL_CC}' is gcc-$(gcc-major-version)" - fi - elif [[ -v clangv ]]; then - if ! tc-is-clang; then - warn="clang-${clangv} but\n '${KERNEL_CC}' is not clang" - elif [[ $(clang-major-version) -ne "${clangv}" ]]; then - warn="clang-${clangv} but\n '${KERNEL_CC}' is clang-$(clang-major-version)" - fi - fi - - if [[ -v warn ]]; then - ewarn - ewarn "Warning: kernel ${KV_FULL} is built with ${warn}" - ewarn "This *could* result in build issues or other incompatibilities." - ewarn "It is recommended to either \`make clean\` and rebuild the kernel" - ewarn "with the current toolchain (for distribution kernels, re-installing" - ewarn "will do the same), or set the KERNEL_CC variable to point to the" - ewarn "same compiler. Note that when it is available, auto-selection is" - ewarn "attempted making the latter rarely needed." - ewarn - fi -} - -# @FUNCTION: _modules_process_compress -# @USAGE: ... -# @INTERNAL -# @DESCRIPTION: -# If enabled in the kernel configuration, this compresses the given -# modules using the same format. -_modules_process_compress() { - local -a compress - if linux_chkconfig_present MODULE_COMPRESS_XZ; then - compress=(xz -qT"$(makeopts_jobs)" --memlimit-compress=50%) - elif linux_chkconfig_present MODULE_COMPRESS_GZIP; then - if type -P pigz &>/dev/null; then - compress=(pigz -p"$(makeopts_jobs)") - else - compress=(gzip) - fi - elif linux_chkconfig_present MODULE_COMPRESS_ZSTD; then - compress=(zstd -qT"$(makeopts_jobs)" --rm) - fi - - if [[ -v compress ]]; then - # could fail, assumes have commands that were needed for the kernel - einfo "Compressing modules (matching the kernel configuration) ..." - edob "${compress[@]}" -- "${@}" - fi -} - -# @FUNCTION: _modules_process_depmod.d -# @USAGE: ... -# @INTERNAL -# @DESCRIPTION: -# Generate a depmod.d file to ensure priority if duplicate modules -# exist, such as stale modules in different directories, or to -# override the kernel's own modules. -_modules_process_depmod.d() { - ( - [[ ${SLOT%/*} == 0 ]] && slot= || slot=-${SLOT%/*} - insinto /lib/depmod.d - newins - ${PN}${slot}.conf < <( - echo "# Automatically generated by linux-mod-r1.eclass for ${CATEGORY}/${PN}" - for mod; do - [[ ${mod} =~ ^(.+)/(.+).ko$ ]] && - echo "override ${BASH_REMATCH[2]} ${KV_FULL} ${BASH_REMATCH[1]}" - done - ) - ) -} - -# @FUNCTION: _modules_process_sign -# @USAGE: ... -# @INTERNAL -# @DESCRIPTION: -# Cryptographically signs the given modules when USE=modules-sign is -# enabled. -_modules_process_sign() { - use modules-sign || return 0 - - # scripts/sign-file used to be a perl script but is now written in C, - # and it could either be missing or broken given it links with openssl - # (no subslot rebuilds on kernel sources), trivial to compile regardless - local sign= - if [[ -f ${KV_DIR}/scripts/sign-file.c ]]; then - sign=${T}/linux-mod-r1_sign-file - ( - # unfortunately using the kernel's Makefile is inconvenient (no - # simple build target for this), may need revisiting on changes - einfo "Compiling sign-file ..." - tc-export_build_env - nonfatal edob $(tc-getBUILD_CC) ${BUILD_CFLAGS} ${BUILD_CPPFLAGS} \ - $($(tc-getBUILD_PKG_CONFIG) --cflags libcrypto) \ - ${BUILD_LDFLAGS} -o "${sign}" "${KV_DIR}"/scripts/sign-file.c \ - $($(tc-getBUILD_PKG_CONFIG) --libs libcrypto || echo -lcrypto) - ) || { - einfo "Trying fallback ..." - sign= - } - fi - - if [[ -z ${sign} ]]; then - if [[ -x ${KV_OUT_DIR}/scripts/sign-file ]]; then - sign=${KV_OUT_DIR}/scripts/sign-file # try if built - elif [[ -x ${KV_DIR}/scripts/sign-file ]]; then - sign=${KV_DIR}/scripts/sign-file # old kernel (... -# @INTERNAL -# @DESCRIPTION: -# Strips the given modules of unneeded symbols when USE=strip is -# enabled, and informs the package manager not to regardless. -_modules_process_strip() { - # letting the package manager handle this complicates scenarios - # where we want to either compress the pre-stripped module, or - # sign the module without its signature becoming invalid on merge - dostrip -x "${@#"${ED}"}" - - if use strip; then - einfo "Stripping modules ..." - edob "${KERNEL_STRIP}" --strip-unneeded -- "${@}" - fi -} - -# @FUNCTION: _modules_sanity_gccplugins -# @INTERNAL -# @DESCRIPTION: -# Performs a basic build test to detect GCC plugins mismatch issues -# and, if so, aborts with explanation given it often confuses users. -# -# Using mismatching gcc can sometime work to build modules, but if -# GCC plugins are enabled it will almost always be an error. -# -# Note: may need occasional review to ensure the test still works by: -# enabling a GCC plugin in the kernel, building with older GCC, -# then building a module by setting KERNEL_CC=gcc-. -_modules_sanity_gccplugins() { - linux_chkconfig_present GCC_PLUGINS || return 0 - - local tmp=${T}/linux-mod-r1_gccplugins - mkdir -p -- "${tmp}" || die - - echo "obj-m += test.o" > "${tmp}"/Kbuild || die - :> "${tmp}"/test.c || die - - # always fails, but interested in the stderr messages - local output=$( - cd -- "${KV_OUT_DIR}" && # fwiw skip non-POSIX -C in eclasses - LC_ALL=C nonfatal emake "${MODULES_MAKEARGS[@]}" M="${tmp}" \ - 2>&1 >/dev/null - ) - - if [[ ${output} == *"error: incompatible gcc/plugin version"* ]]; then - eerror "GCC_PLUGINS is enabled in the kernel and plugin version mismatch issues" - eerror "have been detected. Please \`make clean\` and rebuild the kernel using" - eerror "the current version of GCC (or re-install for distribution kernels)." - die "kernel ${KV_FULL} needs to be rebuilt" - fi -} - -# @FUNCTION: _modules_sanity_kernelbuilt -# @INTERNAL -# @DESCRIPTION: -# Checks if the kernel seems fully built by having a Module.symvers -# that is also readable, abort otherwise. -# -# About readability, occasionally users build their kernel as root with -# umask 0077 and then the package manager's user cannot read built files -# leaving them confused. -# -# Given user and access can very between phases (notably src_compile), -# it makes sense to run this check more than once. -# -# Note: -# This is an alternate version of linux-info's check_kernel_built -# which probably will not need to exist there if linux-mod-r0 is -# gone, error it gives is also modules-specific and fits better here. -# -# The old check_kernel_built checks version.h and suggests running -# modules_prepare if missing, but that does not create Module.symvers. -# Nowadays the kernel makes unresolved symbols fatal by default -# meaning that all modules will fail unless KBUILD_MODPOST_WARN=1 -# which seem questionable to support. So rather than version.h, this -# checks and require Module.symvers, and suggests a full build if -# missing (if really must, users can bypass by touching the file). -# nvidia-drivers (for one) further checks this file directly to do -# configure tests that will break badly without. -_modules_sanity_kernelbuilt() { - local symvers=${KV_OUT_DIR}/Module.symvers - - if [[ ! -f ${symvers} ]]; then - eerror "'${symvers}' was not found implying that the" - eerror "linux-${KV_FULL} tree at that location has not been built." - eerror - eerror "Please verify that this is the intended kernel version, then perform" - eerror "a full build[1] (i.e. make && make modules_install && make install)." - eerror - eerror "Alternatively, consider a distribution kernel[2] that does not need" - eerror "these manual steps (e.g. sys-kernel/gentoo-kernel or gentoo-kernel-bin)." - eerror - eerror "[1] https://wiki.gentoo.org/wiki/Kernel/Configuration#Build" - eerror "[2] https://wiki.gentoo.org/wiki/Project:Distribution_Kernel" - die "built kernel sources are required to build kernel modules" - fi - - if [[ ! -r ${symvers} ]]; then - eerror "'${symvers}' exists but cannot be read by the" - eerror "user id(${EUID}) of the package manager, likely implying no world" - eerror "read access permissions:" - eerror - eerror " $(ls -l -- "${symvers}")" - eerror - eerror "Causes may vary, but a common one is building the kernel with a umask" - eerror "value of '0077' rather than the more typical '0022' (run the \`umask\`" - eerror "command to confirm, as root if was building the kernel using it)." - eerror - eerror "Many other files are likely affected and will lead to build failures." - eerror "It is recommended to clean the sources and rebuild with \`umask 0022\`" - eerror "rather than attempt to fix the permissions manually." - die "no read access permission to the generated kernel files" - fi -} - -# @FUNCTION: _modules_sanity_kernelversion -# @INTERNAL -# @DESCRIPTION: -# Prints a warning if the kernel version is greater than to -# MODULES_KERNEL_MAX (while only considering same amount of version -# components), or aborts if it is less than MODULES_KERNEL_MIN -_modules_sanity_kernelversion() { - local kv=${KV_MAJOR}.${KV_MINOR}.${KV_PATCH} - - if [[ -n ${MODULES_KERNEL_MIN} ]] && - ver_test "${kv}" -lt "${MODULES_KERNEL_MIN}" - then - eerror "${P} requires a kernel version of at least >=${MODULES_KERNEL_MIN}," - eerror "but the current kernel is ${KV_FULL}. Please update." - die "kernel ${KV_FULL} is too old" - fi - - if [[ -n ${MODULES_KERNEL_MAX} ]]; then - : "${MODULES_KERNEL_MAX//[^.]/}" - local -i count=${#_} - - if ver_test "$(ver_cut 1-$((count+1)) "${kv}")" \ - -gt "${MODULES_KERNEL_MAX}" - then - # add .x to 1 missing component to make, e.g. <=1.2.x more natural, - # not <1.3 given users sometimes see it as 1.3 support at a glance - local max=${MODULES_KERNEL_MAX} - [[ ${count} -lt 2 ]] && max+=.x - - ewarn - ewarn " *** WARNING *** " - ewarn - ewarn "${PN} is known to break easily with new kernel versions and," - ewarn "with the current kernel (${KV_FULL}), it was either hardly" - ewarn "tested or is known broken. It is recommended to use one of:" - ewarn - # fwiw we do not know what is *actually* used or wanted even with - # the USE, so stay a bit vague and always mention both dist+sources - if use dist-kernel; then - ewarn " <=virtual/dist-kernel-${max} or" - else - ewarn " <=sys-kernel/gentoo-kernel-${max} or" - fi - ewarn " <=sys-kernel/gentoo-sources-${max}" - ewarn - ewarn "or equivalent rather than file downstream bug reports if run into" - ewarn "issues, then wait for upstream fixes and a new release. Ideally," - ewarn "with out-of-tree modules, use an LTS (Long Term Support) kernel" - ewarn "branch[1]. If in doubt, Gentoo's stable kernels are always LTS" - ewarn "and can be easily used even on ~testing systems." - ewarn - ewarn "[1] https://www.kernel.org/category/releases.html" - ewarn - fi - fi -} - -# @FUNCTION: _modules_sanity_modversion -# @USAGE: ... -# @INTERNAL -# @DESCRIPTION: -# Checks if the passed module(s) do not seem obviously broken and the -# builtin versions match ${KV_FULL}, otherwise die with an explanation. -# -# If receive a bug with a version error, an easy way to reproduce is to -# set KERNEL_DIR with the sources of a different kernel version than -# both the ones pointed by /usr/src/linux and `uname -r`. Refer to -# linux-mod-r1_src_compile's modargs in the eclass docs for fixing. -_modules_sanity_modversion() { - local mod ver - for mod; do - # modinfo can read different-arch modules, being fatal *should* be safe - # and serve as a basic sanity check to ensure the module is valid - read -rd ' ' ver < <( - LC_ALL=C modinfo -F vermagic -- "${mod}" || - die "modinfo failed to read module '${mod}' (broken module?)" - ) - [[ -n ${ver} ]] || - die "modinfo found no kernel version in '${mod}' (broken module?)" - - if [[ ${ver} != "${KV_FULL}" ]]; then - eerror "A module seem to have been built for kernel version '${ver}'" - eerror "while it was meant for '${KV_FULL}'. This may indicate an" - eerror "ebuild issue (e.g. used runtime \`uname -r\` kernel rather than" - eerror "the chosen sources). Please report this to the ebuild's maintainer." - die "module and source version mismatch in '${mod}'" - fi - done -} - -# @FUNCTION: _modules_set_makeargs -# @INTERNAL -# @DESCRIPTION: -# Sets the MODULES_MAKEARGS global array. -_modules_set_makeargs() { - MODULES_MAKEARGS=( - ARCH="$(tc-arch-kernel)" - - V=1 - # normally redundant with V, but some custom Makefiles override it - KBUILD_VERBOSE=1 - - # unrealistic when building modules that often have slow releases, - # but note that the kernel will still pass some -Werror=bad-thing - CONFIG_WERROR= - - # these are only needed if using these arguments for installing, lets - # eclass handle strip, sign, compress, and depmod (CONFIG_ should - # have no impact on building, only used by Makefile.modinst) - CONFIG_MODULE_{SIG_ALL,COMPRESS_{GZIP,XZ,ZSTD}}= - DEPMOD=: - STRIP=: - ) - - if [[ ! ${MODULES_I_WANT_FULL_CONTROL} ]]; then - # many of these are unlikely to be useful here, but still trying to be - # complete given never know what out-of-tree modules may use - MODULES_MAKEARGS+=( - # wrt bug #550428, given most toolchain variables are being passed to - # make, setting CROSS in the environment would change very little - # (instead set KERNEL_CHOST which will affect other variables, - # or MODULES_I_WANT_FULL_CONTROL if do not want any of this) - CROSS_COMPILE="${KERNEL_CHOST}-" - - HOSTCC="$(tc-getBUILD_CC)" - HOSTCXX="$(tc-getBUILD_CXX)" - - # fwiw this function is not meant to pollute the environment - HOSTCFLAGS="$(tc-export_build_env; echo "${BUILD_CFLAGS}")" - HOSTCXXFLAGS="$(tc-export_build_env; echo "${BUILD_CXXFLAGS}")" - HOSTLDFLAGS="$(tc-export_build_env; echo "${BUILD_LDFLAGS}")" - - HOSTPKG_CONFIG="$(tc-getBUILD_PKG_CONFIG)" - - CC="${KERNEL_CC}" - CXX="${KERNEL_CXX}" - LD="${KERNEL_LD}" - AR="${KERNEL_AR}" - NM="${KERNEL_NM}" - OBJCOPY="${KERNEL_OBJCOPY}" - OBJDUMP="${KERNEL_OBJDUMP}" - READELF="${KERNEL_READELF}" - ) - fi - - # eval is to handle quoted spaces, die is for syntax errors - eval "MODULES_MAKEARGS+=( ${MODULES_EXTRA_EMAKE} )" || die -} - -# @FUNCTION: _modules_update_depmod -# @INTERNAL -# @DESCRIPTION: -# If possible, update module dependencies using depmod and System.map, -# otherwise prompt user to handle it. System.map may notably no longer -# be available on binary merges. -_modules_update_depmod() { - # prefer /lib/modules' path given it is what depmod operates on, - # and is mostly foolproof when it comes to ROOT (relative symlink) - local map=${EROOT}/lib/modules/${KV_FULL}/build/System.map - - if [[ ! -f ${map} ]]; then - # KV_OUT_DIR may still be right even on a different system, but state - # of (E)ROOT is unknown, e.g. could be from KERNEL_DIR=${OLDROOT}/... - map=${KV_OUT_DIR}/System.map - - # last resort, typical but may not be mounted/readable/installed - [[ ! -f ${map} ]] && - map=${EROOT}/boot/System.map-${KV_FULL} - fi - - einfo "Updating module dependencies for kernel ${KV_FULL} ..." - if [[ -f ${map} ]]; then - local depmodargs=( -ae -F "${map}" "${KV_FULL}" ) - - # for nicer postinst display, keep command shorter if EROOT is unset - [[ ${EROOT} ]] && - depmodargs+=( - -b "${EROOT}" - - # EROOT from -b is not used when looking for configuration - # directories, so pass the whole list from kmod's tools/depmod.c - --config="${EROOT}"/{etc,run,usr/local/lib,lib}/depmod.d - ) - - nonfatal edob depmod "${depmodargs[@]}" && return 0 - else - eerror - eerror "System.map for kernel ${KV_FULL} was not found, may be due to the" - eerror "built kernel sources no longer being available and lacking the fallback:" - eerror - eerror "${EROOT}/boot/System.map-${KV_FULL}" - fi - eerror - eerror "Some modules may not load without updating manually using depmod." -} - -fi - -EXPORT_FUNCTIONS pkg_setup src_compile src_install pkg_postinst diff --git a/files/zfs/3602.2.2/overlay/metadata/layout.conf b/files/zfs/3602.2.2/overlay/metadata/layout.conf deleted file mode 100644 index e85e826..0000000 --- a/files/zfs/3602.2.2/overlay/metadata/layout.conf +++ /dev/null @@ -1,4 +0,0 @@ -masters = portage-stable -thin-manifests = true -sign-commits = false -sign-manifests = false diff --git a/files/zfs/3602.2.2/overlay/profiles/repo_name b/files/zfs/3602.2.2/overlay/profiles/repo_name deleted file mode 100644 index e0f34db..0000000 --- a/files/zfs/3602.2.2/overlay/profiles/repo_name +++ /dev/null @@ -1 +0,0 @@ -zfs-overlay diff --git a/files/zfs/3602.2.2/overlay/sec-policy/selinux-base-policy/Manifest b/files/zfs/3602.2.2/overlay/sec-policy/selinux-base-policy/Manifest deleted file mode 100644 index 1029253..0000000 --- a/files/zfs/3602.2.2/overlay/sec-policy/selinux-base-policy/Manifest +++ /dev/null @@ -1,3 +0,0 @@ -DIST patchbundle-selinux-base-policy-2.20221101-r3.tar.bz2 444710 BLAKE2B e33cc01a8be5a354e022be1e8bf242883b09b15ead0673f859819f5e668f18773a16527f2e608878e6976695dcb2890c55658e77877e93c716ae0b2dd2ed5a9b SHA512 52e60b22346903a6fead95c9fb348fa1d4037b7dcd3e5781248a7dfc426c8c3fced258fd22762c779a5f436d8be21eaed5425ed36ff99c267daae5e1cb9c8e7f -DIST patchbundle-selinux-base-policy-2.20221101-r4.tar.bz2 457886 BLAKE2B 1e085f9f1739e0640c5eafa70db4c7ec19bca887c682ca2312a457fa57ee3eb176d0c8f16c2f84a1a026669b1240be3ff69066bd825c92fad75dcd2c13739f6c SHA512 da3ba1f076c04746719698aedb3aad48eb7c8a09df95c314b36f7a052538a07d893be413f35f4c34b01c1bf967ebe35ff32c2cea0722fe74a6e089a9d6aa47a6 -DIST refpolicy-2.20221101.tar.bz2 583183 BLAKE2B 783d8af40fd77d7ddb848dba32e91921dd7c1380c094c45b719ada7b15f91aacbb52b410ffa6341f2f705ecbc9674b8570bd4867ce998e944fa0054ffd8bdf74 SHA512 29e5a29d90f714018c88fead2d5006ea90338fb5b7a1e4e98cb2e588c96cd861871d32176f6cc6f7c4e864ce5acae1aeed85d4c706ce2da8168986535baaf3a6 diff --git a/files/zfs/3602.2.2/overlay/sec-policy/selinux-base-policy/metadata.xml b/files/zfs/3602.2.2/overlay/sec-policy/selinux-base-policy/metadata.xml deleted file mode 100644 index 5828cfe..0000000 --- a/files/zfs/3602.2.2/overlay/sec-policy/selinux-base-policy/metadata.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - selinux@gentoo.org - SELinux Team - - - Gentoo SELinux base policy. This contains policy for a system at the end of system installation. - There is no extra policy in this package. - - - Enable support for the unconfined SELinux policy module - - diff --git a/files/zfs/3602.2.2/overlay/sec-policy/selinux-base-policy/selinux-base-policy-2.20221101-r3.ebuild b/files/zfs/3602.2.2/overlay/sec-policy/selinux-base-policy/selinux-base-policy-2.20221101-r3.ebuild deleted file mode 100644 index 5327824..0000000 --- a/files/zfs/3602.2.2/overlay/sec-policy/selinux-base-policy/selinux-base-policy-2.20221101-r3.ebuild +++ /dev/null @@ -1,141 +0,0 @@ -# Copyright 1999-2022 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI="7" - -if [[ ${PV} == 9999* ]]; then - EGIT_REPO_URI="${SELINUX_GIT_REPO:-https://anongit.gentoo.org/git/proj/hardened-refpolicy.git}" - EGIT_BRANCH="${SELINUX_GIT_BRANCH:-master}" - EGIT_CHECKOUT_DIR="${WORKDIR}/refpolicy" - - inherit git-r3 -else - SRC_URI="https://github.com/SELinuxProject/refpolicy/releases/download/RELEASE_${PV/./_}/refpolicy-${PV}.tar.bz2 - https://dev.gentoo.org/~perfinion/patches/${PN}/patchbundle-${PN}-${PVR}.tar.bz2" - KEYWORDS="amd64 arm arm64 ~mips x86" -fi - -HOMEPAGE="https://wiki.gentoo.org/wiki/Project:SELinux" -DESCRIPTION="SELinux policy for core modules" - -IUSE="systemd +unconfined" - -PDEPEND="unconfined? ( sec-policy/selinux-unconfined )" -DEPEND="=sec-policy/selinux-base-${PVR}[systemd?]" -RDEPEND="${DEPEND}" -BDEPEND=" - sys-apps/checkpolicy - sys-devel/m4" - -MODS="application authlogin bootloader clock consoletype cron dmesg fstools getty hostname init iptables libraries locallogin logging lvm miscfiles modutils mount mta netutils nscd portage raid rsync selinuxutil setrans ssh staff storage su sysadm sysnetwork systemd tmpfiles udev userdomain usermanage unprivuser xdg" -DEL_MODS="hotplug" -LICENSE="GPL-2" -SLOT="0" -S="${WORKDIR}/" - -# Code entirely copied from selinux-eclass (cannot inherit due to dependency on -# itself), when reworked reinclude it. Only postinstall (where -b base.pp is -# added) needs to remain then. - -pkg_pretend() { - for i in ${POLICY_TYPES}; do - if [[ "${i}" == "targeted" ]] && ! use unconfined; then - die "If you use POLICY_TYPES=targeted, then USE=unconfined is mandatory." - fi - done -} - -src_prepare() { - local modfiles - - if [[ ${PV} != 9999* ]]; then - einfo "Applying SELinux policy updates ... " - eapply -p0 "${WORKDIR}/0001-full-patch-against-stable-release.patch" - fi - - eapply_user - - # Collect only those files needed for this particular module - for i in ${MODS}; do - modfiles="$(find "${S}"/refpolicy/policy/modules -iname $i.te) $modfiles" - modfiles="$(find "${S}"/refpolicy/policy/modules -iname $i.fc) $modfiles" - done - - for i in ${DEL_MODS}; do - [[ "${MODS}" != *${i}* ]] || die "Duplicate module in MODS and DEL_MODS: ${i}" - done - - for i in ${POLICY_TYPES}; do - mkdir "${S}"/${i} || die "Failed to create directory ${S}/${i}" - cp "${S}"/refpolicy/doc/Makefile.example "${S}"/${i}/Makefile \ - || die "Failed to copy Makefile.example to ${S}/${i}/Makefile" - - cp ${modfiles} "${S}"/${i} \ - || die "Failed to copy the module files to ${S}/${i}" - done -} - -src_compile() { - for i in ${POLICY_TYPES}; do - emake NAME=$i SHAREDIR="${SYSROOT%/}/usr/share/selinux" -C "${S}"/${i} - done -} - -src_install() { - local BASEDIR="/usr/share/selinux" - - for i in ${POLICY_TYPES}; do - for j in ${MODS}; do - einfo "Installing ${i} ${j} policy package" - insinto ${BASEDIR}/${i} - doins "${S}"/${i}/${j}.pp - done - done -} - -pkg_postinst() { - # Set root path and don't load policy into the kernel when cross compiling - local root_opts="" - if [[ "${ROOT}" != "" ]]; then - root_opts="-p ${ROOT} -n" - fi - - # Override the command from the eclass, we need to load in base as well here - local COMMAND="-i base.pp" - if has_version " - - - - selinux@gentoo.org - SELinux Team - - - Gentoo SELinux base policy. This contains policy for a system at the end of system installation. - There is no extra policy in this package. - - - Enable User Based Access Control (UBAC) in the SELinux policy - Enable support for the unconfined SELinux module - Default allow unknown classes in kernels newer than the policy (SELinux policy capability). - - diff --git a/files/zfs/3602.2.2/overlay/sec-policy/selinux-base/selinux-base-2.20221101-r3.ebuild b/files/zfs/3602.2.2/overlay/sec-policy/selinux-base/selinux-base-2.20221101-r3.ebuild deleted file mode 100644 index d38a576..0000000 --- a/files/zfs/3602.2.2/overlay/sec-policy/selinux-base/selinux-base-2.20221101-r3.ebuild +++ /dev/null @@ -1,158 +0,0 @@ -# Copyright 1999-2023 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI="7" - -PYTHON_COMPAT=( python3_{9..11} ) -PYTHON_REQ_USE="xml(+)" -inherit python-any-r1 - -if [[ ${PV} == 9999* ]]; then - EGIT_REPO_URI="${SELINUX_GIT_REPO:-https://anongit.gentoo.org/git/proj/hardened-refpolicy.git}" - EGIT_BRANCH="${SELINUX_GIT_BRANCH:-master}" - EGIT_CHECKOUT_DIR="${WORKDIR}/refpolicy" - - inherit git-r3 -else - SRC_URI="https://github.com/SELinuxProject/refpolicy/releases/download/RELEASE_${PV/./_}/refpolicy-${PV}.tar.bz2 - https://dev.gentoo.org/~perfinion/patches/selinux-base-policy/patchbundle-selinux-base-policy-${PVR}.tar.bz2" - - KEYWORDS="amd64 arm arm64 ~mips x86" -fi - -IUSE="doc +unknown-perms systemd +ubac +unconfined" - -DESCRIPTION="Gentoo base policy for SELinux" -HOMEPAGE="https://wiki.gentoo.org/wiki/Project:SELinux" -LICENSE="GPL-2" -SLOT="0" - -RDEPEND=">=sys-apps/policycoreutils-2.8" -DEPEND="${RDEPEND}" -BDEPEND=" - ${PYTHON_DEPS} - >=sys-apps/checkpolicy-2.8 - sys-devel/m4" - -S=${WORKDIR}/ - -src_prepare() { - if [[ ${PV} != 9999* ]]; then - einfo "Applying SELinux policy updates ... " - eapply -p0 "${WORKDIR}/0001-full-patch-against-stable-release.patch" - fi - - eapply_user - - cd "${S}/refpolicy" || die - emake bare -} - -src_configure() { - [ -z "${POLICY_TYPES}" ] && local POLICY_TYPES="targeted strict mls mcs" - - # Update the SELinux refpolicy capabilities based on the users' USE flags. - if use unknown-perms; then - sed -i -e '/^UNK_PERMS/s/deny/allow/' "${S}/refpolicy/build.conf" \ - || die "Failed to allow Unknown Permissions Handling" - sed -i -e '/^UNK_PERMS/s/deny/allow/' "${S}/refpolicy/Makefile" \ - || die "Failed to allow Unknown Permissions Handling" - fi - - if ! use ubac; then - sed -i -e '/^UBAC/s/y/n/' "${S}/refpolicy/build.conf" \ - || die "Failed to disable User Based Access Control" - fi - - if use systemd; then - sed -i -e '/^SYSTEMD/s/n/y/' "${S}/refpolicy/build.conf" \ - || die "Failed to enable SystemD" - fi - - echo "DISTRO = gentoo" >> "${S}/refpolicy/build.conf" || die - - # Prepare initial configuration - cd "${S}/refpolicy" || die - emake conf - - # Setup the policies based on the types delivered by the end user. - # These types can be "targeted", "strict", "mcs" and "mls". - for i in ${POLICY_TYPES}; do - cp -a "${S}/refpolicy" "${S}/${i}" || die - cd "${S}/${i}" || die - - sed -i -e "/= module/d" "${S}/${i}/policy/modules.conf" || die - - sed -i -e '/^QUIET/s/n/y/' -e "/^NAME/s/refpolicy/$i/" \ - "${S}/${i}/build.conf" || die "build.conf setup failed." - - if [[ "${i}" == "mls" ]] || [[ "${i}" == "mcs" ]]; - then - # MCS/MLS require additional settings - sed -i -e "/^TYPE/s/standard/${i}/" "${S}/${i}/build.conf" \ - || die "failed to set type to mls" - fi - - if [ "${i}" == "targeted" ]; then - sed -i -e '/root/d' -e 's/user_u/unconfined_u/' \ - "${S}/${i}/config/appconfig-standard/seusers" \ - || die "targeted seusers setup failed." - fi - - if [ "${i}" != "targeted" ] && [ "${i}" != "strict" ] && use unconfined; then - sed -i -e '/root/d' -e 's/user_u/unconfined_u/' \ - "${S}/${i}/config/appconfig-${i}/seusers" \ - || die "policy seusers setup failed." - fi - done -} - -src_compile() { - [ -z "${POLICY_TYPES}" ] && local POLICY_TYPES="targeted strict mls mcs" - - for i in ${POLICY_TYPES}; do - cd "${S}/${i}" || die - emake base - if use doc; then - emake html - fi - done -} - -src_install() { - [ -z "${POLICY_TYPES}" ] && local POLICY_TYPES="targeted strict mls mcs" - - for i in ${POLICY_TYPES}; do - cd "${S}/${i}" || die - - emake DESTDIR="${D}" install - emake DESTDIR="${D}" install-headers - - echo "run_init_t" > "${D}/etc/selinux/${i}/contexts/run_init_type" || die - - echo "textrel_shlib_t" >> "${D}/etc/selinux/${i}/contexts/customizable_types" || die - - # libsemanage won't make this on its own - keepdir "/etc/selinux/${i}/policy" - - if use doc; then - docinto ${i}/html - dodoc -r doc/html/*; - fi - - insinto /usr/share/selinux/devel; - doins doc/policy.xml; - - done - - docinto / - dodoc doc/Makefile.example doc/example.{te,fc,if} - - doman man/man8/*.8; - - insinto /etc/selinux - doins "${FILESDIR}/config" - - insinto /usr/share/portage/config/sets - doins "${FILESDIR}/selinux.conf" -} diff --git a/files/zfs/3602.2.2/overlay/sec-policy/selinux-base/selinux-base-2.20221101-r4.ebuild b/files/zfs/3602.2.2/overlay/sec-policy/selinux-base/selinux-base-2.20221101-r4.ebuild deleted file mode 100644 index d38a576..0000000 --- a/files/zfs/3602.2.2/overlay/sec-policy/selinux-base/selinux-base-2.20221101-r4.ebuild +++ /dev/null @@ -1,158 +0,0 @@ -# Copyright 1999-2023 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI="7" - -PYTHON_COMPAT=( python3_{9..11} ) -PYTHON_REQ_USE="xml(+)" -inherit python-any-r1 - -if [[ ${PV} == 9999* ]]; then - EGIT_REPO_URI="${SELINUX_GIT_REPO:-https://anongit.gentoo.org/git/proj/hardened-refpolicy.git}" - EGIT_BRANCH="${SELINUX_GIT_BRANCH:-master}" - EGIT_CHECKOUT_DIR="${WORKDIR}/refpolicy" - - inherit git-r3 -else - SRC_URI="https://github.com/SELinuxProject/refpolicy/releases/download/RELEASE_${PV/./_}/refpolicy-${PV}.tar.bz2 - https://dev.gentoo.org/~perfinion/patches/selinux-base-policy/patchbundle-selinux-base-policy-${PVR}.tar.bz2" - - KEYWORDS="amd64 arm arm64 ~mips x86" -fi - -IUSE="doc +unknown-perms systemd +ubac +unconfined" - -DESCRIPTION="Gentoo base policy for SELinux" -HOMEPAGE="https://wiki.gentoo.org/wiki/Project:SELinux" -LICENSE="GPL-2" -SLOT="0" - -RDEPEND=">=sys-apps/policycoreutils-2.8" -DEPEND="${RDEPEND}" -BDEPEND=" - ${PYTHON_DEPS} - >=sys-apps/checkpolicy-2.8 - sys-devel/m4" - -S=${WORKDIR}/ - -src_prepare() { - if [[ ${PV} != 9999* ]]; then - einfo "Applying SELinux policy updates ... " - eapply -p0 "${WORKDIR}/0001-full-patch-against-stable-release.patch" - fi - - eapply_user - - cd "${S}/refpolicy" || die - emake bare -} - -src_configure() { - [ -z "${POLICY_TYPES}" ] && local POLICY_TYPES="targeted strict mls mcs" - - # Update the SELinux refpolicy capabilities based on the users' USE flags. - if use unknown-perms; then - sed -i -e '/^UNK_PERMS/s/deny/allow/' "${S}/refpolicy/build.conf" \ - || die "Failed to allow Unknown Permissions Handling" - sed -i -e '/^UNK_PERMS/s/deny/allow/' "${S}/refpolicy/Makefile" \ - || die "Failed to allow Unknown Permissions Handling" - fi - - if ! use ubac; then - sed -i -e '/^UBAC/s/y/n/' "${S}/refpolicy/build.conf" \ - || die "Failed to disable User Based Access Control" - fi - - if use systemd; then - sed -i -e '/^SYSTEMD/s/n/y/' "${S}/refpolicy/build.conf" \ - || die "Failed to enable SystemD" - fi - - echo "DISTRO = gentoo" >> "${S}/refpolicy/build.conf" || die - - # Prepare initial configuration - cd "${S}/refpolicy" || die - emake conf - - # Setup the policies based on the types delivered by the end user. - # These types can be "targeted", "strict", "mcs" and "mls". - for i in ${POLICY_TYPES}; do - cp -a "${S}/refpolicy" "${S}/${i}" || die - cd "${S}/${i}" || die - - sed -i -e "/= module/d" "${S}/${i}/policy/modules.conf" || die - - sed -i -e '/^QUIET/s/n/y/' -e "/^NAME/s/refpolicy/$i/" \ - "${S}/${i}/build.conf" || die "build.conf setup failed." - - if [[ "${i}" == "mls" ]] || [[ "${i}" == "mcs" ]]; - then - # MCS/MLS require additional settings - sed -i -e "/^TYPE/s/standard/${i}/" "${S}/${i}/build.conf" \ - || die "failed to set type to mls" - fi - - if [ "${i}" == "targeted" ]; then - sed -i -e '/root/d' -e 's/user_u/unconfined_u/' \ - "${S}/${i}/config/appconfig-standard/seusers" \ - || die "targeted seusers setup failed." - fi - - if [ "${i}" != "targeted" ] && [ "${i}" != "strict" ] && use unconfined; then - sed -i -e '/root/d' -e 's/user_u/unconfined_u/' \ - "${S}/${i}/config/appconfig-${i}/seusers" \ - || die "policy seusers setup failed." - fi - done -} - -src_compile() { - [ -z "${POLICY_TYPES}" ] && local POLICY_TYPES="targeted strict mls mcs" - - for i in ${POLICY_TYPES}; do - cd "${S}/${i}" || die - emake base - if use doc; then - emake html - fi - done -} - -src_install() { - [ -z "${POLICY_TYPES}" ] && local POLICY_TYPES="targeted strict mls mcs" - - for i in ${POLICY_TYPES}; do - cd "${S}/${i}" || die - - emake DESTDIR="${D}" install - emake DESTDIR="${D}" install-headers - - echo "run_init_t" > "${D}/etc/selinux/${i}/contexts/run_init_type" || die - - echo "textrel_shlib_t" >> "${D}/etc/selinux/${i}/contexts/customizable_types" || die - - # libsemanage won't make this on its own - keepdir "/etc/selinux/${i}/policy" - - if use doc; then - docinto ${i}/html - dodoc -r doc/html/*; - fi - - insinto /usr/share/selinux/devel; - doins doc/policy.xml; - - done - - docinto / - dodoc doc/Makefile.example doc/example.{te,fc,if} - - doman man/man8/*.8; - - insinto /etc/selinux - doins "${FILESDIR}/config" - - insinto /usr/share/portage/config/sets - doins "${FILESDIR}/selinux.conf" -} diff --git a/files/zfs/3602.2.2/overlay/sec-policy/selinux-base/selinux-base-9999.ebuild b/files/zfs/3602.2.2/overlay/sec-policy/selinux-base/selinux-base-9999.ebuild deleted file mode 100644 index 1185969..0000000 --- a/files/zfs/3602.2.2/overlay/sec-policy/selinux-base/selinux-base-9999.ebuild +++ /dev/null @@ -1,158 +0,0 @@ -# Copyright 1999-2023 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI="7" - -PYTHON_COMPAT=( python3_{9..11} ) -PYTHON_REQ_USE="xml(+)" -inherit python-any-r1 - -if [[ ${PV} == 9999* ]]; then - EGIT_REPO_URI="${SELINUX_GIT_REPO:-https://anongit.gentoo.org/git/proj/hardened-refpolicy.git}" - EGIT_BRANCH="${SELINUX_GIT_BRANCH:-master}" - EGIT_CHECKOUT_DIR="${WORKDIR}/refpolicy" - - inherit git-r3 -else - SRC_URI="https://github.com/SELinuxProject/refpolicy/releases/download/RELEASE_${PV/./_}/refpolicy-${PV}.tar.bz2 - https://dev.gentoo.org/~perfinion/patches/selinux-base-policy/patchbundle-selinux-base-policy-${PVR}.tar.bz2" - - KEYWORDS="~amd64 ~arm ~arm64 ~mips ~x86" -fi - -IUSE="doc +unknown-perms systemd +ubac +unconfined" - -DESCRIPTION="Gentoo base policy for SELinux" -HOMEPAGE="https://wiki.gentoo.org/wiki/Project:SELinux" -LICENSE="GPL-2" -SLOT="0" - -RDEPEND=">=sys-apps/policycoreutils-2.8" -DEPEND="${RDEPEND}" -BDEPEND=" - ${PYTHON_DEPS} - >=sys-apps/checkpolicy-2.8 - sys-devel/m4" - -S=${WORKDIR}/ - -src_prepare() { - if [[ ${PV} != 9999* ]]; then - einfo "Applying SELinux policy updates ... " - eapply -p0 "${WORKDIR}/0001-full-patch-against-stable-release.patch" - fi - - eapply_user - - cd "${S}/refpolicy" || die - emake bare -} - -src_configure() { - [ -z "${POLICY_TYPES}" ] && local POLICY_TYPES="targeted strict mls mcs" - - # Update the SELinux refpolicy capabilities based on the users' USE flags. - if use unknown-perms; then - sed -i -e '/^UNK_PERMS/s/deny/allow/' "${S}/refpolicy/build.conf" \ - || die "Failed to allow Unknown Permissions Handling" - sed -i -e '/^UNK_PERMS/s/deny/allow/' "${S}/refpolicy/Makefile" \ - || die "Failed to allow Unknown Permissions Handling" - fi - - if ! use ubac; then - sed -i -e '/^UBAC/s/y/n/' "${S}/refpolicy/build.conf" \ - || die "Failed to disable User Based Access Control" - fi - - if use systemd; then - sed -i -e '/^SYSTEMD/s/n/y/' "${S}/refpolicy/build.conf" \ - || die "Failed to enable SystemD" - fi - - echo "DISTRO = gentoo" >> "${S}/refpolicy/build.conf" || die - - # Prepare initial configuration - cd "${S}/refpolicy" || die - emake conf - - # Setup the policies based on the types delivered by the end user. - # These types can be "targeted", "strict", "mcs" and "mls". - for i in ${POLICY_TYPES}; do - cp -a "${S}/refpolicy" "${S}/${i}" || die - cd "${S}/${i}" || die - - sed -i -e "/= module/d" "${S}/${i}/policy/modules.conf" || die - - sed -i -e '/^QUIET/s/n/y/' -e "/^NAME/s/refpolicy/$i/" \ - "${S}/${i}/build.conf" || die "build.conf setup failed." - - if [[ "${i}" == "mls" ]] || [[ "${i}" == "mcs" ]]; - then - # MCS/MLS require additional settings - sed -i -e "/^TYPE/s/standard/${i}/" "${S}/${i}/build.conf" \ - || die "failed to set type to mls" - fi - - if [ "${i}" == "targeted" ]; then - sed -i -e '/root/d' -e 's/user_u/unconfined_u/' \ - "${S}/${i}/config/appconfig-standard/seusers" \ - || die "targeted seusers setup failed." - fi - - if [ "${i}" != "targeted" ] && [ "${i}" != "strict" ] && use unconfined; then - sed -i -e '/root/d' -e 's/user_u/unconfined_u/' \ - "${S}/${i}/config/appconfig-${i}/seusers" \ - || die "policy seusers setup failed." - fi - done -} - -src_compile() { - [ -z "${POLICY_TYPES}" ] && local POLICY_TYPES="targeted strict mls mcs" - - for i in ${POLICY_TYPES}; do - cd "${S}/${i}" || die - emake base - if use doc; then - emake html - fi - done -} - -src_install() { - [ -z "${POLICY_TYPES}" ] && local POLICY_TYPES="targeted strict mls mcs" - - for i in ${POLICY_TYPES}; do - cd "${S}/${i}" || die - - emake DESTDIR="${D}" install - emake DESTDIR="${D}" install-headers - - echo "run_init_t" > "${D}/etc/selinux/${i}/contexts/run_init_type" || die - - echo "textrel_shlib_t" >> "${D}/etc/selinux/${i}/contexts/customizable_types" || die - - # libsemanage won't make this on its own - keepdir "/etc/selinux/${i}/policy" - - if use doc; then - docinto ${i}/html - dodoc -r doc/html/*; - fi - - insinto /usr/share/selinux/devel; - doins doc/policy.xml; - - done - - docinto / - dodoc doc/Makefile.example doc/example.{te,fc,if} - - doman man/man8/*.8; - - insinto /etc/selinux - doins "${FILESDIR}/config" - - insinto /usr/share/portage/config/sets - doins "${FILESDIR}/selinux.conf" -} diff --git a/files/zfs/3602.2.2/overlay/sec-policy/selinux-zfs/Manifest b/files/zfs/3602.2.2/overlay/sec-policy/selinux-zfs/Manifest deleted file mode 100644 index 1029253..0000000 --- a/files/zfs/3602.2.2/overlay/sec-policy/selinux-zfs/Manifest +++ /dev/null @@ -1,3 +0,0 @@ -DIST patchbundle-selinux-base-policy-2.20221101-r3.tar.bz2 444710 BLAKE2B e33cc01a8be5a354e022be1e8bf242883b09b15ead0673f859819f5e668f18773a16527f2e608878e6976695dcb2890c55658e77877e93c716ae0b2dd2ed5a9b SHA512 52e60b22346903a6fead95c9fb348fa1d4037b7dcd3e5781248a7dfc426c8c3fced258fd22762c779a5f436d8be21eaed5425ed36ff99c267daae5e1cb9c8e7f -DIST patchbundle-selinux-base-policy-2.20221101-r4.tar.bz2 457886 BLAKE2B 1e085f9f1739e0640c5eafa70db4c7ec19bca887c682ca2312a457fa57ee3eb176d0c8f16c2f84a1a026669b1240be3ff69066bd825c92fad75dcd2c13739f6c SHA512 da3ba1f076c04746719698aedb3aad48eb7c8a09df95c314b36f7a052538a07d893be413f35f4c34b01c1bf967ebe35ff32c2cea0722fe74a6e089a9d6aa47a6 -DIST refpolicy-2.20221101.tar.bz2 583183 BLAKE2B 783d8af40fd77d7ddb848dba32e91921dd7c1380c094c45b719ada7b15f91aacbb52b410ffa6341f2f705ecbc9674b8570bd4867ce998e944fa0054ffd8bdf74 SHA512 29e5a29d90f714018c88fead2d5006ea90338fb5b7a1e4e98cb2e588c96cd861871d32176f6cc6f7c4e864ce5acae1aeed85d4c706ce2da8168986535baaf3a6 diff --git a/files/zfs/3602.2.2/overlay/sec-policy/selinux-zfs/metadata.xml b/files/zfs/3602.2.2/overlay/sec-policy/selinux-zfs/metadata.xml deleted file mode 100644 index 781bc07..0000000 --- a/files/zfs/3602.2.2/overlay/sec-policy/selinux-zfs/metadata.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - selinux@gentoo.org - SELinux Team - - diff --git a/files/zfs/3602.2.2/overlay/sec-policy/selinux-zfs/selinux-zfs-2.20221101-r3.ebuild b/files/zfs/3602.2.2/overlay/sec-policy/selinux-zfs/selinux-zfs-2.20221101-r3.ebuild deleted file mode 100644 index b782d3a..0000000 --- a/files/zfs/3602.2.2/overlay/sec-policy/selinux-zfs/selinux-zfs-2.20221101-r3.ebuild +++ /dev/null @@ -1,15 +0,0 @@ -# Copyright 1999-2022 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI="7" - -IUSE="" -MODS="zfs" - -inherit selinux-policy-2 - -DESCRIPTION="SELinux policy for zfs" - -if [[ ${PV} != 9999* ]] ; then - KEYWORDS="amd64 arm arm64 ~mips x86" -fi diff --git a/files/zfs/3602.2.2/overlay/sec-policy/selinux-zfs/selinux-zfs-2.20221101-r4.ebuild b/files/zfs/3602.2.2/overlay/sec-policy/selinux-zfs/selinux-zfs-2.20221101-r4.ebuild deleted file mode 100644 index 2eabf7c..0000000 --- a/files/zfs/3602.2.2/overlay/sec-policy/selinux-zfs/selinux-zfs-2.20221101-r4.ebuild +++ /dev/null @@ -1,15 +0,0 @@ -# Copyright 1999-2023 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI="7" - -IUSE="" -MODS="zfs" - -inherit selinux-policy-2 - -DESCRIPTION="SELinux policy for zfs" - -if [[ ${PV} != 9999* ]] ; then - KEYWORDS="amd64 arm arm64 ~mips x86" -fi diff --git a/files/zfs/3602.2.2/overlay/sec-policy/selinux-zfs/selinux-zfs-9999.ebuild b/files/zfs/3602.2.2/overlay/sec-policy/selinux-zfs/selinux-zfs-9999.ebuild deleted file mode 100644 index 7f6f6f3..0000000 --- a/files/zfs/3602.2.2/overlay/sec-policy/selinux-zfs/selinux-zfs-9999.ebuild +++ /dev/null @@ -1,15 +0,0 @@ -# Copyright 1999-2022 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI="7" - -IUSE="" -MODS="zfs" - -inherit selinux-policy-2 - -DESCRIPTION="SELinux policy for zfs" - -if [[ ${PV} != 9999* ]] ; then - KEYWORDS="~amd64 ~arm ~arm64 ~mips ~x86" -fi diff --git a/files/zfs/3602.2.2/overlay/sys-fs/udev-init-scripts/Manifest b/files/zfs/3602.2.2/overlay/sys-fs/udev-init-scripts/Manifest deleted file mode 100644 index 838b43a..0000000 --- a/files/zfs/3602.2.2/overlay/sys-fs/udev-init-scripts/Manifest +++ /dev/null @@ -1,2 +0,0 @@ -DIST udev-init-scripts-34.tar.gz 3660 BLAKE2B 954b003c78b31649fef69213a5424098f40e17e7ed11f4ec1443247950ea60db8536f37ca603caa06e5c9f8bab07b5ac3cb8c9435144532a97ff04836c24da49 SHA512 ed48bcd0815e235b2b3fa38f857cd97f164aac7c6ea805be87890eb06a0d52064bd733da240c6e2a34c8c73e10fd047b5e53096de06f17bc81d8266d70c0cc9d -DIST udev-init-scripts-35.tar.gz 3666 BLAKE2B fddae466428605ea930519e8a47e0ea91f89f9eacc1fd97c137d175142125b12c3d045aec68db35a463de444ac6d8c037cca55f9628f10576c968259d566a9e4 SHA512 da9d2093149967e2e1b9bc7190ddfd55a87c9ae2177e3216f7cb2694fc9b64037eb6f2599ad8a4b7594ef32ced88fbb319c92904bc72a81ea5404945f8a8378a diff --git a/files/zfs/3602.2.2/overlay/sys-fs/udev-init-scripts/metadata.xml b/files/zfs/3602.2.2/overlay/sys-fs/udev-init-scripts/metadata.xml deleted file mode 100644 index 31123d0..0000000 --- a/files/zfs/3602.2.2/overlay/sys-fs/udev-init-scripts/metadata.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - systemd@gentoo.org - - diff --git a/files/zfs/3602.2.2/overlay/sys-fs/udev-init-scripts/udev-init-scripts-34.ebuild b/files/zfs/3602.2.2/overlay/sys-fs/udev-init-scripts/udev-init-scripts-34.ebuild deleted file mode 100644 index 26fa347..0000000 --- a/files/zfs/3602.2.2/overlay/sys-fs/udev-init-scripts/udev-init-scripts-34.ebuild +++ /dev/null @@ -1,50 +0,0 @@ -# Copyright 1999-2021 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 -OLD_PN=udev-gentoo-scripts -OLD_P=${OLD_PN}-${PV} - -if [ "${PV}" = "9999" ]; then - EGIT_REPO_URI="git://anongit.gentoo.org/proj/${OLD_PN}.git" - inherit git-r3 -else - SRC_URI="https://gitweb.gentoo.org/proj/${OLD_PN}.git/snapshot/${OLD_P}.tar.gz -> ${P}.tar.gz" - S="${WORKDIR}/${OLD_P}" - KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86" -fi - -DESCRIPTION="udev startup scripts for openrc" -HOMEPAGE="https://wiki.gentoo.org/wiki/No_homepage" - -LICENSE="GPL-2" -SLOT="0" - -RESTRICT="test" - -RDEPEND=">=virtual/udev-217 - !$1/build.log 2>&1]) diff --git a/files/zfs/3602.2.2/overlay/sys-fs/zfs-kmod/metadata.xml b/files/zfs/3602.2.2/overlay/sys-fs/zfs-kmod/metadata.xml deleted file mode 100644 index 7e27782..0000000 --- a/files/zfs/3602.2.2/overlay/sys-fs/zfs-kmod/metadata.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - gyakovlev@gentoo.org - Georgy Yakovlev - - - sam@gentoo.org - Sam James - - - Prevents upgrading to an unsupported kernel version when combined with USE=dist-kernel - Pull dependencies and check kernel options required for root-on-zfs - - - https://github.com/openzfs/zfs/issues - https://openzfs.github.io/openzfs-docs - openzfs/zfs - - diff --git a/files/zfs/3602.2.2/overlay/sys-fs/zfs-kmod/zfs-kmod-2.1.11-r1.ebuild b/files/zfs/3602.2.2/overlay/sys-fs/zfs-kmod/zfs-kmod-2.1.11-r1.ebuild deleted file mode 100644 index 7bf3eba..0000000 --- a/files/zfs/3602.2.2/overlay/sys-fs/zfs-kmod/zfs-kmod-2.1.11-r1.ebuild +++ /dev/null @@ -1,177 +0,0 @@ -# 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-r1 multiprocessing - -DESCRIPTION="Linux ZFS kernel module for sys-fs/zfs" -HOMEPAGE="https://github.com/openzfs/zfs" - -MODULES_KERNEL_MAX=6.2 -MODULES_KERNEL_MIN=3.10 - -if [[ ${PV} == 9999 ]] ; then - EGIT_REPO_URI="https://github.com/openzfs/zfs.git" - inherit git-r3 - unset MODULES_KERNEL_MAX -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="${MODULES_KERNEL_MAX}" - # 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" -RESTRICT="test" - -BDEPEND=" - dev-lang/perl - app-alternatives/awk -" - -if [[ ${PV} != 9999 ]] ; then - BDEPEND+=" verify-sig? ( sec-keys/openpgp-keys-openzfs )" - - IUSE+=" +dist-kernel-cap" - RDEPEND=" - dist-kernel-cap? ( dist-kernel? ( - 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? ( 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" -RESTRICT="test" - -BDEPEND=" - dev-lang/perl - app-alternatives/awk -" - -if [[ ${PV} != 9999 ]] ; then - BDEPEND+=" verify-sig? ( sec-keys/openpgp-keys-openzfs )" - - IUSE+=" +dist-kernel-cap" - RDEPEND=" - dist-kernel-cap? ( dist-kernel? ( - 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? ( 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" -RESTRICT="test" - -BDEPEND=" - app-alternatives/awk - dev-lang/perl -" - -if [[ ${PV} != 9999 ]] ; then - BDEPEND+=" verify-sig? ( sec-keys/openpgp-keys-openzfs )" - - IUSE+=" +dist-kernel-cap" - RDEPEND=" - dist-kernel-cap? ( dist-kernel? ( - 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" -RESTRICT="test" - -BDEPEND=" - app-alternatives/awk - dev-lang/perl -" - -if [[ ${PV} != 9999 ]] ; then - BDEPEND+=" verify-sig? ( sec-keys/openpgp-keys-openzfs )" - - IUSE+=" +dist-kernel-cap" - RDEPEND=" - dist-kernel-cap? ( dist-kernel? ( - -Date: Thu, 30 Jun 2022 13:47:58 -0400 -Subject: [PATCH] dracut: fix boot on non-zfs-root systems - -Simply prevent overwriting root until it needs to be overwritten. - -Dracut could change this value before this module is called, but won't -change the kernel command line. - -Reviewed-by: Andrew J. Hesford -Signed-off-by: Toyam Cox -Closes #13592 ---- - contrib/dracut/90zfs/zfs-lib.sh.in | 10 +++++----- - 1 file changed, 5 insertions(+), 5 deletions(-) - -diff --git a/contrib/dracut/90zfs/zfs-lib.sh.in b/contrib/dracut/90zfs/zfs-lib.sh.in -index e44673c2d75..3a43e514d6f 100755 ---- a/contrib/dracut/90zfs/zfs-lib.sh.in -+++ b/contrib/dracut/90zfs/zfs-lib.sh.in -@@ -88,11 +88,11 @@ decode_root_args() { - return - fi - -- root=$(getarg root=) -+ xroot=$(getarg root=) - rootfstype=$(getarg rootfstype=) - - # shellcheck disable=SC2249 -- case "$root" in -+ case "$xroot" in - ""|zfs|zfs:|zfs:AUTO) - root=zfs:AUTO - rootfstype=zfs -@@ -100,7 +100,7 @@ decode_root_args() { - ;; - - ZFS=*|zfs:*) -- root="${root#zfs:}" -+ root="${xroot#zfs:}" - root="${root#ZFS=}" - root=$(echo "$root" | tr '+' ' ') - rootfstype=zfs -@@ -109,9 +109,9 @@ decode_root_args() { - esac - - if [ "$rootfstype" = "zfs" ]; then -- case "$root" in -+ case "$xroot" in - "") root=zfs:AUTO ;; -- *) root=$(echo "$root" | tr '+' ' ') ;; -+ *) root=$(echo "$xroot" | tr '+' ' ') ;; - esac - return 0 - fi - diff --git a/files/zfs/3602.2.2/overlay/sys-fs/zfs/metadata.xml b/files/zfs/3602.2.2/overlay/sys-fs/zfs/metadata.xml deleted file mode 100644 index 8518b15..0000000 --- a/files/zfs/3602.2.2/overlay/sys-fs/zfs/metadata.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - - - gyakovlev@gentoo.org - Georgy Yakovlev - - - sam@gentoo.org - Sam James - - - Disable dependency on sys-fs/zfs-kmod under the assumption that ZFS is part of the kernel source tree - Don't install python scripts (arcstat, dbufstat etc) and avoid dependency on dev-lang/python - Install zfs_key pam module, for automatically loading zfs encryption keys for home datasets - Enable dependencies required for booting off a pool containing a rootfs - Install regression test suite - - - https://github.com/openzfs/zfs/issues - https://openzfs.github.io/openzfs-docs - openzfs/zfs - - - OpenZFS is an advanced file system and volume manager which was originally developed - for Solaris and is now maintained by the OpenZFS community - - It includes the functionality of both traditional file systems and volume manager. - It has many advanced features including: - * Protection against data corruption. Integrity checking for both data and metadata. - * Continuous integrity verification and automatic “self-healing” repair - * Data redundancy with mirroring, RAID-Z1/2/3 [and DRAID] - * Support for high storage capacities — up to 256 trillion yobibytes (2^128 bytes) - * Space-saving with transparent compression using LZ4, GZIP or ZSTD - * Hardware-accelerated native encryption - * Efficient storage with snapshots and copy-on-write clones - * Efficient local or remote replication — send only changed blocks with ZFS send and receive - - The OpenZFS project brings together developers from the Linux, FreeBSD, illumos, MacOS, and Windows platforms. - OpenZFS is supported by a wide range of companies. - - diff --git a/files/zfs/3602.2.2/overlay/sys-fs/zfs/zfs-2.1.11.ebuild b/files/zfs/3602.2.2/overlay/sys-fs/zfs/zfs-2.1.11.ebuild deleted file mode 100644 index c67dc48..0000000 --- a/files/zfs/3602.2.2/overlay/sys-fs/zfs/zfs-2.1.11.ebuild +++ /dev/null @@ -1,320 +0,0 @@ -# Copyright 1999-2023 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -DISTUTILS_OPTIONAL=1 -PYTHON_COMPAT=( python3_{9..11} ) - -inherit autotools bash-completion-r1 dist-kernel-utils distutils-r1 flag-o-matic linux-info pam systemd udev usr-ldscript - -DESCRIPTION="Userland utilities for ZFS Linux kernel module" -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_P="${P/_rc/-rc}" - SRC_URI="https://github.com/openzfs/${PN}/releases/download/${MY_P}/${MY_P}.tar.gz" - SRC_URI+=" verify-sig? ( https://github.com/openzfs/${PN}/releases/download/${MY_P}/${MY_P}.tar.gz.asc )" - S="${WORKDIR}/${P%_rc?}" - - if [[ ${PV} != *_rc* ]]; then - KEYWORDS="amd64 arm64 ppc64 ~riscv ~sparc" - fi -fi - -LICENSE="BSD-2 CDDL MIT" -# just libzfs soname major for now. -# possible candidates: libuutil, libzpool, libnvpair. Those do not provide stable abi, but are considered. -# see libsoversion_check() below as well -SLOT="0/5" -IUSE="custom-cflags debug dist-kernel kernel-builtin minimal nls pam python +rootfs selinux test-suite" - -DEPEND=" - net-libs/libtirpc:= - sys-apps/util-linux - sys-libs/zlib - virtual/libudev:= - dev-libs/openssl:0= - !minimal? ( ${PYTHON_DEPS} ) - pam? ( sys-libs/pam ) - python? ( - virtual/python-cffi[${PYTHON_USEDEP}] - ) -" - -BDEPEND="app-alternatives/awk - virtual/pkgconfig - nls? ( sys-devel/gettext ) - python? ( - dev-python/setuptools[${PYTHON_USEDEP}] - || ( - dev-python/packaging[${PYTHON_USEDEP}] - dev-python/distlib[${PYTHON_USEDEP}] - ) - ) -" - -if [[ ${PV} != "9999" ]] ; then - BDEPEND+=" verify-sig? ( sec-keys/openpgp-keys-openzfs )" -fi - -# awk is used for some scripts, completions, and the Dracut module -RDEPEND="${DEPEND} - !kernel-builtin? ( ~sys-fs/zfs-kmod-${PV}:= ) - !prefix? ( virtual/udev ) - sys-fs/udev-init-scripts - app-alternatives/awk - dist-kernel? ( virtual/dist-kernel:= ) - rootfs? ( - app-arch/cpio - app-misc/pax-utils - ) - selinux? ( sec-policy/selinux-zfs ) - test-suite? ( - app-shells/ksh - sys-apps/kmod[tools] - sys-apps/util-linux - sys-devel/bc - sys-block/parted - sys-fs/lsscsi - sys-fs/mdadm - sys-process/procps - ) -" - -# PDEPEND in this form is needed to trick portage suggest -# enabling dist-kernel if only 1 package have it set, without suggesting to disable -PDEPEND="dist-kernel? ( ~sys-fs/zfs-kmod-${PV}[dist-kernel] )" - -REQUIRED_USE=" - !minimal? ( ${PYTHON_REQUIRED_USE} ) - python? ( !minimal ) - test-suite? ( !minimal ) -" - -RESTRICT="test" - -PATCHES=( - # bug #854333 - "${FILESDIR}"/2.1.5-r2-dracut-non-root.patch - - "${FILESDIR}"/2.1.5-dracut-zfs-missing.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() { - if use kernel_linux; then - linux-info_pkg_setup - - if ! linux_config_exists; then - ewarn "Cannot check the linux kernel configuration." - else - if use test-suite; then - if linux_chkconfig_present BLK_DEV_LOOP; then - eerror "The ZFS test suite requires loop device support enabled." - eerror "Please enable it:" - eerror " CONFIG_BLK_DEV_LOOP=y" - eerror "in /usr/src/linux/.config or" - eerror " Device Drivers --->" - eerror " Block devices --->" - eerror " [X] Loopback device support" - fi - fi - fi - fi -} - -libsoversion_check() { - local bugurl libzfs_sover - bugurl="https://bugs.gentoo.org/enter_bug.cgi?form_name=enter_bug&product=Gentoo+Linux&component=Current+packages" - - libzfs_sover="$(grep 'libzfs_la_LDFLAGS += -version-info' lib/libzfs/Makefile.am \ - | grep -Eo '[0-9]+:[0-9]+:[0-9]+')" - libzfs_sover="${libzfs_sover%%:*}" - - if [[ ${libzfs_sover} -ne $(ver_cut 2 ${SLOT}) ]]; then - echo - eerror "BUG BUG BUG BUG BUG BUG BUG BUG" - eerror "ebuild subslot does not match libzfs soversion!" - eerror "libzfs soversion: ${libzfs_sover}" - eerror "ebuild value: $(ver_cut 2 ${SLOT})" - eerror "This is a bug in the ebuild, please use the following URL to report it" - eerror "${bugurl}&short_desc=${CATEGORY}%2F${P}+update+subslot" - echo - # we want to abort for releases, but just print a warning for live ebuild - # to keep package installable - [[ ${PV} == "9999" ]] || die - fi -} - -src_unpack() { - if use verify-sig ; then - # Needed for downloaded patch (which is unsigned, which is fine) - verify-sig_verify_detached "${DISTDIR}"/${MY_P}.tar.gz{,.asc} - fi - - default -} - -src_prepare() { - default - libsoversion_check - - # Run unconditionally (bug #792627) - eautoreconf - - if [[ ${PV} != "9999" ]]; then - # Set revision number - sed -i "s/\(Release:\)\(.*\)1/\1\2${PR}-gentoo/" META || die "Could not set Gentoo release" - fi - - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_prepare - popd >/dev/null || die - fi - - # prevent errors showing up on zfs-mount stop, #647688 - # openrc will unmount all filesystems anyway. - sed -i "/^ZFS_UNMOUNT=/ s/yes/no/" "etc/default/zfs.in" || die -} - -src_configure() { - use custom-cflags || strip-flags - use minimal || python_setup - - # All the same issue: - # Segfaults w/ GCC 12 and 'zfs send' - # bug #856373 - # https://github.com/openzfs/zfs/issues/13620 - # https://github.com/openzfs/zfs/issues/13605 - append-flags -fno-tree-vectorize - - local myconf=( - --bindir="${EPREFIX}/bin" - --enable-shared - --enable-sysvinit - --localstatedir="${EPREFIX}/var" - --sbindir="${EPREFIX}/sbin" - --with-config=user - --with-dracutdir="${EPREFIX}/usr/lib/dracut" - --with-linux="${KV_DIR}" - --with-linux-obj="${KV_OUT_DIR}" - --with-udevdir="$(get_udevdir)" - --with-pamconfigsdir="${EPREFIX}/unwanted_files" - --with-pammoduledir="$(getpam_mod_dir)" - --with-systemdunitdir="$(systemd_get_systemunitdir)" - --with-systemdpresetdir="$(systemd_get_systempresetdir)" - --with-vendor=gentoo - # Building zfs-mount-generator.c on musl breaks as strndupa - # isn't available. But systemd doesn't support musl anyway, so - # just disable building it. - $(use_enable !elibc_musl systemd) - $(use_enable debug) - $(use_enable nls) - $(use_enable pam) - $(use_enable python pyzfs) - --disable-static - $(usex minimal --without-python --with-python="${EPYTHON}") - ) - - econf "${myconf[@]}" -} - -src_compile() { - default - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_compile - popd >/dev/null || die - fi -} - -src_install() { - default - - gen_usr_ldscript -a nvpair uutil zfsbootenv zfs zfs_core zpool - - use pam && { rm -rv "${ED}/unwanted_files" || die ; } - - use test-suite || { rm -r "${ED}"/usr/share/zfs/{test-runner,zfs-tests,runfiles,*sh} || die ; } - - find "${ED}" -name '*.la' -delete || die - - dobashcomp contrib/bash_completion.d/zfs - bashcomp_alias zfs zpool - - # strip executable bit from conf.d file - fperms 0644 /etc/conf.d/zfs - - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_install - popd >/dev/null || die - fi - - # enforce best available python implementation - use minimal || python_fix_shebang "${ED}/bin" -} - -pkg_postinst() { - udev_reload - - # we always need userspace utils in sync with zfs-kmod - # so force initrd update for userspace as well, to avoid - # situation when zfs-kmod trigger initrd rebuild before - # userspace component is rebuilt - # KV_* variables are provided by linux-info.eclass - if [[ -z ${ROOT} ]] && use dist-kernel; then - dist-kernel_reinstall_initramfs "${KV_DIR}" "${KV_FULL}" - fi - - if use rootfs; then - if ! has_version sys-kernel/genkernel && ! has_version sys-kernel/dracut; then - elog "Root on zfs requires an initramfs to boot" - elog "The following packages provide one and are tested on a regular basis:" - elog " sys-kernel/dracut ( preferred, module maintained by zfs developers )" - elog " sys-kernel/genkernel" - fi - fi - - if systemd_is_booted || has_version sys-apps/systemd; then - einfo "Please refer to ${EROOT}/$(systemd_get_systempresetdir)/50-zfs.preset" - einfo "for default zfs systemd service configuration" - else - [[ -e "${EROOT}/etc/runlevels/boot/zfs-import" ]] || \ - einfo "You should add zfs-import to the boot runlevel." - [[ -e "${EROOT}/etc/runlevels/boot/zfs-load-key" ]] || \ - einfo "You should add zfs-load-key to the boot runlevel." - [[ -e "${EROOT}/etc/runlevels/boot/zfs-mount" ]]|| \ - einfo "You should add zfs-mount to the boot runlevel." - [[ -e "${EROOT}/etc/runlevels/default/zfs-share" ]] || \ - einfo "You should add zfs-share to the default runlevel." - [[ -e "${EROOT}/etc/runlevels/default/zfs-zed" ]] || \ - einfo "You should add zfs-zed to the default runlevel." - fi -} - -pkg_postrm() { - udev_reload - - if ! use kernel-builtin && [[ ${PV} == "9999" ]]; then - remove_moduledb - fi -} diff --git a/files/zfs/3602.2.2/overlay/sys-fs/zfs/zfs-2.1.12.ebuild b/files/zfs/3602.2.2/overlay/sys-fs/zfs/zfs-2.1.12.ebuild deleted file mode 100644 index 03acb2c..0000000 --- a/files/zfs/3602.2.2/overlay/sys-fs/zfs/zfs-2.1.12.ebuild +++ /dev/null @@ -1,312 +0,0 @@ -# Copyright 1999-2023 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -DISTUTILS_OPTIONAL=1 -DISTUTILS_USE_PEP517=setuptools -PYTHON_COMPAT=( python3_{10..11} ) - -inherit autotools bash-completion-r1 dist-kernel-utils distutils-r1 flag-o-matic linux-info pam systemd udev usr-ldscript - -DESCRIPTION="Userland utilities for ZFS Linux kernel module" -HOMEPAGE="https://github.com/openzfs/zfs" - -if [[ ${PV} == "9999" ]]; then - inherit git-r3 linux-mod - 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_P="${P/_rc/-rc}" - SRC_URI="https://github.com/openzfs/${PN}/releases/download/${MY_P}/${MY_P}.tar.gz" - SRC_URI+=" verify-sig? ( https://github.com/openzfs/${PN}/releases/download/${MY_P}/${MY_P}.tar.gz.asc )" - S="${WORKDIR}/${P%_rc?}" - - if [[ ${PV} != *_rc* ]]; then - KEYWORDS="amd64 arm64 ppc64 ~riscv ~sparc" - fi -fi - -LICENSE="BSD-2 CDDL MIT" -# just libzfs soname major for now. -# possible candidates: libuutil, libzpool, libnvpair. Those do not provide stable abi, but are considered. -# see libsoversion_check() below as well -SLOT="0/5" -IUSE="custom-cflags debug dist-kernel kernel-builtin minimal nls pam python +rootfs selinux test-suite" - -DEPEND=" - net-libs/libtirpc:= - sys-apps/util-linux - sys-libs/zlib - virtual/libudev:= - dev-libs/openssl:0= - !minimal? ( ${PYTHON_DEPS} ) - pam? ( sys-libs/pam ) - python? ( - $(python_gen_cond_dep 'dev-python/cffi[${PYTHON_USEDEP}]' 'python*') - ) -" - -BDEPEND="app-alternatives/awk - virtual/pkgconfig - nls? ( sys-devel/gettext ) - python? ( - ${DISTUTILS_DEPS} - || ( - dev-python/packaging[${PYTHON_USEDEP}] - dev-python/distlib[${PYTHON_USEDEP}] - ) - ) -" - -if [[ ${PV} != "9999" ]] ; then - BDEPEND+=" verify-sig? ( sec-keys/openpgp-keys-openzfs )" -fi - -# awk is used for some scripts, completions, and the Dracut module -RDEPEND="${DEPEND} - !kernel-builtin? ( ~sys-fs/zfs-kmod-${PV}:= ) - !prefix? ( virtual/udev ) - sys-fs/udev-init-scripts - app-alternatives/awk - dist-kernel? ( virtual/dist-kernel:= ) - rootfs? ( - app-arch/cpio - app-misc/pax-utils - ) - selinux? ( sec-policy/selinux-zfs ) - test-suite? ( - app-shells/ksh - sys-apps/kmod[tools] - sys-apps/util-linux - sys-devel/bc - sys-block/parted - sys-fs/lsscsi - sys-fs/mdadm - sys-process/procps - ) -" - -# PDEPEND in this form is needed to trick portage suggest -# enabling dist-kernel if only 1 package have it set, without suggesting to disable -PDEPEND="dist-kernel? ( ~sys-fs/zfs-kmod-${PV}[dist-kernel] )" - -REQUIRED_USE=" - !minimal? ( ${PYTHON_REQUIRED_USE} ) - python? ( !minimal ) - test-suite? ( !minimal ) -" - -RESTRICT="test" - -PATCHES=( - # bug #854333 - "${FILESDIR}"/2.1.5-r2-dracut-non-root.patch - - "${FILESDIR}"/2.1.5-dracut-zfs-missing.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() { - if use kernel_linux; then - linux-info_pkg_setup - - if ! linux_config_exists; then - ewarn "Cannot check the linux kernel configuration." - else - if use test-suite; then - if linux_chkconfig_present BLK_DEV_LOOP; then - eerror "The ZFS test suite requires loop device support enabled." - eerror "Please enable it:" - eerror " CONFIG_BLK_DEV_LOOP=y" - eerror "in /usr/src/linux/.config or" - eerror " Device Drivers --->" - eerror " Block devices --->" - eerror " [X] Loopback device support" - fi - fi - fi - fi -} - -libsoversion_check() { - local bugurl libzfs_sover - bugurl="https://bugs.gentoo.org/enter_bug.cgi?form_name=enter_bug&product=Gentoo+Linux&component=Current+packages" - - libzfs_sover="$(grep 'libzfs_la_LDFLAGS += -version-info' lib/libzfs/Makefile.am \ - | grep -Eo '[0-9]+:[0-9]+:[0-9]+')" - libzfs_sover="${libzfs_sover%%:*}" - - if [[ ${libzfs_sover} -ne $(ver_cut 2 ${SLOT}) ]]; then - echo - eerror "BUG BUG BUG BUG BUG BUG BUG BUG" - eerror "ebuild subslot does not match libzfs soversion!" - eerror "libzfs soversion: ${libzfs_sover}" - eerror "ebuild value: $(ver_cut 2 ${SLOT})" - eerror "This is a bug in the ebuild, please use the following URL to report it" - eerror "${bugurl}&short_desc=${CATEGORY}%2F${P}+update+subslot" - echo - # we want to abort for releases, but just print a warning for live ebuild - # to keep package installable - [[ ${PV} == "9999" ]] || die - fi -} - -src_prepare() { - default - libsoversion_check - - # Run unconditionally (bug #792627) - eautoreconf - - if [[ ${PV} != "9999" ]]; then - # Set revision number - sed -i "s/\(Release:\)\(.*\)1/\1\2${PR}-gentoo/" META || die "Could not set Gentoo release" - fi - - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_prepare - popd >/dev/null || die - fi - - # prevent errors showing up on zfs-mount stop, #647688 - # openrc will unmount all filesystems anyway. - sed -i "/^ZFS_UNMOUNT=/ s/yes/no/" "etc/default/zfs.in" || die -} - -src_configure() { - use custom-cflags || strip-flags - use minimal || python_setup - - # All the same issue: - # Segfaults w/ GCC 12 and 'zfs send' - # bug #856373 - # https://github.com/openzfs/zfs/issues/13620 - # https://github.com/openzfs/zfs/issues/13605 - append-flags -fno-tree-vectorize - - local myconf=( - --bindir="${EPREFIX}/bin" - --enable-shared - --enable-sysvinit - --localstatedir="${EPREFIX}/var" - --sbindir="${EPREFIX}/sbin" - --with-config=user - --with-dracutdir="${EPREFIX}/usr/lib/dracut" - --with-linux="${KV_DIR}" - --with-linux-obj="${KV_OUT_DIR}" - --with-udevdir="$(get_udevdir)" - --with-pamconfigsdir="${EPREFIX}/unwanted_files" - --with-pammoduledir="$(getpam_mod_dir)" - --with-systemdunitdir="$(systemd_get_systemunitdir)" - --with-systemdpresetdir="$(systemd_get_systempresetdir)" - --with-vendor=gentoo - # Building zfs-mount-generator.c on musl breaks as strndupa - # isn't available. But systemd doesn't support musl anyway, so - # just disable building it. - # UPDATE: it has been fixed since, - # https://github.com/openzfs/zfs/commit/1f19826c9ac85835cbde61a7439d9d1fefe43a4a - # but we still leave it as this for now. - $(use_enable !elibc_musl systemd) - $(use_enable debug) - $(use_enable nls) - $(use_enable pam) - $(use_enable python pyzfs) - --disable-static - $(usex minimal --without-python --with-python="${EPYTHON}") - ) - - unset am_cv_python_version - econf "${myconf[@]}" -} - -src_compile() { - default - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_compile - popd >/dev/null || die - fi -} - -src_install() { - default - - gen_usr_ldscript -a nvpair uutil zfsbootenv zfs zfs_core zpool - - use pam && { rm -rv "${ED}/unwanted_files" || die ; } - - use test-suite || { rm -r "${ED}"/usr/share/zfs/{test-runner,zfs-tests,runfiles,*sh} || die ; } - - find "${ED}" -name '*.la' -delete || die - - dobashcomp contrib/bash_completion.d/zfs - bashcomp_alias zfs zpool - - # strip executable bit from conf.d file - fperms 0644 /etc/conf.d/zfs - - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_install - popd >/dev/null || die - fi - - # enforce best available python implementation - use minimal || python_fix_shebang "${ED}/bin" -} - -pkg_postinst() { - udev_reload - - # we always need userspace utils in sync with zfs-kmod - # so force initrd update for userspace as well, to avoid - # situation when zfs-kmod trigger initrd rebuild before - # userspace component is rebuilt - # KV_* variables are provided by linux-info.eclass - if [[ -z ${ROOT} ]] && use dist-kernel; then - dist-kernel_reinstall_initramfs "${KV_DIR}" "${KV_FULL}" - fi - - if use rootfs; then - if ! has_version sys-kernel/genkernel && ! has_version sys-kernel/dracut; then - elog "Root on zfs requires an initramfs to boot" - elog "The following packages provide one and are tested on a regular basis:" - elog " sys-kernel/dracut ( preferred, module maintained by zfs developers )" - elog " sys-kernel/genkernel" - fi - fi - - if systemd_is_booted || has_version sys-apps/systemd; then - einfo "Please refer to ${EROOT}/$(systemd_get_systempresetdir)/50-zfs.preset" - einfo "for default zfs systemd service configuration" - else - [[ -e "${EROOT}/etc/runlevels/boot/zfs-import" ]] || \ - einfo "You should add zfs-import to the boot runlevel." - [[ -e "${EROOT}/etc/runlevels/boot/zfs-load-key" ]] || \ - einfo "You should add zfs-load-key to the boot runlevel." - [[ -e "${EROOT}/etc/runlevels/boot/zfs-mount" ]]|| \ - einfo "You should add zfs-mount to the boot runlevel." - [[ -e "${EROOT}/etc/runlevels/default/zfs-share" ]] || \ - einfo "You should add zfs-share to the default runlevel." - [[ -e "${EROOT}/etc/runlevels/default/zfs-zed" ]] || \ - einfo "You should add zfs-zed to the default runlevel." - fi -} - -pkg_postrm() { - udev_reload -} diff --git a/files/zfs/3602.2.2/overlay/sys-fs/zfs/zfs-2.1.9.ebuild b/files/zfs/3602.2.2/overlay/sys-fs/zfs/zfs-2.1.9.ebuild deleted file mode 100644 index 2930846..0000000 --- a/files/zfs/3602.2.2/overlay/sys-fs/zfs/zfs-2.1.9.ebuild +++ /dev/null @@ -1,326 +0,0 @@ -# Copyright 1999-2023 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -DISTUTILS_OPTIONAL=1 -PYTHON_COMPAT=( python3_{9..11} ) - -inherit autotools bash-completion-r1 dist-kernel-utils distutils-r1 flag-o-matic linux-info pam systemd udev usr-ldscript - -DESCRIPTION="Userland utilities for ZFS Linux kernel module" -HOMEPAGE="https://github.com/openzfs/zfs" - -if [[ ${PV} == "9999" ]]; then - inherit git-r3 linux-mod - 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_P="${P/_rc/-rc}" - SRC_URI="https://github.com/openzfs/${PN}/releases/download/${MY_P}/${MY_P}.tar.gz" - SRC_URI+=" verify-sig? ( https://github.com/openzfs/${PN}/releases/download/${MY_P}/${MY_P}.tar.gz.asc )" - S="${WORKDIR}/${P%_rc?}" - - if [[ ${PV} != *_rc* ]]; then - KEYWORDS="amd64 arm64 ppc64 ~riscv ~sparc" - fi -fi - -LICENSE="BSD-2 CDDL MIT" -# just libzfs soname major for now. -# possible candidates: libuutil, libzpool, libnvpair. Those do not provide stable abi, but are considered. -# see libsoversion_check() below as well -SLOT="0/5" -IUSE="custom-cflags debug dist-kernel kernel-builtin minimal nls pam python +rootfs selinux test-suite" - -DEPEND=" - net-libs/libtirpc:= - sys-apps/util-linux - sys-libs/zlib - virtual/libudev:= - dev-libs/openssl:0= - !minimal? ( ${PYTHON_DEPS} ) - pam? ( sys-libs/pam ) - python? ( - virtual/python-cffi[${PYTHON_USEDEP}] - ) -" - -BDEPEND="app-alternatives/awk - virtual/pkgconfig - nls? ( sys-devel/gettext ) - python? ( - dev-python/setuptools[${PYTHON_USEDEP}] - || ( - dev-python/packaging[${PYTHON_USEDEP}] - dev-python/distlib[${PYTHON_USEDEP}] - ) - ) -" - -if [[ ${PV} != "9999" ]] ; then - BDEPEND+=" verify-sig? ( sec-keys/openpgp-keys-openzfs )" -fi - -# awk is used for some scripts, completions, and the Dracut module -RDEPEND="${DEPEND} - !kernel-builtin? ( ~sys-fs/zfs-kmod-${PV}:= ) - !prefix? ( virtual/udev ) - sys-fs/udev-init-scripts - app-alternatives/awk - dist-kernel? ( virtual/dist-kernel:= ) - rootfs? ( - app-arch/cpio - app-misc/pax-utils - ) - selinux? ( sec-policy/selinux-zfs ) - test-suite? ( - app-shells/ksh - sys-apps/kmod[tools] - sys-apps/util-linux - sys-devel/bc - sys-block/parted - sys-fs/lsscsi - sys-fs/mdadm - sys-process/procps - ) -" - -# PDEPEND in this form is needed to trick portage suggest -# enabling dist-kernel if only 1 package have it set, without suggesting to disable -PDEPEND="dist-kernel? ( ~sys-fs/zfs-kmod-${PV}[dist-kernel] )" - -REQUIRED_USE=" - !minimal? ( ${PYTHON_REQUIRED_USE} ) - python? ( !minimal ) - test-suite? ( !minimal ) -" - -RESTRICT="test" - -PATCHES=( - # bug #854333 - "${FILESDIR}"/2.1.5-r2-dracut-non-root.patch - - "${FILESDIR}"/2.1.5-dracut-zfs-missing.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() { - if use kernel_linux; then - linux-info_pkg_setup - - if ! linux_config_exists; then - ewarn "Cannot check the linux kernel configuration." - else - if use test-suite; then - if linux_chkconfig_present BLK_DEV_LOOP; then - eerror "The ZFS test suite requires loop device support enabled." - eerror "Please enable it:" - eerror " CONFIG_BLK_DEV_LOOP=y" - eerror "in /usr/src/linux/.config or" - eerror " Device Drivers --->" - eerror " Block devices --->" - eerror " [X] Loopback device support" - fi - fi - fi - fi -} - -libsoversion_check() { - local bugurl libzfs_sover - bugurl="https://bugs.gentoo.org/enter_bug.cgi?form_name=enter_bug&product=Gentoo+Linux&component=Current+packages" - - libzfs_sover="$(grep 'libzfs_la_LDFLAGS += -version-info' lib/libzfs/Makefile.am \ - | grep -Eo '[0-9]+:[0-9]+:[0-9]+')" - libzfs_sover="${libzfs_sover%%:*}" - - if [[ ${libzfs_sover} -ne $(ver_cut 2 ${SLOT}) ]]; then - echo - eerror "BUG BUG BUG BUG BUG BUG BUG BUG" - eerror "ebuild subslot does not match libzfs soversion!" - eerror "libzfs soversion: ${libzfs_sover}" - eerror "ebuild value: $(ver_cut 2 ${SLOT})" - eerror "This is a bug in the ebuild, please use the following URL to report it" - eerror "${bugurl}&short_desc=${CATEGORY}%2F${P}+update+subslot" - echo - # we want to abort for releases, but just print a warning for live ebuild - # to keep package installable - [[ ${PV} == "9999" ]] || die - fi -} - -src_unpack() { - if use verify-sig ; then - # Needed for downloaded patch (which is unsigned, which is fine) - verify-sig_verify_detached "${DISTDIR}"/${MY_P}.tar.gz{,.asc} - fi - - default -} - -src_prepare() { - default - libsoversion_check - - # Run unconditionally (bug #792627) - eautoreconf - - if [[ ${PV} != "9999" ]]; then - # Set revision number - sed -i "s/\(Release:\)\(.*\)1/\1\2${PR}-gentoo/" META || die "Could not set Gentoo release" - fi - - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_prepare - popd >/dev/null || die - fi - - # prevent errors showing up on zfs-mount stop, #647688 - # openrc will unmount all filesystems anyway. - sed -i "/^ZFS_UNMOUNT=/ s/yes/no/" "etc/default/zfs.in" || die -} - -src_configure() { - use custom-cflags || strip-flags - use minimal || python_setup - - # All the same issue: - # Segfaults w/ GCC 12 and 'zfs send' - # bug #856373 - # https://github.com/openzfs/zfs/issues/13620 - # https://github.com/openzfs/zfs/issues/13605 - append-flags -fno-tree-vectorize - - local myconf=( - --bindir="${EPREFIX}/bin" - --enable-shared - --enable-sysvinit - --localstatedir="${EPREFIX}/var" - --sbindir="${EPREFIX}/sbin" - --with-config=user - --with-dracutdir="${EPREFIX}/usr/lib/dracut" - --with-linux="${KV_DIR}" - --with-linux-obj="${KV_OUT_DIR}" - --with-udevdir="$(get_udevdir)" - --with-pamconfigsdir="${EPREFIX}/unwanted_files" - --with-pammoduledir="$(getpam_mod_dir)" - --with-systemdunitdir="$(systemd_get_systemunitdir)" - --with-systemdpresetdir="$(systemd_get_systempresetdir)" - --with-vendor=gentoo - # Building zfs-mount-generator.c on musl breaks as strndupa - # isn't available. But systemd doesn't support musl anyway, so - # just disable building it. - $(use_enable !elibc_musl systemd) - $(use_enable debug) - $(use_enable nls) - $(use_enable pam) - $(use_enable python pyzfs) - --disable-static - $(usex minimal --without-python --with-python="${EPYTHON}") - ) - - econf "${myconf[@]}" -} - -src_compile() { - default - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_compile - popd >/dev/null || die - fi -} - -src_install() { - default - - gen_usr_ldscript -a nvpair uutil zfsbootenv zfs zfs_core zpool - - use pam && { rm -rv "${ED}/unwanted_files" || die ; } - - use test-suite || { rm -r "${ED}"/usr/share/zfs/{test-runner,zfs-tests,runfiles,*sh} || die ; } - - find "${ED}" -name '*.la' -delete || die - - dobashcomp contrib/bash_completion.d/zfs - bashcomp_alias zfs zpool - - # strip executable bit from conf.d file - fperms 0644 /etc/conf.d/zfs - - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_install - popd >/dev/null || die - fi - - # enforce best available python implementation - use minimal || python_fix_shebang "${ED}/bin" -} - -pkg_postinst() { - udev_reload - - # we always need userspace utils in sync with zfs-kmod - # so force initrd update for userspace as well, to avoid - # situation when zfs-kmod trigger initrd rebuild before - # userspace component is rebuilt - # KV_* variables are provided by linux-info.eclass - if [[ -z ${ROOT} ]] && use dist-kernel; then - dist-kernel_reinstall_initramfs "${KV_DIR}" "${KV_FULL}" - fi - - if use rootfs; then - if ! has_version sys-kernel/genkernel && ! has_version sys-kernel/dracut; then - elog "Root on zfs requires an initramfs to boot" - elog "The following packages provide one and are tested on a regular basis:" - elog " sys-kernel/dracut ( preferred, module maintained by zfs developers )" - elog " sys-kernel/genkernel" - fi - fi - - if ! use kernel-builtin && [[ ${PV} == "9999" ]]; then - einfo "Adding ${P} to the module database to ensure that the" - einfo "kernel modules and userland utilities stay in sync." - update_moduledb - fi - - if systemd_is_booted || has_version sys-apps/systemd; then - einfo "Please refer to ${EROOT}/$(systemd_get_systempresetdir)/50-zfs.preset" - einfo "for default zfs systemd service configuration" - else - [[ -e "${EROOT}/etc/runlevels/boot/zfs-import" ]] || \ - einfo "You should add zfs-import to the boot runlevel." - [[ -e "${EROOT}/etc/runlevels/boot/zfs-load-key" ]] || \ - einfo "You should add zfs-load-key to the boot runlevel." - [[ -e "${EROOT}/etc/runlevels/boot/zfs-mount" ]]|| \ - einfo "You should add zfs-mount to the boot runlevel." - [[ -e "${EROOT}/etc/runlevels/default/zfs-share" ]] || \ - einfo "You should add zfs-share to the default runlevel." - [[ -e "${EROOT}/etc/runlevels/default/zfs-zed" ]] || \ - einfo "You should add zfs-zed to the default runlevel." - fi -} - -pkg_postrm() { - udev_reload - - if ! use kernel-builtin && [[ ${PV} == "9999" ]]; then - remove_moduledb - fi -} diff --git a/files/zfs/3602.2.2/overlay/sys-fs/zfs/zfs-2.2.0_rc3.ebuild b/files/zfs/3602.2.2/overlay/sys-fs/zfs/zfs-2.2.0_rc3.ebuild deleted file mode 100644 index e9d67dd..0000000 --- a/files/zfs/3602.2.2/overlay/sys-fs/zfs/zfs-2.2.0_rc3.ebuild +++ /dev/null @@ -1,306 +0,0 @@ -# Copyright 1999-2023 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -DISTUTILS_OPTIONAL=1 -DISTUTILS_USE_PEP517=setuptools -PYTHON_COMPAT=( python3_{10..11} ) - -inherit autotools bash-completion-r1 dist-kernel-utils distutils-r1 flag-o-matic linux-info pam systemd udev usr-ldscript - -DESCRIPTION="Userland utilities for ZFS Linux kernel module" -HOMEPAGE="https://github.com/openzfs/zfs" - -if [[ ${PV} == "9999" ]]; then - inherit git-r3 linux-mod - 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_P="${P/_rc/-rc}" - SRC_URI="https://github.com/openzfs/${PN}/releases/download/${MY_P}/${MY_P}.tar.gz" - SRC_URI+=" verify-sig? ( https://github.com/openzfs/${PN}/releases/download/${MY_P}/${MY_P}.tar.gz.asc )" - S="${WORKDIR}/${MY_P}" - - if [[ ${PV} != *_rc* ]]; then - KEYWORDS="~amd64 ~arm64 ~ppc64 ~riscv ~sparc" - fi -fi - -LICENSE="BSD-2 CDDL MIT" -# just libzfs soname major for now. -# possible candidates: libuutil, libzpool, libnvpair. Those do not provide stable abi, but are considered. -# see libsoversion_check() below as well -SLOT="0/5" -IUSE="custom-cflags debug dist-kernel kernel-builtin minimal nls pam python +rootfs selinux test-suite" - -DEPEND=" - dev-libs/openssl:= - net-libs/libtirpc:= - sys-apps/util-linux - sys-libs/zlib - virtual/libudev:= - !minimal? ( ${PYTHON_DEPS} ) - pam? ( sys-libs/pam ) - python? ( - $(python_gen_cond_dep 'dev-python/cffi[${PYTHON_USEDEP}]' 'python*') - ) -" - -BDEPEND=" - app-alternatives/awk - virtual/pkgconfig - nls? ( sys-devel/gettext ) - python? ( - ${DISTUTILS_DEPS} - || ( - dev-python/packaging[${PYTHON_USEDEP}] - dev-python/distlib[${PYTHON_USEDEP}] - ) - ) -" - -if [[ ${PV} != "9999" ]] ; then - BDEPEND+=" verify-sig? ( sec-keys/openpgp-keys-openzfs )" -fi - -# awk is used for some scripts, completions, and the Dracut module -RDEPEND=" - ${DEPEND} - !kernel-builtin? ( ~sys-fs/zfs-kmod-${PV}:= ) - !prefix? ( virtual/udev ) - app-alternatives/awk - sys-fs/udev-init-scripts - dist-kernel? ( virtual/dist-kernel:= ) - rootfs? ( - app-arch/cpio - app-misc/pax-utils - ) - selinux? ( sec-policy/selinux-zfs ) - test-suite? ( - app-shells/ksh - sys-apps/kmod[tools] - sys-apps/util-linux - sys-devel/bc - sys-block/parted - sys-fs/lsscsi - sys-fs/mdadm - sys-process/procps - ) -" - -# PDEPEND in this form is needed to trick portage suggest -# enabling dist-kernel if only 1 package have it set, without suggesting to disable -PDEPEND="dist-kernel? ( ~sys-fs/zfs-kmod-${PV}[dist-kernel] )" - -REQUIRED_USE=" - !minimal? ( ${PYTHON_REQUIRED_USE} ) - python? ( !minimal ) - test-suite? ( !minimal ) -" - -RESTRICT="test" - -PATCHES=( - "${FILESDIR}"/2.1.5-dracut-zfs-missing.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() { - if use kernel_linux; then - linux-info_pkg_setup - - if ! linux_config_exists; then - ewarn "Cannot check the linux kernel configuration." - else - if use test-suite; then - if linux_chkconfig_present BLK_DEV_LOOP; then - eerror "The ZFS test suite requires loop device support enabled." - eerror "Please enable it:" - eerror " CONFIG_BLK_DEV_LOOP=y" - eerror "in /usr/src/linux/.config or" - eerror " Device Drivers --->" - eerror " Block devices --->" - eerror " [X] Loopback device support" - fi - fi - fi - fi -} - -libsoversion_check() { - local bugurl libzfs_sover - bugurl="https://bugs.gentoo.org/enter_bug.cgi?form_name=enter_bug&product=Gentoo+Linux&component=Current+packages" - - libzfs_sover="$(grep 'libzfs_la_LDFLAGS += -version-info' lib/libzfs/Makefile.am \ - | grep -Eo '[0-9]+:[0-9]+:[0-9]+')" - libzfs_sover="${libzfs_sover%%:*}" - - if [[ ${libzfs_sover} -ne $(ver_cut 2 ${SLOT}) ]]; then - echo - eerror "BUG BUG BUG BUG BUG BUG BUG BUG" - eerror "ebuild subslot does not match libzfs soversion!" - eerror "libzfs soversion: ${libzfs_sover}" - eerror "ebuild value: $(ver_cut 2 ${SLOT})" - eerror "This is a bug in the ebuild, please use the following URL to report it" - eerror "${bugurl}&short_desc=${CATEGORY}%2F${P}+update+subslot" - echo - # we want to abort for releases, but just print a warning for live ebuild - # to keep package installable - [[ ${PV} == "9999" ]] || die - fi -} - -src_prepare() { - default - libsoversion_check - - # Run unconditionally (bug #792627) - eautoreconf - - if [[ ${PV} != "9999" ]]; then - # Set revision number - sed -i "s/\(Release:\)\(.*\)1/\1\2${PR}-gentoo/" META || die "Could not set Gentoo release" - fi - - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_prepare - popd >/dev/null || die - fi - - # Tries to use /etc/conf.d which we reserve for OpenRC - sed -i -e '/EnvironmentFile/d' etc/systemd/system/zfs*.in || die - - # prevent errors showing up on zfs-mount stop, #647688 - # openrc will unmount all filesystems anyway. - sed -i "/^ZFS_UNMOUNT=/ s/yes/no/" "etc/default/zfs.in" || die -} - -src_configure() { - use custom-cflags || strip-flags - use minimal || python_setup - - local myconf=( - --bindir="${EPREFIX}/bin" - --enable-shared - --enable-sysvinit - --localstatedir="${EPREFIX}/var" - --sbindir="${EPREFIX}/sbin" - --with-config=user - --with-dracutdir="${EPREFIX}/usr/lib/dracut" - --with-linux="${KV_DIR}" - --with-linux-obj="${KV_OUT_DIR}" - --with-udevdir="$(get_udevdir)" - --with-pamconfigsdir="${EPREFIX}/unwanted_files" - --with-pammoduledir="$(getpam_mod_dir)" - --with-systemdunitdir="$(systemd_get_systemunitdir)" - --with-systemdpresetdir="$(systemd_get_systempresetdir)" - --with-vendor=gentoo - # Building zfs-mount-generator.c on musl breaks as strndupa - # isn't available. But systemd doesn't support musl anyway, so - # just disable building it. - # UPDATE: it has been fixed since, - # https://github.com/openzfs/zfs/commit/1f19826c9ac85835cbde61a7439d9d1fefe43a4a - # but we still leave it as this for now. - $(use_enable !elibc_musl systemd) - $(use_enable debug) - $(use_enable nls) - $(use_enable pam) - $(use_enable python pyzfs) - --disable-static - $(usex minimal --without-python --with-python="${EPYTHON}") - ) - - econf "${myconf[@]}" -} - -src_compile() { - default - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_compile - popd >/dev/null || die - fi -} - -src_install() { - default - - gen_usr_ldscript -a nvpair uutil zfsbootenv zfs zfs_core zpool - - use pam && { rm -rv "${ED}/unwanted_files" || die ; } - - use test-suite || { rm -r "${ED}"/usr/share/zfs/{test-runner,zfs-tests,runfiles,*sh} || die ; } - - find "${ED}" -name '*.la' -delete || die - - dobashcomp contrib/bash_completion.d/zfs - bashcomp_alias zfs zpool - - # strip executable bit from conf.d file - fperms 0644 /etc/conf.d/zfs - - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_install - popd >/dev/null || die - fi - - # enforce best available python implementation - use minimal || python_fix_shebang "${ED}/bin" -} - -pkg_postinst() { - udev_reload - - # we always need userspace utils in sync with zfs-kmod - # so force initrd update for userspace as well, to avoid - # situation when zfs-kmod trigger initrd rebuild before - # userspace component is rebuilt - # KV_* variables are provided by linux-info.eclass - if [[ -z ${ROOT} ]] && use dist-kernel; then - dist-kernel_reinstall_initramfs "${KV_DIR}" "${KV_FULL}" - fi - - if use rootfs; then - if ! has_version sys-kernel/genkernel && ! has_version sys-kernel/dracut; then - elog "Root on zfs requires an initramfs to boot" - elog "The following packages provide one and are tested on a regular basis:" - elog " sys-kernel/dracut ( preferred, module maintained by zfs developers )" - elog " sys-kernel/genkernel" - fi - fi - - if systemd_is_booted || has_version sys-apps/systemd; then - einfo "Please refer to ${EROOT}/$(systemd_get_systempresetdir)/50-zfs.preset" - einfo "for default zfs systemd service configuration" - else - [[ -e "${EROOT}/etc/runlevels/boot/zfs-import" ]] || \ - einfo "You should add zfs-import to the boot runlevel." - [[ -e "${EROOT}/etc/runlevels/boot/zfs-load-key" ]] || \ - einfo "You should add zfs-load-key to the boot runlevel." - [[ -e "${EROOT}/etc/runlevels/boot/zfs-mount" ]]|| \ - einfo "You should add zfs-mount to the boot runlevel." - [[ -e "${EROOT}/etc/runlevels/default/zfs-share" ]] || \ - einfo "You should add zfs-share to the default runlevel." - [[ -e "${EROOT}/etc/runlevels/default/zfs-zed" ]] || \ - einfo "You should add zfs-zed to the default runlevel." - fi -} - -pkg_postrm() { - udev_reload -} diff --git a/files/zfs/3602.2.2/overlay/sys-fs/zfs/zfs-9999.ebuild b/files/zfs/3602.2.2/overlay/sys-fs/zfs/zfs-9999.ebuild deleted file mode 100644 index e9d67dd..0000000 --- a/files/zfs/3602.2.2/overlay/sys-fs/zfs/zfs-9999.ebuild +++ /dev/null @@ -1,306 +0,0 @@ -# Copyright 1999-2023 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -DISTUTILS_OPTIONAL=1 -DISTUTILS_USE_PEP517=setuptools -PYTHON_COMPAT=( python3_{10..11} ) - -inherit autotools bash-completion-r1 dist-kernel-utils distutils-r1 flag-o-matic linux-info pam systemd udev usr-ldscript - -DESCRIPTION="Userland utilities for ZFS Linux kernel module" -HOMEPAGE="https://github.com/openzfs/zfs" - -if [[ ${PV} == "9999" ]]; then - inherit git-r3 linux-mod - 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_P="${P/_rc/-rc}" - SRC_URI="https://github.com/openzfs/${PN}/releases/download/${MY_P}/${MY_P}.tar.gz" - SRC_URI+=" verify-sig? ( https://github.com/openzfs/${PN}/releases/download/${MY_P}/${MY_P}.tar.gz.asc )" - S="${WORKDIR}/${MY_P}" - - if [[ ${PV} != *_rc* ]]; then - KEYWORDS="~amd64 ~arm64 ~ppc64 ~riscv ~sparc" - fi -fi - -LICENSE="BSD-2 CDDL MIT" -# just libzfs soname major for now. -# possible candidates: libuutil, libzpool, libnvpair. Those do not provide stable abi, but are considered. -# see libsoversion_check() below as well -SLOT="0/5" -IUSE="custom-cflags debug dist-kernel kernel-builtin minimal nls pam python +rootfs selinux test-suite" - -DEPEND=" - dev-libs/openssl:= - net-libs/libtirpc:= - sys-apps/util-linux - sys-libs/zlib - virtual/libudev:= - !minimal? ( ${PYTHON_DEPS} ) - pam? ( sys-libs/pam ) - python? ( - $(python_gen_cond_dep 'dev-python/cffi[${PYTHON_USEDEP}]' 'python*') - ) -" - -BDEPEND=" - app-alternatives/awk - virtual/pkgconfig - nls? ( sys-devel/gettext ) - python? ( - ${DISTUTILS_DEPS} - || ( - dev-python/packaging[${PYTHON_USEDEP}] - dev-python/distlib[${PYTHON_USEDEP}] - ) - ) -" - -if [[ ${PV} != "9999" ]] ; then - BDEPEND+=" verify-sig? ( sec-keys/openpgp-keys-openzfs )" -fi - -# awk is used for some scripts, completions, and the Dracut module -RDEPEND=" - ${DEPEND} - !kernel-builtin? ( ~sys-fs/zfs-kmod-${PV}:= ) - !prefix? ( virtual/udev ) - app-alternatives/awk - sys-fs/udev-init-scripts - dist-kernel? ( virtual/dist-kernel:= ) - rootfs? ( - app-arch/cpio - app-misc/pax-utils - ) - selinux? ( sec-policy/selinux-zfs ) - test-suite? ( - app-shells/ksh - sys-apps/kmod[tools] - sys-apps/util-linux - sys-devel/bc - sys-block/parted - sys-fs/lsscsi - sys-fs/mdadm - sys-process/procps - ) -" - -# PDEPEND in this form is needed to trick portage suggest -# enabling dist-kernel if only 1 package have it set, without suggesting to disable -PDEPEND="dist-kernel? ( ~sys-fs/zfs-kmod-${PV}[dist-kernel] )" - -REQUIRED_USE=" - !minimal? ( ${PYTHON_REQUIRED_USE} ) - python? ( !minimal ) - test-suite? ( !minimal ) -" - -RESTRICT="test" - -PATCHES=( - "${FILESDIR}"/2.1.5-dracut-zfs-missing.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() { - if use kernel_linux; then - linux-info_pkg_setup - - if ! linux_config_exists; then - ewarn "Cannot check the linux kernel configuration." - else - if use test-suite; then - if linux_chkconfig_present BLK_DEV_LOOP; then - eerror "The ZFS test suite requires loop device support enabled." - eerror "Please enable it:" - eerror " CONFIG_BLK_DEV_LOOP=y" - eerror "in /usr/src/linux/.config or" - eerror " Device Drivers --->" - eerror " Block devices --->" - eerror " [X] Loopback device support" - fi - fi - fi - fi -} - -libsoversion_check() { - local bugurl libzfs_sover - bugurl="https://bugs.gentoo.org/enter_bug.cgi?form_name=enter_bug&product=Gentoo+Linux&component=Current+packages" - - libzfs_sover="$(grep 'libzfs_la_LDFLAGS += -version-info' lib/libzfs/Makefile.am \ - | grep -Eo '[0-9]+:[0-9]+:[0-9]+')" - libzfs_sover="${libzfs_sover%%:*}" - - if [[ ${libzfs_sover} -ne $(ver_cut 2 ${SLOT}) ]]; then - echo - eerror "BUG BUG BUG BUG BUG BUG BUG BUG" - eerror "ebuild subslot does not match libzfs soversion!" - eerror "libzfs soversion: ${libzfs_sover}" - eerror "ebuild value: $(ver_cut 2 ${SLOT})" - eerror "This is a bug in the ebuild, please use the following URL to report it" - eerror "${bugurl}&short_desc=${CATEGORY}%2F${P}+update+subslot" - echo - # we want to abort for releases, but just print a warning for live ebuild - # to keep package installable - [[ ${PV} == "9999" ]] || die - fi -} - -src_prepare() { - default - libsoversion_check - - # Run unconditionally (bug #792627) - eautoreconf - - if [[ ${PV} != "9999" ]]; then - # Set revision number - sed -i "s/\(Release:\)\(.*\)1/\1\2${PR}-gentoo/" META || die "Could not set Gentoo release" - fi - - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_prepare - popd >/dev/null || die - fi - - # Tries to use /etc/conf.d which we reserve for OpenRC - sed -i -e '/EnvironmentFile/d' etc/systemd/system/zfs*.in || die - - # prevent errors showing up on zfs-mount stop, #647688 - # openrc will unmount all filesystems anyway. - sed -i "/^ZFS_UNMOUNT=/ s/yes/no/" "etc/default/zfs.in" || die -} - -src_configure() { - use custom-cflags || strip-flags - use minimal || python_setup - - local myconf=( - --bindir="${EPREFIX}/bin" - --enable-shared - --enable-sysvinit - --localstatedir="${EPREFIX}/var" - --sbindir="${EPREFIX}/sbin" - --with-config=user - --with-dracutdir="${EPREFIX}/usr/lib/dracut" - --with-linux="${KV_DIR}" - --with-linux-obj="${KV_OUT_DIR}" - --with-udevdir="$(get_udevdir)" - --with-pamconfigsdir="${EPREFIX}/unwanted_files" - --with-pammoduledir="$(getpam_mod_dir)" - --with-systemdunitdir="$(systemd_get_systemunitdir)" - --with-systemdpresetdir="$(systemd_get_systempresetdir)" - --with-vendor=gentoo - # Building zfs-mount-generator.c on musl breaks as strndupa - # isn't available. But systemd doesn't support musl anyway, so - # just disable building it. - # UPDATE: it has been fixed since, - # https://github.com/openzfs/zfs/commit/1f19826c9ac85835cbde61a7439d9d1fefe43a4a - # but we still leave it as this for now. - $(use_enable !elibc_musl systemd) - $(use_enable debug) - $(use_enable nls) - $(use_enable pam) - $(use_enable python pyzfs) - --disable-static - $(usex minimal --without-python --with-python="${EPYTHON}") - ) - - econf "${myconf[@]}" -} - -src_compile() { - default - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_compile - popd >/dev/null || die - fi -} - -src_install() { - default - - gen_usr_ldscript -a nvpair uutil zfsbootenv zfs zfs_core zpool - - use pam && { rm -rv "${ED}/unwanted_files" || die ; } - - use test-suite || { rm -r "${ED}"/usr/share/zfs/{test-runner,zfs-tests,runfiles,*sh} || die ; } - - find "${ED}" -name '*.la' -delete || die - - dobashcomp contrib/bash_completion.d/zfs - bashcomp_alias zfs zpool - - # strip executable bit from conf.d file - fperms 0644 /etc/conf.d/zfs - - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_install - popd >/dev/null || die - fi - - # enforce best available python implementation - use minimal || python_fix_shebang "${ED}/bin" -} - -pkg_postinst() { - udev_reload - - # we always need userspace utils in sync with zfs-kmod - # so force initrd update for userspace as well, to avoid - # situation when zfs-kmod trigger initrd rebuild before - # userspace component is rebuilt - # KV_* variables are provided by linux-info.eclass - if [[ -z ${ROOT} ]] && use dist-kernel; then - dist-kernel_reinstall_initramfs "${KV_DIR}" "${KV_FULL}" - fi - - if use rootfs; then - if ! has_version sys-kernel/genkernel && ! has_version sys-kernel/dracut; then - elog "Root on zfs requires an initramfs to boot" - elog "The following packages provide one and are tested on a regular basis:" - elog " sys-kernel/dracut ( preferred, module maintained by zfs developers )" - elog " sys-kernel/genkernel" - fi - fi - - if systemd_is_booted || has_version sys-apps/systemd; then - einfo "Please refer to ${EROOT}/$(systemd_get_systempresetdir)/50-zfs.preset" - einfo "for default zfs systemd service configuration" - else - [[ -e "${EROOT}/etc/runlevels/boot/zfs-import" ]] || \ - einfo "You should add zfs-import to the boot runlevel." - [[ -e "${EROOT}/etc/runlevels/boot/zfs-load-key" ]] || \ - einfo "You should add zfs-load-key to the boot runlevel." - [[ -e "${EROOT}/etc/runlevels/boot/zfs-mount" ]]|| \ - einfo "You should add zfs-mount to the boot runlevel." - [[ -e "${EROOT}/etc/runlevels/default/zfs-share" ]] || \ - einfo "You should add zfs-share to the default runlevel." - [[ -e "${EROOT}/etc/runlevels/default/zfs-zed" ]] || \ - einfo "You should add zfs-zed to the default runlevel." - fi -} - -pkg_postrm() { - udev_reload -} diff --git a/files/zfs/3815.2.0/overlay/eclass/dist-kernel-utils.eclass b/files/zfs/3815.2.0/overlay/eclass/dist-kernel-utils.eclass deleted file mode 100644 index 6903183..0000000 --- a/files/zfs/3815.2.0/overlay/eclass/dist-kernel-utils.eclass +++ /dev/null @@ -1,201 +0,0 @@ -# Copyright 2020-2023 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -# @ECLASS: dist-kernel-utils.eclass -# @MAINTAINER: -# Distribution Kernel Project -# @AUTHOR: -# Michał Górny -# @SUPPORTED_EAPIS: 7 8 -# @BLURB: Utility functions related to Distribution Kernels -# @DESCRIPTION: -# This eclass provides various utility functions related to Distribution -# Kernels. - -# @ECLASS_VARIABLE: KERNEL_IUSE_SECUREBOOT -# @PRE_INHERIT -# @DEFAULT_UNSET -# @DESCRIPTION: -# If set to a non-null value, inherits secureboot.eclass -# and allows signing of generated kernel images. - -if [[ ! ${_DIST_KERNEL_UTILS} ]]; then - -case ${EAPI} in - 7|8) ;; - *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; -esac - -if [[ ${KERNEL_IUSE_SECUREBOOT} ]]; then - inherit secureboot -fi - -# @FUNCTION: dist-kernel_build_initramfs -# @USAGE: -# @DESCRIPTION: -# Build an initramfs for the kernel. specifies the absolute -# path where initramfs will be created, while specifies -# the kernel version, used to find modules. -# -# Note: while this function uses dracut at the moment, other initramfs -# variants may be supported in the future. -dist-kernel_build_initramfs() { - debug-print-function ${FUNCNAME} "${@}" - - [[ ${#} -eq 2 ]] || die "${FUNCNAME}: invalid arguments" - local output=${1} - local version=${2} - - local rel_image_path=$(dist-kernel_get_image_path) - local image=${output%/*}/${rel_image_path##*/} - - local args=( - --force - # if uefi=yes is used, dracut needs to locate the kernel image - --kernel-image "${image}" - - # positional arguments - "${output}" "${version}" - ) - - ebegin "Building initramfs via dracut" - dracut "${args[@]}" - eend ${?} || die -n "Building initramfs failed" -} - -# @FUNCTION: dist-kernel_get_image_path -# @DESCRIPTION: -# Get relative kernel image path specific to the current ${ARCH}. -dist-kernel_get_image_path() { - case ${ARCH} in - amd64|x86) - echo arch/x86/boot/bzImage - ;; - arm64) - echo arch/arm64/boot/Image.gz - ;; - arm) - echo arch/arm/boot/zImage - ;; - hppa|ppc|ppc64|sparc) - # https://www.kernel.org/doc/html/latest/powerpc/bootwrapper.html - # ./ is required because of ${image_path%/*} - # substitutions in the code - echo ./vmlinux - ;; - riscv) - echo arch/riscv/boot/Image.gz - ;; - *) - die "${FUNCNAME}: unsupported ARCH=${ARCH}" - ;; - esac -} - -# @FUNCTION: dist-kernel_install_kernel -# @USAGE: -# @DESCRIPTION: -# Install kernel using installkernel tool. specifies -# the kernel version, full path to the image, -# full path to System.map. -dist-kernel_install_kernel() { - debug-print-function ${FUNCNAME} "${@}" - - [[ ${#} -eq 3 ]] || die "${FUNCNAME}: invalid arguments" - local version=${1} - local image=${2} - local map=${3} - - # if dracut is used in uefi=yes mode, initrd will actually - # be a combined kernel+initramfs UEFI executable. we can easily - # recognize it by PE magic (vs cpio for a regular initramfs) - local initrd=${image%/*}/initrd - local magic - [[ -s ${initrd} ]] && read -n 2 magic < "${initrd}" - if [[ ${magic} == MZ ]]; then - einfo "Combined UEFI kernel+initramfs executable found" - # install the combined executable in place of kernel - image=${initrd%/*}/uki.efi - mv "${initrd}" "${image}" || die - # We moved the generated initrd, prevent dracut from running again - # https://github.com/dracutdevs/dracut/pull/2405 - shopt -s nullglob - local plugins=() - for file in "${EROOT}"/etc/kernel/install.d/*.install; do - plugins+=( "${file}" ) - done - for file in "${EROOT}"/usr/lib/kernel/install.d/*.install; do - if ! has "${file##*/}" 50-dracut.install 51-dracut-rescue.install "${plugins[@]##*/}"; then - plugins+=( "${file}" ) - fi - done - shopt -u nullglob - export KERNEL_INSTALL_PLUGINS="${KERNEL_INSTALL_PLUGINS} ${plugins[@]}" - fi - - if [[ ${KERNEL_IUSE_SECUREBOOT} ]]; then - # Kernel-install requires uki's are named uki.efi, sign in-place - secureboot_sign_efi_file "${image}" "${image}" - fi - - ebegin "Installing the kernel via installkernel" - # note: .config is taken relatively to System.map; - # initrd relatively to bzImage - installkernel "${version}" "${image}" "${map}" - eend ${?} || die -n "Installing the kernel failed" -} - -# @FUNCTION: dist-kernel_reinstall_initramfs -# @USAGE: -# @DESCRIPTION: -# Rebuild and install initramfs for the specified dist-kernel. -# is the kernel source directory (${KV_DIR} from linux-info), -# while is the full kernel version (${KV_FULL}). -# The function will determine whether is actually -# a dist-kernel, and whether initramfs was used. -# -# This function is to be used in pkg_postinst() of ebuilds installing -# kernel modules that are included in the initramfs. -dist-kernel_reinstall_initramfs() { - debug-print-function ${FUNCNAME} "${@}" - - [[ ${#} -eq 2 ]] || die "${FUNCNAME}: invalid arguments" - local kernel_dir=${1} - local ver=${2} - - local image_path=${kernel_dir}/$(dist-kernel_get_image_path) - local initramfs_path=${image_path%/*}/initrd - if [[ ! -f ${image_path} ]]; then - eerror "Kernel install missing, image not found:" - eerror " ${image_path}" - eerror "Initramfs will not be updated. Please reinstall your kernel." - return - fi - if [[ ! -f ${initramfs_path} && ! -f ${initramfs_path%/*}/uki.efi ]]; then - einfo "No initramfs or uki found at ${image_path}" - return - fi - - dist-kernel_build_initramfs "${initramfs_path}" "${ver}" - dist-kernel_install_kernel "${ver}" "${image_path}" \ - "${kernel_dir}/System.map" -} - -# @FUNCTION: dist-kernel_PV_to_KV -# @USAGE: -# @DESCRIPTION: -# Convert a Gentoo-style ebuild version to kernel "x.y.z[-rcN]" version. -dist-kernel_PV_to_KV() { - debug-print-function ${FUNCNAME} "${@}" - - [[ ${#} -ne 1 ]] && die "${FUNCNAME}: invalid arguments" - local pv=${1} - - local kv=${pv%%_*} - [[ -z $(ver_cut 3- "${kv}") ]] && kv+=".0" - [[ ${pv} == *_* ]] && kv+=-${pv#*_} - echo "${kv}" -} - -_DIST_KERNEL_UTILS=1 -fi diff --git a/files/zfs/3815.2.0/overlay/eclass/linux-mod-r1.eclass b/files/zfs/3815.2.0/overlay/eclass/linux-mod-r1.eclass deleted file mode 100644 index 8d384c2..0000000 --- a/files/zfs/3815.2.0/overlay/eclass/linux-mod-r1.eclass +++ /dev/null @@ -1,1280 +0,0 @@ -# Copyright 2023-2024 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -# @ECLASS: linux-mod-r1.eclass -# @MAINTAINER: -# Ionen Wolkens -# Gentoo Kernel project -# @AUTHOR: -# Ionen Wolkens -# @SUPPORTED_EAPIS: 8 -# @PROVIDES: linux-info -# @BLURB: Functions for installing out-of-tree Linux kernel modules -# @DESCRIPTION: -# See the linux-mod-r1_src_compile function documentation for in-depth -# usage, and see the example further down for a quick overview. -# -# @SUBSECTION linux-mod -> linux-mod-r1 migration notes -# 0. Define a src_compile if missing, local variables below go there. -# 1. MODULE_NAMES="name(libdir:srcdir:objdir)" -# BUILD_TARGETS="target" -# -> local modlist=( name=libdir:srcdir:objdir:target(s) ) -# - try without :target first, it is now almost always unnecessary -# - srcdir defaults to the current directory, and note that paths -# can be relative to that (should typically *not* pass ${S}) -# 2. BUILD_PARAMS and/or BUILD_FIXES -# -> local modargs=( VAR="${KV_OUT_DIR}" ... ) -# - CC/LD and similar are unneeded, always passed (V=1 too) -# - eval (aka eval "${BUILD_PARAMS}") is /not/ used for this anymore -# 3. s/linux-mod_/linux-mod-r1/g -# 4. _preinst+_postrm can be dropped, keep linux-mod-r1_pkg_postinst -# 5. linux-mod-r1_src_install now runs einstalldocs, adjust as needed -# 6. if *not* using linux-mod-r1_src_compile/install, then refer to -# the eclass' 2nd example and ensure using modules_post_process -# 7. If any, clang<->gcc switching custom workarounds can be dropped -# 8. See MODULES_KERNEL_MAX/_MIN if had or need kernel version checks. -# -# Not an exhaustive list, verify that no installed files are missing -# after. Look for "command not found" errors in the build log too. -# -# Revision bumps are not strictly needed to migrate unless want to -# keep the old as fallback for regressions, kernel upgrades or the -# new IUSE=+strip will typically cause rebuilds either way. -# -# @EXAMPLE: -# -# If source directory S had a layout such as: -# - Makefile (builds a gentoo.ko in current directory) -# - gamepad/Makefile (want to install to kernel/drivers/hid) -# - gamepad/obj/ (the built gamepad.ko ends up here) -# -# ...and the Makefile uses the NIH_SOURCE variable to find where the -# kernel build directory is (aka KV_OUT_DIR, see linux-info.eclass) -# -# then: -# -# @CODE -# CONFIG_CHECK="INPUT_FF_MEMLESS" # gamepad needs it to rumble -# MODULES_KERNEL_MIN=5.4 # needs features introduced in 5.4 -# -# src_compile() { -# local modlist=( -# gentoo -# gamepad=kernel/drivers/hid:gamepad:gamepad/obj -# ) -# local modargs=( NIH_SOURCE="${KV_OUT_DIR}" ) -# -# linux-mod-r1_src_compile -# } -# @CODE -# -# Alternatively, if using the package's build system directly is -# more convenient, a typical example could be: -# -# @CODE -# src_compile() { -# MODULES_MAKEARGS+=( -# NIH_KDIR="${KV_OUT_DIR}" -# NIH_KSRC="${KV_DIR}" -# ) -# -# emake "${MODULES_MAKEARGS[@]}" -# } -# -# src_install() { -# emake "${MODULES_MAKEARGS[@]}" DESTDIR="${ED}" install -# modules_post_process # strip->sign->compress -# -# einstalldocs -# } -# @CODE -# -# Some extra make variables may be of interest: -# - INSTALL_MOD_PATH: sometime used as DESTDIR -# - INSTALL_MOD_DIR: equivalent to linux_moduleinto -# -# MODULES_MAKEARGS is set by the eclass to handle toolchain and, -# when installing, also attempts to disable automatic stripping, -# compression, signing, and depmod to let the eclass handle it. -# -# linux_domodule can alternatively be used to install a single module. -# -# (remember to ensure that linux-mod-r1_pkg_postinst is ran for depmod) - -case ${EAPI} in - 8) ;; - *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; -esac - -if [[ ! ${_LINUX_MOD_R1_ECLASS} ]]; then -_LINUX_MOD_R1_ECLASS=1 - -inherit dist-kernel-utils edo linux-info multiprocessing toolchain-funcs - -IUSE="dist-kernel modules-compress modules-sign +strip ${MODULES_OPTIONAL_IUSE}" - -RDEPEND=" - sys-apps/kmod[tools] - dist-kernel? ( virtual/dist-kernel:= ) -" -DEPEND=" - virtual/linux-sources -" -BDEPEND=" - sys-apps/kmod[tools] - modules-sign? ( - dev-libs/openssl - virtual/pkgconfig - ) -" -IDEPEND=" - sys-apps/kmod[tools] -" - -if [[ -n ${MODULES_OPTIONAL_IUSE} ]]; then - : "${MODULES_OPTIONAL_IUSE#+}? ( | )" - RDEPEND=${_/|/${RDEPEND}} DEPEND=${_/|/${DEPEND}} \ - BDEPEND=${_/|/${BDEPEND}} IDEPEND=${_/|/${IDEPEND}} -fi - -# @ECLASS_VARIABLE: KERNEL_CHOST -# @USER_VARIABLE -# @DEFAULT_UNSET -# @DESCRIPTION: -# Can be set to the CHOST value to use when selecting the toolchain -# for building kernel modules. This is similar to setting the kernel -# build system's CROSS_COMPILE variable minus the trailing dash. -# -# If this does not auto-select the desired toolchain, finer control -# can be achieved by setting the not directly documented (but valid) -# variables: -# -# KERNEL_{CC,CXX,LD,AR,NM,OBJCOPY,OBJDUMP,READELF,STRIP} -# -# If in doubt, do not set any of this. -# -# Default if unset: auto-detection, typically same as the current CHOST - -# @ECLASS_VARIABLE: MODULES_EXTRA_EMAKE -# @USER_VARIABLE -# @DEFAULT_UNSET -# @DESCRIPTION: -# Extra arguments to pass to emake when building modules. -# Can contain arguments with quoted spaces, e.g. -# @CODE -# ..._EMAKE="KCFLAGS='-fzomg-optimize -fsuper-strict-aliasing' ..." -# @CODE - -# @ECLASS_VARIABLE: MODULES_I_WANT_FULL_CONTROL -# @USER_VARIABLE -# @DEFAULT_UNSET -# @DESCRIPTION: -# When set to a non-empty value, disables passing most of the eclass' -# toolchain defaults to emake when building modules. Basic eclass -# requirements, ebuilds' modargs, and users' MODULES_EXTRA_EMAKE are -# still used. -# -# Primarily intended for expert users with modified kernel Makefiles -# that want the Makefile's values to be used by default. -# -# May want to look at KERNEL_CHOST before considering this. - -# @ECLASS_VARIABLE: MODULES_SIGN_HASH -# @USER_VARIABLE -# @DEFAULT_UNSET -# @DESCRIPTION: -# Used with USE=modules-sign. Can be set to hash algorithm to use -# during signature generation. -# -# Rather than set this, it is recommended to select using the kernel's -# configuration to ensure proper support (e.g. CONFIG_MODULE_SIG_SHA256), -# and then it will be auto-detected here. -# -# Valid values: sha512,sha384,sha256,sha224,sha1 -# -# Default if unset: kernel CONFIG_MODULE_SIG_HASH's value - -# @ECLASS_VARIABLE: MODULES_SIGN_KEY -# @USER_VARIABLE -# @DEFAULT_UNSET -# @DESCRIPTION: -# Used with USE=modules-sign. Can be set to the path of the private -# key in PEM format to use, or a PKCS#11 URI. -# -# If path is relative (e.g. "certs/name.pem"), it is assumed to be -# relative to the kernel build directory being used. -# -# If the key requires a passphrase or PIN, the used kernel sign-file -# utility recognizes the KBUILD_SIGN_PIN environment variable. Be -# warned that the package manager may store this value in binary -# packages, database files, temporary files, and possibly logs. This -# eclass unsets the variable after use to mitigate the issue (notably -# for shared binary packages), but use this with care. -# -# Default if unset: kernel CONFIG_MODULE_SIG_KEY's value which itself -# defaults to certs/signing_key.pem - -# @ECLASS_VARIABLE: MODULES_SIGN_CERT -# @USER_VARIABLE -# @DESCRIPTION: -# Used with USE=modules-sign. Can be set to the path of the X.509 -# public key certificate to use. -# -# If path is relative (e.g. "certs/name.x509"), it is assumed to be -# relative to the kernel build directory being used. -: "${MODULES_SIGN_CERT:=certs/signing_key.x509}" - -# @ECLASS_VARIABLE: MODULES_KERNEL_MAX -# @DEFAULT_UNSET -# @DESCRIPTION: -# If set to a kernel version (format: 1, 1.2, or 1.2.3), will print a -# warning if the used version is greater than (ver_test -gt) to this -# value using the same amount of version components (i.e. MAX=1.2 -# allows 1.2.3, but MAX=1.2.2 does not). -# -# This should *only* be used for modules that are known to break -# frequently on kernel upgrades. If setting this to a non-LTS kernel, -# then should also take care to test and update this value regularly -# with new major kernel releases not to let the warning become stale -# and ignored by users. -# -# Not fatal to allow users to try or self-patch easily, but the (large) -# warning is difficult to miss. If need a fatal check for more serious -# issues (e.g. runtime filesystem corruption), please do it manually. -# -# This is intended to reduce the amount of bug reports for recurring -# expected issues that can be easily mitigated by using LTS kernels -# and waiting for new releases. -# -# If used, must be set before linux-mod-r1_pkg_setup is called. - -# @ECLASS_VARIABLE: MODULES_KERNEL_MIN -# @DEFAULT_UNSET -# @DESCRIPTION: -# If set to a kernel version (format: 1, 1.2, or 1.2.3), will abort if -# the used version is less than (ver_test -lt) this value. -# -# Should only be used if known broken, or if upstream recommends a sane -# minimum. Not particularly necessary for kernels that are no longer -# in the tree. -# -# If used, must be set before linux-mod-r1_pkg_setup is called. - -# @ECLASS_VARIABLE: MODULES_OPTIONAL_IUSE -# @PRE_INHERIT -# @DEFAULT_UNSET -# @DESCRIPTION: -# May contain a single flag to be added to IUSE optionally prefixed -# with a + sign to enable it by default. Doing so makes *all* of -# linux-mod-r1's functions and dependencies a no-op unless the flag -# is enabled. This includes phases, e.g. linux-mod-r1_pkg_setup will -# not process CONFIG_CHECK unless the flag is set. -# -# The typical recommended value is "+modules" (global IUSE). -# -# Note that modules being optional can be useful even if user space -# tools require them (e.g. installing in a chroot or prefix when the -# modules are loaded on the host, saves setting up linux sources). -# However, if tools are non-trivial to build, it may be preferable -# to split into two packages than use this variable due to requiring -# rebuilds every kernel upgrades. - -# @ECLASS_VARIABLE: MODULES_MAKEARGS -# @OUTPUT_VARIABLE -# @DESCRIPTION: -# Will be set after linux-mod-r1_pkg_setup has been called. Contains -# arguments that should be passed to emake when building or installing -# modules. -# -# Modifying this variable is acceptable (e.g. to append kernel source -# arguments) but, if using linux-mod-r1_src_compile, setting modargs -# is the intended method seen as cleaner and less error-prone. - -# @FUNCTION: linux-mod-r1_pkg_setup -# @DESCRIPTION: -# Required before using other functions from this eclass, and will: -# 1. run linux-info_pkg_setup (see linux-info.eclass) -# -> implies processing CONFIG_CHECK, and providing KV_ variables -# (MODULES and TRIM_UNUSED_KSYMS are always checked) -# 2. prepare toolchain to match the kernel -# -> sets KERNEL_{CHOST,CC,CXX,LD,AR,NM,OBJCOPY,OBJDUMP,READELF,STRIP} -# -> also sets MODULES_MAKEARGS array with, e.g. CC="${KERNEL_CC}" -# (normally these should not be used directly, for custom builds) -# 3. perform various sanity checks to fail early on issues -linux-mod-r1_pkg_setup() { - debug-print-function ${FUNCNAME[0]} "${@}" - [[ ${MERGE_TYPE} != binary ]] || return 0 - _MODULES_GLOBAL[ran:pkg_setup]=1 - _modules_check_function ${#} 0 0 || return 0 - _modules_check_migration - - _modules_prepare_kernel - _modules_prepare_sign - _modules_prepare_toolchain - - _modules_set_makeargs - - _modules_sanity_gccplugins -} - -# @FUNCTION: linux-mod-r1_src_compile -# @DESCRIPTION: -# Builds modules, see the eclass' example for a quick overview. -# Uses the variables modlist and modargs as described below: -# -# * local modlist=( ... ) - list of modules to build, set as: -# -# module-name=install-dir:source-dir:build-dir:make-target -# -# > module-name: Resulting name, aka .ko (required). -# -# > install-dir: Kernel modules sub-directory to install the module -# to (/lib/modules/version//name.ko). Will be used when -# run linux-mod-r1_src_install. May want to consider the values of -# INSTALL_MOD_DIR(Makefile) or DEST_MODULE_LOCATION(dkms.conf) if it -# exists, but it can be anything. -# -> Default: extra -# -# Warning: Changing this location may leave stale modules until a -# kernel upgrade as the package manager does not typically delete -# old modules and only does overwrite on rebuilds. -# -# > source-dir: Directory containing the Makefile to build the module. -# Path can be relative to the current directory or absolute. -# -> Default: current directory -# -# > build-dir: Directory that will hold the built module-name.ko. -# -> Default: same as source-dir's value -# -# > make-target: Almost always unneeded but, if defaults are not right, -# then can specify the Makefile's target(s) to build the module/extras. -# Multiple targets can be used with spaces, e.g. :"first second". -# -> Default: specially tries modules, module, .ko, default, -# all, empty target, and runs the first found usable -# -# Missing elements results in defaults being used, e.g. this is valid: -# modlist=( name1 name2=:source name3=install::build ) -# -# * local modargs=( ... ) - extra arguments to pass to emake -# -# Makefile should notably be inspected for which variable it uses -# to find the kernel's build directory then, e.g. KDIR="${KV_OUT_DIR}" -# as appropriate. Note that typically want to pass KV_OUT_DIR(build) -# rather than KV_DIR(sources) if not both. This allows users to do -# out-of-source kernel builds and still build modules. -# -# Passing common toolchain variables such as CC or LD is not needed -# here as they are passed by default. -# -# --- -# -# Allowed to be called multiple times with a different modlist if need -# different make arguments per modules or intermediate steps -- albeit, -# if atypical, may want to build manually (see eclass' example). -linux-mod-r1_src_compile() { - debug-print-function ${FUNCNAME[0]} "${@}" - _modules_check_function ${#} 0 0 || return 0 - - [[ ${modlist@a} == *a* && ${#modlist[@]} -gt 0 ]] || - die "${FUNCNAME[0]} was called without a 'modlist' array" - - # run this again to verify built files access with src_compile's user - _modules_sanity_kernelbuilt - - local -a emakeargs=( "${MODULES_MAKEARGS[@]}" ) - [[ ${modargs@a} == *a* ]] && emakeargs+=( "${modargs[@]}" ) - - local -A built=() - local build mod name target - for mod in "${modlist[@]}"; do - # note modlist was not made an associative array ([name]=) to preserve - # ordering, but is still using = to improve readability - name=${mod%%=*} - [[ -n ${name} && ${name} != *:* ]] || die "invalid mod entry '${mod}'" - - # 0:install-dir 1:source-dir 2:build-dir 3:make-target(s) - mod=${mod#"${name}"} - IFS=: read -ra mod <<<"${mod#=}" - [[ ${#mod[@]} -le 4 ]] || die "too many ':' in ${name}'s modlist" - - [[ ${mod[1]:=${PWD}} != /* ]] && mod[1]=${PWD}/${mod[1]} - [[ ${mod[2]:=${mod[1]}} != /* ]] && mod[2]=${PWD}/${mod[2]} - _MODULES_INSTALL[${mod[2]}/${name}.ko]=${mod[0]:-extra} - - pushd "${mod[1]}" >/dev/null || die - - if [[ -z ${mod[3]} ]]; then - # guess between commonly used targets if none given, fallback to - # an empty target without trying to see the error output - for target in module{s,} "${name}".ko default all; do - nonfatal emake "${emakeargs[@]}" -q "${target}" &>/dev/null - if [[ ${?} -eq 1 ]]; then - mod[3]=${target} - break - fi - done - fi - - # sometime modules are all from same source dir and built all at once, - # make will not rebuild either way but can skip the unnecessary noise - build= - for target in ${mod[3]:-&}; do - if ! has "${target}" ${built[${mod[1]}]}; then - build=1 - built[${mod[1]}]+=" ${target} " - fi - done - - if [[ ${build} ]]; then - einfo "Building ${name} module in ${mod[1]} ..." - - # allow word splitting for rare cases of multiple targets - emake "${emakeargs[@]}" ${mod[3]} - else - einfo "Building ${name} module in ${mod[1]} ... already done." - fi - - popd >/dev/null || die - done -} - -# @FUNCTION: linux-mod-r1_src_install -# @DESCRIPTION: -# Installs modules built by linux-mod-r1_src_compile using -# linux_domodule, then runs modules_post_process and einstalldocs. -linux-mod-r1_src_install() { - debug-print-function ${FUNCNAME[0]} "${@}" - _modules_check_function ${#} 0 0 || return 0 - - (( ${#_MODULES_INSTALL[@]} )) || - die "${FUNCNAME[0]} was called without running linux-mod-r1_src_compile" - - ( - for mod in "${!_MODULES_INSTALL[@]}"; do - linux_moduleinto "${_MODULES_INSTALL[${mod}]}" - linux_domodule "${mod}" - done - ) - - modules_post_process - - einstalldocs -} - -# @FUNCTION: linux-mod-r1_pkg_postinst -# @DESCRIPTION: -# Updates module dependencies using depmod. -linux-mod-r1_pkg_postinst() { - debug-print-function ${FUNCNAME[0]} "${@}" - _modules_check_function ${#} 0 0 || return 0 - - dist-kernel_compressed_module_cleanup "${EROOT}/lib/modules/${KV_FULL}" - _modules_update_depmod - - # post_process ensures modules were installed and that the eclass' USE - # are likely not no-ops (unfortunately postinst itself may be missed) - [[ -v _MODULES_GLOBAL[ran:post_process] ]] || - eqawarn "QA Notice: neither linux-mod-r1_src_install nor modules_post_process were used" -} - -# @FUNCTION: linux_domodule -# @USAGE: ... -# @DESCRIPTION: -# Installs Linux modules (.ko files). -# -# See also linux_moduleinto. -linux_domodule() { - debug-print-function ${FUNCNAME[0]} "${@}" - _modules_check_function ${#} 1 '' "..." || return 0 - ( - # linux-mod-r0 formerly supported INSTALL_MOD_PATH (bug #642240), but - # this been judged messy to integrate consistently as not everything - # uses this function and build systems sometime mix it with DESTDIR - # (try ROOT if need to install somewhere else instead) - insinto "/lib/modules/${KV_FULL}/${_MODULES_GLOBAL[moduleinto]:-extra}" - doins "${@}" - ) -} - -# @FUNCTION: linux_moduleinto -# @USAGE: -# @DESCRIPTION: -# Directory to install modules into when calling linux_domodule. -# Relative to kernel modules path as in: -# ${ED}/lib/modules/${KV_FULL}/ -# -# Can contain subdirectories, e.g. kernel/fs. -# -# If not called, defaults to "extra". On the kernel build system, -# this is like setting INSTALL_MOD_DIR which has the same default -# for external modules. -linux_moduleinto() { - debug-print-function ${FUNCNAME[0]} "${@}" - _modules_check_function ${#} 1 1 "" || return 0 - _MODULES_GLOBAL[moduleinto]=${1} -} - -# @FUNCTION: modules_post_process -# @USAGE: [] -# @DESCRIPTION: -# Strip, sign, verify, and compress all .ko modules found under -# . Should typically *not* be called directly as it will -# be run by linux-mod-r1_src_install. This is intended for use -# when modules were installed some other way. -# -# should exist under ${ED}. -# Defaults to /lib/modules/${KV_FULL}. -# -# Filenames may change due to compression, so any operations on -# these should be performed prior. -# -# Warning: This will abort if no modules are found, which can happen -# if modules were unexpectedly pre-compressed possibly due to using -# make install without passing MODULES_MAKEARGS to disable it. -modules_post_process() { - debug-print-function ${FUNCNAME[0]} "${@}" - _modules_check_function ${#} 0 1 '[]' || return 0 - [[ ${EBUILD_PHASE} == install ]] || - die "${FUNCNAME[0]} can only be called in the src_install phase" - - local path=${ED}${1-/lib/modules/${KV_FULL}} - local -a mods - [[ -d ${path} ]] && mapfile -td '' mods < <( - find "${path}" -type f -name '*.ko' -print0 || die - ) - (( ${#mods[@]} )) || - die "${FUNCNAME[0]} was called with no installed modules under ${path}" - - # TODO?: find way for sane use with dracut (its 90kernel-modules-extra - # parses depmod.d files directly and assumes should include its modules - # which can lead to unnecessarily increased size or stale modules) -# _modules_process_depmod.d "${mods[@]#"${path}/"}" - - _modules_process_strip "${mods[@]}" - _modules_process_sign "${mods[@]}" - _modules_sanity_modversion "${mods[@]}" # after strip/sign in case broke it - _modules_process_compress "${mods[@]}" - - _MODULES_GLOBAL[ran:post_process]=1 -} - -# @ECLASS_VARIABLE: _MODULES_GLOBAL -# @INTERNAL -# @DESCRIPTION: -# General use associative array to avoid defining separate globals. -declare -gA _MODULES_GLOBAL=() - -# @ECLASS_VARIABLE: _MODULES_INSTALL -# @INTERNAL -# @DESCRIPTION: -# List of modules from linux-mod-r1_src_compile to be installed. -declare -gA _MODULES_INSTALL=() - -# @FUNCTION: _modules_check_function -# @USAGE: [ []] -# @RETURN: 0 or 1 if caller should do nothing -# @INTERNAL -# @DESCRIPTION: -# Checks for MODULES_OPTIONAL_IUSE, and aborts if amount of arguments -# does not add up or if it was called before linux-mod-r1_pkg_setup. -_modules_check_function() { - [[ -z ${MODULES_OPTIONAL_IUSE} ]] || - use "${MODULES_OPTIONAL_IUSE#+}" || return 1 - - [[ ${#} == 0 || ${1} -ge ${2} && ( ! ${3} || ${1} -le ${3} ) ]] || - die "Usage: ${FUNCNAME[1]} ${4-(no arguments)}" - - [[ -v _MODULES_GLOBAL[ran:pkg_setup] ]] || - die "${FUNCNAME[1]} was called without running linux-mod-r1_pkg_setup" -} - -# @FUNCTION: _modules_check_migration -# @INTERNAL -# @DESCRIPTION: -# Aborts if see obsolete variables from the linux-mod-r0 eclass being -# used, likely due to an incomplete migration. This function should -# eventually be removed after linux-mod-r0 is @DEAD not to fail for -# nothing if users happen to have these in their environment given the -# naming for some is a bit generic. -_modules_check_migration() { - _modules_check_var() { - [[ -z ${!1} ]] || - die "${1} is obsolete, see ${2} in linux-mod-r1 eclass docs" - } - # the 'I' on this one is notably sneaky and could silently be ignored - _modules_check_var MODULES_OPTIONAL_USE MODULES_OPTIONAL_IUSE - _modules_check_var MODULES_OPTIONAL_USE_IUSE_DEFAULT MODULES_OPTIONAL_IUSE - _modules_check_var BUILD_PARAMS modargs - _modules_check_var BUILD_TARGETS modlist - _modules_check_var MODULE_NAMES modlist - [[ -z ${!MODULESD_*} ]] || - die "MODULESD_* variables are no longer supported, replace by handcrafted .conf files if needed" - - # Ignored variables: - # - BUILD_FIXES: seen in some ebuilds but was undocumented and linux-info - # still sets it preventing from blocking it entirely - # - ECONF_PARAMS: documented but was a no-op in linux-mod too -} - -# @FUNCTION: _modules_prepare_kernel -# @INTERNAL -# @DESCRIPTION: -# Handles linux-info bits to provide usable sources, KV_ variables, -# and CONFIG_CHECK use. -_modules_prepare_kernel() { - get_version - - # linux-info allows skipping checks if SKIP_KERNEL_CHECK is set and - # then require_configured_kernel will not abort, but no sources means - # 100% failure for building modules and so just abort now (the proper - # way to allow skipping sources here is MODULES_OPTIONAL_IUSE) - [[ -n ${KV_FULL} ]] || - die "kernel sources are required to build kernel modules" - - require_configured_kernel - - _modules_sanity_kernelbuilt - _modules_sanity_kernelversion - - # note: modules-specific check_modules_supported could probably be - # removed from linux-info in the future as this is a sufficient check - local CONFIG_CHECK="${CONFIG_CHECK} MODULES" - - # kernel will not typically know about symbols we use (bug #591832), - # but stay non-fatal if kernel has an exception list set (bug #759238) - # note: possible to bypass either way with CHECKCONFIG_DONOTHING=1 - if [[ $(linux_chkconfig_string UNUSED_KSYMS_WHITELIST) == \"+(?)\" ]]; then - CONFIG_CHECK+=" ~!TRIM_UNUSED_KSYMS" - else - CONFIG_CHECK+=" !TRIM_UNUSED_KSYMS" - fi - - linux-info_pkg_setup - - if use dist-kernel && - ! has_version "~virtual/dist-kernel-${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}" - then - ewarn - ewarn "The kernel modules in ${CATEGORY}/${PN} are being built for" - ewarn "kernel version ${KV_FULL}. But this does not match the" - ewarn "installed version of virtual/dist-kernel." - ewarn - ewarn "If this is not intentional, the problem may be corrected by" - ewarn "using \"eselect kernel\" to set the default kernel version to" - ewarn "the same version as the installed version of virtual/dist-kernel." - ewarn - ewarn "If the distribution kernel is being downgraded, ensure that" - ewarn "virtual/dist-kernel is also downgraded to the same version" - ewarn "before rebuilding external kernel modules." - ewarn - fi -} - -# @FUNCTION: _modules_prepare_sign -# @INTERNAL -# @DESCRIPTION: -# Determines arguments to pass to sign-file (hash/keys), and performs -# basic sanity checks to abort early if signing does not look possible. -_modules_prepare_sign() { - use modules-sign || return 0 - - _modules_sign_die() { - eerror "USE=modules-sign requires additional configuration, please see the" - eerror "kernel[1] documentation and the linux-mod-r1 eclass[2] user variables." - eerror "[1] https://www.kernel.org/doc/html/v${KV_MAJOR}.${KV_MINOR}/admin-guide/module-signing.html" - eerror "[2] https://devmanual.gentoo.org/eclass-reference/linux-mod-r1.eclass/index.html" - die "USE=modules-sign is set but ${*}" - } - - linux_chkconfig_present MODULE_SIG || - _modules_sign_die "CONFIG_MODULE_SIG is not set in the kernel" - - if [[ -z ${MODULES_SIGN_HASH} ]]; then - : "$(linux_chkconfig_string MODULE_SIG_HASH)" - MODULES_SIGN_HASH=${_//\"} - [[ -n ${MODULES_SIGN_HASH} ]] || - _modules_sign_die "CONFIG_MODULE_SIG_HASH is not set in the kernel" - fi - - if [[ -z ${MODULES_SIGN_KEY} ]]; then - : "$(linux_chkconfig_string MODULE_SIG_KEY)" - MODULES_SIGN_KEY=${_//\"} - [[ -n ${MODULES_SIGN_KEY} ]] || - _modules_sign_die "CONFIG_MODULE_SIG_KEY is not set in the kernel" - fi - - [[ ${MODULES_SIGN_KEY} != @(/|pkcs11:)* ]] && - MODULES_SIGN_KEY=${KV_OUT_DIR}/${MODULES_SIGN_KEY} - [[ ${MODULES_SIGN_CERT} != /* ]] && - MODULES_SIGN_CERT=${KV_OUT_DIR}/${MODULES_SIGN_CERT} - - # assumes users know what they are doing if using a pkcs11 URI - [[ ${MODULES_SIGN_KEY} == pkcs11:* || -f ${MODULES_SIGN_KEY} ]] || - _modules_sign_die "the private key '${MODULES_SIGN_KEY}' was not found" - [[ -f ${MODULES_SIGN_CERT} ]] || - _modules_sign_die "the public key certificate '${MODULES_SIGN_CERT}' was not found" -} - -# @FUNCTION: _modules_prepare_toolchain -# @INTERNAL -# @DESCRIPTION: -# Sets KERNEL_{CC,CXX,LD,AR,NM,OBJCOPY,OBJDUMP,READELF,STRIP} based on -# the kernel configuration and KERNEL_CHOST (also set if missing) that -# *should* be usable to build modules. -# -# Tries to match compiler type (gcc or clang), and major version. Will -# inform if matching was not possible likely due to the compiler being -# uninstalled. Users can set KERNEL_ variables themselves to override. -# -# These variables are normally manipulated by the kernel's LLVM=1 with -# the exception of CXX that is included anyway given *some* out-of-tree -# modules use it, e.g. nvidia-drivers[kernel-open]. -_modules_prepare_toolchain() { - # note that the kernel adds -m32/-m64/-m elf_x86_64/etc... for, e.g. - # toolchains defaulting to x32, but may need automagic here if need - # a different toolchain such as sys-devel/kgcc64 - [[ -z ${KERNEL_CHOST} ]] && linux_chkconfig_present 64BIT && - case ${CHOST} in - # matching kernel-build.eclass, see for details - hppa2.0-*) KERNEL_CHOST=${CHOST/2.0/64};; - esac - - # recognizing KERNEL_CHOST given CROSS_COMPILE seems too generic here, - # but should rarely be necessary unless different userland and kernel - : "${KERNEL_CHOST:=${CHOST}}" - - einfo "Preparing ${KERNEL_CHOST} toolchain for kernel modules (override with KERNEL_CHOST) ..." - - _modules_tc_best() { - [[ -z ${!1} ]] && read -r ${1} < <(type -P -- "${@:2}") - } - - local gccv clangv tool - if linux_chkconfig_present CC_IS_GCC; then - gccv=$(linux_chkconfig_string GCC_VERSION) - gccv=${gccv::2} # major version, will break on gcc-100... - # chost-gcc-ver > chost-gcc > gcc-ver > gcc - _modules_tc_best KERNEL_CC {"${KERNEL_CHOST}-",}gcc{"-${gccv}",} - _modules_tc_best KERNEL_CXX {"${KERNEL_CHOST}-",}g++{"-${gccv}",} - # unknown what was used exactly here, but prefer non-llvm with gcc - for tool in AR NM OBJCOPY OBJDUMP READELF STRIP; do - _modules_tc_best KERNEL_${tool} \ - {"${KERNEL_CHOST}-",}{gcc-,}${tool,,} - done - elif linux_chkconfig_present CC_IS_CLANG; then - clangv=$(linux_chkconfig_string CLANG_VERSION) - clangv=${clangv::2} - # like gcc, but try directories to get same version on all tools - # (not using get_llvm_prefix to avoid conflicts with ebuilds using - # llvm slots for non-modules reasons, e.g. sets llvm_check_deps) - _modules_tc_best KERNEL_CC \ - {"${BROOT}/usr/lib/llvm/${clangv}/bin/",}{"${KERNEL_CHOST}-",}clang{"-${clangv}",} - _modules_tc_best KERNEL_CXX \ - {"${BROOT}/usr/lib/llvm/${clangv}/bin/",}{"${KERNEL_CHOST}-",}clang++{"-${clangv}",} - for tool in AR NM OBJCOPY OBJDUMP READELF STRIP; do - _modules_tc_best KERNEL_${tool} \ - {"${BROOT}/usr/lib/llvm/${clangv}/bin/",}{"${KERNEL_CHOST}-",}{llvm-,}${tool,,} - done - fi - - if linux_chkconfig_present LD_IS_BFD; then - _modules_tc_best KERNEL_LD {"${KERNEL_CHOST}-",}ld.bfd - elif linux_chkconfig_present LD_IS_LLD; then - # also match with clang if it was used - _modules_tc_best KERNEL_LD \ - {${clangv+"${BROOT}/usr/lib/llvm/${clangv}/bin/"},}{"${KERNEL_CHOST}-",}ld.lld - fi - - # if any variables are still empty, fallback to normal defaults - local CHOST=${KERNEL_CHOST} - : "${KERNEL_CC:=$(tc-getCC)}" - : "${KERNEL_CXX:=$(tc-getCXX)}" - : "${KERNEL_LD:=$(tc-getLD)}" - : "${KERNEL_AR:=$(tc-getAR)}" - : "${KERNEL_NM:=$(tc-getNM)}" - : "${KERNEL_OBJCOPY:=$(tc-getOBJCOPY)}" - : "${KERNEL_OBJDUMP:=$(tc-getOBJDUMP)}" - : "${KERNEL_READELF:=$(tc-getREADELF)}" - : "${KERNEL_STRIP:=$(tc-getSTRIP)}" - - # for toolchain-funcs, uses CPP > CC but set both not to make assumptions - local CC=${KERNEL_CC} CPP="${KERNEL_CC} -E" LD=${KERNEL_LD} - - # show results, skip line wrap to avoid standing out too much - einfo "Toolchain picked for kernel modules (override with KERNEL_CC, _LD, ...):"\ - "'${KERNEL_CC}' '${KERNEL_CXX}' '${KERNEL_LD}' '${KERNEL_AR}'"\ - "'${KERNEL_NM}' '${KERNEL_OBJCOPY}' '${KERNEL_OBJDUMP}'"\ - "'${KERNEL_READELF}' '${KERNEL_STRIP}'" - - # hack: kernel adds --thinlto-cache-dir to KBUILD_LDFLAGS with ThinLTO - # resulting in sandbox violations and we cannot safely override that - # variable, using *both* {LDFLAGS_MODULE,ldflags-y}=--thinlto-cache-dir= - # can work but raises concerns about breaking packages that may use these - if linux_chkconfig_present LTO_CLANG_THIN && tc-ld-is-lld; then - KERNEL_LD=${T}/linux-mod-r1_ld.lld - printf '#!/usr/bin/env sh\nexec %s "${@}" --thinlto-cache-dir=\n' \ - "${LD}" > "${KERNEL_LD}" || die - chmod +x -- "${KERNEL_LD}" || die - fi - - # warn if final picked CC type or major version is mismatching, arguably - # should be fatal but not forcing given it is not *always* an issue - local warn - if [[ -v gccv ]]; then - if ! tc-is-gcc; then - warn="gcc-${gccv} but\n '${KERNEL_CC}' is not gcc" - elif [[ $(gcc-major-version) -ne "${gccv}" ]]; then - warn="gcc-${gccv} but\n '${KERNEL_CC}' is gcc-$(gcc-major-version)" - fi - elif [[ -v clangv ]]; then - if ! tc-is-clang; then - warn="clang-${clangv} but\n '${KERNEL_CC}' is not clang" - elif [[ $(clang-major-version) -ne "${clangv}" ]]; then - warn="clang-${clangv} but\n '${KERNEL_CC}' is clang-$(clang-major-version)" - fi - fi - - if [[ -v warn ]]; then - ewarn - ewarn "Warning: kernel ${KV_FULL} is built with ${warn}" - ewarn "This *could* result in build issues or other incompatibilities." - ewarn "It is recommended to either \`make clean\` and rebuild the kernel" - ewarn "with the current toolchain (for distribution kernels, re-installing" - ewarn "will do the same), or set the KERNEL_CC variable to point to the" - ewarn "same compiler. Note that when it is available, auto-selection is" - ewarn "attempted making the latter rarely needed." - ewarn - fi -} - -# @FUNCTION: _modules_process_compress -# @USAGE: ... -# @INTERNAL -# @DESCRIPTION: -# If enabled in the kernel configuration, this compresses the given -# modules using the same format. -_modules_process_compress() { - use modules-compress || return - - local -a compress - if linux_chkconfig_present MODULE_COMPRESS_XZ; then - compress=( - xz -q - --memlimit-compress=50% - --threads="$(makeopts_jobs)" - # match options from kernel's Makefile.modinst (bug #920837) - --check=crc32 - --lzma2=dict=1MiB - ) - elif linux_chkconfig_present MODULE_COMPRESS_GZIP; then - if type -P pigz &>/dev/null; then - compress=(pigz -p"$(makeopts_jobs)") - else - compress=(gzip) - fi - elif linux_chkconfig_present MODULE_COMPRESS_ZSTD; then - compress=(zstd -qT"$(makeopts_jobs)" --rm) - else - die "USE=modules-compress enabled but no MODULE_COMPRESS* configured" - fi - - # could fail, assumes have commands that were needed for the kernel - einfo "Compressing modules (matching the kernel configuration) ..." - edob "${compress[@]}" -- "${@}" -} - -# @FUNCTION: _modules_process_depmod.d -# @USAGE: ... -# @INTERNAL -# @DESCRIPTION: -# Generate a depmod.d file to ensure priority if duplicate modules -# exist, such as stale modules in different directories, or to -# override the kernel's own modules. -_modules_process_depmod.d() { - ( - [[ ${SLOT%/*} == 0 ]] && slot= || slot=-${SLOT%/*} - insinto /lib/depmod.d - newins - ${PN}${slot}.conf < <( - echo "# Automatically generated by linux-mod-r1.eclass for ${CATEGORY}/${PN}" - for mod; do - [[ ${mod} =~ ^(.+)/(.+).ko$ ]] && - echo "override ${BASH_REMATCH[2]} ${KV_FULL} ${BASH_REMATCH[1]}" - done - ) - ) -} - -# @FUNCTION: _modules_process_sign -# @USAGE: ... -# @INTERNAL -# @DESCRIPTION: -# Cryptographically signs the given modules when USE=modules-sign is -# enabled. -_modules_process_sign() { - use modules-sign || return 0 - - # scripts/sign-file used to be a perl script but is now written in C, - # and it could either be missing or broken given it links with openssl - # (no subslot rebuilds on kernel sources), trivial to compile regardless - local sign= - if [[ -f ${KV_DIR}/scripts/sign-file.c ]]; then - sign=${T}/linux-mod-r1_sign-file - ( - # unfortunately using the kernel's Makefile is inconvenient (no - # simple build target for this), may need revisiting on changes - einfo "Compiling sign-file ..." - tc-export_build_env - nonfatal edob $(tc-getBUILD_CC) ${BUILD_CFLAGS} ${BUILD_CPPFLAGS} \ - $($(tc-getBUILD_PKG_CONFIG) --cflags libcrypto) \ - ${BUILD_LDFLAGS} -o "${sign}" "${KV_DIR}"/scripts/sign-file.c \ - $($(tc-getBUILD_PKG_CONFIG) --libs libcrypto || echo -lcrypto) - ) || { - einfo "Trying fallback ..." - sign= - } - fi - - if [[ -z ${sign} ]]; then - if [[ -x ${KV_OUT_DIR}/scripts/sign-file ]]; then - sign=${KV_OUT_DIR}/scripts/sign-file # try if built - elif [[ -x ${KV_DIR}/scripts/sign-file ]]; then - sign=${KV_DIR}/scripts/sign-file # old kernel (... -# @INTERNAL -# @DESCRIPTION: -# Strips the given modules of unneeded symbols when USE=strip is -# enabled, and informs the package manager not to regardless. -_modules_process_strip() { - # letting the package manager handle this complicates scenarios - # where we want to either compress the pre-stripped module, or - # sign the module without its signature becoming invalid on merge - dostrip -x "${@#"${ED}"}" - - if use strip; then - einfo "Stripping modules ..." - edob "${KERNEL_STRIP}" --strip-unneeded -- "${@}" - fi -} - -# @FUNCTION: _modules_sanity_gccplugins -# @INTERNAL -# @DESCRIPTION: -# Performs a basic build test to detect GCC plugins mismatch issues -# and, if so, aborts with explanation given it often confuses users. -# -# Using mismatching gcc can sometime work to build modules, but if -# GCC plugins are enabled it will almost always be an error. -# -# Note: may need occasional review to ensure the test still works by: -# enabling a GCC plugin in the kernel, building with older GCC, -# then building a module by setting KERNEL_CC=gcc-. -_modules_sanity_gccplugins() { - linux_chkconfig_present GCC_PLUGINS || return 0 - - local tmp=${T}/linux-mod-r1_gccplugins - mkdir -p -- "${tmp}" || die - - echo "obj-m += test.o" > "${tmp}"/Kbuild || die - :> "${tmp}"/test.c || die - - # always fails, but interested in the stderr messages - local output=$( - cd -- "${KV_OUT_DIR}" && # fwiw skip non-POSIX -C in eclasses - LC_ALL=C nonfatal emake "${MODULES_MAKEARGS[@]}" M="${tmp}" \ - 2>&1 >/dev/null - ) - - if [[ ${output} == *"error: incompatible gcc/plugin version"* ]]; then - eerror "GCC_PLUGINS is enabled in the kernel and plugin version mismatch issues" - eerror "have been detected. Please \`make clean\` and rebuild the kernel using" - eerror "the current version of GCC (or re-install for distribution kernels)." - die "kernel ${KV_FULL} needs to be rebuilt" - fi -} - -# @FUNCTION: _modules_sanity_kernelbuilt -# @INTERNAL -# @DESCRIPTION: -# Checks if the kernel seems fully built by having a Module.symvers -# that is also readable, abort otherwise. -# -# About readability, occasionally users build their kernel as root with -# umask 0077 and then the package manager's user cannot read built files -# leaving them confused. -# -# Given user and access can very between phases (notably src_compile), -# it makes sense to run this check more than once. -# -# Note: -# This is an alternate version of linux-info's check_kernel_built -# which probably will not need to exist there if linux-mod-r0 is -# gone, error it gives is also modules-specific and fits better here. -# -# The old check_kernel_built checks version.h and suggests running -# modules_prepare if missing, but that does not create Module.symvers. -# Nowadays the kernel makes unresolved symbols fatal by default -# meaning that all modules will fail unless KBUILD_MODPOST_WARN=1 -# which seem questionable to support. So rather than version.h, this -# checks and require Module.symvers, and suggests a full build if -# missing (if really must, users can bypass by touching the file). -# nvidia-drivers (for one) further checks this file directly to do -# configure tests that will break badly without. -_modules_sanity_kernelbuilt() { - local symvers=${KV_OUT_DIR}/Module.symvers - - if [[ ! -f ${symvers} ]]; then - eerror "'${symvers}' was not found implying that the" - eerror "linux-${KV_FULL} tree at that location has not been built." - eerror - eerror "Please verify that this is the intended kernel version, then perform" - eerror "a full build[1] (i.e. make && make modules_install && make install)." - eerror - eerror "Alternatively, consider a distribution kernel[2] that does not need" - eerror "these manual steps (e.g. sys-kernel/gentoo-kernel or gentoo-kernel-bin)." - eerror - eerror "[1] https://wiki.gentoo.org/wiki/Kernel/Configuration#Build" - eerror "[2] https://wiki.gentoo.org/wiki/Project:Distribution_Kernel" - die "built kernel sources are required to build kernel modules" - fi - - if [[ ! -r ${symvers} ]]; then - eerror "'${symvers}' exists but cannot be read by the" - eerror "user id(${EUID}) of the package manager, likely implying no world" - eerror "read access permissions:" - eerror - eerror " $(ls -l -- "${symvers}")" - eerror - eerror "Causes may vary, but a common one is building the kernel with a umask" - eerror "value of '0077' rather than the more typical '0022' (run the \`umask\`" - eerror "command to confirm, as root if was building the kernel using it)." - eerror - eerror "Many other files are likely affected and will lead to build failures." - eerror "It is recommended to clean the sources and rebuild with \`umask 0022\`" - eerror "rather than attempt to fix the permissions manually." - die "no read access permission to the generated kernel files" - fi -} - -# @FUNCTION: _modules_sanity_kernelversion -# @INTERNAL -# @DESCRIPTION: -# Prints a warning if the kernel version is greater than to -# MODULES_KERNEL_MAX (while only considering same amount of version -# components), or aborts if it is less than MODULES_KERNEL_MIN -_modules_sanity_kernelversion() { - local kv=${KV_MAJOR}.${KV_MINOR}.${KV_PATCH} - - if [[ -n ${MODULES_KERNEL_MIN} ]] && - ver_test "${kv}" -lt "${MODULES_KERNEL_MIN}" - then - eerror "${P} requires a kernel version of at least >=${MODULES_KERNEL_MIN}," - eerror "but the current kernel is ${KV_FULL}. Please update." - die "kernel ${KV_FULL} is too old" - fi - - if [[ -n ${MODULES_KERNEL_MAX} ]]; then - : "${MODULES_KERNEL_MAX//[^.]/}" - local -i count=${#_} - - if ver_test "$(ver_cut 1-$((count+1)) "${kv}")" \ - -gt "${MODULES_KERNEL_MAX}" - then - # add .x to 1 missing component to make, e.g. <=1.2.x more natural, - # not <1.3 given users sometimes see it as 1.3 support at a glance - local max=${MODULES_KERNEL_MAX} - [[ ${count} -lt 2 ]] && max+=.x - - ewarn - ewarn " *** WARNING *** " - ewarn - ewarn "${PN} is known to break easily with new kernel versions and," - ewarn "with the current kernel (${KV_FULL}), it was either hardly" - ewarn "tested or is known broken. It is recommended to use one of:" - ewarn - # fwiw we do not know what is *actually* used or wanted even with - # the USE, so stay a bit vague and always mention both dist+sources - if use dist-kernel; then - ewarn " <=virtual/dist-kernel-${max} or" - else - ewarn " <=sys-kernel/gentoo-kernel-${max} or" - fi - ewarn " <=sys-kernel/gentoo-sources-${max}" - ewarn - ewarn "or equivalent rather than file downstream bug reports if run into" - ewarn "issues, then wait for upstream fixes and a new release. Ideally," - ewarn "with out-of-tree modules, use an LTS (Long Term Support) kernel" - ewarn "branch[1]. If in doubt, Gentoo's stable kernels are always LTS" - ewarn "and can be easily used even on ~testing systems." - ewarn - ewarn "[1] https://www.kernel.org/category/releases.html" - ewarn - fi - fi -} - -# @FUNCTION: _modules_sanity_modversion -# @USAGE: ... -# @INTERNAL -# @DESCRIPTION: -# Checks if the passed module(s) do not seem obviously broken and the -# builtin versions match ${KV_FULL}, otherwise die with an explanation. -# -# If receive a bug with a version error, an easy way to reproduce is to -# set KERNEL_DIR with the sources of a different kernel version than -# both the ones pointed by /usr/src/linux and `uname -r`. Refer to -# linux-mod-r1_src_compile's modargs in the eclass docs for fixing. -_modules_sanity_modversion() { - local mod ver - for mod; do - # modinfo can read different-arch modules, being fatal *should* be safe - # and serve as a basic sanity check to ensure the module is valid - read -rd ' ' ver < <( - LC_ALL=C modinfo -F vermagic -- "${mod}" || - die "modinfo failed to read module '${mod}' (broken module?)" - ) - [[ -n ${ver} ]] || - die "modinfo found no kernel version in '${mod}' (broken module?)" - - if [[ ${ver} != "${KV_FULL}" ]]; then - eerror "A module seem to have been built for kernel version '${ver}'" - eerror "while it was meant for '${KV_FULL}'. This may indicate an" - eerror "ebuild issue (e.g. used runtime \`uname -r\` kernel rather than" - eerror "the chosen sources). Please report this to the ebuild's maintainer." - die "module and source version mismatch in '${mod}'" - fi - done -} - -# @FUNCTION: _modules_set_makeargs -# @INTERNAL -# @DESCRIPTION: -# Sets the MODULES_MAKEARGS global array. -_modules_set_makeargs() { - MODULES_MAKEARGS=( - ARCH="$(tc-arch-kernel)" - - V=1 - # normally redundant with V, but some custom Makefiles override it - KBUILD_VERBOSE=1 - - # unrealistic when building modules that often have slow releases, - # but note that the kernel will still pass some -Werror=bad-thing - CONFIG_WERROR= - - # these are only needed if using these arguments for installing, lets - # eclass handle strip, sign, compress, and depmod (CONFIG_ should - # have no impact on building, only used by Makefile.modinst) - CONFIG_MODULE_{SIG_ALL,COMPRESS_{GZIP,XZ,ZSTD}}= - DEPMOD=true #916587 - STRIP=true - ) - - if [[ ! ${MODULES_I_WANT_FULL_CONTROL} ]]; then - # many of these are unlikely to be useful here, but still trying to be - # complete given never know what out-of-tree modules may use - MODULES_MAKEARGS+=( - # wrt bug #550428, given most toolchain variables are being passed to - # make, setting CROSS in the environment would change very little - # (instead set KERNEL_CHOST which will affect other variables, - # or MODULES_I_WANT_FULL_CONTROL if do not want any of this) - CROSS_COMPILE="${KERNEL_CHOST}-" - - HOSTCC="$(tc-getBUILD_CC)" - HOSTCXX="$(tc-getBUILD_CXX)" - - # fwiw this function is not meant to pollute the environment - HOSTCFLAGS="$(tc-export_build_env; echo "${BUILD_CFLAGS}")" - HOSTCXXFLAGS="$(tc-export_build_env; echo "${BUILD_CXXFLAGS}")" - HOSTLDFLAGS="$(tc-export_build_env; echo "${BUILD_LDFLAGS}")" - - HOSTPKG_CONFIG="$(tc-getBUILD_PKG_CONFIG)" - - CC="${KERNEL_CC}" - CXX="${KERNEL_CXX}" - LD="${KERNEL_LD}" - AR="${KERNEL_AR}" - NM="${KERNEL_NM}" - OBJCOPY="${KERNEL_OBJCOPY}" - OBJDUMP="${KERNEL_OBJDUMP}" - READELF="${KERNEL_READELF}" - ) - fi - - # eval is to handle quoted spaces, die is for syntax errors - eval "MODULES_MAKEARGS+=( ${MODULES_EXTRA_EMAKE} )" || die -} - -# @FUNCTION: _modules_update_depmod -# @INTERNAL -# @DESCRIPTION: -# If possible, update module dependencies using depmod and System.map, -# otherwise prompt user to handle it. System.map may notably no longer -# be available on binary merges. -_modules_update_depmod() { - # prefer /lib/modules' path given it is what depmod operates on, - # and is mostly foolproof when it comes to ROOT (relative symlink) - local map=${EROOT}/lib/modules/${KV_FULL}/build/System.map - - if [[ ! -f ${map} ]]; then - # KV_OUT_DIR may still be right even on a different system, but state - # of (E)ROOT is unknown, e.g. could be from KERNEL_DIR=${OLDROOT}/... - map=${KV_OUT_DIR}/System.map - - # last resort, typical but may not be mounted/readable/installed - [[ ! -f ${map} ]] && - map=${EROOT}/boot/System.map-${KV_FULL} - fi - - einfo "Updating module dependencies for kernel ${KV_FULL} ..." - if [[ -f ${map} ]]; then - local depmodargs=( -ae -F "${map}" "${KV_FULL}" ) - - # for nicer postinst display, keep command shorter if EROOT is unset - [[ ${EROOT} ]] && - depmodargs+=( - -b "${EROOT}" - - # EROOT from -b is not used when looking for configuration - # directories, so pass the whole list from kmod's tools/depmod.c - --config="${EROOT}"/{etc,run,usr/local/lib,lib}/depmod.d - ) - - nonfatal edob depmod "${depmodargs[@]}" && return 0 - else - eerror - eerror "System.map for kernel ${KV_FULL} was not found, may be due to the" - eerror "built kernel sources no longer being available and lacking the fallback:" - eerror - eerror "${EROOT}/boot/System.map-${KV_FULL}" - fi - eerror - eerror "Some modules may not load without updating manually using depmod." -} - -fi - -EXPORT_FUNCTIONS pkg_setup src_compile src_install pkg_postinst diff --git a/files/zfs/3815.2.0/overlay/metadata/layout.conf b/files/zfs/3815.2.0/overlay/metadata/layout.conf deleted file mode 100644 index e85e826..0000000 --- a/files/zfs/3815.2.0/overlay/metadata/layout.conf +++ /dev/null @@ -1,4 +0,0 @@ -masters = portage-stable -thin-manifests = true -sign-commits = false -sign-manifests = false diff --git a/files/zfs/3815.2.0/overlay/profiles/repo_name b/files/zfs/3815.2.0/overlay/profiles/repo_name deleted file mode 100644 index e0f34db..0000000 --- a/files/zfs/3815.2.0/overlay/profiles/repo_name +++ /dev/null @@ -1 +0,0 @@ -zfs-overlay diff --git a/files/zfs/3815.2.0/overlay/sys-fs/udev-init-scripts/Manifest b/files/zfs/3815.2.0/overlay/sys-fs/udev-init-scripts/Manifest deleted file mode 100644 index 037e60f..0000000 --- a/files/zfs/3815.2.0/overlay/sys-fs/udev-init-scripts/Manifest +++ /dev/null @@ -1 +0,0 @@ -DIST udev-init-scripts-35.tar.gz 3666 BLAKE2B fddae466428605ea930519e8a47e0ea91f89f9eacc1fd97c137d175142125b12c3d045aec68db35a463de444ac6d8c037cca55f9628f10576c968259d566a9e4 SHA512 da9d2093149967e2e1b9bc7190ddfd55a87c9ae2177e3216f7cb2694fc9b64037eb6f2599ad8a4b7594ef32ced88fbb319c92904bc72a81ea5404945f8a8378a diff --git a/files/zfs/3815.2.0/overlay/sys-fs/udev-init-scripts/metadata.xml b/files/zfs/3815.2.0/overlay/sys-fs/udev-init-scripts/metadata.xml deleted file mode 100644 index 31123d0..0000000 --- a/files/zfs/3815.2.0/overlay/sys-fs/udev-init-scripts/metadata.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - systemd@gentoo.org - - diff --git a/files/zfs/3815.2.0/overlay/sys-fs/udev-init-scripts/udev-init-scripts-35.ebuild b/files/zfs/3815.2.0/overlay/sys-fs/udev-init-scripts/udev-init-scripts-35.ebuild deleted file mode 100644 index 866d0ce..0000000 --- a/files/zfs/3815.2.0/overlay/sys-fs/udev-init-scripts/udev-init-scripts-35.ebuild +++ /dev/null @@ -1,50 +0,0 @@ -# Copyright 1999-2022 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 -OLD_PN=udev-gentoo-scripts -OLD_P=${OLD_PN}-${PV} - -if [ "${PV}" = "9999" ]; then - EGIT_REPO_URI="https://anongit.gentoo.org/proj/${OLD_PN}.git" - inherit git-r3 -else - SRC_URI="https://gitweb.gentoo.org/proj/${OLD_PN}.git/snapshot/${OLD_P}.tar.gz -> ${P}.tar.gz" - S="${WORKDIR}/${OLD_P}" - KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86" -fi - -DESCRIPTION="udev startup scripts for openrc" -HOMEPAGE="https://wiki.gentoo.org/wiki/No_homepage" - -LICENSE="GPL-2" -SLOT="0" - -RESTRICT="test" - -RDEPEND=">=virtual/udev-217 - !$1/build.log 2>&1]) diff --git a/files/zfs/3815.2.0/overlay/sys-fs/zfs-kmod/files/zfs-kmod-2.2.2-arm64-neon.patch b/files/zfs/3815.2.0/overlay/sys-fs/zfs-kmod/files/zfs-kmod-2.2.2-arm64-neon.patch deleted file mode 100644 index 54121ad..0000000 --- a/files/zfs/3815.2.0/overlay/sys-fs/zfs-kmod/files/zfs-kmod-2.2.2-arm64-neon.patch +++ /dev/null @@ -1,100 +0,0 @@ -https://bugs.gentoo.org/904657 -https://github.com/openzfs/zfs/issues/14555 -https://github.com/openzfs/zfs/commit/976bf9b6a61919638d42ed79cd207132785d128a - -From 976bf9b6a61919638d42ed79cd207132785d128a Mon Sep 17 00:00:00 2001 -From: Shengqi Chen -Date: Tue, 9 Jan 2024 08:05:24 +0800 -Subject: [PATCH] Linux 6.2 compat: add check for kernel_neon_* availability - -This patch adds check for `kernel_neon_*` symbols on arm and arm64 -platforms to address the following issues: - -1. Linux 6.2+ on arm64 has exported them with `EXPORT_SYMBOL_GPL`, so - license compatibility must be checked before use. -2. On both arm and arm64, the definitions of these symbols are guarded - by `CONFIG_KERNEL_MODE_NEON`, but their declarations are still - present. Checking in configuration phase only leads to MODPOST - errors (undefined references). - -Reviewed-by: Brian Behlendorf -Signed-off-by: Shengqi Chen -Closes #15711 -Closes #14555 -Closes: #15401 ---- a/config/kernel-fpu.m4 -+++ b/config/kernel-fpu.m4 -@@ -79,6 +79,12 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_FPU], [ - __kernel_fpu_end(); - ], [], [ZFS_META_LICENSE]) - -+ ZFS_LINUX_TEST_SRC([kernel_neon], [ -+ #include -+ ], [ -+ kernel_neon_begin(); -+ kernel_neon_end(); -+ ], [], [ZFS_META_LICENSE]) - ]) - - AC_DEFUN([ZFS_AC_KERNEL_FPU], [ -@@ -105,9 +111,20 @@ AC_DEFUN([ZFS_AC_KERNEL_FPU], [ - AC_DEFINE(KERNEL_EXPORTS_X86_FPU, 1, - [kernel exports FPU functions]) - ],[ -- AC_MSG_RESULT(internal) -- AC_DEFINE(HAVE_KERNEL_FPU_INTERNAL, 1, -- [kernel fpu internal]) -+ dnl # -+ dnl # ARM neon symbols (only on arm and arm64) -+ dnl # could be GPL-only on arm64 after Linux 6.2 -+ dnl # -+ ZFS_LINUX_TEST_RESULT([kernel_neon_license],[ -+ AC_MSG_RESULT(kernel_neon_*) -+ AC_DEFINE(HAVE_KERNEL_NEON, 1, -+ [kernel has kernel_neon_* functions]) -+ ],[ -+ # catch-all -+ AC_MSG_RESULT(internal) -+ AC_DEFINE(HAVE_KERNEL_FPU_INTERNAL, 1, -+ [kernel fpu internal]) -+ ]) - ]) - ]) - ]) ---- a/include/os/linux/kernel/linux/simd_aarch64.h -+++ b/include/os/linux/kernel/linux/simd_aarch64.h -@@ -71,9 +71,15 @@ - #define ID_AA64PFR0_EL1 sys_reg(3, 0, 0, 1, 0) - #define ID_AA64ISAR0_EL1 sys_reg(3, 0, 0, 6, 0) - -+#if (defined(HAVE_KERNEL_NEON) && defined(CONFIG_KERNEL_MODE_NEON)) - #define kfpu_allowed() 1 - #define kfpu_begin() kernel_neon_begin() - #define kfpu_end() kernel_neon_end() -+#else -+#define kfpu_allowed() 0 -+#define kfpu_begin() do {} while (0) -+#define kfpu_end() do {} while (0) -+#endif - #define kfpu_init() (0) - #define kfpu_fini() do {} while (0) - ---- a/include/os/linux/kernel/linux/simd_arm.h -+++ b/include/os/linux/kernel/linux/simd_arm.h -@@ -53,9 +53,15 @@ - #include - #include - -+#if (defined(HAVE_KERNEL_NEON) && defined(CONFIG_KERNEL_MODE_NEON)) - #define kfpu_allowed() 1 - #define kfpu_begin() kernel_neon_begin() - #define kfpu_end() kernel_neon_end() -+#else -+#define kfpu_allowed() 0 -+#define kfpu_begin() do {} while (0) -+#define kfpu_end() do {} while (0) -+#endif - #define kfpu_init() (0) - #define kfpu_fini() do {} while (0) - - diff --git a/files/zfs/3815.2.0/overlay/sys-fs/zfs-kmod/files/zfs-kmod-2.2.2-autotrim.patch b/files/zfs/3815.2.0/overlay/sys-fs/zfs-kmod/files/zfs-kmod-2.2.2-autotrim.patch deleted file mode 100644 index 6d72389..0000000 --- a/files/zfs/3815.2.0/overlay/sys-fs/zfs-kmod/files/zfs-kmod-2.2.2-autotrim.patch +++ /dev/null @@ -1,31 +0,0 @@ -https://bugs.gentoo.org/923745 -https://github.com/openzfs/zfs/issues/15453 -https://github.com/openzfs/zfs/pull/15781 -https://github.com/openzfs/zfs/pull/15789 - -From a0aa7a2ee3b56d7b6d69c2081034ec8293a6d605 Mon Sep 17 00:00:00 2001 -From: Kevin Jin <33590050+jxdking@users.noreply.github.com> -Date: Wed, 17 Jan 2024 12:03:58 -0500 -Subject: [PATCH] Autotrim High Load Average Fix - -Switch from cv_wait() to cv_wait_idle() in vdev_autotrim_wait_kick(), -which should mitigate the high load average while waiting. - -Reviewed-by: Brian Atkinson -Reviewed-by: Brian Behlendorf -Reviewed-by: Alexander Motin -Signed-off-by: jxdking -Closes #15781 ---- a/module/zfs/vdev_trim.c -+++ b/module/zfs/vdev_trim.c -@@ -194,7 +194,8 @@ vdev_autotrim_wait_kick(vdev_t *vd, int num_of_kick) - for (int i = 0; i < num_of_kick; i++) { - if (vd->vdev_autotrim_exit_wanted) - break; -- cv_wait(&vd->vdev_autotrim_kick_cv, &vd->vdev_autotrim_lock); -+ cv_wait_idle(&vd->vdev_autotrim_kick_cv, -+ &vd->vdev_autotrim_lock); - } - boolean_t exit_wanted = vd->vdev_autotrim_exit_wanted; - mutex_exit(&vd->vdev_autotrim_lock); - diff --git a/files/zfs/3815.2.0/overlay/sys-fs/zfs-kmod/metadata.xml b/files/zfs/3815.2.0/overlay/sys-fs/zfs-kmod/metadata.xml deleted file mode 100644 index deb3879..0000000 --- a/files/zfs/3815.2.0/overlay/sys-fs/zfs-kmod/metadata.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - sam@gentoo.org - Sam James - - - Prevents upgrading to an unsupported kernel version when combined with USE=dist-kernel - Pull dependencies and check kernel options required for root-on-zfs - - - https://github.com/openzfs/zfs/issues - https://openzfs.github.io/openzfs-docs - openzfs/zfs - - diff --git a/files/zfs/3815.2.0/overlay/sys-fs/zfs-kmod/zfs-kmod-2.1.14.ebuild b/files/zfs/3815.2.0/overlay/sys-fs/zfs-kmod/zfs-kmod-2.1.14.ebuild deleted file mode 100644 index c698d19..0000000 --- a/files/zfs/3815.2.0/overlay/sys-fs/zfs-kmod/zfs-kmod-2.1.14.ebuild +++ /dev/null @@ -1,177 +0,0 @@ -# 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-r1 multiprocessing - -DESCRIPTION="Linux ZFS kernel module for sys-fs/zfs" -HOMEPAGE="https://github.com/openzfs/zfs" - -MODULES_KERNEL_MAX=6.5 -MODULES_KERNEL_MIN=3.10 - -if [[ ${PV} == 9999 ]] ; then - EGIT_REPO_URI="https://github.com/openzfs/zfs.git" - inherit git-r3 - unset MODULES_KERNEL_MAX -else - VERIFY_SIG_OPENPGP_KEY_PATH=/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="${MODULES_KERNEL_MAX}" - # 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" -RESTRICT="test" - -BDEPEND=" - dev-lang/perl - app-alternatives/awk -" - -if [[ ${PV} != 9999 ]] ; then - BDEPEND+=" verify-sig? ( sec-keys/openpgp-keys-openzfs )" - - IUSE+=" +dist-kernel-cap" - RDEPEND=" - dist-kernel-cap? ( dist-kernel? ( - 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 ~loong ~ppc64 ~riscv ~sparc" - fi -fi - -LICENSE="CDDL MIT debug? ( GPL-2+ )" -SLOT="0/${PVR}" -IUSE="custom-cflags debug +rootfs" -RESTRICT="test" - -BDEPEND=" - app-alternatives/awk - dev-lang/perl -" - -if [[ ${PV} != 9999 ]] ; then - BDEPEND+=" verify-sig? ( sec-keys/openpgp-keys-openzfs )" - - IUSE+=" +dist-kernel-cap" - RDEPEND=" - dist-kernel-cap? ( dist-kernel? ( - 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 ~loong ppc64 ~riscv ~sparc" - fi -fi - -LICENSE="CDDL MIT debug? ( GPL-2+ )" -SLOT="0/${PVR}" -IUSE="custom-cflags debug +rootfs" -RESTRICT="test" - -BDEPEND=" - app-alternatives/awk - dev-lang/perl -" - -if [[ ${PV} != 9999 ]] ; then - BDEPEND+=" verify-sig? ( sec-keys/openpgp-keys-openzfs )" - - IUSE+=" +dist-kernel-cap" - RDEPEND=" - dist-kernel-cap? ( dist-kernel? ( - 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 ~loong ~ppc64 ~riscv ~sparc" - fi -fi - -LICENSE="CDDL MIT debug? ( GPL-2+ )" -SLOT="0/${PVR}" -IUSE="custom-cflags debug +rootfs" -RESTRICT="test" - -BDEPEND=" - app-alternatives/awk - dev-lang/perl -" - -if [[ ${PV} != 9999 ]] ; then - BDEPEND+=" verify-sig? ( sec-keys/openpgp-keys-openzfs )" - - IUSE+=" +dist-kernel-cap" - RDEPEND=" - dist-kernel-cap? ( dist-kernel? ( - -Date: Thu, 30 Jun 2022 13:47:58 -0400 -Subject: [PATCH] dracut: fix boot on non-zfs-root systems - -Simply prevent overwriting root until it needs to be overwritten. - -Dracut could change this value before this module is called, but won't -change the kernel command line. - -Reviewed-by: Andrew J. Hesford -Signed-off-by: Toyam Cox -Closes #13592 ---- - contrib/dracut/90zfs/zfs-lib.sh.in | 10 +++++----- - 1 file changed, 5 insertions(+), 5 deletions(-) - -diff --git a/contrib/dracut/90zfs/zfs-lib.sh.in b/contrib/dracut/90zfs/zfs-lib.sh.in -index e44673c2d75..3a43e514d6f 100755 ---- a/contrib/dracut/90zfs/zfs-lib.sh.in -+++ b/contrib/dracut/90zfs/zfs-lib.sh.in -@@ -88,11 +88,11 @@ decode_root_args() { - return - fi - -- root=$(getarg root=) -+ xroot=$(getarg root=) - rootfstype=$(getarg rootfstype=) - - # shellcheck disable=SC2249 -- case "$root" in -+ case "$xroot" in - ""|zfs|zfs:|zfs:AUTO) - root=zfs:AUTO - rootfstype=zfs -@@ -100,7 +100,7 @@ decode_root_args() { - ;; - - ZFS=*|zfs:*) -- root="${root#zfs:}" -+ root="${xroot#zfs:}" - root="${root#ZFS=}" - root=$(echo "$root" | tr '+' ' ') - rootfstype=zfs -@@ -109,9 +109,9 @@ decode_root_args() { - esac - - if [ "$rootfstype" = "zfs" ]; then -- case "$root" in -+ case "$xroot" in - "") root=zfs:AUTO ;; -- *) root=$(echo "$root" | tr '+' ' ') ;; -+ *) root=$(echo "$xroot" | tr '+' ' ') ;; - esac - return 0 - fi - diff --git a/files/zfs/3815.2.0/overlay/sys-fs/zfs/files/2.2.2-no-USER_NS.patch b/files/zfs/3815.2.0/overlay/sys-fs/zfs/files/2.2.2-no-USER_NS.patch deleted file mode 100644 index b132db9..0000000 --- a/files/zfs/3815.2.0/overlay/sys-fs/zfs/files/2.2.2-no-USER_NS.patch +++ /dev/null @@ -1,39 +0,0 @@ -https://github.com/openzfs/zfs/issues/15241 -https://github.com/openzfs/zfs/pull/15560 - -From e0a7ec29d91b79adfd81073f229241351ed0ae21 Mon Sep 17 00:00:00 2001 -From: Ilkka Sovanto -Date: Wed, 22 Nov 2023 20:24:47 +0200 -Subject: [PATCH] Fix zoneid when USER_NS is disabled - -getzoneid() should return GLOBAL_ZONEID instead of 0 when USER_NS is disabled. - -Signed-off-by: Ilkka Sovanto ---- a/lib/libspl/os/linux/zone.c -+++ b/lib/libspl/os/linux/zone.c -@@ -42,20 +42,20 @@ getzoneid(void) - int c = snprintf(path, sizeof (path), "/proc/self/ns/user"); - /* This API doesn't have any error checking... */ - if (c < 0 || c >= sizeof (path)) -- return (0); -+ return (GLOBAL_ZONEID); - - ssize_t r = readlink(path, buf, sizeof (buf) - 1); - if (r < 0) -- return (0); -+ return (GLOBAL_ZONEID); - - cp = strchr(buf, '['); - if (cp == NULL) -- return (0); -+ return (GLOBAL_ZONEID); - cp++; - - unsigned long n = strtoul(cp, NULL, 10); - if (n == ULONG_MAX && errno == ERANGE) -- return (0); -+ return (GLOBAL_ZONEID); - zoneid_t z = (zoneid_t)n; - - return (z); - diff --git a/files/zfs/3815.2.0/overlay/sys-fs/zfs/metadata.xml b/files/zfs/3815.2.0/overlay/sys-fs/zfs/metadata.xml deleted file mode 100644 index b2f96b1..0000000 --- a/files/zfs/3815.2.0/overlay/sys-fs/zfs/metadata.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - sam@gentoo.org - Sam James - - - Disable dependency on sys-fs/zfs-kmod under the assumption that ZFS is part of the kernel source tree - Don't install python scripts (arcstat, dbufstat etc) and avoid dependency on dev-lang/python - Install zfs_key pam module, for automatically loading zfs encryption keys for home datasets - Enable dependencies required for booting off a pool containing a rootfs - Install regression test suite - - - https://github.com/openzfs/zfs/issues - https://openzfs.github.io/openzfs-docs - openzfs/zfs - - - OpenZFS is an advanced file system and volume manager which was originally developed - for Solaris and is now maintained by the OpenZFS community - - It includes the functionality of both traditional file systems and volume manager. - It has many advanced features including: - * Protection against data corruption. Integrity checking for both data and metadata. - * Continuous integrity verification and automatic “self-healing” repair - * Data redundancy with mirroring, RAID-Z1/2/3 [and DRAID] - * Support for high storage capacities — up to 256 trillion yobibytes (2^128 bytes) - * Space-saving with transparent compression using LZ4, GZIP or ZSTD - * Hardware-accelerated native encryption - * Efficient storage with snapshots and copy-on-write clones - * Efficient local or remote replication — send only changed blocks with ZFS send and receive - - The OpenZFS project brings together developers from the Linux, FreeBSD, illumos, MacOS, and Windows platforms. - OpenZFS is supported by a wide range of companies. - - diff --git a/files/zfs/3815.2.0/overlay/sys-fs/zfs/zfs-2.1.14.ebuild b/files/zfs/3815.2.0/overlay/sys-fs/zfs/zfs-2.1.14.ebuild deleted file mode 100644 index 5dcfd94..0000000 --- a/files/zfs/3815.2.0/overlay/sys-fs/zfs/zfs-2.1.14.ebuild +++ /dev/null @@ -1,311 +0,0 @@ -# Copyright 1999-2024 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -DISTUTILS_OPTIONAL=1 -DISTUTILS_USE_PEP517=setuptools -PYTHON_COMPAT=( python3_{10..11} ) - -inherit autotools bash-completion-r1 dist-kernel-utils distutils-r1 flag-o-matic linux-info pam systemd udev usr-ldscript - -DESCRIPTION="Userland utilities for ZFS Linux kernel module" -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=/usr/share/openpgp-keys/openzfs.asc - inherit verify-sig - - MY_P="${P/_rc/-rc}" - SRC_URI="https://github.com/openzfs/${PN}/releases/download/${MY_P}/${MY_P}.tar.gz" - SRC_URI+=" verify-sig? ( https://github.com/openzfs/${PN}/releases/download/${MY_P}/${MY_P}.tar.gz.asc )" - S="${WORKDIR}/${P%_rc?}" - - if [[ ${PV} != *_rc* ]]; then - KEYWORDS="amd64 arm64 ppc64 ~riscv ~sparc" - fi -fi - -LICENSE="BSD-2 CDDL MIT" -# just libzfs soname major for now. -# possible candidates: libuutil, libzpool, libnvpair. Those do not provide stable abi, but are considered. -# see libsoversion_check() below as well -SLOT="0/5" -IUSE="custom-cflags debug dist-kernel kernel-builtin minimal nls pam python +rootfs selinux test-suite" - -DEPEND=" - net-libs/libtirpc:= - sys-apps/util-linux - sys-libs/zlib - virtual/libudev:= - dev-libs/openssl:0= - !minimal? ( ${PYTHON_DEPS} ) - pam? ( sys-libs/pam ) - python? ( - $(python_gen_cond_dep 'dev-python/cffi[${PYTHON_USEDEP}]' 'python*') - ) -" - -BDEPEND="app-alternatives/awk - virtual/pkgconfig - nls? ( sys-devel/gettext ) - python? ( - ${DISTUTILS_DEPS} - || ( - dev-python/packaging[${PYTHON_USEDEP}] - dev-python/distlib[${PYTHON_USEDEP}] - ) - ) -" - -if [[ ${PV} != "9999" ]] ; then - BDEPEND+=" verify-sig? ( sec-keys/openpgp-keys-openzfs )" -fi - -# awk is used for some scripts, completions, and the Dracut module -RDEPEND="${DEPEND} - !kernel-builtin? ( ~sys-fs/zfs-kmod-${PV}:= ) - !prefix? ( virtual/udev ) - sys-fs/udev-init-scripts - app-alternatives/awk - dist-kernel? ( virtual/dist-kernel:= ) - rootfs? ( - app-alternatives/cpio - app-misc/pax-utils - ) - selinux? ( sec-policy/selinux-zfs ) - test-suite? ( - app-shells/ksh - sys-apps/kmod[tools] - sys-apps/util-linux - app-alternatives/bc - sys-block/parted - sys-fs/lsscsi - sys-fs/mdadm - sys-process/procps - ) -" - -# PDEPEND in this form is needed to trick portage suggest -# enabling dist-kernel if only 1 package have it set, without suggesting to disable -PDEPEND="dist-kernel? ( ~sys-fs/zfs-kmod-${PV}[dist-kernel] )" - -REQUIRED_USE=" - !minimal? ( ${PYTHON_REQUIRED_USE} ) - python? ( !minimal ) - test-suite? ( !minimal ) -" - -RESTRICT="test" - -PATCHES=( - # bug #854333 - "${FILESDIR}"/2.1.5-r2-dracut-non-root.patch - - "${FILESDIR}"/2.1.5-dracut-zfs-missing.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() { - if use kernel_linux; then - linux-info_pkg_setup - - if ! linux_config_exists; then - ewarn "Cannot check the linux kernel configuration." - else - if use test-suite; then - if linux_chkconfig_present BLK_DEV_LOOP; then - eerror "The ZFS test suite requires loop device support enabled." - eerror "Please enable it:" - eerror " CONFIG_BLK_DEV_LOOP=y" - eerror "in /usr/src/linux/.config or" - eerror " Device Drivers --->" - eerror " Block devices --->" - eerror " [X] Loopback device support" - fi - fi - fi - fi -} - -libsoversion_check() { - local bugurl libzfs_sover - bugurl="https://bugs.gentoo.org/enter_bug.cgi?form_name=enter_bug&product=Gentoo+Linux&component=Current+packages" - - libzfs_sover="$(grep 'libzfs_la_LDFLAGS += -version-info' lib/libzfs/Makefile.am \ - | grep -Eo '[0-9]+:[0-9]+:[0-9]+')" - libzfs_sover="${libzfs_sover%%:*}" - - if [[ ${libzfs_sover} -ne $(ver_cut 2 ${SLOT}) ]]; then - echo - eerror "BUG BUG BUG BUG BUG BUG BUG BUG" - eerror "ebuild subslot does not match libzfs soversion!" - eerror "libzfs soversion: ${libzfs_sover}" - eerror "ebuild value: $(ver_cut 2 ${SLOT})" - eerror "This is a bug in the ebuild, please use the following URL to report it" - eerror "${bugurl}&short_desc=${CATEGORY}%2F${P}+update+subslot" - echo - # we want to abort for releases, but just print a warning for live ebuild - # to keep package installable - [[ ${PV} == "9999" ]] || die - fi -} - -src_prepare() { - default - libsoversion_check - - # Run unconditionally (bug #792627) - eautoreconf - - if [[ ${PV} != "9999" ]]; then - # Set revision number - sed -i "s/\(Release:\)\(.*\)1/\1\2${PR}-gentoo/" META || die "Could not set Gentoo release" - fi - - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_prepare - popd >/dev/null || die - fi - - # prevent errors showing up on zfs-mount stop, #647688 - # openrc will unmount all filesystems anyway. - sed -i "/^ZFS_UNMOUNT=/ s/yes/no/" "etc/default/zfs.in" || die -} - -src_configure() { - use custom-cflags || strip-flags - use minimal || python_setup - - # All the same issue: - # Segfaults w/ GCC 12 and 'zfs send' - # bug #856373 - # https://github.com/openzfs/zfs/issues/13620 - # https://github.com/openzfs/zfs/issues/13605 - append-flags -fno-tree-vectorize - - local myconf=( - --bindir="${EPREFIX}/bin" - --enable-shared - --enable-sysvinit - --localstatedir="${EPREFIX}/var" - --sbindir="${EPREFIX}/sbin" - --with-config=user - --with-dracutdir="${EPREFIX}/usr/lib/dracut" - --with-linux="${KV_DIR}" - --with-linux-obj="${KV_OUT_DIR}" - --with-udevdir="$(get_udevdir)" - --with-pamconfigsdir="${EPREFIX}/unwanted_files" - --with-pammoduledir="$(getpam_mod_dir)" - --with-systemdunitdir="$(systemd_get_systemunitdir)" - --with-systemdpresetdir="$(systemd_get_systempresetdir)" - --with-vendor=gentoo - # Building zfs-mount-generator.c on musl breaks as strndupa - # isn't available. But systemd doesn't support musl anyway, so - # just disable building it. - # UPDATE: it has been fixed since, - # https://github.com/openzfs/zfs/commit/1f19826c9ac85835cbde61a7439d9d1fefe43a4a - # but we still leave it as this for now. - $(use_enable !elibc_musl systemd) - $(use_enable debug) - $(use_enable nls) - $(use_enable pam) - $(use_enable python pyzfs) - --disable-static - $(usex minimal --without-python --with-python="${EPYTHON}") - ) - - econf "${myconf[@]}" -} - -src_compile() { - default - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_compile - popd >/dev/null || die - fi -} - -src_install() { - default - - gen_usr_ldscript -a nvpair uutil zfsbootenv zfs zfs_core zpool - - use pam && { rm -rv "${ED}/unwanted_files" || die ; } - - use test-suite || { rm -r "${ED}"/usr/share/zfs/{test-runner,zfs-tests,runfiles,*sh} || die ; } - - find "${ED}" -name '*.la' -delete || die - - dobashcomp contrib/bash_completion.d/zfs - bashcomp_alias zfs zpool - - # strip executable bit from conf.d file - fperms 0644 /etc/conf.d/zfs - - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_install - popd >/dev/null || die - fi - - # enforce best available python implementation - use minimal || python_fix_shebang "${ED}/bin" -} - -pkg_postinst() { - udev_reload - - # we always need userspace utils in sync with zfs-kmod - # so force initrd update for userspace as well, to avoid - # situation when zfs-kmod trigger initrd rebuild before - # userspace component is rebuilt - # KV_* variables are provided by linux-info.eclass - if [[ -z ${ROOT} ]] && use dist-kernel; then - dist-kernel_reinstall_initramfs "${KV_DIR}" "${KV_FULL}" - fi - - if use rootfs; then - if ! has_version sys-kernel/genkernel && ! has_version sys-kernel/dracut; then - elog "Root on zfs requires an initramfs to boot" - elog "The following packages provide one and are tested on a regular basis:" - elog " sys-kernel/dracut ( preferred, module maintained by zfs developers )" - elog " sys-kernel/genkernel" - fi - fi - - if systemd_is_booted || has_version sys-apps/systemd; then - einfo "Please refer to ${EROOT}/$(systemd_get_systempresetdir)/50-zfs.preset" - einfo "for default zfs systemd service configuration" - else - [[ -e "${EROOT}/etc/runlevels/boot/zfs-import" ]] || \ - einfo "You should add zfs-import to the boot runlevel." - [[ -e "${EROOT}/etc/runlevels/boot/zfs-load-key" ]] || \ - einfo "You should add zfs-load-key to the boot runlevel." - [[ -e "${EROOT}/etc/runlevels/boot/zfs-mount" ]]|| \ - einfo "You should add zfs-mount to the boot runlevel." - [[ -e "${EROOT}/etc/runlevels/default/zfs-share" ]] || \ - einfo "You should add zfs-share to the default runlevel." - [[ -e "${EROOT}/etc/runlevels/default/zfs-zed" ]] || \ - einfo "You should add zfs-zed to the default runlevel." - fi -} - -pkg_postrm() { - udev_reload -} diff --git a/files/zfs/3815.2.0/overlay/sys-fs/zfs/zfs-2.2.2-r1.ebuild b/files/zfs/3815.2.0/overlay/sys-fs/zfs/zfs-2.2.2-r1.ebuild deleted file mode 100644 index 80914d2..0000000 --- a/files/zfs/3815.2.0/overlay/sys-fs/zfs/zfs-2.2.2-r1.ebuild +++ /dev/null @@ -1,307 +0,0 @@ -# Copyright 1999-2024 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -DISTUTILS_OPTIONAL=1 -DISTUTILS_USE_PEP517=setuptools -PYTHON_COMPAT=( python3_{10..11} ) - -inherit autotools bash-completion-r1 dist-kernel-utils distutils-r1 flag-o-matic linux-info pam systemd udev usr-ldscript - -DESCRIPTION="Userland utilities for ZFS Linux kernel module" -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=/usr/share/openpgp-keys/openzfs.asc - inherit verify-sig - - MY_P="${P/_rc/-rc}" - SRC_URI="https://github.com/openzfs/${PN}/releases/download/${MY_P}/${MY_P}.tar.gz" - SRC_URI+=" verify-sig? ( https://github.com/openzfs/${PN}/releases/download/${MY_P}/${MY_P}.tar.gz.asc )" - S="${WORKDIR}/${MY_P}" - - if [[ ${PV} != *_rc* ]]; then - KEYWORDS="amd64 arm64 ~loong ppc64 ~riscv ~sparc" - fi -fi - -LICENSE="BSD-2 CDDL MIT" -# just libzfs soname major for now. -# possible candidates: libuutil, libzpool, libnvpair. Those do not provide stable abi, but are considered. -# see libsoversion_check() below as well -SLOT="0/5" -IUSE="custom-cflags debug dist-kernel kernel-builtin minimal nls pam python +rootfs selinux test-suite" - -DEPEND=" - dev-libs/openssl:= - net-libs/libtirpc:= - sys-apps/util-linux - sys-libs/zlib - virtual/libudev:= - !minimal? ( ${PYTHON_DEPS} ) - pam? ( sys-libs/pam ) - python? ( - $(python_gen_cond_dep 'dev-python/cffi[${PYTHON_USEDEP}]' 'python*') - ) -" - -BDEPEND=" - app-alternatives/awk - virtual/pkgconfig - nls? ( sys-devel/gettext ) - python? ( - ${DISTUTILS_DEPS} - || ( - dev-python/packaging[${PYTHON_USEDEP}] - dev-python/distlib[${PYTHON_USEDEP}] - ) - ) -" - -if [[ ${PV} != "9999" ]] ; then - BDEPEND+=" verify-sig? ( sec-keys/openpgp-keys-openzfs )" -fi - -# awk is used for some scripts, completions, and the Dracut module -RDEPEND=" - ${DEPEND} - !kernel-builtin? ( ~sys-fs/zfs-kmod-${PV}:= ) - !prefix? ( virtual/udev ) - app-alternatives/awk - sys-fs/udev-init-scripts - dist-kernel? ( virtual/dist-kernel:= ) - rootfs? ( - app-alternatives/cpio - app-misc/pax-utils - ) - selinux? ( sec-policy/selinux-zfs ) - test-suite? ( - app-shells/ksh - sys-apps/kmod[tools] - sys-apps/util-linux - app-alternatives/bc - sys-block/parted - sys-fs/lsscsi - sys-fs/mdadm - sys-process/procps - ) -" - -# PDEPEND in this form is needed to trick portage suggest -# enabling dist-kernel if only 1 package have it set, without suggesting to disable -PDEPEND="dist-kernel? ( ~sys-fs/zfs-kmod-${PV}[dist-kernel] )" - -REQUIRED_USE=" - !minimal? ( ${PYTHON_REQUIRED_USE} ) - python? ( !minimal ) - test-suite? ( !minimal ) -" - -RESTRICT="test" - -PATCHES=( - "${FILESDIR}"/2.1.5-dracut-zfs-missing.patch - "${FILESDIR}"/2.2.2-no-USER_NS.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() { - if use kernel_linux; then - linux-info_pkg_setup - - if ! linux_config_exists; then - ewarn "Cannot check the linux kernel configuration." - else - if use test-suite; then - if linux_chkconfig_present BLK_DEV_LOOP; then - eerror "The ZFS test suite requires loop device support enabled." - eerror "Please enable it:" - eerror " CONFIG_BLK_DEV_LOOP=y" - eerror "in /usr/src/linux/.config or" - eerror " Device Drivers --->" - eerror " Block devices --->" - eerror " [X] Loopback device support" - fi - fi - fi - fi -} - -libsoversion_check() { - local bugurl libzfs_sover - bugurl="https://bugs.gentoo.org/enter_bug.cgi?form_name=enter_bug&product=Gentoo+Linux&component=Current+packages" - - libzfs_sover="$(grep 'libzfs_la_LDFLAGS += -version-info' lib/libzfs/Makefile.am \ - | grep -Eo '[0-9]+:[0-9]+:[0-9]+')" - libzfs_sover="${libzfs_sover%%:*}" - - if [[ ${libzfs_sover} -ne $(ver_cut 2 ${SLOT}) ]]; then - echo - eerror "BUG BUG BUG BUG BUG BUG BUG BUG" - eerror "ebuild subslot does not match libzfs soversion!" - eerror "libzfs soversion: ${libzfs_sover}" - eerror "ebuild value: $(ver_cut 2 ${SLOT})" - eerror "This is a bug in the ebuild, please use the following URL to report it" - eerror "${bugurl}&short_desc=${CATEGORY}%2F${P}+update+subslot" - echo - # we want to abort for releases, but just print a warning for live ebuild - # to keep package installable - [[ ${PV} == "9999" ]] || die - fi -} - -src_prepare() { - default - libsoversion_check - - # Run unconditionally (bug #792627) - eautoreconf - - if [[ ${PV} != "9999" ]]; then - # Set revision number - sed -i "s/\(Release:\)\(.*\)1/\1\2${PR}-gentoo/" META || die "Could not set Gentoo release" - fi - - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_prepare - popd >/dev/null || die - fi - - # Tries to use /etc/conf.d which we reserve for OpenRC - sed -i -e '/EnvironmentFile/d' etc/systemd/system/zfs*.in || die - - # prevent errors showing up on zfs-mount stop, #647688 - # openrc will unmount all filesystems anyway. - sed -i "/^ZFS_UNMOUNT=/ s/yes/no/" "etc/default/zfs.in" || die -} - -src_configure() { - use custom-cflags || strip-flags - use minimal || python_setup - - local myconf=( - --bindir="${EPREFIX}/bin" - --enable-shared - --enable-sysvinit - --localstatedir="${EPREFIX}/var" - --sbindir="${EPREFIX}/sbin" - --with-config=user - --with-dracutdir="${EPREFIX}/usr/lib/dracut" - --with-linux="${KV_DIR}" - --with-linux-obj="${KV_OUT_DIR}" - --with-udevdir="$(get_udevdir)" - --with-pamconfigsdir="${EPREFIX}/unwanted_files" - --with-pammoduledir="$(getpam_mod_dir)" - --with-systemdunitdir="$(systemd_get_systemunitdir)" - --with-systemdpresetdir="$(systemd_get_systempresetdir)" - --with-vendor=gentoo - # Building zfs-mount-generator.c on musl breaks as strndupa - # isn't available. But systemd doesn't support musl anyway, so - # just disable building it. - # UPDATE: it has been fixed since, - # https://github.com/openzfs/zfs/commit/1f19826c9ac85835cbde61a7439d9d1fefe43a4a - # but we still leave it as this for now. - $(use_enable !elibc_musl systemd) - $(use_enable debug) - $(use_enable nls) - $(use_enable pam) - $(use_enable python pyzfs) - --disable-static - $(usex minimal --without-python --with-python="${EPYTHON}") - ) - - econf "${myconf[@]}" -} - -src_compile() { - default - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_compile - popd >/dev/null || die - fi -} - -src_install() { - default - - gen_usr_ldscript -a nvpair uutil zfsbootenv zfs zfs_core zpool - - use pam && { rm -rv "${ED}/unwanted_files" || die ; } - - use test-suite || { rm -r "${ED}"/usr/share/zfs/{test-runner,zfs-tests,runfiles,*sh} || die ; } - - find "${ED}" -name '*.la' -delete || die - - dobashcomp contrib/bash_completion.d/zfs - bashcomp_alias zfs zpool - - # strip executable bit from conf.d file - fperms 0644 /etc/conf.d/zfs - - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_install - popd >/dev/null || die - fi - - # enforce best available python implementation - use minimal || python_fix_shebang "${ED}/bin" -} - -pkg_postinst() { - udev_reload - - # we always need userspace utils in sync with zfs-kmod - # so force initrd update for userspace as well, to avoid - # situation when zfs-kmod trigger initrd rebuild before - # userspace component is rebuilt - # KV_* variables are provided by linux-info.eclass - if [[ -z ${ROOT} ]] && use dist-kernel; then - dist-kernel_reinstall_initramfs "${KV_DIR}" "${KV_FULL}" - fi - - if use rootfs; then - if ! has_version sys-kernel/genkernel && ! has_version sys-kernel/dracut; then - elog "Root on zfs requires an initramfs to boot" - elog "The following packages provide one and are tested on a regular basis:" - elog " sys-kernel/dracut ( preferred, module maintained by zfs developers )" - elog " sys-kernel/genkernel" - fi - fi - - if systemd_is_booted || has_version sys-apps/systemd; then - einfo "Please refer to ${EROOT}/$(systemd_get_systempresetdir)/50-zfs.preset" - einfo "for default zfs systemd service configuration" - else - [[ -e "${EROOT}/etc/runlevels/boot/zfs-import" ]] || \ - einfo "You should add zfs-import to the boot runlevel." - [[ -e "${EROOT}/etc/runlevels/boot/zfs-load-key" ]] || \ - einfo "You should add zfs-load-key to the boot runlevel." - [[ -e "${EROOT}/etc/runlevels/boot/zfs-mount" ]]|| \ - einfo "You should add zfs-mount to the boot runlevel." - [[ -e "${EROOT}/etc/runlevels/default/zfs-share" ]] || \ - einfo "You should add zfs-share to the default runlevel." - [[ -e "${EROOT}/etc/runlevels/default/zfs-zed" ]] || \ - einfo "You should add zfs-zed to the default runlevel." - fi -} - -pkg_postrm() { - udev_reload -} diff --git a/files/zfs/3815.2.0/overlay/sys-fs/zfs/zfs-9999.ebuild b/files/zfs/3815.2.0/overlay/sys-fs/zfs/zfs-9999.ebuild deleted file mode 100644 index 3f4ecf0..0000000 --- a/files/zfs/3815.2.0/overlay/sys-fs/zfs/zfs-9999.ebuild +++ /dev/null @@ -1,306 +0,0 @@ -# Copyright 1999-2024 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -DISTUTILS_OPTIONAL=1 -DISTUTILS_USE_PEP517=setuptools -PYTHON_COMPAT=( python3_{10..11} ) - -inherit autotools bash-completion-r1 dist-kernel-utils distutils-r1 flag-o-matic linux-info pam systemd udev usr-ldscript - -DESCRIPTION="Userland utilities for ZFS Linux kernel module" -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=/usr/share/openpgp-keys/openzfs.asc - inherit verify-sig - - MY_P="${P/_rc/-rc}" - SRC_URI="https://github.com/openzfs/${PN}/releases/download/${MY_P}/${MY_P}.tar.gz" - SRC_URI+=" verify-sig? ( https://github.com/openzfs/${PN}/releases/download/${MY_P}/${MY_P}.tar.gz.asc )" - S="${WORKDIR}/${MY_P}" - - if [[ ${PV} != *_rc* ]]; then - KEYWORDS="~amd64 ~arm64 ~loong ~ppc64 ~riscv ~sparc" - fi -fi - -LICENSE="BSD-2 CDDL MIT" -# just libzfs soname major for now. -# possible candidates: libuutil, libzpool, libnvpair. Those do not provide stable abi, but are considered. -# see libsoversion_check() below as well -SLOT="0/5" -IUSE="custom-cflags debug dist-kernel kernel-builtin minimal nls pam python +rootfs selinux test-suite" - -DEPEND=" - dev-libs/openssl:= - net-libs/libtirpc:= - sys-apps/util-linux - sys-libs/zlib - virtual/libudev:= - !minimal? ( ${PYTHON_DEPS} ) - pam? ( sys-libs/pam ) - python? ( - $(python_gen_cond_dep 'dev-python/cffi[${PYTHON_USEDEP}]' 'python*') - ) -" - -BDEPEND=" - app-alternatives/awk - virtual/pkgconfig - nls? ( sys-devel/gettext ) - python? ( - ${DISTUTILS_DEPS} - || ( - dev-python/packaging[${PYTHON_USEDEP}] - dev-python/distlib[${PYTHON_USEDEP}] - ) - ) -" - -if [[ ${PV} != "9999" ]] ; then - BDEPEND+=" verify-sig? ( sec-keys/openpgp-keys-openzfs )" -fi - -# awk is used for some scripts, completions, and the Dracut module -RDEPEND=" - ${DEPEND} - !kernel-builtin? ( ~sys-fs/zfs-kmod-${PV}:= ) - !prefix? ( virtual/udev ) - app-alternatives/awk - sys-fs/udev-init-scripts - dist-kernel? ( virtual/dist-kernel:= ) - rootfs? ( - app-alternatives/cpio - app-misc/pax-utils - ) - selinux? ( sec-policy/selinux-zfs ) - test-suite? ( - app-shells/ksh - sys-apps/kmod[tools] - sys-apps/util-linux - app-alternatives/bc - sys-block/parted - sys-fs/lsscsi - sys-fs/mdadm - sys-process/procps - ) -" - -# PDEPEND in this form is needed to trick portage suggest -# enabling dist-kernel if only 1 package have it set, without suggesting to disable -PDEPEND="dist-kernel? ( ~sys-fs/zfs-kmod-${PV}[dist-kernel] )" - -REQUIRED_USE=" - !minimal? ( ${PYTHON_REQUIRED_USE} ) - python? ( !minimal ) - test-suite? ( !minimal ) -" - -RESTRICT="test" - -PATCHES=( - "${FILESDIR}"/2.1.5-dracut-zfs-missing.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() { - if use kernel_linux; then - linux-info_pkg_setup - - if ! linux_config_exists; then - ewarn "Cannot check the linux kernel configuration." - else - if use test-suite; then - if linux_chkconfig_present BLK_DEV_LOOP; then - eerror "The ZFS test suite requires loop device support enabled." - eerror "Please enable it:" - eerror " CONFIG_BLK_DEV_LOOP=y" - eerror "in /usr/src/linux/.config or" - eerror " Device Drivers --->" - eerror " Block devices --->" - eerror " [X] Loopback device support" - fi - fi - fi - fi -} - -libsoversion_check() { - local bugurl libzfs_sover - bugurl="https://bugs.gentoo.org/enter_bug.cgi?form_name=enter_bug&product=Gentoo+Linux&component=Current+packages" - - libzfs_sover="$(grep 'libzfs_la_LDFLAGS += -version-info' lib/libzfs/Makefile.am \ - | grep -Eo '[0-9]+:[0-9]+:[0-9]+')" - libzfs_sover="${libzfs_sover%%:*}" - - if [[ ${libzfs_sover} -ne $(ver_cut 2 ${SLOT}) ]]; then - echo - eerror "BUG BUG BUG BUG BUG BUG BUG BUG" - eerror "ebuild subslot does not match libzfs soversion!" - eerror "libzfs soversion: ${libzfs_sover}" - eerror "ebuild value: $(ver_cut 2 ${SLOT})" - eerror "This is a bug in the ebuild, please use the following URL to report it" - eerror "${bugurl}&short_desc=${CATEGORY}%2F${P}+update+subslot" - echo - # we want to abort for releases, but just print a warning for live ebuild - # to keep package installable - [[ ${PV} == "9999" ]] || die - fi -} - -src_prepare() { - default - libsoversion_check - - # Run unconditionally (bug #792627) - eautoreconf - - if [[ ${PV} != "9999" ]]; then - # Set revision number - sed -i "s/\(Release:\)\(.*\)1/\1\2${PR}-gentoo/" META || die "Could not set Gentoo release" - fi - - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_prepare - popd >/dev/null || die - fi - - # Tries to use /etc/conf.d which we reserve for OpenRC - sed -i -e '/EnvironmentFile/d' etc/systemd/system/zfs*.in || die - - # prevent errors showing up on zfs-mount stop, #647688 - # openrc will unmount all filesystems anyway. - sed -i "/^ZFS_UNMOUNT=/ s/yes/no/" "etc/default/zfs.in" || die -} - -src_configure() { - use custom-cflags || strip-flags - use minimal || python_setup - - local myconf=( - --bindir="${EPREFIX}/bin" - --enable-shared - --enable-sysvinit - --localstatedir="${EPREFIX}/var" - --sbindir="${EPREFIX}/sbin" - --with-config=user - --with-dracutdir="${EPREFIX}/usr/lib/dracut" - --with-linux="${KV_DIR}" - --with-linux-obj="${KV_OUT_DIR}" - --with-udevdir="$(get_udevdir)" - --with-pamconfigsdir="${EPREFIX}/unwanted_files" - --with-pammoduledir="$(getpam_mod_dir)" - --with-systemdunitdir="$(systemd_get_systemunitdir)" - --with-systemdpresetdir="$(systemd_get_systempresetdir)" - --with-vendor=gentoo - # Building zfs-mount-generator.c on musl breaks as strndupa - # isn't available. But systemd doesn't support musl anyway, so - # just disable building it. - # UPDATE: it has been fixed since, - # https://github.com/openzfs/zfs/commit/1f19826c9ac85835cbde61a7439d9d1fefe43a4a - # but we still leave it as this for now. - $(use_enable !elibc_musl systemd) - $(use_enable debug) - $(use_enable nls) - $(use_enable pam) - $(use_enable python pyzfs) - --disable-static - $(usex minimal --without-python --with-python="${EPYTHON}") - ) - - econf "${myconf[@]}" -} - -src_compile() { - default - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_compile - popd >/dev/null || die - fi -} - -src_install() { - default - - gen_usr_ldscript -a nvpair uutil zfsbootenv zfs zfs_core zpool - - use pam && { rm -rv "${ED}/unwanted_files" || die ; } - - use test-suite || { rm -r "${ED}"/usr/share/zfs/{test-runner,zfs-tests,runfiles,*sh} || die ; } - - find "${ED}" -name '*.la' -delete || die - - dobashcomp contrib/bash_completion.d/zfs - bashcomp_alias zfs zpool - - # strip executable bit from conf.d file - fperms 0644 /etc/conf.d/zfs - - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_install - popd >/dev/null || die - fi - - # enforce best available python implementation - use minimal || python_fix_shebang "${ED}/bin" -} - -pkg_postinst() { - udev_reload - - # we always need userspace utils in sync with zfs-kmod - # so force initrd update for userspace as well, to avoid - # situation when zfs-kmod trigger initrd rebuild before - # userspace component is rebuilt - # KV_* variables are provided by linux-info.eclass - if [[ -z ${ROOT} ]] && use dist-kernel; then - dist-kernel_reinstall_initramfs "${KV_DIR}" "${KV_FULL}" - fi - - if use rootfs; then - if ! has_version sys-kernel/genkernel && ! has_version sys-kernel/dracut; then - elog "Root on zfs requires an initramfs to boot" - elog "The following packages provide one and are tested on a regular basis:" - elog " sys-kernel/dracut ( preferred, module maintained by zfs developers )" - elog " sys-kernel/genkernel" - fi - fi - - if systemd_is_booted || has_version sys-apps/systemd; then - einfo "Please refer to ${EROOT}/$(systemd_get_systempresetdir)/50-zfs.preset" - einfo "for default zfs systemd service configuration" - else - [[ -e "${EROOT}/etc/runlevels/boot/zfs-import" ]] || \ - einfo "You should add zfs-import to the boot runlevel." - [[ -e "${EROOT}/etc/runlevels/boot/zfs-load-key" ]] || \ - einfo "You should add zfs-load-key to the boot runlevel." - [[ -e "${EROOT}/etc/runlevels/boot/zfs-mount" ]]|| \ - einfo "You should add zfs-mount to the boot runlevel." - [[ -e "${EROOT}/etc/runlevels/default/zfs-share" ]] || \ - einfo "You should add zfs-share to the default runlevel." - [[ -e "${EROOT}/etc/runlevels/default/zfs-zed" ]] || \ - einfo "You should add zfs-zed to the default runlevel." - fi -} - -pkg_postrm() { - udev_reload -} diff --git a/files/zfs/3815.2.1/overlay/eclass/dist-kernel-utils.eclass b/files/zfs/3815.2.1/overlay/eclass/dist-kernel-utils.eclass deleted file mode 100644 index 6903183..0000000 --- a/files/zfs/3815.2.1/overlay/eclass/dist-kernel-utils.eclass +++ /dev/null @@ -1,201 +0,0 @@ -# Copyright 2020-2023 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -# @ECLASS: dist-kernel-utils.eclass -# @MAINTAINER: -# Distribution Kernel Project -# @AUTHOR: -# Michał Górny -# @SUPPORTED_EAPIS: 7 8 -# @BLURB: Utility functions related to Distribution Kernels -# @DESCRIPTION: -# This eclass provides various utility functions related to Distribution -# Kernels. - -# @ECLASS_VARIABLE: KERNEL_IUSE_SECUREBOOT -# @PRE_INHERIT -# @DEFAULT_UNSET -# @DESCRIPTION: -# If set to a non-null value, inherits secureboot.eclass -# and allows signing of generated kernel images. - -if [[ ! ${_DIST_KERNEL_UTILS} ]]; then - -case ${EAPI} in - 7|8) ;; - *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; -esac - -if [[ ${KERNEL_IUSE_SECUREBOOT} ]]; then - inherit secureboot -fi - -# @FUNCTION: dist-kernel_build_initramfs -# @USAGE: -# @DESCRIPTION: -# Build an initramfs for the kernel. specifies the absolute -# path where initramfs will be created, while specifies -# the kernel version, used to find modules. -# -# Note: while this function uses dracut at the moment, other initramfs -# variants may be supported in the future. -dist-kernel_build_initramfs() { - debug-print-function ${FUNCNAME} "${@}" - - [[ ${#} -eq 2 ]] || die "${FUNCNAME}: invalid arguments" - local output=${1} - local version=${2} - - local rel_image_path=$(dist-kernel_get_image_path) - local image=${output%/*}/${rel_image_path##*/} - - local args=( - --force - # if uefi=yes is used, dracut needs to locate the kernel image - --kernel-image "${image}" - - # positional arguments - "${output}" "${version}" - ) - - ebegin "Building initramfs via dracut" - dracut "${args[@]}" - eend ${?} || die -n "Building initramfs failed" -} - -# @FUNCTION: dist-kernel_get_image_path -# @DESCRIPTION: -# Get relative kernel image path specific to the current ${ARCH}. -dist-kernel_get_image_path() { - case ${ARCH} in - amd64|x86) - echo arch/x86/boot/bzImage - ;; - arm64) - echo arch/arm64/boot/Image.gz - ;; - arm) - echo arch/arm/boot/zImage - ;; - hppa|ppc|ppc64|sparc) - # https://www.kernel.org/doc/html/latest/powerpc/bootwrapper.html - # ./ is required because of ${image_path%/*} - # substitutions in the code - echo ./vmlinux - ;; - riscv) - echo arch/riscv/boot/Image.gz - ;; - *) - die "${FUNCNAME}: unsupported ARCH=${ARCH}" - ;; - esac -} - -# @FUNCTION: dist-kernel_install_kernel -# @USAGE: -# @DESCRIPTION: -# Install kernel using installkernel tool. specifies -# the kernel version, full path to the image, -# full path to System.map. -dist-kernel_install_kernel() { - debug-print-function ${FUNCNAME} "${@}" - - [[ ${#} -eq 3 ]] || die "${FUNCNAME}: invalid arguments" - local version=${1} - local image=${2} - local map=${3} - - # if dracut is used in uefi=yes mode, initrd will actually - # be a combined kernel+initramfs UEFI executable. we can easily - # recognize it by PE magic (vs cpio for a regular initramfs) - local initrd=${image%/*}/initrd - local magic - [[ -s ${initrd} ]] && read -n 2 magic < "${initrd}" - if [[ ${magic} == MZ ]]; then - einfo "Combined UEFI kernel+initramfs executable found" - # install the combined executable in place of kernel - image=${initrd%/*}/uki.efi - mv "${initrd}" "${image}" || die - # We moved the generated initrd, prevent dracut from running again - # https://github.com/dracutdevs/dracut/pull/2405 - shopt -s nullglob - local plugins=() - for file in "${EROOT}"/etc/kernel/install.d/*.install; do - plugins+=( "${file}" ) - done - for file in "${EROOT}"/usr/lib/kernel/install.d/*.install; do - if ! has "${file##*/}" 50-dracut.install 51-dracut-rescue.install "${plugins[@]##*/}"; then - plugins+=( "${file}" ) - fi - done - shopt -u nullglob - export KERNEL_INSTALL_PLUGINS="${KERNEL_INSTALL_PLUGINS} ${plugins[@]}" - fi - - if [[ ${KERNEL_IUSE_SECUREBOOT} ]]; then - # Kernel-install requires uki's are named uki.efi, sign in-place - secureboot_sign_efi_file "${image}" "${image}" - fi - - ebegin "Installing the kernel via installkernel" - # note: .config is taken relatively to System.map; - # initrd relatively to bzImage - installkernel "${version}" "${image}" "${map}" - eend ${?} || die -n "Installing the kernel failed" -} - -# @FUNCTION: dist-kernel_reinstall_initramfs -# @USAGE: -# @DESCRIPTION: -# Rebuild and install initramfs for the specified dist-kernel. -# is the kernel source directory (${KV_DIR} from linux-info), -# while is the full kernel version (${KV_FULL}). -# The function will determine whether is actually -# a dist-kernel, and whether initramfs was used. -# -# This function is to be used in pkg_postinst() of ebuilds installing -# kernel modules that are included in the initramfs. -dist-kernel_reinstall_initramfs() { - debug-print-function ${FUNCNAME} "${@}" - - [[ ${#} -eq 2 ]] || die "${FUNCNAME}: invalid arguments" - local kernel_dir=${1} - local ver=${2} - - local image_path=${kernel_dir}/$(dist-kernel_get_image_path) - local initramfs_path=${image_path%/*}/initrd - if [[ ! -f ${image_path} ]]; then - eerror "Kernel install missing, image not found:" - eerror " ${image_path}" - eerror "Initramfs will not be updated. Please reinstall your kernel." - return - fi - if [[ ! -f ${initramfs_path} && ! -f ${initramfs_path%/*}/uki.efi ]]; then - einfo "No initramfs or uki found at ${image_path}" - return - fi - - dist-kernel_build_initramfs "${initramfs_path}" "${ver}" - dist-kernel_install_kernel "${ver}" "${image_path}" \ - "${kernel_dir}/System.map" -} - -# @FUNCTION: dist-kernel_PV_to_KV -# @USAGE: -# @DESCRIPTION: -# Convert a Gentoo-style ebuild version to kernel "x.y.z[-rcN]" version. -dist-kernel_PV_to_KV() { - debug-print-function ${FUNCNAME} "${@}" - - [[ ${#} -ne 1 ]] && die "${FUNCNAME}: invalid arguments" - local pv=${1} - - local kv=${pv%%_*} - [[ -z $(ver_cut 3- "${kv}") ]] && kv+=".0" - [[ ${pv} == *_* ]] && kv+=-${pv#*_} - echo "${kv}" -} - -_DIST_KERNEL_UTILS=1 -fi diff --git a/files/zfs/3815.2.1/overlay/eclass/linux-mod-r1.eclass b/files/zfs/3815.2.1/overlay/eclass/linux-mod-r1.eclass deleted file mode 100644 index 8d384c2..0000000 --- a/files/zfs/3815.2.1/overlay/eclass/linux-mod-r1.eclass +++ /dev/null @@ -1,1280 +0,0 @@ -# Copyright 2023-2024 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -# @ECLASS: linux-mod-r1.eclass -# @MAINTAINER: -# Ionen Wolkens -# Gentoo Kernel project -# @AUTHOR: -# Ionen Wolkens -# @SUPPORTED_EAPIS: 8 -# @PROVIDES: linux-info -# @BLURB: Functions for installing out-of-tree Linux kernel modules -# @DESCRIPTION: -# See the linux-mod-r1_src_compile function documentation for in-depth -# usage, and see the example further down for a quick overview. -# -# @SUBSECTION linux-mod -> linux-mod-r1 migration notes -# 0. Define a src_compile if missing, local variables below go there. -# 1. MODULE_NAMES="name(libdir:srcdir:objdir)" -# BUILD_TARGETS="target" -# -> local modlist=( name=libdir:srcdir:objdir:target(s) ) -# - try without :target first, it is now almost always unnecessary -# - srcdir defaults to the current directory, and note that paths -# can be relative to that (should typically *not* pass ${S}) -# 2. BUILD_PARAMS and/or BUILD_FIXES -# -> local modargs=( VAR="${KV_OUT_DIR}" ... ) -# - CC/LD and similar are unneeded, always passed (V=1 too) -# - eval (aka eval "${BUILD_PARAMS}") is /not/ used for this anymore -# 3. s/linux-mod_/linux-mod-r1/g -# 4. _preinst+_postrm can be dropped, keep linux-mod-r1_pkg_postinst -# 5. linux-mod-r1_src_install now runs einstalldocs, adjust as needed -# 6. if *not* using linux-mod-r1_src_compile/install, then refer to -# the eclass' 2nd example and ensure using modules_post_process -# 7. If any, clang<->gcc switching custom workarounds can be dropped -# 8. See MODULES_KERNEL_MAX/_MIN if had or need kernel version checks. -# -# Not an exhaustive list, verify that no installed files are missing -# after. Look for "command not found" errors in the build log too. -# -# Revision bumps are not strictly needed to migrate unless want to -# keep the old as fallback for regressions, kernel upgrades or the -# new IUSE=+strip will typically cause rebuilds either way. -# -# @EXAMPLE: -# -# If source directory S had a layout such as: -# - Makefile (builds a gentoo.ko in current directory) -# - gamepad/Makefile (want to install to kernel/drivers/hid) -# - gamepad/obj/ (the built gamepad.ko ends up here) -# -# ...and the Makefile uses the NIH_SOURCE variable to find where the -# kernel build directory is (aka KV_OUT_DIR, see linux-info.eclass) -# -# then: -# -# @CODE -# CONFIG_CHECK="INPUT_FF_MEMLESS" # gamepad needs it to rumble -# MODULES_KERNEL_MIN=5.4 # needs features introduced in 5.4 -# -# src_compile() { -# local modlist=( -# gentoo -# gamepad=kernel/drivers/hid:gamepad:gamepad/obj -# ) -# local modargs=( NIH_SOURCE="${KV_OUT_DIR}" ) -# -# linux-mod-r1_src_compile -# } -# @CODE -# -# Alternatively, if using the package's build system directly is -# more convenient, a typical example could be: -# -# @CODE -# src_compile() { -# MODULES_MAKEARGS+=( -# NIH_KDIR="${KV_OUT_DIR}" -# NIH_KSRC="${KV_DIR}" -# ) -# -# emake "${MODULES_MAKEARGS[@]}" -# } -# -# src_install() { -# emake "${MODULES_MAKEARGS[@]}" DESTDIR="${ED}" install -# modules_post_process # strip->sign->compress -# -# einstalldocs -# } -# @CODE -# -# Some extra make variables may be of interest: -# - INSTALL_MOD_PATH: sometime used as DESTDIR -# - INSTALL_MOD_DIR: equivalent to linux_moduleinto -# -# MODULES_MAKEARGS is set by the eclass to handle toolchain and, -# when installing, also attempts to disable automatic stripping, -# compression, signing, and depmod to let the eclass handle it. -# -# linux_domodule can alternatively be used to install a single module. -# -# (remember to ensure that linux-mod-r1_pkg_postinst is ran for depmod) - -case ${EAPI} in - 8) ;; - *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; -esac - -if [[ ! ${_LINUX_MOD_R1_ECLASS} ]]; then -_LINUX_MOD_R1_ECLASS=1 - -inherit dist-kernel-utils edo linux-info multiprocessing toolchain-funcs - -IUSE="dist-kernel modules-compress modules-sign +strip ${MODULES_OPTIONAL_IUSE}" - -RDEPEND=" - sys-apps/kmod[tools] - dist-kernel? ( virtual/dist-kernel:= ) -" -DEPEND=" - virtual/linux-sources -" -BDEPEND=" - sys-apps/kmod[tools] - modules-sign? ( - dev-libs/openssl - virtual/pkgconfig - ) -" -IDEPEND=" - sys-apps/kmod[tools] -" - -if [[ -n ${MODULES_OPTIONAL_IUSE} ]]; then - : "${MODULES_OPTIONAL_IUSE#+}? ( | )" - RDEPEND=${_/|/${RDEPEND}} DEPEND=${_/|/${DEPEND}} \ - BDEPEND=${_/|/${BDEPEND}} IDEPEND=${_/|/${IDEPEND}} -fi - -# @ECLASS_VARIABLE: KERNEL_CHOST -# @USER_VARIABLE -# @DEFAULT_UNSET -# @DESCRIPTION: -# Can be set to the CHOST value to use when selecting the toolchain -# for building kernel modules. This is similar to setting the kernel -# build system's CROSS_COMPILE variable minus the trailing dash. -# -# If this does not auto-select the desired toolchain, finer control -# can be achieved by setting the not directly documented (but valid) -# variables: -# -# KERNEL_{CC,CXX,LD,AR,NM,OBJCOPY,OBJDUMP,READELF,STRIP} -# -# If in doubt, do not set any of this. -# -# Default if unset: auto-detection, typically same as the current CHOST - -# @ECLASS_VARIABLE: MODULES_EXTRA_EMAKE -# @USER_VARIABLE -# @DEFAULT_UNSET -# @DESCRIPTION: -# Extra arguments to pass to emake when building modules. -# Can contain arguments with quoted spaces, e.g. -# @CODE -# ..._EMAKE="KCFLAGS='-fzomg-optimize -fsuper-strict-aliasing' ..." -# @CODE - -# @ECLASS_VARIABLE: MODULES_I_WANT_FULL_CONTROL -# @USER_VARIABLE -# @DEFAULT_UNSET -# @DESCRIPTION: -# When set to a non-empty value, disables passing most of the eclass' -# toolchain defaults to emake when building modules. Basic eclass -# requirements, ebuilds' modargs, and users' MODULES_EXTRA_EMAKE are -# still used. -# -# Primarily intended for expert users with modified kernel Makefiles -# that want the Makefile's values to be used by default. -# -# May want to look at KERNEL_CHOST before considering this. - -# @ECLASS_VARIABLE: MODULES_SIGN_HASH -# @USER_VARIABLE -# @DEFAULT_UNSET -# @DESCRIPTION: -# Used with USE=modules-sign. Can be set to hash algorithm to use -# during signature generation. -# -# Rather than set this, it is recommended to select using the kernel's -# configuration to ensure proper support (e.g. CONFIG_MODULE_SIG_SHA256), -# and then it will be auto-detected here. -# -# Valid values: sha512,sha384,sha256,sha224,sha1 -# -# Default if unset: kernel CONFIG_MODULE_SIG_HASH's value - -# @ECLASS_VARIABLE: MODULES_SIGN_KEY -# @USER_VARIABLE -# @DEFAULT_UNSET -# @DESCRIPTION: -# Used with USE=modules-sign. Can be set to the path of the private -# key in PEM format to use, or a PKCS#11 URI. -# -# If path is relative (e.g. "certs/name.pem"), it is assumed to be -# relative to the kernel build directory being used. -# -# If the key requires a passphrase or PIN, the used kernel sign-file -# utility recognizes the KBUILD_SIGN_PIN environment variable. Be -# warned that the package manager may store this value in binary -# packages, database files, temporary files, and possibly logs. This -# eclass unsets the variable after use to mitigate the issue (notably -# for shared binary packages), but use this with care. -# -# Default if unset: kernel CONFIG_MODULE_SIG_KEY's value which itself -# defaults to certs/signing_key.pem - -# @ECLASS_VARIABLE: MODULES_SIGN_CERT -# @USER_VARIABLE -# @DESCRIPTION: -# Used with USE=modules-sign. Can be set to the path of the X.509 -# public key certificate to use. -# -# If path is relative (e.g. "certs/name.x509"), it is assumed to be -# relative to the kernel build directory being used. -: "${MODULES_SIGN_CERT:=certs/signing_key.x509}" - -# @ECLASS_VARIABLE: MODULES_KERNEL_MAX -# @DEFAULT_UNSET -# @DESCRIPTION: -# If set to a kernel version (format: 1, 1.2, or 1.2.3), will print a -# warning if the used version is greater than (ver_test -gt) to this -# value using the same amount of version components (i.e. MAX=1.2 -# allows 1.2.3, but MAX=1.2.2 does not). -# -# This should *only* be used for modules that are known to break -# frequently on kernel upgrades. If setting this to a non-LTS kernel, -# then should also take care to test and update this value regularly -# with new major kernel releases not to let the warning become stale -# and ignored by users. -# -# Not fatal to allow users to try or self-patch easily, but the (large) -# warning is difficult to miss. If need a fatal check for more serious -# issues (e.g. runtime filesystem corruption), please do it manually. -# -# This is intended to reduce the amount of bug reports for recurring -# expected issues that can be easily mitigated by using LTS kernels -# and waiting for new releases. -# -# If used, must be set before linux-mod-r1_pkg_setup is called. - -# @ECLASS_VARIABLE: MODULES_KERNEL_MIN -# @DEFAULT_UNSET -# @DESCRIPTION: -# If set to a kernel version (format: 1, 1.2, or 1.2.3), will abort if -# the used version is less than (ver_test -lt) this value. -# -# Should only be used if known broken, or if upstream recommends a sane -# minimum. Not particularly necessary for kernels that are no longer -# in the tree. -# -# If used, must be set before linux-mod-r1_pkg_setup is called. - -# @ECLASS_VARIABLE: MODULES_OPTIONAL_IUSE -# @PRE_INHERIT -# @DEFAULT_UNSET -# @DESCRIPTION: -# May contain a single flag to be added to IUSE optionally prefixed -# with a + sign to enable it by default. Doing so makes *all* of -# linux-mod-r1's functions and dependencies a no-op unless the flag -# is enabled. This includes phases, e.g. linux-mod-r1_pkg_setup will -# not process CONFIG_CHECK unless the flag is set. -# -# The typical recommended value is "+modules" (global IUSE). -# -# Note that modules being optional can be useful even if user space -# tools require them (e.g. installing in a chroot or prefix when the -# modules are loaded on the host, saves setting up linux sources). -# However, if tools are non-trivial to build, it may be preferable -# to split into two packages than use this variable due to requiring -# rebuilds every kernel upgrades. - -# @ECLASS_VARIABLE: MODULES_MAKEARGS -# @OUTPUT_VARIABLE -# @DESCRIPTION: -# Will be set after linux-mod-r1_pkg_setup has been called. Contains -# arguments that should be passed to emake when building or installing -# modules. -# -# Modifying this variable is acceptable (e.g. to append kernel source -# arguments) but, if using linux-mod-r1_src_compile, setting modargs -# is the intended method seen as cleaner and less error-prone. - -# @FUNCTION: linux-mod-r1_pkg_setup -# @DESCRIPTION: -# Required before using other functions from this eclass, and will: -# 1. run linux-info_pkg_setup (see linux-info.eclass) -# -> implies processing CONFIG_CHECK, and providing KV_ variables -# (MODULES and TRIM_UNUSED_KSYMS are always checked) -# 2. prepare toolchain to match the kernel -# -> sets KERNEL_{CHOST,CC,CXX,LD,AR,NM,OBJCOPY,OBJDUMP,READELF,STRIP} -# -> also sets MODULES_MAKEARGS array with, e.g. CC="${KERNEL_CC}" -# (normally these should not be used directly, for custom builds) -# 3. perform various sanity checks to fail early on issues -linux-mod-r1_pkg_setup() { - debug-print-function ${FUNCNAME[0]} "${@}" - [[ ${MERGE_TYPE} != binary ]] || return 0 - _MODULES_GLOBAL[ran:pkg_setup]=1 - _modules_check_function ${#} 0 0 || return 0 - _modules_check_migration - - _modules_prepare_kernel - _modules_prepare_sign - _modules_prepare_toolchain - - _modules_set_makeargs - - _modules_sanity_gccplugins -} - -# @FUNCTION: linux-mod-r1_src_compile -# @DESCRIPTION: -# Builds modules, see the eclass' example for a quick overview. -# Uses the variables modlist and modargs as described below: -# -# * local modlist=( ... ) - list of modules to build, set as: -# -# module-name=install-dir:source-dir:build-dir:make-target -# -# > module-name: Resulting name, aka .ko (required). -# -# > install-dir: Kernel modules sub-directory to install the module -# to (/lib/modules/version//name.ko). Will be used when -# run linux-mod-r1_src_install. May want to consider the values of -# INSTALL_MOD_DIR(Makefile) or DEST_MODULE_LOCATION(dkms.conf) if it -# exists, but it can be anything. -# -> Default: extra -# -# Warning: Changing this location may leave stale modules until a -# kernel upgrade as the package manager does not typically delete -# old modules and only does overwrite on rebuilds. -# -# > source-dir: Directory containing the Makefile to build the module. -# Path can be relative to the current directory or absolute. -# -> Default: current directory -# -# > build-dir: Directory that will hold the built module-name.ko. -# -> Default: same as source-dir's value -# -# > make-target: Almost always unneeded but, if defaults are not right, -# then can specify the Makefile's target(s) to build the module/extras. -# Multiple targets can be used with spaces, e.g. :"first second". -# -> Default: specially tries modules, module, .ko, default, -# all, empty target, and runs the first found usable -# -# Missing elements results in defaults being used, e.g. this is valid: -# modlist=( name1 name2=:source name3=install::build ) -# -# * local modargs=( ... ) - extra arguments to pass to emake -# -# Makefile should notably be inspected for which variable it uses -# to find the kernel's build directory then, e.g. KDIR="${KV_OUT_DIR}" -# as appropriate. Note that typically want to pass KV_OUT_DIR(build) -# rather than KV_DIR(sources) if not both. This allows users to do -# out-of-source kernel builds and still build modules. -# -# Passing common toolchain variables such as CC or LD is not needed -# here as they are passed by default. -# -# --- -# -# Allowed to be called multiple times with a different modlist if need -# different make arguments per modules or intermediate steps -- albeit, -# if atypical, may want to build manually (see eclass' example). -linux-mod-r1_src_compile() { - debug-print-function ${FUNCNAME[0]} "${@}" - _modules_check_function ${#} 0 0 || return 0 - - [[ ${modlist@a} == *a* && ${#modlist[@]} -gt 0 ]] || - die "${FUNCNAME[0]} was called without a 'modlist' array" - - # run this again to verify built files access with src_compile's user - _modules_sanity_kernelbuilt - - local -a emakeargs=( "${MODULES_MAKEARGS[@]}" ) - [[ ${modargs@a} == *a* ]] && emakeargs+=( "${modargs[@]}" ) - - local -A built=() - local build mod name target - for mod in "${modlist[@]}"; do - # note modlist was not made an associative array ([name]=) to preserve - # ordering, but is still using = to improve readability - name=${mod%%=*} - [[ -n ${name} && ${name} != *:* ]] || die "invalid mod entry '${mod}'" - - # 0:install-dir 1:source-dir 2:build-dir 3:make-target(s) - mod=${mod#"${name}"} - IFS=: read -ra mod <<<"${mod#=}" - [[ ${#mod[@]} -le 4 ]] || die "too many ':' in ${name}'s modlist" - - [[ ${mod[1]:=${PWD}} != /* ]] && mod[1]=${PWD}/${mod[1]} - [[ ${mod[2]:=${mod[1]}} != /* ]] && mod[2]=${PWD}/${mod[2]} - _MODULES_INSTALL[${mod[2]}/${name}.ko]=${mod[0]:-extra} - - pushd "${mod[1]}" >/dev/null || die - - if [[ -z ${mod[3]} ]]; then - # guess between commonly used targets if none given, fallback to - # an empty target without trying to see the error output - for target in module{s,} "${name}".ko default all; do - nonfatal emake "${emakeargs[@]}" -q "${target}" &>/dev/null - if [[ ${?} -eq 1 ]]; then - mod[3]=${target} - break - fi - done - fi - - # sometime modules are all from same source dir and built all at once, - # make will not rebuild either way but can skip the unnecessary noise - build= - for target in ${mod[3]:-&}; do - if ! has "${target}" ${built[${mod[1]}]}; then - build=1 - built[${mod[1]}]+=" ${target} " - fi - done - - if [[ ${build} ]]; then - einfo "Building ${name} module in ${mod[1]} ..." - - # allow word splitting for rare cases of multiple targets - emake "${emakeargs[@]}" ${mod[3]} - else - einfo "Building ${name} module in ${mod[1]} ... already done." - fi - - popd >/dev/null || die - done -} - -# @FUNCTION: linux-mod-r1_src_install -# @DESCRIPTION: -# Installs modules built by linux-mod-r1_src_compile using -# linux_domodule, then runs modules_post_process and einstalldocs. -linux-mod-r1_src_install() { - debug-print-function ${FUNCNAME[0]} "${@}" - _modules_check_function ${#} 0 0 || return 0 - - (( ${#_MODULES_INSTALL[@]} )) || - die "${FUNCNAME[0]} was called without running linux-mod-r1_src_compile" - - ( - for mod in "${!_MODULES_INSTALL[@]}"; do - linux_moduleinto "${_MODULES_INSTALL[${mod}]}" - linux_domodule "${mod}" - done - ) - - modules_post_process - - einstalldocs -} - -# @FUNCTION: linux-mod-r1_pkg_postinst -# @DESCRIPTION: -# Updates module dependencies using depmod. -linux-mod-r1_pkg_postinst() { - debug-print-function ${FUNCNAME[0]} "${@}" - _modules_check_function ${#} 0 0 || return 0 - - dist-kernel_compressed_module_cleanup "${EROOT}/lib/modules/${KV_FULL}" - _modules_update_depmod - - # post_process ensures modules were installed and that the eclass' USE - # are likely not no-ops (unfortunately postinst itself may be missed) - [[ -v _MODULES_GLOBAL[ran:post_process] ]] || - eqawarn "QA Notice: neither linux-mod-r1_src_install nor modules_post_process were used" -} - -# @FUNCTION: linux_domodule -# @USAGE: ... -# @DESCRIPTION: -# Installs Linux modules (.ko files). -# -# See also linux_moduleinto. -linux_domodule() { - debug-print-function ${FUNCNAME[0]} "${@}" - _modules_check_function ${#} 1 '' "..." || return 0 - ( - # linux-mod-r0 formerly supported INSTALL_MOD_PATH (bug #642240), but - # this been judged messy to integrate consistently as not everything - # uses this function and build systems sometime mix it with DESTDIR - # (try ROOT if need to install somewhere else instead) - insinto "/lib/modules/${KV_FULL}/${_MODULES_GLOBAL[moduleinto]:-extra}" - doins "${@}" - ) -} - -# @FUNCTION: linux_moduleinto -# @USAGE: -# @DESCRIPTION: -# Directory to install modules into when calling linux_domodule. -# Relative to kernel modules path as in: -# ${ED}/lib/modules/${KV_FULL}/ -# -# Can contain subdirectories, e.g. kernel/fs. -# -# If not called, defaults to "extra". On the kernel build system, -# this is like setting INSTALL_MOD_DIR which has the same default -# for external modules. -linux_moduleinto() { - debug-print-function ${FUNCNAME[0]} "${@}" - _modules_check_function ${#} 1 1 "" || return 0 - _MODULES_GLOBAL[moduleinto]=${1} -} - -# @FUNCTION: modules_post_process -# @USAGE: [] -# @DESCRIPTION: -# Strip, sign, verify, and compress all .ko modules found under -# . Should typically *not* be called directly as it will -# be run by linux-mod-r1_src_install. This is intended for use -# when modules were installed some other way. -# -# should exist under ${ED}. -# Defaults to /lib/modules/${KV_FULL}. -# -# Filenames may change due to compression, so any operations on -# these should be performed prior. -# -# Warning: This will abort if no modules are found, which can happen -# if modules were unexpectedly pre-compressed possibly due to using -# make install without passing MODULES_MAKEARGS to disable it. -modules_post_process() { - debug-print-function ${FUNCNAME[0]} "${@}" - _modules_check_function ${#} 0 1 '[]' || return 0 - [[ ${EBUILD_PHASE} == install ]] || - die "${FUNCNAME[0]} can only be called in the src_install phase" - - local path=${ED}${1-/lib/modules/${KV_FULL}} - local -a mods - [[ -d ${path} ]] && mapfile -td '' mods < <( - find "${path}" -type f -name '*.ko' -print0 || die - ) - (( ${#mods[@]} )) || - die "${FUNCNAME[0]} was called with no installed modules under ${path}" - - # TODO?: find way for sane use with dracut (its 90kernel-modules-extra - # parses depmod.d files directly and assumes should include its modules - # which can lead to unnecessarily increased size or stale modules) -# _modules_process_depmod.d "${mods[@]#"${path}/"}" - - _modules_process_strip "${mods[@]}" - _modules_process_sign "${mods[@]}" - _modules_sanity_modversion "${mods[@]}" # after strip/sign in case broke it - _modules_process_compress "${mods[@]}" - - _MODULES_GLOBAL[ran:post_process]=1 -} - -# @ECLASS_VARIABLE: _MODULES_GLOBAL -# @INTERNAL -# @DESCRIPTION: -# General use associative array to avoid defining separate globals. -declare -gA _MODULES_GLOBAL=() - -# @ECLASS_VARIABLE: _MODULES_INSTALL -# @INTERNAL -# @DESCRIPTION: -# List of modules from linux-mod-r1_src_compile to be installed. -declare -gA _MODULES_INSTALL=() - -# @FUNCTION: _modules_check_function -# @USAGE: [ []] -# @RETURN: 0 or 1 if caller should do nothing -# @INTERNAL -# @DESCRIPTION: -# Checks for MODULES_OPTIONAL_IUSE, and aborts if amount of arguments -# does not add up or if it was called before linux-mod-r1_pkg_setup. -_modules_check_function() { - [[ -z ${MODULES_OPTIONAL_IUSE} ]] || - use "${MODULES_OPTIONAL_IUSE#+}" || return 1 - - [[ ${#} == 0 || ${1} -ge ${2} && ( ! ${3} || ${1} -le ${3} ) ]] || - die "Usage: ${FUNCNAME[1]} ${4-(no arguments)}" - - [[ -v _MODULES_GLOBAL[ran:pkg_setup] ]] || - die "${FUNCNAME[1]} was called without running linux-mod-r1_pkg_setup" -} - -# @FUNCTION: _modules_check_migration -# @INTERNAL -# @DESCRIPTION: -# Aborts if see obsolete variables from the linux-mod-r0 eclass being -# used, likely due to an incomplete migration. This function should -# eventually be removed after linux-mod-r0 is @DEAD not to fail for -# nothing if users happen to have these in their environment given the -# naming for some is a bit generic. -_modules_check_migration() { - _modules_check_var() { - [[ -z ${!1} ]] || - die "${1} is obsolete, see ${2} in linux-mod-r1 eclass docs" - } - # the 'I' on this one is notably sneaky and could silently be ignored - _modules_check_var MODULES_OPTIONAL_USE MODULES_OPTIONAL_IUSE - _modules_check_var MODULES_OPTIONAL_USE_IUSE_DEFAULT MODULES_OPTIONAL_IUSE - _modules_check_var BUILD_PARAMS modargs - _modules_check_var BUILD_TARGETS modlist - _modules_check_var MODULE_NAMES modlist - [[ -z ${!MODULESD_*} ]] || - die "MODULESD_* variables are no longer supported, replace by handcrafted .conf files if needed" - - # Ignored variables: - # - BUILD_FIXES: seen in some ebuilds but was undocumented and linux-info - # still sets it preventing from blocking it entirely - # - ECONF_PARAMS: documented but was a no-op in linux-mod too -} - -# @FUNCTION: _modules_prepare_kernel -# @INTERNAL -# @DESCRIPTION: -# Handles linux-info bits to provide usable sources, KV_ variables, -# and CONFIG_CHECK use. -_modules_prepare_kernel() { - get_version - - # linux-info allows skipping checks if SKIP_KERNEL_CHECK is set and - # then require_configured_kernel will not abort, but no sources means - # 100% failure for building modules and so just abort now (the proper - # way to allow skipping sources here is MODULES_OPTIONAL_IUSE) - [[ -n ${KV_FULL} ]] || - die "kernel sources are required to build kernel modules" - - require_configured_kernel - - _modules_sanity_kernelbuilt - _modules_sanity_kernelversion - - # note: modules-specific check_modules_supported could probably be - # removed from linux-info in the future as this is a sufficient check - local CONFIG_CHECK="${CONFIG_CHECK} MODULES" - - # kernel will not typically know about symbols we use (bug #591832), - # but stay non-fatal if kernel has an exception list set (bug #759238) - # note: possible to bypass either way with CHECKCONFIG_DONOTHING=1 - if [[ $(linux_chkconfig_string UNUSED_KSYMS_WHITELIST) == \"+(?)\" ]]; then - CONFIG_CHECK+=" ~!TRIM_UNUSED_KSYMS" - else - CONFIG_CHECK+=" !TRIM_UNUSED_KSYMS" - fi - - linux-info_pkg_setup - - if use dist-kernel && - ! has_version "~virtual/dist-kernel-${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}" - then - ewarn - ewarn "The kernel modules in ${CATEGORY}/${PN} are being built for" - ewarn "kernel version ${KV_FULL}. But this does not match the" - ewarn "installed version of virtual/dist-kernel." - ewarn - ewarn "If this is not intentional, the problem may be corrected by" - ewarn "using \"eselect kernel\" to set the default kernel version to" - ewarn "the same version as the installed version of virtual/dist-kernel." - ewarn - ewarn "If the distribution kernel is being downgraded, ensure that" - ewarn "virtual/dist-kernel is also downgraded to the same version" - ewarn "before rebuilding external kernel modules." - ewarn - fi -} - -# @FUNCTION: _modules_prepare_sign -# @INTERNAL -# @DESCRIPTION: -# Determines arguments to pass to sign-file (hash/keys), and performs -# basic sanity checks to abort early if signing does not look possible. -_modules_prepare_sign() { - use modules-sign || return 0 - - _modules_sign_die() { - eerror "USE=modules-sign requires additional configuration, please see the" - eerror "kernel[1] documentation and the linux-mod-r1 eclass[2] user variables." - eerror "[1] https://www.kernel.org/doc/html/v${KV_MAJOR}.${KV_MINOR}/admin-guide/module-signing.html" - eerror "[2] https://devmanual.gentoo.org/eclass-reference/linux-mod-r1.eclass/index.html" - die "USE=modules-sign is set but ${*}" - } - - linux_chkconfig_present MODULE_SIG || - _modules_sign_die "CONFIG_MODULE_SIG is not set in the kernel" - - if [[ -z ${MODULES_SIGN_HASH} ]]; then - : "$(linux_chkconfig_string MODULE_SIG_HASH)" - MODULES_SIGN_HASH=${_//\"} - [[ -n ${MODULES_SIGN_HASH} ]] || - _modules_sign_die "CONFIG_MODULE_SIG_HASH is not set in the kernel" - fi - - if [[ -z ${MODULES_SIGN_KEY} ]]; then - : "$(linux_chkconfig_string MODULE_SIG_KEY)" - MODULES_SIGN_KEY=${_//\"} - [[ -n ${MODULES_SIGN_KEY} ]] || - _modules_sign_die "CONFIG_MODULE_SIG_KEY is not set in the kernel" - fi - - [[ ${MODULES_SIGN_KEY} != @(/|pkcs11:)* ]] && - MODULES_SIGN_KEY=${KV_OUT_DIR}/${MODULES_SIGN_KEY} - [[ ${MODULES_SIGN_CERT} != /* ]] && - MODULES_SIGN_CERT=${KV_OUT_DIR}/${MODULES_SIGN_CERT} - - # assumes users know what they are doing if using a pkcs11 URI - [[ ${MODULES_SIGN_KEY} == pkcs11:* || -f ${MODULES_SIGN_KEY} ]] || - _modules_sign_die "the private key '${MODULES_SIGN_KEY}' was not found" - [[ -f ${MODULES_SIGN_CERT} ]] || - _modules_sign_die "the public key certificate '${MODULES_SIGN_CERT}' was not found" -} - -# @FUNCTION: _modules_prepare_toolchain -# @INTERNAL -# @DESCRIPTION: -# Sets KERNEL_{CC,CXX,LD,AR,NM,OBJCOPY,OBJDUMP,READELF,STRIP} based on -# the kernel configuration and KERNEL_CHOST (also set if missing) that -# *should* be usable to build modules. -# -# Tries to match compiler type (gcc or clang), and major version. Will -# inform if matching was not possible likely due to the compiler being -# uninstalled. Users can set KERNEL_ variables themselves to override. -# -# These variables are normally manipulated by the kernel's LLVM=1 with -# the exception of CXX that is included anyway given *some* out-of-tree -# modules use it, e.g. nvidia-drivers[kernel-open]. -_modules_prepare_toolchain() { - # note that the kernel adds -m32/-m64/-m elf_x86_64/etc... for, e.g. - # toolchains defaulting to x32, but may need automagic here if need - # a different toolchain such as sys-devel/kgcc64 - [[ -z ${KERNEL_CHOST} ]] && linux_chkconfig_present 64BIT && - case ${CHOST} in - # matching kernel-build.eclass, see for details - hppa2.0-*) KERNEL_CHOST=${CHOST/2.0/64};; - esac - - # recognizing KERNEL_CHOST given CROSS_COMPILE seems too generic here, - # but should rarely be necessary unless different userland and kernel - : "${KERNEL_CHOST:=${CHOST}}" - - einfo "Preparing ${KERNEL_CHOST} toolchain for kernel modules (override with KERNEL_CHOST) ..." - - _modules_tc_best() { - [[ -z ${!1} ]] && read -r ${1} < <(type -P -- "${@:2}") - } - - local gccv clangv tool - if linux_chkconfig_present CC_IS_GCC; then - gccv=$(linux_chkconfig_string GCC_VERSION) - gccv=${gccv::2} # major version, will break on gcc-100... - # chost-gcc-ver > chost-gcc > gcc-ver > gcc - _modules_tc_best KERNEL_CC {"${KERNEL_CHOST}-",}gcc{"-${gccv}",} - _modules_tc_best KERNEL_CXX {"${KERNEL_CHOST}-",}g++{"-${gccv}",} - # unknown what was used exactly here, but prefer non-llvm with gcc - for tool in AR NM OBJCOPY OBJDUMP READELF STRIP; do - _modules_tc_best KERNEL_${tool} \ - {"${KERNEL_CHOST}-",}{gcc-,}${tool,,} - done - elif linux_chkconfig_present CC_IS_CLANG; then - clangv=$(linux_chkconfig_string CLANG_VERSION) - clangv=${clangv::2} - # like gcc, but try directories to get same version on all tools - # (not using get_llvm_prefix to avoid conflicts with ebuilds using - # llvm slots for non-modules reasons, e.g. sets llvm_check_deps) - _modules_tc_best KERNEL_CC \ - {"${BROOT}/usr/lib/llvm/${clangv}/bin/",}{"${KERNEL_CHOST}-",}clang{"-${clangv}",} - _modules_tc_best KERNEL_CXX \ - {"${BROOT}/usr/lib/llvm/${clangv}/bin/",}{"${KERNEL_CHOST}-",}clang++{"-${clangv}",} - for tool in AR NM OBJCOPY OBJDUMP READELF STRIP; do - _modules_tc_best KERNEL_${tool} \ - {"${BROOT}/usr/lib/llvm/${clangv}/bin/",}{"${KERNEL_CHOST}-",}{llvm-,}${tool,,} - done - fi - - if linux_chkconfig_present LD_IS_BFD; then - _modules_tc_best KERNEL_LD {"${KERNEL_CHOST}-",}ld.bfd - elif linux_chkconfig_present LD_IS_LLD; then - # also match with clang if it was used - _modules_tc_best KERNEL_LD \ - {${clangv+"${BROOT}/usr/lib/llvm/${clangv}/bin/"},}{"${KERNEL_CHOST}-",}ld.lld - fi - - # if any variables are still empty, fallback to normal defaults - local CHOST=${KERNEL_CHOST} - : "${KERNEL_CC:=$(tc-getCC)}" - : "${KERNEL_CXX:=$(tc-getCXX)}" - : "${KERNEL_LD:=$(tc-getLD)}" - : "${KERNEL_AR:=$(tc-getAR)}" - : "${KERNEL_NM:=$(tc-getNM)}" - : "${KERNEL_OBJCOPY:=$(tc-getOBJCOPY)}" - : "${KERNEL_OBJDUMP:=$(tc-getOBJDUMP)}" - : "${KERNEL_READELF:=$(tc-getREADELF)}" - : "${KERNEL_STRIP:=$(tc-getSTRIP)}" - - # for toolchain-funcs, uses CPP > CC but set both not to make assumptions - local CC=${KERNEL_CC} CPP="${KERNEL_CC} -E" LD=${KERNEL_LD} - - # show results, skip line wrap to avoid standing out too much - einfo "Toolchain picked for kernel modules (override with KERNEL_CC, _LD, ...):"\ - "'${KERNEL_CC}' '${KERNEL_CXX}' '${KERNEL_LD}' '${KERNEL_AR}'"\ - "'${KERNEL_NM}' '${KERNEL_OBJCOPY}' '${KERNEL_OBJDUMP}'"\ - "'${KERNEL_READELF}' '${KERNEL_STRIP}'" - - # hack: kernel adds --thinlto-cache-dir to KBUILD_LDFLAGS with ThinLTO - # resulting in sandbox violations and we cannot safely override that - # variable, using *both* {LDFLAGS_MODULE,ldflags-y}=--thinlto-cache-dir= - # can work but raises concerns about breaking packages that may use these - if linux_chkconfig_present LTO_CLANG_THIN && tc-ld-is-lld; then - KERNEL_LD=${T}/linux-mod-r1_ld.lld - printf '#!/usr/bin/env sh\nexec %s "${@}" --thinlto-cache-dir=\n' \ - "${LD}" > "${KERNEL_LD}" || die - chmod +x -- "${KERNEL_LD}" || die - fi - - # warn if final picked CC type or major version is mismatching, arguably - # should be fatal but not forcing given it is not *always* an issue - local warn - if [[ -v gccv ]]; then - if ! tc-is-gcc; then - warn="gcc-${gccv} but\n '${KERNEL_CC}' is not gcc" - elif [[ $(gcc-major-version) -ne "${gccv}" ]]; then - warn="gcc-${gccv} but\n '${KERNEL_CC}' is gcc-$(gcc-major-version)" - fi - elif [[ -v clangv ]]; then - if ! tc-is-clang; then - warn="clang-${clangv} but\n '${KERNEL_CC}' is not clang" - elif [[ $(clang-major-version) -ne "${clangv}" ]]; then - warn="clang-${clangv} but\n '${KERNEL_CC}' is clang-$(clang-major-version)" - fi - fi - - if [[ -v warn ]]; then - ewarn - ewarn "Warning: kernel ${KV_FULL} is built with ${warn}" - ewarn "This *could* result in build issues or other incompatibilities." - ewarn "It is recommended to either \`make clean\` and rebuild the kernel" - ewarn "with the current toolchain (for distribution kernels, re-installing" - ewarn "will do the same), or set the KERNEL_CC variable to point to the" - ewarn "same compiler. Note that when it is available, auto-selection is" - ewarn "attempted making the latter rarely needed." - ewarn - fi -} - -# @FUNCTION: _modules_process_compress -# @USAGE: ... -# @INTERNAL -# @DESCRIPTION: -# If enabled in the kernel configuration, this compresses the given -# modules using the same format. -_modules_process_compress() { - use modules-compress || return - - local -a compress - if linux_chkconfig_present MODULE_COMPRESS_XZ; then - compress=( - xz -q - --memlimit-compress=50% - --threads="$(makeopts_jobs)" - # match options from kernel's Makefile.modinst (bug #920837) - --check=crc32 - --lzma2=dict=1MiB - ) - elif linux_chkconfig_present MODULE_COMPRESS_GZIP; then - if type -P pigz &>/dev/null; then - compress=(pigz -p"$(makeopts_jobs)") - else - compress=(gzip) - fi - elif linux_chkconfig_present MODULE_COMPRESS_ZSTD; then - compress=(zstd -qT"$(makeopts_jobs)" --rm) - else - die "USE=modules-compress enabled but no MODULE_COMPRESS* configured" - fi - - # could fail, assumes have commands that were needed for the kernel - einfo "Compressing modules (matching the kernel configuration) ..." - edob "${compress[@]}" -- "${@}" -} - -# @FUNCTION: _modules_process_depmod.d -# @USAGE: ... -# @INTERNAL -# @DESCRIPTION: -# Generate a depmod.d file to ensure priority if duplicate modules -# exist, such as stale modules in different directories, or to -# override the kernel's own modules. -_modules_process_depmod.d() { - ( - [[ ${SLOT%/*} == 0 ]] && slot= || slot=-${SLOT%/*} - insinto /lib/depmod.d - newins - ${PN}${slot}.conf < <( - echo "# Automatically generated by linux-mod-r1.eclass for ${CATEGORY}/${PN}" - for mod; do - [[ ${mod} =~ ^(.+)/(.+).ko$ ]] && - echo "override ${BASH_REMATCH[2]} ${KV_FULL} ${BASH_REMATCH[1]}" - done - ) - ) -} - -# @FUNCTION: _modules_process_sign -# @USAGE: ... -# @INTERNAL -# @DESCRIPTION: -# Cryptographically signs the given modules when USE=modules-sign is -# enabled. -_modules_process_sign() { - use modules-sign || return 0 - - # scripts/sign-file used to be a perl script but is now written in C, - # and it could either be missing or broken given it links with openssl - # (no subslot rebuilds on kernel sources), trivial to compile regardless - local sign= - if [[ -f ${KV_DIR}/scripts/sign-file.c ]]; then - sign=${T}/linux-mod-r1_sign-file - ( - # unfortunately using the kernel's Makefile is inconvenient (no - # simple build target for this), may need revisiting on changes - einfo "Compiling sign-file ..." - tc-export_build_env - nonfatal edob $(tc-getBUILD_CC) ${BUILD_CFLAGS} ${BUILD_CPPFLAGS} \ - $($(tc-getBUILD_PKG_CONFIG) --cflags libcrypto) \ - ${BUILD_LDFLAGS} -o "${sign}" "${KV_DIR}"/scripts/sign-file.c \ - $($(tc-getBUILD_PKG_CONFIG) --libs libcrypto || echo -lcrypto) - ) || { - einfo "Trying fallback ..." - sign= - } - fi - - if [[ -z ${sign} ]]; then - if [[ -x ${KV_OUT_DIR}/scripts/sign-file ]]; then - sign=${KV_OUT_DIR}/scripts/sign-file # try if built - elif [[ -x ${KV_DIR}/scripts/sign-file ]]; then - sign=${KV_DIR}/scripts/sign-file # old kernel (... -# @INTERNAL -# @DESCRIPTION: -# Strips the given modules of unneeded symbols when USE=strip is -# enabled, and informs the package manager not to regardless. -_modules_process_strip() { - # letting the package manager handle this complicates scenarios - # where we want to either compress the pre-stripped module, or - # sign the module without its signature becoming invalid on merge - dostrip -x "${@#"${ED}"}" - - if use strip; then - einfo "Stripping modules ..." - edob "${KERNEL_STRIP}" --strip-unneeded -- "${@}" - fi -} - -# @FUNCTION: _modules_sanity_gccplugins -# @INTERNAL -# @DESCRIPTION: -# Performs a basic build test to detect GCC plugins mismatch issues -# and, if so, aborts with explanation given it often confuses users. -# -# Using mismatching gcc can sometime work to build modules, but if -# GCC plugins are enabled it will almost always be an error. -# -# Note: may need occasional review to ensure the test still works by: -# enabling a GCC plugin in the kernel, building with older GCC, -# then building a module by setting KERNEL_CC=gcc-. -_modules_sanity_gccplugins() { - linux_chkconfig_present GCC_PLUGINS || return 0 - - local tmp=${T}/linux-mod-r1_gccplugins - mkdir -p -- "${tmp}" || die - - echo "obj-m += test.o" > "${tmp}"/Kbuild || die - :> "${tmp}"/test.c || die - - # always fails, but interested in the stderr messages - local output=$( - cd -- "${KV_OUT_DIR}" && # fwiw skip non-POSIX -C in eclasses - LC_ALL=C nonfatal emake "${MODULES_MAKEARGS[@]}" M="${tmp}" \ - 2>&1 >/dev/null - ) - - if [[ ${output} == *"error: incompatible gcc/plugin version"* ]]; then - eerror "GCC_PLUGINS is enabled in the kernel and plugin version mismatch issues" - eerror "have been detected. Please \`make clean\` and rebuild the kernel using" - eerror "the current version of GCC (or re-install for distribution kernels)." - die "kernel ${KV_FULL} needs to be rebuilt" - fi -} - -# @FUNCTION: _modules_sanity_kernelbuilt -# @INTERNAL -# @DESCRIPTION: -# Checks if the kernel seems fully built by having a Module.symvers -# that is also readable, abort otherwise. -# -# About readability, occasionally users build their kernel as root with -# umask 0077 and then the package manager's user cannot read built files -# leaving them confused. -# -# Given user and access can very between phases (notably src_compile), -# it makes sense to run this check more than once. -# -# Note: -# This is an alternate version of linux-info's check_kernel_built -# which probably will not need to exist there if linux-mod-r0 is -# gone, error it gives is also modules-specific and fits better here. -# -# The old check_kernel_built checks version.h and suggests running -# modules_prepare if missing, but that does not create Module.symvers. -# Nowadays the kernel makes unresolved symbols fatal by default -# meaning that all modules will fail unless KBUILD_MODPOST_WARN=1 -# which seem questionable to support. So rather than version.h, this -# checks and require Module.symvers, and suggests a full build if -# missing (if really must, users can bypass by touching the file). -# nvidia-drivers (for one) further checks this file directly to do -# configure tests that will break badly without. -_modules_sanity_kernelbuilt() { - local symvers=${KV_OUT_DIR}/Module.symvers - - if [[ ! -f ${symvers} ]]; then - eerror "'${symvers}' was not found implying that the" - eerror "linux-${KV_FULL} tree at that location has not been built." - eerror - eerror "Please verify that this is the intended kernel version, then perform" - eerror "a full build[1] (i.e. make && make modules_install && make install)." - eerror - eerror "Alternatively, consider a distribution kernel[2] that does not need" - eerror "these manual steps (e.g. sys-kernel/gentoo-kernel or gentoo-kernel-bin)." - eerror - eerror "[1] https://wiki.gentoo.org/wiki/Kernel/Configuration#Build" - eerror "[2] https://wiki.gentoo.org/wiki/Project:Distribution_Kernel" - die "built kernel sources are required to build kernel modules" - fi - - if [[ ! -r ${symvers} ]]; then - eerror "'${symvers}' exists but cannot be read by the" - eerror "user id(${EUID}) of the package manager, likely implying no world" - eerror "read access permissions:" - eerror - eerror " $(ls -l -- "${symvers}")" - eerror - eerror "Causes may vary, but a common one is building the kernel with a umask" - eerror "value of '0077' rather than the more typical '0022' (run the \`umask\`" - eerror "command to confirm, as root if was building the kernel using it)." - eerror - eerror "Many other files are likely affected and will lead to build failures." - eerror "It is recommended to clean the sources and rebuild with \`umask 0022\`" - eerror "rather than attempt to fix the permissions manually." - die "no read access permission to the generated kernel files" - fi -} - -# @FUNCTION: _modules_sanity_kernelversion -# @INTERNAL -# @DESCRIPTION: -# Prints a warning if the kernel version is greater than to -# MODULES_KERNEL_MAX (while only considering same amount of version -# components), or aborts if it is less than MODULES_KERNEL_MIN -_modules_sanity_kernelversion() { - local kv=${KV_MAJOR}.${KV_MINOR}.${KV_PATCH} - - if [[ -n ${MODULES_KERNEL_MIN} ]] && - ver_test "${kv}" -lt "${MODULES_KERNEL_MIN}" - then - eerror "${P} requires a kernel version of at least >=${MODULES_KERNEL_MIN}," - eerror "but the current kernel is ${KV_FULL}. Please update." - die "kernel ${KV_FULL} is too old" - fi - - if [[ -n ${MODULES_KERNEL_MAX} ]]; then - : "${MODULES_KERNEL_MAX//[^.]/}" - local -i count=${#_} - - if ver_test "$(ver_cut 1-$((count+1)) "${kv}")" \ - -gt "${MODULES_KERNEL_MAX}" - then - # add .x to 1 missing component to make, e.g. <=1.2.x more natural, - # not <1.3 given users sometimes see it as 1.3 support at a glance - local max=${MODULES_KERNEL_MAX} - [[ ${count} -lt 2 ]] && max+=.x - - ewarn - ewarn " *** WARNING *** " - ewarn - ewarn "${PN} is known to break easily with new kernel versions and," - ewarn "with the current kernel (${KV_FULL}), it was either hardly" - ewarn "tested or is known broken. It is recommended to use one of:" - ewarn - # fwiw we do not know what is *actually* used or wanted even with - # the USE, so stay a bit vague and always mention both dist+sources - if use dist-kernel; then - ewarn " <=virtual/dist-kernel-${max} or" - else - ewarn " <=sys-kernel/gentoo-kernel-${max} or" - fi - ewarn " <=sys-kernel/gentoo-sources-${max}" - ewarn - ewarn "or equivalent rather than file downstream bug reports if run into" - ewarn "issues, then wait for upstream fixes and a new release. Ideally," - ewarn "with out-of-tree modules, use an LTS (Long Term Support) kernel" - ewarn "branch[1]. If in doubt, Gentoo's stable kernels are always LTS" - ewarn "and can be easily used even on ~testing systems." - ewarn - ewarn "[1] https://www.kernel.org/category/releases.html" - ewarn - fi - fi -} - -# @FUNCTION: _modules_sanity_modversion -# @USAGE: ... -# @INTERNAL -# @DESCRIPTION: -# Checks if the passed module(s) do not seem obviously broken and the -# builtin versions match ${KV_FULL}, otherwise die with an explanation. -# -# If receive a bug with a version error, an easy way to reproduce is to -# set KERNEL_DIR with the sources of a different kernel version than -# both the ones pointed by /usr/src/linux and `uname -r`. Refer to -# linux-mod-r1_src_compile's modargs in the eclass docs for fixing. -_modules_sanity_modversion() { - local mod ver - for mod; do - # modinfo can read different-arch modules, being fatal *should* be safe - # and serve as a basic sanity check to ensure the module is valid - read -rd ' ' ver < <( - LC_ALL=C modinfo -F vermagic -- "${mod}" || - die "modinfo failed to read module '${mod}' (broken module?)" - ) - [[ -n ${ver} ]] || - die "modinfo found no kernel version in '${mod}' (broken module?)" - - if [[ ${ver} != "${KV_FULL}" ]]; then - eerror "A module seem to have been built for kernel version '${ver}'" - eerror "while it was meant for '${KV_FULL}'. This may indicate an" - eerror "ebuild issue (e.g. used runtime \`uname -r\` kernel rather than" - eerror "the chosen sources). Please report this to the ebuild's maintainer." - die "module and source version mismatch in '${mod}'" - fi - done -} - -# @FUNCTION: _modules_set_makeargs -# @INTERNAL -# @DESCRIPTION: -# Sets the MODULES_MAKEARGS global array. -_modules_set_makeargs() { - MODULES_MAKEARGS=( - ARCH="$(tc-arch-kernel)" - - V=1 - # normally redundant with V, but some custom Makefiles override it - KBUILD_VERBOSE=1 - - # unrealistic when building modules that often have slow releases, - # but note that the kernel will still pass some -Werror=bad-thing - CONFIG_WERROR= - - # these are only needed if using these arguments for installing, lets - # eclass handle strip, sign, compress, and depmod (CONFIG_ should - # have no impact on building, only used by Makefile.modinst) - CONFIG_MODULE_{SIG_ALL,COMPRESS_{GZIP,XZ,ZSTD}}= - DEPMOD=true #916587 - STRIP=true - ) - - if [[ ! ${MODULES_I_WANT_FULL_CONTROL} ]]; then - # many of these are unlikely to be useful here, but still trying to be - # complete given never know what out-of-tree modules may use - MODULES_MAKEARGS+=( - # wrt bug #550428, given most toolchain variables are being passed to - # make, setting CROSS in the environment would change very little - # (instead set KERNEL_CHOST which will affect other variables, - # or MODULES_I_WANT_FULL_CONTROL if do not want any of this) - CROSS_COMPILE="${KERNEL_CHOST}-" - - HOSTCC="$(tc-getBUILD_CC)" - HOSTCXX="$(tc-getBUILD_CXX)" - - # fwiw this function is not meant to pollute the environment - HOSTCFLAGS="$(tc-export_build_env; echo "${BUILD_CFLAGS}")" - HOSTCXXFLAGS="$(tc-export_build_env; echo "${BUILD_CXXFLAGS}")" - HOSTLDFLAGS="$(tc-export_build_env; echo "${BUILD_LDFLAGS}")" - - HOSTPKG_CONFIG="$(tc-getBUILD_PKG_CONFIG)" - - CC="${KERNEL_CC}" - CXX="${KERNEL_CXX}" - LD="${KERNEL_LD}" - AR="${KERNEL_AR}" - NM="${KERNEL_NM}" - OBJCOPY="${KERNEL_OBJCOPY}" - OBJDUMP="${KERNEL_OBJDUMP}" - READELF="${KERNEL_READELF}" - ) - fi - - # eval is to handle quoted spaces, die is for syntax errors - eval "MODULES_MAKEARGS+=( ${MODULES_EXTRA_EMAKE} )" || die -} - -# @FUNCTION: _modules_update_depmod -# @INTERNAL -# @DESCRIPTION: -# If possible, update module dependencies using depmod and System.map, -# otherwise prompt user to handle it. System.map may notably no longer -# be available on binary merges. -_modules_update_depmod() { - # prefer /lib/modules' path given it is what depmod operates on, - # and is mostly foolproof when it comes to ROOT (relative symlink) - local map=${EROOT}/lib/modules/${KV_FULL}/build/System.map - - if [[ ! -f ${map} ]]; then - # KV_OUT_DIR may still be right even on a different system, but state - # of (E)ROOT is unknown, e.g. could be from KERNEL_DIR=${OLDROOT}/... - map=${KV_OUT_DIR}/System.map - - # last resort, typical but may not be mounted/readable/installed - [[ ! -f ${map} ]] && - map=${EROOT}/boot/System.map-${KV_FULL} - fi - - einfo "Updating module dependencies for kernel ${KV_FULL} ..." - if [[ -f ${map} ]]; then - local depmodargs=( -ae -F "${map}" "${KV_FULL}" ) - - # for nicer postinst display, keep command shorter if EROOT is unset - [[ ${EROOT} ]] && - depmodargs+=( - -b "${EROOT}" - - # EROOT from -b is not used when looking for configuration - # directories, so pass the whole list from kmod's tools/depmod.c - --config="${EROOT}"/{etc,run,usr/local/lib,lib}/depmod.d - ) - - nonfatal edob depmod "${depmodargs[@]}" && return 0 - else - eerror - eerror "System.map for kernel ${KV_FULL} was not found, may be due to the" - eerror "built kernel sources no longer being available and lacking the fallback:" - eerror - eerror "${EROOT}/boot/System.map-${KV_FULL}" - fi - eerror - eerror "Some modules may not load without updating manually using depmod." -} - -fi - -EXPORT_FUNCTIONS pkg_setup src_compile src_install pkg_postinst diff --git a/files/zfs/3815.2.1/overlay/metadata/layout.conf b/files/zfs/3815.2.1/overlay/metadata/layout.conf deleted file mode 100644 index e85e826..0000000 --- a/files/zfs/3815.2.1/overlay/metadata/layout.conf +++ /dev/null @@ -1,4 +0,0 @@ -masters = portage-stable -thin-manifests = true -sign-commits = false -sign-manifests = false diff --git a/files/zfs/3815.2.1/overlay/profiles/repo_name b/files/zfs/3815.2.1/overlay/profiles/repo_name deleted file mode 100644 index e0f34db..0000000 --- a/files/zfs/3815.2.1/overlay/profiles/repo_name +++ /dev/null @@ -1 +0,0 @@ -zfs-overlay diff --git a/files/zfs/3815.2.1/overlay/sys-fs/udev-init-scripts/Manifest b/files/zfs/3815.2.1/overlay/sys-fs/udev-init-scripts/Manifest deleted file mode 100644 index 037e60f..0000000 --- a/files/zfs/3815.2.1/overlay/sys-fs/udev-init-scripts/Manifest +++ /dev/null @@ -1 +0,0 @@ -DIST udev-init-scripts-35.tar.gz 3666 BLAKE2B fddae466428605ea930519e8a47e0ea91f89f9eacc1fd97c137d175142125b12c3d045aec68db35a463de444ac6d8c037cca55f9628f10576c968259d566a9e4 SHA512 da9d2093149967e2e1b9bc7190ddfd55a87c9ae2177e3216f7cb2694fc9b64037eb6f2599ad8a4b7594ef32ced88fbb319c92904bc72a81ea5404945f8a8378a diff --git a/files/zfs/3815.2.1/overlay/sys-fs/udev-init-scripts/metadata.xml b/files/zfs/3815.2.1/overlay/sys-fs/udev-init-scripts/metadata.xml deleted file mode 100644 index 31123d0..0000000 --- a/files/zfs/3815.2.1/overlay/sys-fs/udev-init-scripts/metadata.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - systemd@gentoo.org - - diff --git a/files/zfs/3815.2.1/overlay/sys-fs/udev-init-scripts/udev-init-scripts-35.ebuild b/files/zfs/3815.2.1/overlay/sys-fs/udev-init-scripts/udev-init-scripts-35.ebuild deleted file mode 100644 index 866d0ce..0000000 --- a/files/zfs/3815.2.1/overlay/sys-fs/udev-init-scripts/udev-init-scripts-35.ebuild +++ /dev/null @@ -1,50 +0,0 @@ -# Copyright 1999-2022 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 -OLD_PN=udev-gentoo-scripts -OLD_P=${OLD_PN}-${PV} - -if [ "${PV}" = "9999" ]; then - EGIT_REPO_URI="https://anongit.gentoo.org/proj/${OLD_PN}.git" - inherit git-r3 -else - SRC_URI="https://gitweb.gentoo.org/proj/${OLD_PN}.git/snapshot/${OLD_P}.tar.gz -> ${P}.tar.gz" - S="${WORKDIR}/${OLD_P}" - KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86" -fi - -DESCRIPTION="udev startup scripts for openrc" -HOMEPAGE="https://wiki.gentoo.org/wiki/No_homepage" - -LICENSE="GPL-2" -SLOT="0" - -RESTRICT="test" - -RDEPEND=">=virtual/udev-217 - !$1/build.log 2>&1]) diff --git a/files/zfs/3815.2.1/overlay/sys-fs/zfs-kmod/files/zfs-kmod-2.2.2-arm64-neon.patch b/files/zfs/3815.2.1/overlay/sys-fs/zfs-kmod/files/zfs-kmod-2.2.2-arm64-neon.patch deleted file mode 100644 index 54121ad..0000000 --- a/files/zfs/3815.2.1/overlay/sys-fs/zfs-kmod/files/zfs-kmod-2.2.2-arm64-neon.patch +++ /dev/null @@ -1,100 +0,0 @@ -https://bugs.gentoo.org/904657 -https://github.com/openzfs/zfs/issues/14555 -https://github.com/openzfs/zfs/commit/976bf9b6a61919638d42ed79cd207132785d128a - -From 976bf9b6a61919638d42ed79cd207132785d128a Mon Sep 17 00:00:00 2001 -From: Shengqi Chen -Date: Tue, 9 Jan 2024 08:05:24 +0800 -Subject: [PATCH] Linux 6.2 compat: add check for kernel_neon_* availability - -This patch adds check for `kernel_neon_*` symbols on arm and arm64 -platforms to address the following issues: - -1. Linux 6.2+ on arm64 has exported them with `EXPORT_SYMBOL_GPL`, so - license compatibility must be checked before use. -2. On both arm and arm64, the definitions of these symbols are guarded - by `CONFIG_KERNEL_MODE_NEON`, but their declarations are still - present. Checking in configuration phase only leads to MODPOST - errors (undefined references). - -Reviewed-by: Brian Behlendorf -Signed-off-by: Shengqi Chen -Closes #15711 -Closes #14555 -Closes: #15401 ---- a/config/kernel-fpu.m4 -+++ b/config/kernel-fpu.m4 -@@ -79,6 +79,12 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_FPU], [ - __kernel_fpu_end(); - ], [], [ZFS_META_LICENSE]) - -+ ZFS_LINUX_TEST_SRC([kernel_neon], [ -+ #include -+ ], [ -+ kernel_neon_begin(); -+ kernel_neon_end(); -+ ], [], [ZFS_META_LICENSE]) - ]) - - AC_DEFUN([ZFS_AC_KERNEL_FPU], [ -@@ -105,9 +111,20 @@ AC_DEFUN([ZFS_AC_KERNEL_FPU], [ - AC_DEFINE(KERNEL_EXPORTS_X86_FPU, 1, - [kernel exports FPU functions]) - ],[ -- AC_MSG_RESULT(internal) -- AC_DEFINE(HAVE_KERNEL_FPU_INTERNAL, 1, -- [kernel fpu internal]) -+ dnl # -+ dnl # ARM neon symbols (only on arm and arm64) -+ dnl # could be GPL-only on arm64 after Linux 6.2 -+ dnl # -+ ZFS_LINUX_TEST_RESULT([kernel_neon_license],[ -+ AC_MSG_RESULT(kernel_neon_*) -+ AC_DEFINE(HAVE_KERNEL_NEON, 1, -+ [kernel has kernel_neon_* functions]) -+ ],[ -+ # catch-all -+ AC_MSG_RESULT(internal) -+ AC_DEFINE(HAVE_KERNEL_FPU_INTERNAL, 1, -+ [kernel fpu internal]) -+ ]) - ]) - ]) - ]) ---- a/include/os/linux/kernel/linux/simd_aarch64.h -+++ b/include/os/linux/kernel/linux/simd_aarch64.h -@@ -71,9 +71,15 @@ - #define ID_AA64PFR0_EL1 sys_reg(3, 0, 0, 1, 0) - #define ID_AA64ISAR0_EL1 sys_reg(3, 0, 0, 6, 0) - -+#if (defined(HAVE_KERNEL_NEON) && defined(CONFIG_KERNEL_MODE_NEON)) - #define kfpu_allowed() 1 - #define kfpu_begin() kernel_neon_begin() - #define kfpu_end() kernel_neon_end() -+#else -+#define kfpu_allowed() 0 -+#define kfpu_begin() do {} while (0) -+#define kfpu_end() do {} while (0) -+#endif - #define kfpu_init() (0) - #define kfpu_fini() do {} while (0) - ---- a/include/os/linux/kernel/linux/simd_arm.h -+++ b/include/os/linux/kernel/linux/simd_arm.h -@@ -53,9 +53,15 @@ - #include - #include - -+#if (defined(HAVE_KERNEL_NEON) && defined(CONFIG_KERNEL_MODE_NEON)) - #define kfpu_allowed() 1 - #define kfpu_begin() kernel_neon_begin() - #define kfpu_end() kernel_neon_end() -+#else -+#define kfpu_allowed() 0 -+#define kfpu_begin() do {} while (0) -+#define kfpu_end() do {} while (0) -+#endif - #define kfpu_init() (0) - #define kfpu_fini() do {} while (0) - - diff --git a/files/zfs/3815.2.1/overlay/sys-fs/zfs-kmod/files/zfs-kmod-2.2.2-autotrim.patch b/files/zfs/3815.2.1/overlay/sys-fs/zfs-kmod/files/zfs-kmod-2.2.2-autotrim.patch deleted file mode 100644 index 6d72389..0000000 --- a/files/zfs/3815.2.1/overlay/sys-fs/zfs-kmod/files/zfs-kmod-2.2.2-autotrim.patch +++ /dev/null @@ -1,31 +0,0 @@ -https://bugs.gentoo.org/923745 -https://github.com/openzfs/zfs/issues/15453 -https://github.com/openzfs/zfs/pull/15781 -https://github.com/openzfs/zfs/pull/15789 - -From a0aa7a2ee3b56d7b6d69c2081034ec8293a6d605 Mon Sep 17 00:00:00 2001 -From: Kevin Jin <33590050+jxdking@users.noreply.github.com> -Date: Wed, 17 Jan 2024 12:03:58 -0500 -Subject: [PATCH] Autotrim High Load Average Fix - -Switch from cv_wait() to cv_wait_idle() in vdev_autotrim_wait_kick(), -which should mitigate the high load average while waiting. - -Reviewed-by: Brian Atkinson -Reviewed-by: Brian Behlendorf -Reviewed-by: Alexander Motin -Signed-off-by: jxdking -Closes #15781 ---- a/module/zfs/vdev_trim.c -+++ b/module/zfs/vdev_trim.c -@@ -194,7 +194,8 @@ vdev_autotrim_wait_kick(vdev_t *vd, int num_of_kick) - for (int i = 0; i < num_of_kick; i++) { - if (vd->vdev_autotrim_exit_wanted) - break; -- cv_wait(&vd->vdev_autotrim_kick_cv, &vd->vdev_autotrim_lock); -+ cv_wait_idle(&vd->vdev_autotrim_kick_cv, -+ &vd->vdev_autotrim_lock); - } - boolean_t exit_wanted = vd->vdev_autotrim_exit_wanted; - mutex_exit(&vd->vdev_autotrim_lock); - diff --git a/files/zfs/3815.2.1/overlay/sys-fs/zfs-kmod/metadata.xml b/files/zfs/3815.2.1/overlay/sys-fs/zfs-kmod/metadata.xml deleted file mode 100644 index deb3879..0000000 --- a/files/zfs/3815.2.1/overlay/sys-fs/zfs-kmod/metadata.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - sam@gentoo.org - Sam James - - - Prevents upgrading to an unsupported kernel version when combined with USE=dist-kernel - Pull dependencies and check kernel options required for root-on-zfs - - - https://github.com/openzfs/zfs/issues - https://openzfs.github.io/openzfs-docs - openzfs/zfs - - diff --git a/files/zfs/3815.2.1/overlay/sys-fs/zfs-kmod/zfs-kmod-2.1.14.ebuild b/files/zfs/3815.2.1/overlay/sys-fs/zfs-kmod/zfs-kmod-2.1.14.ebuild deleted file mode 100644 index c698d19..0000000 --- a/files/zfs/3815.2.1/overlay/sys-fs/zfs-kmod/zfs-kmod-2.1.14.ebuild +++ /dev/null @@ -1,177 +0,0 @@ -# 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-r1 multiprocessing - -DESCRIPTION="Linux ZFS kernel module for sys-fs/zfs" -HOMEPAGE="https://github.com/openzfs/zfs" - -MODULES_KERNEL_MAX=6.5 -MODULES_KERNEL_MIN=3.10 - -if [[ ${PV} == 9999 ]] ; then - EGIT_REPO_URI="https://github.com/openzfs/zfs.git" - inherit git-r3 - unset MODULES_KERNEL_MAX -else - VERIFY_SIG_OPENPGP_KEY_PATH=/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="${MODULES_KERNEL_MAX}" - # 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" -RESTRICT="test" - -BDEPEND=" - dev-lang/perl - app-alternatives/awk -" - -if [[ ${PV} != 9999 ]] ; then - BDEPEND+=" verify-sig? ( sec-keys/openpgp-keys-openzfs )" - - IUSE+=" +dist-kernel-cap" - RDEPEND=" - dist-kernel-cap? ( dist-kernel? ( - 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 ~loong ~ppc64 ~riscv ~sparc" - fi -fi - -LICENSE="CDDL MIT debug? ( GPL-2+ )" -SLOT="0/${PVR}" -IUSE="custom-cflags debug +rootfs" -RESTRICT="test" - -BDEPEND=" - app-alternatives/awk - dev-lang/perl -" - -if [[ ${PV} != 9999 ]] ; then - BDEPEND+=" verify-sig? ( sec-keys/openpgp-keys-openzfs )" - - IUSE+=" +dist-kernel-cap" - RDEPEND=" - dist-kernel-cap? ( dist-kernel? ( - 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 ~loong ppc64 ~riscv ~sparc" - fi -fi - -LICENSE="CDDL MIT debug? ( GPL-2+ )" -SLOT="0/${PVR}" -IUSE="custom-cflags debug +rootfs" -RESTRICT="test" - -BDEPEND=" - app-alternatives/awk - dev-lang/perl -" - -if [[ ${PV} != 9999 ]] ; then - BDEPEND+=" verify-sig? ( sec-keys/openpgp-keys-openzfs )" - - IUSE+=" +dist-kernel-cap" - RDEPEND=" - dist-kernel-cap? ( dist-kernel? ( - -Date: Thu, 30 Jun 2022 13:47:58 -0400 -Subject: [PATCH] dracut: fix boot on non-zfs-root systems - -Simply prevent overwriting root until it needs to be overwritten. - -Dracut could change this value before this module is called, but won't -change the kernel command line. - -Reviewed-by: Andrew J. Hesford -Signed-off-by: Toyam Cox -Closes #13592 ---- - contrib/dracut/90zfs/zfs-lib.sh.in | 10 +++++----- - 1 file changed, 5 insertions(+), 5 deletions(-) - -diff --git a/contrib/dracut/90zfs/zfs-lib.sh.in b/contrib/dracut/90zfs/zfs-lib.sh.in -index e44673c2d75..3a43e514d6f 100755 ---- a/contrib/dracut/90zfs/zfs-lib.sh.in -+++ b/contrib/dracut/90zfs/zfs-lib.sh.in -@@ -88,11 +88,11 @@ decode_root_args() { - return - fi - -- root=$(getarg root=) -+ xroot=$(getarg root=) - rootfstype=$(getarg rootfstype=) - - # shellcheck disable=SC2249 -- case "$root" in -+ case "$xroot" in - ""|zfs|zfs:|zfs:AUTO) - root=zfs:AUTO - rootfstype=zfs -@@ -100,7 +100,7 @@ decode_root_args() { - ;; - - ZFS=*|zfs:*) -- root="${root#zfs:}" -+ root="${xroot#zfs:}" - root="${root#ZFS=}" - root=$(echo "$root" | tr '+' ' ') - rootfstype=zfs -@@ -109,9 +109,9 @@ decode_root_args() { - esac - - if [ "$rootfstype" = "zfs" ]; then -- case "$root" in -+ case "$xroot" in - "") root=zfs:AUTO ;; -- *) root=$(echo "$root" | tr '+' ' ') ;; -+ *) root=$(echo "$xroot" | tr '+' ' ') ;; - esac - return 0 - fi - diff --git a/files/zfs/3815.2.1/overlay/sys-fs/zfs/files/2.2.2-no-USER_NS.patch b/files/zfs/3815.2.1/overlay/sys-fs/zfs/files/2.2.2-no-USER_NS.patch deleted file mode 100644 index b132db9..0000000 --- a/files/zfs/3815.2.1/overlay/sys-fs/zfs/files/2.2.2-no-USER_NS.patch +++ /dev/null @@ -1,39 +0,0 @@ -https://github.com/openzfs/zfs/issues/15241 -https://github.com/openzfs/zfs/pull/15560 - -From e0a7ec29d91b79adfd81073f229241351ed0ae21 Mon Sep 17 00:00:00 2001 -From: Ilkka Sovanto -Date: Wed, 22 Nov 2023 20:24:47 +0200 -Subject: [PATCH] Fix zoneid when USER_NS is disabled - -getzoneid() should return GLOBAL_ZONEID instead of 0 when USER_NS is disabled. - -Signed-off-by: Ilkka Sovanto ---- a/lib/libspl/os/linux/zone.c -+++ b/lib/libspl/os/linux/zone.c -@@ -42,20 +42,20 @@ getzoneid(void) - int c = snprintf(path, sizeof (path), "/proc/self/ns/user"); - /* This API doesn't have any error checking... */ - if (c < 0 || c >= sizeof (path)) -- return (0); -+ return (GLOBAL_ZONEID); - - ssize_t r = readlink(path, buf, sizeof (buf) - 1); - if (r < 0) -- return (0); -+ return (GLOBAL_ZONEID); - - cp = strchr(buf, '['); - if (cp == NULL) -- return (0); -+ return (GLOBAL_ZONEID); - cp++; - - unsigned long n = strtoul(cp, NULL, 10); - if (n == ULONG_MAX && errno == ERANGE) -- return (0); -+ return (GLOBAL_ZONEID); - zoneid_t z = (zoneid_t)n; - - return (z); - diff --git a/files/zfs/3815.2.1/overlay/sys-fs/zfs/metadata.xml b/files/zfs/3815.2.1/overlay/sys-fs/zfs/metadata.xml deleted file mode 100644 index b2f96b1..0000000 --- a/files/zfs/3815.2.1/overlay/sys-fs/zfs/metadata.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - sam@gentoo.org - Sam James - - - Disable dependency on sys-fs/zfs-kmod under the assumption that ZFS is part of the kernel source tree - Don't install python scripts (arcstat, dbufstat etc) and avoid dependency on dev-lang/python - Install zfs_key pam module, for automatically loading zfs encryption keys for home datasets - Enable dependencies required for booting off a pool containing a rootfs - Install regression test suite - - - https://github.com/openzfs/zfs/issues - https://openzfs.github.io/openzfs-docs - openzfs/zfs - - - OpenZFS is an advanced file system and volume manager which was originally developed - for Solaris and is now maintained by the OpenZFS community - - It includes the functionality of both traditional file systems and volume manager. - It has many advanced features including: - * Protection against data corruption. Integrity checking for both data and metadata. - * Continuous integrity verification and automatic “self-healing” repair - * Data redundancy with mirroring, RAID-Z1/2/3 [and DRAID] - * Support for high storage capacities — up to 256 trillion yobibytes (2^128 bytes) - * Space-saving with transparent compression using LZ4, GZIP or ZSTD - * Hardware-accelerated native encryption - * Efficient storage with snapshots and copy-on-write clones - * Efficient local or remote replication — send only changed blocks with ZFS send and receive - - The OpenZFS project brings together developers from the Linux, FreeBSD, illumos, MacOS, and Windows platforms. - OpenZFS is supported by a wide range of companies. - - diff --git a/files/zfs/3815.2.1/overlay/sys-fs/zfs/zfs-2.1.14.ebuild b/files/zfs/3815.2.1/overlay/sys-fs/zfs/zfs-2.1.14.ebuild deleted file mode 100644 index 5dcfd94..0000000 --- a/files/zfs/3815.2.1/overlay/sys-fs/zfs/zfs-2.1.14.ebuild +++ /dev/null @@ -1,311 +0,0 @@ -# Copyright 1999-2024 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -DISTUTILS_OPTIONAL=1 -DISTUTILS_USE_PEP517=setuptools -PYTHON_COMPAT=( python3_{10..11} ) - -inherit autotools bash-completion-r1 dist-kernel-utils distutils-r1 flag-o-matic linux-info pam systemd udev usr-ldscript - -DESCRIPTION="Userland utilities for ZFS Linux kernel module" -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=/usr/share/openpgp-keys/openzfs.asc - inherit verify-sig - - MY_P="${P/_rc/-rc}" - SRC_URI="https://github.com/openzfs/${PN}/releases/download/${MY_P}/${MY_P}.tar.gz" - SRC_URI+=" verify-sig? ( https://github.com/openzfs/${PN}/releases/download/${MY_P}/${MY_P}.tar.gz.asc )" - S="${WORKDIR}/${P%_rc?}" - - if [[ ${PV} != *_rc* ]]; then - KEYWORDS="amd64 arm64 ppc64 ~riscv ~sparc" - fi -fi - -LICENSE="BSD-2 CDDL MIT" -# just libzfs soname major for now. -# possible candidates: libuutil, libzpool, libnvpair. Those do not provide stable abi, but are considered. -# see libsoversion_check() below as well -SLOT="0/5" -IUSE="custom-cflags debug dist-kernel kernel-builtin minimal nls pam python +rootfs selinux test-suite" - -DEPEND=" - net-libs/libtirpc:= - sys-apps/util-linux - sys-libs/zlib - virtual/libudev:= - dev-libs/openssl:0= - !minimal? ( ${PYTHON_DEPS} ) - pam? ( sys-libs/pam ) - python? ( - $(python_gen_cond_dep 'dev-python/cffi[${PYTHON_USEDEP}]' 'python*') - ) -" - -BDEPEND="app-alternatives/awk - virtual/pkgconfig - nls? ( sys-devel/gettext ) - python? ( - ${DISTUTILS_DEPS} - || ( - dev-python/packaging[${PYTHON_USEDEP}] - dev-python/distlib[${PYTHON_USEDEP}] - ) - ) -" - -if [[ ${PV} != "9999" ]] ; then - BDEPEND+=" verify-sig? ( sec-keys/openpgp-keys-openzfs )" -fi - -# awk is used for some scripts, completions, and the Dracut module -RDEPEND="${DEPEND} - !kernel-builtin? ( ~sys-fs/zfs-kmod-${PV}:= ) - !prefix? ( virtual/udev ) - sys-fs/udev-init-scripts - app-alternatives/awk - dist-kernel? ( virtual/dist-kernel:= ) - rootfs? ( - app-alternatives/cpio - app-misc/pax-utils - ) - selinux? ( sec-policy/selinux-zfs ) - test-suite? ( - app-shells/ksh - sys-apps/kmod[tools] - sys-apps/util-linux - app-alternatives/bc - sys-block/parted - sys-fs/lsscsi - sys-fs/mdadm - sys-process/procps - ) -" - -# PDEPEND in this form is needed to trick portage suggest -# enabling dist-kernel if only 1 package have it set, without suggesting to disable -PDEPEND="dist-kernel? ( ~sys-fs/zfs-kmod-${PV}[dist-kernel] )" - -REQUIRED_USE=" - !minimal? ( ${PYTHON_REQUIRED_USE} ) - python? ( !minimal ) - test-suite? ( !minimal ) -" - -RESTRICT="test" - -PATCHES=( - # bug #854333 - "${FILESDIR}"/2.1.5-r2-dracut-non-root.patch - - "${FILESDIR}"/2.1.5-dracut-zfs-missing.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() { - if use kernel_linux; then - linux-info_pkg_setup - - if ! linux_config_exists; then - ewarn "Cannot check the linux kernel configuration." - else - if use test-suite; then - if linux_chkconfig_present BLK_DEV_LOOP; then - eerror "The ZFS test suite requires loop device support enabled." - eerror "Please enable it:" - eerror " CONFIG_BLK_DEV_LOOP=y" - eerror "in /usr/src/linux/.config or" - eerror " Device Drivers --->" - eerror " Block devices --->" - eerror " [X] Loopback device support" - fi - fi - fi - fi -} - -libsoversion_check() { - local bugurl libzfs_sover - bugurl="https://bugs.gentoo.org/enter_bug.cgi?form_name=enter_bug&product=Gentoo+Linux&component=Current+packages" - - libzfs_sover="$(grep 'libzfs_la_LDFLAGS += -version-info' lib/libzfs/Makefile.am \ - | grep -Eo '[0-9]+:[0-9]+:[0-9]+')" - libzfs_sover="${libzfs_sover%%:*}" - - if [[ ${libzfs_sover} -ne $(ver_cut 2 ${SLOT}) ]]; then - echo - eerror "BUG BUG BUG BUG BUG BUG BUG BUG" - eerror "ebuild subslot does not match libzfs soversion!" - eerror "libzfs soversion: ${libzfs_sover}" - eerror "ebuild value: $(ver_cut 2 ${SLOT})" - eerror "This is a bug in the ebuild, please use the following URL to report it" - eerror "${bugurl}&short_desc=${CATEGORY}%2F${P}+update+subslot" - echo - # we want to abort for releases, but just print a warning for live ebuild - # to keep package installable - [[ ${PV} == "9999" ]] || die - fi -} - -src_prepare() { - default - libsoversion_check - - # Run unconditionally (bug #792627) - eautoreconf - - if [[ ${PV} != "9999" ]]; then - # Set revision number - sed -i "s/\(Release:\)\(.*\)1/\1\2${PR}-gentoo/" META || die "Could not set Gentoo release" - fi - - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_prepare - popd >/dev/null || die - fi - - # prevent errors showing up on zfs-mount stop, #647688 - # openrc will unmount all filesystems anyway. - sed -i "/^ZFS_UNMOUNT=/ s/yes/no/" "etc/default/zfs.in" || die -} - -src_configure() { - use custom-cflags || strip-flags - use minimal || python_setup - - # All the same issue: - # Segfaults w/ GCC 12 and 'zfs send' - # bug #856373 - # https://github.com/openzfs/zfs/issues/13620 - # https://github.com/openzfs/zfs/issues/13605 - append-flags -fno-tree-vectorize - - local myconf=( - --bindir="${EPREFIX}/bin" - --enable-shared - --enable-sysvinit - --localstatedir="${EPREFIX}/var" - --sbindir="${EPREFIX}/sbin" - --with-config=user - --with-dracutdir="${EPREFIX}/usr/lib/dracut" - --with-linux="${KV_DIR}" - --with-linux-obj="${KV_OUT_DIR}" - --with-udevdir="$(get_udevdir)" - --with-pamconfigsdir="${EPREFIX}/unwanted_files" - --with-pammoduledir="$(getpam_mod_dir)" - --with-systemdunitdir="$(systemd_get_systemunitdir)" - --with-systemdpresetdir="$(systemd_get_systempresetdir)" - --with-vendor=gentoo - # Building zfs-mount-generator.c on musl breaks as strndupa - # isn't available. But systemd doesn't support musl anyway, so - # just disable building it. - # UPDATE: it has been fixed since, - # https://github.com/openzfs/zfs/commit/1f19826c9ac85835cbde61a7439d9d1fefe43a4a - # but we still leave it as this for now. - $(use_enable !elibc_musl systemd) - $(use_enable debug) - $(use_enable nls) - $(use_enable pam) - $(use_enable python pyzfs) - --disable-static - $(usex minimal --without-python --with-python="${EPYTHON}") - ) - - econf "${myconf[@]}" -} - -src_compile() { - default - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_compile - popd >/dev/null || die - fi -} - -src_install() { - default - - gen_usr_ldscript -a nvpair uutil zfsbootenv zfs zfs_core zpool - - use pam && { rm -rv "${ED}/unwanted_files" || die ; } - - use test-suite || { rm -r "${ED}"/usr/share/zfs/{test-runner,zfs-tests,runfiles,*sh} || die ; } - - find "${ED}" -name '*.la' -delete || die - - dobashcomp contrib/bash_completion.d/zfs - bashcomp_alias zfs zpool - - # strip executable bit from conf.d file - fperms 0644 /etc/conf.d/zfs - - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_install - popd >/dev/null || die - fi - - # enforce best available python implementation - use minimal || python_fix_shebang "${ED}/bin" -} - -pkg_postinst() { - udev_reload - - # we always need userspace utils in sync with zfs-kmod - # so force initrd update for userspace as well, to avoid - # situation when zfs-kmod trigger initrd rebuild before - # userspace component is rebuilt - # KV_* variables are provided by linux-info.eclass - if [[ -z ${ROOT} ]] && use dist-kernel; then - dist-kernel_reinstall_initramfs "${KV_DIR}" "${KV_FULL}" - fi - - if use rootfs; then - if ! has_version sys-kernel/genkernel && ! has_version sys-kernel/dracut; then - elog "Root on zfs requires an initramfs to boot" - elog "The following packages provide one and are tested on a regular basis:" - elog " sys-kernel/dracut ( preferred, module maintained by zfs developers )" - elog " sys-kernel/genkernel" - fi - fi - - if systemd_is_booted || has_version sys-apps/systemd; then - einfo "Please refer to ${EROOT}/$(systemd_get_systempresetdir)/50-zfs.preset" - einfo "for default zfs systemd service configuration" - else - [[ -e "${EROOT}/etc/runlevels/boot/zfs-import" ]] || \ - einfo "You should add zfs-import to the boot runlevel." - [[ -e "${EROOT}/etc/runlevels/boot/zfs-load-key" ]] || \ - einfo "You should add zfs-load-key to the boot runlevel." - [[ -e "${EROOT}/etc/runlevels/boot/zfs-mount" ]]|| \ - einfo "You should add zfs-mount to the boot runlevel." - [[ -e "${EROOT}/etc/runlevels/default/zfs-share" ]] || \ - einfo "You should add zfs-share to the default runlevel." - [[ -e "${EROOT}/etc/runlevels/default/zfs-zed" ]] || \ - einfo "You should add zfs-zed to the default runlevel." - fi -} - -pkg_postrm() { - udev_reload -} diff --git a/files/zfs/3815.2.1/overlay/sys-fs/zfs/zfs-2.2.2-r1.ebuild b/files/zfs/3815.2.1/overlay/sys-fs/zfs/zfs-2.2.2-r1.ebuild deleted file mode 100644 index 80914d2..0000000 --- a/files/zfs/3815.2.1/overlay/sys-fs/zfs/zfs-2.2.2-r1.ebuild +++ /dev/null @@ -1,307 +0,0 @@ -# Copyright 1999-2024 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -DISTUTILS_OPTIONAL=1 -DISTUTILS_USE_PEP517=setuptools -PYTHON_COMPAT=( python3_{10..11} ) - -inherit autotools bash-completion-r1 dist-kernel-utils distutils-r1 flag-o-matic linux-info pam systemd udev usr-ldscript - -DESCRIPTION="Userland utilities for ZFS Linux kernel module" -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=/usr/share/openpgp-keys/openzfs.asc - inherit verify-sig - - MY_P="${P/_rc/-rc}" - SRC_URI="https://github.com/openzfs/${PN}/releases/download/${MY_P}/${MY_P}.tar.gz" - SRC_URI+=" verify-sig? ( https://github.com/openzfs/${PN}/releases/download/${MY_P}/${MY_P}.tar.gz.asc )" - S="${WORKDIR}/${MY_P}" - - if [[ ${PV} != *_rc* ]]; then - KEYWORDS="amd64 arm64 ~loong ppc64 ~riscv ~sparc" - fi -fi - -LICENSE="BSD-2 CDDL MIT" -# just libzfs soname major for now. -# possible candidates: libuutil, libzpool, libnvpair. Those do not provide stable abi, but are considered. -# see libsoversion_check() below as well -SLOT="0/5" -IUSE="custom-cflags debug dist-kernel kernel-builtin minimal nls pam python +rootfs selinux test-suite" - -DEPEND=" - dev-libs/openssl:= - net-libs/libtirpc:= - sys-apps/util-linux - sys-libs/zlib - virtual/libudev:= - !minimal? ( ${PYTHON_DEPS} ) - pam? ( sys-libs/pam ) - python? ( - $(python_gen_cond_dep 'dev-python/cffi[${PYTHON_USEDEP}]' 'python*') - ) -" - -BDEPEND=" - app-alternatives/awk - virtual/pkgconfig - nls? ( sys-devel/gettext ) - python? ( - ${DISTUTILS_DEPS} - || ( - dev-python/packaging[${PYTHON_USEDEP}] - dev-python/distlib[${PYTHON_USEDEP}] - ) - ) -" - -if [[ ${PV} != "9999" ]] ; then - BDEPEND+=" verify-sig? ( sec-keys/openpgp-keys-openzfs )" -fi - -# awk is used for some scripts, completions, and the Dracut module -RDEPEND=" - ${DEPEND} - !kernel-builtin? ( ~sys-fs/zfs-kmod-${PV}:= ) - !prefix? ( virtual/udev ) - app-alternatives/awk - sys-fs/udev-init-scripts - dist-kernel? ( virtual/dist-kernel:= ) - rootfs? ( - app-alternatives/cpio - app-misc/pax-utils - ) - selinux? ( sec-policy/selinux-zfs ) - test-suite? ( - app-shells/ksh - sys-apps/kmod[tools] - sys-apps/util-linux - app-alternatives/bc - sys-block/parted - sys-fs/lsscsi - sys-fs/mdadm - sys-process/procps - ) -" - -# PDEPEND in this form is needed to trick portage suggest -# enabling dist-kernel if only 1 package have it set, without suggesting to disable -PDEPEND="dist-kernel? ( ~sys-fs/zfs-kmod-${PV}[dist-kernel] )" - -REQUIRED_USE=" - !minimal? ( ${PYTHON_REQUIRED_USE} ) - python? ( !minimal ) - test-suite? ( !minimal ) -" - -RESTRICT="test" - -PATCHES=( - "${FILESDIR}"/2.1.5-dracut-zfs-missing.patch - "${FILESDIR}"/2.2.2-no-USER_NS.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() { - if use kernel_linux; then - linux-info_pkg_setup - - if ! linux_config_exists; then - ewarn "Cannot check the linux kernel configuration." - else - if use test-suite; then - if linux_chkconfig_present BLK_DEV_LOOP; then - eerror "The ZFS test suite requires loop device support enabled." - eerror "Please enable it:" - eerror " CONFIG_BLK_DEV_LOOP=y" - eerror "in /usr/src/linux/.config or" - eerror " Device Drivers --->" - eerror " Block devices --->" - eerror " [X] Loopback device support" - fi - fi - fi - fi -} - -libsoversion_check() { - local bugurl libzfs_sover - bugurl="https://bugs.gentoo.org/enter_bug.cgi?form_name=enter_bug&product=Gentoo+Linux&component=Current+packages" - - libzfs_sover="$(grep 'libzfs_la_LDFLAGS += -version-info' lib/libzfs/Makefile.am \ - | grep -Eo '[0-9]+:[0-9]+:[0-9]+')" - libzfs_sover="${libzfs_sover%%:*}" - - if [[ ${libzfs_sover} -ne $(ver_cut 2 ${SLOT}) ]]; then - echo - eerror "BUG BUG BUG BUG BUG BUG BUG BUG" - eerror "ebuild subslot does not match libzfs soversion!" - eerror "libzfs soversion: ${libzfs_sover}" - eerror "ebuild value: $(ver_cut 2 ${SLOT})" - eerror "This is a bug in the ebuild, please use the following URL to report it" - eerror "${bugurl}&short_desc=${CATEGORY}%2F${P}+update+subslot" - echo - # we want to abort for releases, but just print a warning for live ebuild - # to keep package installable - [[ ${PV} == "9999" ]] || die - fi -} - -src_prepare() { - default - libsoversion_check - - # Run unconditionally (bug #792627) - eautoreconf - - if [[ ${PV} != "9999" ]]; then - # Set revision number - sed -i "s/\(Release:\)\(.*\)1/\1\2${PR}-gentoo/" META || die "Could not set Gentoo release" - fi - - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_prepare - popd >/dev/null || die - fi - - # Tries to use /etc/conf.d which we reserve for OpenRC - sed -i -e '/EnvironmentFile/d' etc/systemd/system/zfs*.in || die - - # prevent errors showing up on zfs-mount stop, #647688 - # openrc will unmount all filesystems anyway. - sed -i "/^ZFS_UNMOUNT=/ s/yes/no/" "etc/default/zfs.in" || die -} - -src_configure() { - use custom-cflags || strip-flags - use minimal || python_setup - - local myconf=( - --bindir="${EPREFIX}/bin" - --enable-shared - --enable-sysvinit - --localstatedir="${EPREFIX}/var" - --sbindir="${EPREFIX}/sbin" - --with-config=user - --with-dracutdir="${EPREFIX}/usr/lib/dracut" - --with-linux="${KV_DIR}" - --with-linux-obj="${KV_OUT_DIR}" - --with-udevdir="$(get_udevdir)" - --with-pamconfigsdir="${EPREFIX}/unwanted_files" - --with-pammoduledir="$(getpam_mod_dir)" - --with-systemdunitdir="$(systemd_get_systemunitdir)" - --with-systemdpresetdir="$(systemd_get_systempresetdir)" - --with-vendor=gentoo - # Building zfs-mount-generator.c on musl breaks as strndupa - # isn't available. But systemd doesn't support musl anyway, so - # just disable building it. - # UPDATE: it has been fixed since, - # https://github.com/openzfs/zfs/commit/1f19826c9ac85835cbde61a7439d9d1fefe43a4a - # but we still leave it as this for now. - $(use_enable !elibc_musl systemd) - $(use_enable debug) - $(use_enable nls) - $(use_enable pam) - $(use_enable python pyzfs) - --disable-static - $(usex minimal --without-python --with-python="${EPYTHON}") - ) - - econf "${myconf[@]}" -} - -src_compile() { - default - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_compile - popd >/dev/null || die - fi -} - -src_install() { - default - - gen_usr_ldscript -a nvpair uutil zfsbootenv zfs zfs_core zpool - - use pam && { rm -rv "${ED}/unwanted_files" || die ; } - - use test-suite || { rm -r "${ED}"/usr/share/zfs/{test-runner,zfs-tests,runfiles,*sh} || die ; } - - find "${ED}" -name '*.la' -delete || die - - dobashcomp contrib/bash_completion.d/zfs - bashcomp_alias zfs zpool - - # strip executable bit from conf.d file - fperms 0644 /etc/conf.d/zfs - - if use python; then - pushd contrib/pyzfs >/dev/null || die - distutils-r1_src_install - popd >/dev/null || die - fi - - # enforce best available python implementation - use minimal || python_fix_shebang "${ED}/bin" -} - -pkg_postinst() { - udev_reload - - # we always need userspace utils in sync with zfs-kmod - # so force initrd update for userspace as well, to avoid - # situation when zfs-kmod trigger initrd rebuild before - # userspace component is rebuilt - # KV_* variables are provided by linux-info.eclass - if [[ -z ${ROOT} ]] && use dist-kernel; then - dist-kernel_reinstall_initramfs "${KV_DIR}" "${KV_FULL}" - fi - - if use rootfs; then - if ! has_version sys-kernel/genkernel && ! has_version sys-kernel/dracut; then - elog "Root on zfs requires an initramfs to boot" - elog "The following packages provide one and are tested on a regular basis:" - elog " sys-kernel/dracut ( preferred, module maintained by zfs developers )" - elog " sys-kernel/genkernel" - fi - fi - - if systemd_is_booted || has_version sys-apps/systemd; then - einfo "Please refer to ${EROOT}/$(systemd_get_systempresetdir)/50-zfs.preset" - einfo "for default zfs systemd service configuration" - else - [[ -e "${EROOT}/etc/runlevels/boot/zfs-import" ]] || \ - einfo "You should add zfs-import to the boot runlevel." - [[ -e "${EROOT}/etc/runlevels/boot/zfs-load-key" ]] || \ - einfo "You should add zfs-load-key to the boot runlevel." - [[ -e "${EROOT}/etc/runlevels/boot/zfs-mount" ]]|| \ - einfo "You should add zfs-mount to the boot runlevel." - [[ -e "${EROOT}/etc/runlevels/default/zfs-share" ]] || \ - einfo "You should add zfs-share to the default runlevel." - [[ -e "${EROOT}/etc/runlevels/default/zfs-zed" ]] || \ - einfo "You should add zfs-zed to the default runlevel." - fi -} - -pkg_postrm() { - udev_reload -} diff --git a/files/zfs/3815.2.3/overlay/sys-fs/zfs-kmod/Manifest b/files/zfs/3815.2.3/overlay/sys-fs/zfs-kmod/Manifest index 4591d96..6e4c6cb 100644 --- a/files/zfs/3815.2.3/overlay/sys-fs/zfs-kmod/Manifest +++ b/files/zfs/3815.2.3/overlay/sys-fs/zfs-kmod/Manifest @@ -1,4 +1,10 @@ DIST zfs-2.1.14.tar.gz 35167471 BLAKE2B a7b22eaf05e4fbf416ebe4d7b884c515942fc9375c1dd322cefa00c19c550b9318a4192d6a909d49d58523c8f1a6eaf00189dd58e6543fae17cf8cc35042f469 SHA512 4a65c8b7d5576fa2dcc14e7ccaa93191c1d3791479cf89bd02c2bd04434ff5e93709b328796d4f9ba93da19f12772e359df373f40919350a3e1e4c52758b47c8 DIST zfs-2.1.14.tar.gz.asc 836 BLAKE2B f01bc58bf6c3d367c494ed4ea9f3fb1141f3aafdbf4f913b9e0d60d31557076d5ae0e25ca93b013f5fd85e21ba5ae9f61e1a03af54bb0c743869c0ce3d5519df SHA512 be0f386cce952b4047dc2448e356078668e8d4392802dd3bb1a426741f15f4d9fb689cd1cb09972bdbc9fe2e4e782ec4b4754fe811c5657bc1f5308bd38e3926 +DIST zfs-2.1.15.tar.gz 35209038 BLAKE2B 61f9e14c54d43d1c51269917bb3ffde0530166126ea0467103ff1171dffc537315fd21c270d12f73d677e121b8094af39dd0a1fe3f80986bb42dc16d627dff52 SHA512 24096f2a6ecb3cc51f3d2f11cc69ad134d6fc33667007277c50cf798be2b19b6ddfa9be6923ca53d8b09f0bebae14c44d74811ec776e5aaf4ea0e810844c1f3d +DIST zfs-2.1.15.tar.gz.asc 836 BLAKE2B 897c05a8870cd0418493b42fe854ef5b28f9a31513ac262a25631089defa59190808b51bd31e43412b01171bcac0dff0608d417dfdacfeee0b0f067e0627d48f SHA512 a6c5a9d214070a220716075455eb1cb85a53fb20b5fe4319f112cde0653a25f87b66d0f0bcf0ca641e3ac38239759cb9df6ed7f4700056a2732cc8c1ccd9ce05 DIST zfs-2.2.2.tar.gz 33816541 BLAKE2B f0619ae42d898d18077096217d0a9ddd7c7378424707aa51d3645661b2889a1459bc4a5e9fe42b6860b2d26e4600da35765b0e741725dafacc2ead2370cad866 SHA512 bba252cbf7986f2cce154dd18a34aa478cf98f70106337188dc894de2446d60a58fa643706927757d1787506b44d4ff404897a2d0e16aacb0a7bf27765703332 DIST zfs-2.2.2.tar.gz.asc 836 BLAKE2B bdc86492b2bf45d329e34e89ea7796f5cbf518d32ab114c909321b1d0d8040b9ce4e25b3b85fcbc5ea62ee10a2d716b5b27e37c2c005b307c0b593815c49d625 SHA512 110be1aa90f4749106717165a3cb5116379e2d170146a2b3d2601f04212450da9327e028d6e1e5de7f8a46c6bb7a15e2bcdd09e3e760590fbc695f9562f1440b +DIST zfs-2.2.3.tar.gz 33854765 BLAKE2B f83439aa929609191a048dd326b2a15e0f57c72d2901cbfb205b81a29aa42dab49b42eb61647ca3eaed17518b8c907e81343364bfecf83ed441271648f8efd4b SHA512 e6c3df531a33f4bd198429e61b7630f1e965a03fd60d1b847bdf0d55c6d2af3abc38b5e8a63aa9ef9f969cc7eca36cb24a7641f6fb8c41ef2fa024d76cd28f3d +DIST zfs-2.2.3.tar.gz.asc 836 BLAKE2B 86e1adc393d1f4643a6fd8c188b555e9dc0fdf7e25690f37ff0a04ff8826eb4fe3c125b54f0c5b9ab33f1daff43c4b44373ee9a4df506f6714f98d77782e6c3c SHA512 fe23ddb9bde78416776411d66a56aa662fa051c8544b4be01ba238b8c1a85ccde1c55329f228fe8ab2681b54a4e4cb08d4e927c597c117242f0b536a40921dc9 +DIST zfs-2.2.4.tar.gz 33882933 BLAKE2B f0026a12b7c1252bf8941e39f23d3e165750034707dfddf034d8aac942a749cb7f0108478797ca978704a22743d9928240b29cf78fe89eda9f873f40102413f0 SHA512 1d17e30573d594fb5c9ea77cde104616dca362fed7530296816d1b55173594f66170fcfb23ab57c27074f85b79d3eb557b4ee9a1c420e507b2434a7902d8dcc1 +DIST zfs-2.2.4.tar.gz.asc 836 BLAKE2B 7fde4232c25056eac2fae76abec4d6749c91d285d79ae6dce4ae4880fa90a26c9fb370dfa4daaf8a849f30fcc1b63eeb215444bfca724f6750bf7e4344f35fa7 SHA512 0cb3caf01b9e4d1f0c35d9f7933a4b11560b9bbf6c05494d8a1775b0a52ac1d642aebd77ef1c7b23a0a06f92e2b1ab3d8afacce41017eb07745d148af7f76a17 diff --git a/files/zfs/3815.2.1/overlay/sys-fs/zfs-kmod/zfs-kmod-9999.ebuild b/files/zfs/3815.2.3/overlay/sys-fs/zfs-kmod/zfs-kmod-2.2.4.ebuild similarity index 90% rename from files/zfs/3815.2.1/overlay/sys-fs/zfs-kmod/zfs-kmod-9999.ebuild rename to files/zfs/3815.2.3/overlay/sys-fs/zfs-kmod/zfs-kmod-2.2.4.ebuild index 940666b..79b2c44 100644 --- a/files/zfs/3815.2.1/overlay/sys-fs/zfs-kmod/zfs-kmod-9999.ebuild +++ b/files/zfs/3815.2.3/overlay/sys-fs/zfs-kmod/zfs-kmod-2.2.4.ebuild @@ -1,14 +1,15 @@ -# Copyright 1999-2023 Gentoo Authors +# Copyright 1999-2024 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-r1 multiprocessing +MODULES_INITRAMFS_IUSE=+initramfs +inherit autotools flag-o-matic linux-mod-r1 multiprocessing DESCRIPTION="Linux ZFS kernel module for sys-fs/zfs" HOMEPAGE="https://github.com/openzfs/zfs" -MODULES_KERNEL_MAX=6.6 +MODULES_KERNEL_MAX=6.8 MODULES_KERNEL_MIN=3.10 if [[ ${PV} == 9999 ]] ; then @@ -64,13 +65,6 @@ PATCHES=( 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() { @@ -192,10 +186,6 @@ pkg_postinst() { linux-mod-r1_pkg_postinst - if [[ -z ${ROOT} ]] && use dist-kernel ; then - 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." diff --git a/files/zfs/3815.2.3/overlay/sys-fs/zfs/Manifest b/files/zfs/3815.2.3/overlay/sys-fs/zfs/Manifest index 4591d96..6e4c6cb 100644 --- a/files/zfs/3815.2.3/overlay/sys-fs/zfs/Manifest +++ b/files/zfs/3815.2.3/overlay/sys-fs/zfs/Manifest @@ -1,4 +1,10 @@ DIST zfs-2.1.14.tar.gz 35167471 BLAKE2B a7b22eaf05e4fbf416ebe4d7b884c515942fc9375c1dd322cefa00c19c550b9318a4192d6a909d49d58523c8f1a6eaf00189dd58e6543fae17cf8cc35042f469 SHA512 4a65c8b7d5576fa2dcc14e7ccaa93191c1d3791479cf89bd02c2bd04434ff5e93709b328796d4f9ba93da19f12772e359df373f40919350a3e1e4c52758b47c8 DIST zfs-2.1.14.tar.gz.asc 836 BLAKE2B f01bc58bf6c3d367c494ed4ea9f3fb1141f3aafdbf4f913b9e0d60d31557076d5ae0e25ca93b013f5fd85e21ba5ae9f61e1a03af54bb0c743869c0ce3d5519df SHA512 be0f386cce952b4047dc2448e356078668e8d4392802dd3bb1a426741f15f4d9fb689cd1cb09972bdbc9fe2e4e782ec4b4754fe811c5657bc1f5308bd38e3926 +DIST zfs-2.1.15.tar.gz 35209038 BLAKE2B 61f9e14c54d43d1c51269917bb3ffde0530166126ea0467103ff1171dffc537315fd21c270d12f73d677e121b8094af39dd0a1fe3f80986bb42dc16d627dff52 SHA512 24096f2a6ecb3cc51f3d2f11cc69ad134d6fc33667007277c50cf798be2b19b6ddfa9be6923ca53d8b09f0bebae14c44d74811ec776e5aaf4ea0e810844c1f3d +DIST zfs-2.1.15.tar.gz.asc 836 BLAKE2B 897c05a8870cd0418493b42fe854ef5b28f9a31513ac262a25631089defa59190808b51bd31e43412b01171bcac0dff0608d417dfdacfeee0b0f067e0627d48f SHA512 a6c5a9d214070a220716075455eb1cb85a53fb20b5fe4319f112cde0653a25f87b66d0f0bcf0ca641e3ac38239759cb9df6ed7f4700056a2732cc8c1ccd9ce05 DIST zfs-2.2.2.tar.gz 33816541 BLAKE2B f0619ae42d898d18077096217d0a9ddd7c7378424707aa51d3645661b2889a1459bc4a5e9fe42b6860b2d26e4600da35765b0e741725dafacc2ead2370cad866 SHA512 bba252cbf7986f2cce154dd18a34aa478cf98f70106337188dc894de2446d60a58fa643706927757d1787506b44d4ff404897a2d0e16aacb0a7bf27765703332 DIST zfs-2.2.2.tar.gz.asc 836 BLAKE2B bdc86492b2bf45d329e34e89ea7796f5cbf518d32ab114c909321b1d0d8040b9ce4e25b3b85fcbc5ea62ee10a2d716b5b27e37c2c005b307c0b593815c49d625 SHA512 110be1aa90f4749106717165a3cb5116379e2d170146a2b3d2601f04212450da9327e028d6e1e5de7f8a46c6bb7a15e2bcdd09e3e760590fbc695f9562f1440b +DIST zfs-2.2.3.tar.gz 33854765 BLAKE2B f83439aa929609191a048dd326b2a15e0f57c72d2901cbfb205b81a29aa42dab49b42eb61647ca3eaed17518b8c907e81343364bfecf83ed441271648f8efd4b SHA512 e6c3df531a33f4bd198429e61b7630f1e965a03fd60d1b847bdf0d55c6d2af3abc38b5e8a63aa9ef9f969cc7eca36cb24a7641f6fb8c41ef2fa024d76cd28f3d +DIST zfs-2.2.3.tar.gz.asc 836 BLAKE2B 86e1adc393d1f4643a6fd8c188b555e9dc0fdf7e25690f37ff0a04ff8826eb4fe3c125b54f0c5b9ab33f1daff43c4b44373ee9a4df506f6714f98d77782e6c3c SHA512 fe23ddb9bde78416776411d66a56aa662fa051c8544b4be01ba238b8c1a85ccde1c55329f228fe8ab2681b54a4e4cb08d4e927c597c117242f0b536a40921dc9 +DIST zfs-2.2.4.tar.gz 33882933 BLAKE2B f0026a12b7c1252bf8941e39f23d3e165750034707dfddf034d8aac942a749cb7f0108478797ca978704a22743d9928240b29cf78fe89eda9f873f40102413f0 SHA512 1d17e30573d594fb5c9ea77cde104616dca362fed7530296816d1b55173594f66170fcfb23ab57c27074f85b79d3eb557b4ee9a1c420e507b2434a7902d8dcc1 +DIST zfs-2.2.4.tar.gz.asc 836 BLAKE2B 7fde4232c25056eac2fae76abec4d6749c91d285d79ae6dce4ae4880fa90a26c9fb370dfa4daaf8a849f30fcc1b63eeb215444bfca724f6750bf7e4344f35fa7 SHA512 0cb3caf01b9e4d1f0c35d9f7933a4b11560b9bbf6c05494d8a1775b0a52ac1d642aebd77ef1c7b23a0a06f92e2b1ab3d8afacce41017eb07745d148af7f76a17 diff --git a/files/zfs/3815.2.3/overlay/sys-fs/zfs/files/2.2.3-musl.patch b/files/zfs/3815.2.3/overlay/sys-fs/zfs/files/2.2.3-musl.patch new file mode 100644 index 0000000..0143349 --- /dev/null +++ b/files/zfs/3815.2.3/overlay/sys-fs/zfs/files/2.2.3-musl.patch @@ -0,0 +1,63 @@ +https://github.com/openzfs/zfs/pull/15925 + +From 68419c70dc7235a4954d6c0c09d60f9ebe694a3c Mon Sep 17 00:00:00 2001 +From: Sam James +Date: Fri, 23 Feb 2024 05:12:09 +0000 +Subject: [PATCH] Use instead of + +When building on musl, we get: +``` +In file included from tests/zfs-tests/cmd/getversion.c:22: +/usr/include/sys/fcntl.h:1:2: error: #warning redirecting incorrect #include to [-Werror=cpp] + 1 | #warning redirecting incorrect #include to + +In file included from module/os/linux/zfs/vdev_file.c:36: +/usr/include/sys/fcntl.h:1:2: error: #warning redirecting incorrect #include to [-Werror=cpp] + 1 | #warning redirecting incorrect #include to +``` + +Bug: https://bugs.gentoo.org/925235 +Signed-off-by: Sam James +--- + module/os/linux/zfs/vdev_file.c | 2 +- + tests/zfs-tests/cmd/getversion.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/module/os/linux/zfs/vdev_file.c b/module/os/linux/zfs/vdev_file.c +index 5abc0426d1..68e3042a97 100644 +--- a/module/os/linux/zfs/vdev_file.c ++++ b/module/os/linux/zfs/vdev_file.c +@@ -23,6 +23,7 @@ + * Copyright (c) 2011, 2020 by Delphix. All rights reserved. + */ + ++#include + #include + #include + #include +@@ -33,7 +34,6 @@ + #include + #include + #include +-#include + #include + #include + #ifdef _KERNEL +diff --git a/tests/zfs-tests/cmd/getversion.c b/tests/zfs-tests/cmd/getversion.c +index 62c1c5b6ab..1e026b92d1 100644 +--- a/tests/zfs-tests/cmd/getversion.c ++++ b/tests/zfs-tests/cmd/getversion.c +@@ -19,9 +19,9 @@ + */ + + #include +-#include + #include + #include ++#include + #include + #include + #include +-- +2.43.2 + diff --git a/files/zfs/3815.2.1/overlay/sys-fs/zfs/zfs-9999.ebuild b/files/zfs/3815.2.3/overlay/sys-fs/zfs/zfs-2.2.4.ebuild similarity index 98% rename from files/zfs/3815.2.1/overlay/sys-fs/zfs/zfs-9999.ebuild rename to files/zfs/3815.2.3/overlay/sys-fs/zfs/zfs-2.2.4.ebuild index 3f4ecf0..71e2889 100644 --- a/files/zfs/3815.2.1/overlay/sys-fs/zfs/zfs-9999.ebuild +++ b/files/zfs/3815.2.3/overlay/sys-fs/zfs/zfs-2.2.4.ebuild @@ -5,7 +5,7 @@ EAPI=8 DISTUTILS_OPTIONAL=1 DISTUTILS_USE_PEP517=setuptools -PYTHON_COMPAT=( python3_{10..11} ) +PYTHON_COMPAT=( python3_{10..12} ) inherit autotools bash-completion-r1 dist-kernel-utils distutils-r1 flag-o-matic linux-info pam systemd udev usr-ldscript @@ -105,6 +105,8 @@ RESTRICT="test" PATCHES=( "${FILESDIR}"/2.1.5-dracut-zfs-missing.patch + "${FILESDIR}"/2.2.2-no-USER_NS.patch + "${FILESDIR}"/2.2.3-musl.patch ) pkg_pretend() {