summaryrefslogtreecommitdiff
path: root/sys-fs/zfs
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2021-06-15 14:57:03 +0100
committerV3n3RiX <venerix@redcorelinux.org>2021-06-15 14:57:03 +0100
commitd18bf1e01b65ee4bf0c804e2843b282d3d4e5d7c (patch)
tree4a95cbc6ffdf13bad6ecbc7f8d5af99631984123 /sys-fs/zfs
parente748ba9741f6540f4675c23e3e37b73e822c13a4 (diff)
gentoo resync : 15.06.2021
Diffstat (limited to 'sys-fs/zfs')
-rw-r--r--sys-fs/zfs/Manifest13
-rw-r--r--sys-fs/zfs/files/2.0.4-scrub-timers.patch97
-rw-r--r--sys-fs/zfs/zfs-0.8.6.ebuild30
-rw-r--r--sys-fs/zfs/zfs-2.0.4-r1.ebuild (renamed from sys-fs/zfs/zfs-2.0.4.ebuild)45
-rw-r--r--sys-fs/zfs/zfs-2.1.0_rc7.ebuild (renamed from sys-fs/zfs/zfs-2.1.0_rc6.ebuild)36
-rw-r--r--sys-fs/zfs/zfs-9999.ebuild36
6 files changed, 221 insertions, 36 deletions
diff --git a/sys-fs/zfs/Manifest b/sys-fs/zfs/Manifest
index a6cc74d5c66d..b43e93e3b2e6 100644
--- a/sys-fs/zfs/Manifest
+++ b/sys-fs/zfs/Manifest
@@ -1,10 +1,11 @@
+AUX 2.0.4-scrub-timers.patch 2873 BLAKE2B 40986e258ddc3c5b4dfdebc8c2126fbb2c0ff9ac947700fa30c547795612fb98b2778f364ee10ec47c05a6837c4d4129918a6efe7cf3ab5854910e1892a3e348 SHA512 0e557974fe8992a7b0e6c15e46fac55d265e469aa13f85e85b0abe449b5fe2e8c51cf56510863fa2e33c060f2b38c0c43a910a740172ef1d4c42c0aa85e04ab9
AUX bash-completion-sudo.patch 905 BLAKE2B 92e58ff097893436d589f7df0134e09d2e0699ae82618c4c14caf4b26cb466367a5372d7e0a030aa857d024e3db0faef4bb5fa32c54f41f0d4766693a95ba5ab SHA512 e53c79401f4c634a94af27b2f88a40440b68a4c192fd1944668786650aaa0f1f08dff851dca5b9666ce8bba1f0e2b7cb195314cd9d1314c9bab1194d03122319
DIST zfs-0.8.6.tar.gz 9295260 BLAKE2B 45424d710aaf75a05f766ae523ae157a24b5cbdcefe72a59e4cede81e42f7a92ae7f01150388437b78cd49f3d28b9664599f2a624516e6b3f1073497194a99f2 SHA512 626b172554f39a5c70f6ea5c599a92fae52534590d1b0273de2bbfc3676d29dff0eade8ca17e5f179a59870c12bc758fb53b7900f8a1fdbdef3a9161b93f9cce
DIST zfs-2.0.4.tar.gz 13123872 BLAKE2B 7e4780092c0a87d5d187cd5734ddc736574db80b500f155287640ef2230e09335cc9b6b26ec1b7d8ab1b7942673ea49a3007a81da372a6d2ac36f3908913045c SHA512 1dda92d424372bce7020f5215545485eae69211b6f0fb6bea3c7c22efac76c6a2662f0dd14a03f723b6a6fe73b1228ecca211a4034b86cf885bcadf38ba0dc6b
-DIST zfs-2.1.0-rc6.tar.gz 34777294 BLAKE2B 0080b03a9cf9717ae2bc7674e340dffafd923467368d8941df9be5a21f081e88745297e1a8b2ac5059e9f346949bbeb759a5fc8bcdb60c3be49b0645389ec8b1 SHA512 696d525c1c738a508d04366f8ffd0142aebe4498efbf129c9d38fa7c67dbec83554f55a2c4a5d7647a03ca0df173c2720fe85edbc859195f4ca19e04d2adf143
-DIST zfs-2.1.0-rc6.tar.gz.asc 195 BLAKE2B a1267b8faffc75ac70082e261c6053b2070cbad014c92051ebc82af56b21bbe2e72e01e44c0701ed255a3201330bb56b5e1a72e12c1ae9f15f72883b53c17ec6 SHA512 afc0eb839de6b0b21b3d781dd74dce9f6f668b7b9fc079ea764666e28d4d3228b8a80641b6d0084851bffedfc3406dc0f829242f6b4247d192f554ba45ce3a4c
-EBUILD zfs-0.8.6.ebuild 5653 BLAKE2B 38774df7573b4aa50fa6aae5bba143514b6e48d018d8e1a5b112181d7ef2f8048b044ad234b00bd44a8b2f311f72e3ae57a55765c25239779ef618ce65a05290 SHA512 8a49d24c53bff99af55ee3581ec935875fa050aded7b8efc8bc7ecd9f73a342023d23f498e9e0c8730b6b516e2aa510fb64d7680d49aa30a6d4e385ede733f0f
-EBUILD zfs-2.0.4.ebuild 5975 BLAKE2B 9f1a03496e6b18542a85778a02b625ccfa8c9de9dc15c45100c921100f0b9da34884a56ff9117ef014c5364ef96de538f5416f335c10be611f114d323354b53f SHA512 6c9e3cd0717465d4cbc49a53d63f8e4e4d91e97cb5fe2154f83592f41b7b777cb8a13fa81936f9265d8c577c01a8a4715b37f82149a1826f13511dd506d83150
-EBUILD zfs-2.1.0_rc6.ebuild 7259 BLAKE2B 411c348dd7dffbc27453b76eb5b7a378f4181f3f5ed6d50ab27f5e62e822536185afa6e39930ab7837608c28b6c48e29061b8826237aecc6ccea852e58b1cac5 SHA512 b470cf358316366de94d7f4555702459847739b225527b99a77fbde65303ab2874a34feb0c2d00fe8eb24e246e63fe68303cc274ba8c4e60883d9fd6b4b4efbe
-EBUILD zfs-9999.ebuild 7259 BLAKE2B 411c348dd7dffbc27453b76eb5b7a378f4181f3f5ed6d50ab27f5e62e822536185afa6e39930ab7837608c28b6c48e29061b8826237aecc6ccea852e58b1cac5 SHA512 b470cf358316366de94d7f4555702459847739b225527b99a77fbde65303ab2874a34feb0c2d00fe8eb24e246e63fe68303cc274ba8c4e60883d9fd6b4b4efbe
+DIST zfs-2.1.0-rc7.tar.gz 34800406 BLAKE2B a645c3e19f521a7abb606cbcd619ea019abeb7810bd6476ecddcd76c7c801d6f1e3f197d49199eac72497db5c529b22bcd605b2e7ec2c236aec5216dc99b7dc1 SHA512 4e1cb1cc83454d92cac58110c219fca28dcf8361a5ea27dca955a5c88434b6e9ccd68892d93bf14d773056760f1907e004e65cc5d653308dd8996692ecba61f1
+DIST zfs-2.1.0-rc7.tar.gz.asc 195 BLAKE2B b772bba2f64bec51f11b5c51564a1449cd37d5e8e5c90eee1eb5c357193cab187bdeceef299c95622aed9c03601c1b5d67a941de12003c01e0af9ad68e82bfa2 SHA512 6c48eeab7658db1e9bac54da2f73087b1a58046504c507c94e58478f03f3b37336af254947964dbf9383575dc2cb3019640c7286ab0dfa5d5d9f55df96b34864
+EBUILD zfs-0.8.6.ebuild 6466 BLAKE2B 1826a984e3bcafa84585869df35eb86d77e713f6f909ae5bdef3a3bce10e78fbf3aaa9ace7d3e0d096ddfd926f75b164020f570864c868224551f2c16eece2ca SHA512 f9241fb89ecef5ba2ecd118dc6ac856614a9afd2b247e87c71a67a136736d77e79d28ad2dab0a019beeb241238424c9e58958704f9435de320e9b97e26f26a62
+EBUILD zfs-2.0.4-r1.ebuild 6779 BLAKE2B 345bebffe2dc50a00d093de5234a6fbd1902af4ffc604886902fbe361ccd2111fe2afbea3a24e941ef8b208e261d5f70c34b16d6265d822cd533ebb5092c3256 SHA512 273302767f0d9cfcc1948ae13113b9ac797a19852c39a680f02cac7309a5a52263cf6766e3b001b7e5f48a88e821ba9baf400409429b6d98305e4c4644e1a8ba
+EBUILD zfs-2.1.0_rc7.ebuild 8086 BLAKE2B 33003e0e3bbef3018b2f7ea7eab8ac19c6ee5e91ea81cddcfd406f867cb14cd461d5a7c428a3f42d058c60e9970e5fde18e0fae309d8dd47b41b8232ccf2b9d0 SHA512 26849e6fccd79abf48e2b94e5fa739eefbbfe860979421ef5d9aef8174c39726d27fc7b758e63f714d1210f0d666ca83f31069ccfcd9d1cdb5a4662bfcfb64d3
+EBUILD zfs-9999.ebuild 8086 BLAKE2B 33003e0e3bbef3018b2f7ea7eab8ac19c6ee5e91ea81cddcfd406f867cb14cd461d5a7c428a3f42d058c60e9970e5fde18e0fae309d8dd47b41b8232ccf2b9d0 SHA512 26849e6fccd79abf48e2b94e5fa739eefbbfe860979421ef5d9aef8174c39726d27fc7b758e63f714d1210f0d666ca83f31069ccfcd9d1cdb5a4662bfcfb64d3
MISC metadata.xml 1000 BLAKE2B 1f3e75ef73d5680d5863f0fda415931a6af19ab1a535c9795c417526ccce2a826ede05abee88ff27c2ec99f1f23aa06cce02cd3cb6d49b2952e90eb94ab95a6b SHA512 f8b30ce788d80c8f65db738f251fe5ebdc4d3ec7206dc78e0b9e53c2cf92153b90e20f6799b2a36bf8e616147b28f9660421bbc2ad17e7dbd804d47f430f6e40
diff --git a/sys-fs/zfs/files/2.0.4-scrub-timers.patch b/sys-fs/zfs/files/2.0.4-scrub-timers.patch
new file mode 100644
index 000000000000..6aae1e4de596
--- /dev/null
+++ b/sys-fs/zfs/files/2.0.4-scrub-timers.patch
@@ -0,0 +1,97 @@
+From e23d7e03637e377591a480d87630b746cdaa377f Mon Sep 17 00:00:00 2001
+From: Georgy Yakovlev <gyakovlev@gentoo.org>
+Date: Sat, 22 May 2021 22:27:39 -0700
+Subject: [PATCH] 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 <gyakovlev@gentoo.org>
+---
+ 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 | 12 ++++++++++++
+ 4 files changed, 40 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..4c585f45f
+--- /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
++AccuracySec=1h
++Persistent=true
++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..b2454be2c
+--- /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
++AccuracySec=1h
++Persistent=true
++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..720901165
+--- /dev/null
++++ b/etc/systemd/system/zfs-scrub@.service.in
+@@ -0,0 +1,12 @@
++[Unit]
++Description=zpool scrub on %i
++Documentation=man:zpool-scrub(8)
++Requires=zfs.target
++After=zfs.target
++ConditionPathIsDirectory=/sys/module/zfs
++
++[Service]
++Nice=19
++IOSchedulingClass=idle
++KillSignal=SIGINT
++ExecStart=@sbindir@/zpool scrub %i
+--
+2.31.1
+
diff --git a/sys-fs/zfs/zfs-0.8.6.ebuild b/sys-fs/zfs/zfs-0.8.6.ebuild
index fbe500b2f8d9..54845ae75568 100644
--- a/sys-fs/zfs/zfs-0.8.6.ebuild
+++ b/sys-fs/zfs/zfs-0.8.6.ebuild
@@ -7,7 +7,7 @@ DISTUTILS_OPTIONAL=1
DISTUTILS_USE_SETUPTOOLS=manual
PYTHON_COMPAT=( python3_{7,8,9} )
-inherit autotools bash-completion-r1 flag-o-matic linux-info distutils-r1 systemd toolchain-funcs udev usr-ldscript
+inherit autotools bash-completion-r1 dist-kernel-utils distutils-r1 flag-o-matic linux-info systemd toolchain-funcs udev usr-ldscript
DESCRIPTION="Userland utilities for ZFS Linux kernel module"
HOMEPAGE="https://github.com/openzfs/zfs"
@@ -22,7 +22,7 @@ fi
LICENSE="BSD-2 CDDL MIT"
SLOT="0/2" # just libzfs soname major for now. possible candidates: libuutil, libzpool, libnvpair
-IUSE="custom-cflags debug kernel-builtin minimal nls python +rootfs test-suite static-libs"
+IUSE="custom-cflags debug dist-kernel kernel-builtin minimal nls pam python +rootfs test-suite static-libs"
DEPEND="
net-libs/libtirpc[static-libs?]
@@ -46,9 +46,11 @@ BDEPEND="virtual/awk
"
RDEPEND="${DEPEND}
- !kernel-builtin? ( ~sys-fs/zfs-kmod-${PV} )
+ !kernel-builtin? ( ~sys-fs/zfs-kmod-${PV}:=[dist-kernel?] )
!prefix? ( virtual/udev )
sys-fs/udev-init-scripts
+ virtual/awk
+ dist-kernel? ( virtual/dist-kernel:= )
rootfs? (
app-arch/cpio
app-misc/pax-utils
@@ -77,8 +79,19 @@ PATCHES=(
"${FILESDIR}/bash-completion-sudo.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 && use test-suite; then
+ if use kernel_linux; then
linux-info_pkg_setup
if ! linux_config_exists; then
@@ -185,6 +198,15 @@ src_install() {
}
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"
diff --git a/sys-fs/zfs/zfs-2.0.4.ebuild b/sys-fs/zfs/zfs-2.0.4-r1.ebuild
index 597374f40d48..e6152b9eb7e4 100644
--- a/sys-fs/zfs/zfs-2.0.4.ebuild
+++ b/sys-fs/zfs/zfs-2.0.4-r1.ebuild
@@ -7,7 +7,7 @@ DISTUTILS_OPTIONAL=1
DISTUTILS_USE_SETUPTOOLS=manual
PYTHON_COMPAT=( python3_{7,8,9} )
-inherit autotools bash-completion-r1 distutils-r1 flag-o-matic linux-info pam systemd toolchain-funcs udev usr-ldscript
+inherit autotools bash-completion-r1 dist-kernel-utils distutils-r1 flag-o-matic linux-info pam systemd toolchain-funcs udev usr-ldscript
DESCRIPTION="Userland utilities for ZFS Linux kernel module"
HOMEPAGE="https://github.com/openzfs/zfs"
@@ -26,7 +26,7 @@ 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.
SLOT="0/4"
-IUSE="custom-cflags debug kernel-builtin minimal nls pam python +rootfs test-suite static-libs"
+IUSE="custom-cflags debug dist-kernel kernel-builtin minimal nls pam python +rootfs test-suite static-libs"
DEPEND="
net-libs/libtirpc[static-libs?]
@@ -51,9 +51,11 @@ BDEPEND="virtual/awk
"
RDEPEND="${DEPEND}
- !kernel-builtin? ( ~sys-fs/zfs-kmod-${PV} )
+ !kernel-builtin? ( ~sys-fs/zfs-kmod-${PV}:=[dist-kernel?] )
!prefix? ( virtual/udev )
sys-fs/udev-init-scripts
+ virtual/awk
+ dist-kernel? ( virtual/dist-kernel:= )
rootfs? (
app-arch/cpio
app-misc/pax-utils
@@ -78,10 +80,24 @@ REQUIRED_USE="
RESTRICT="test"
-PATCHES=( "${FILESDIR}/bash-completion-sudo.patch" )
+PATCHES=(
+ "${FILESDIR}/bash-completion-sudo.patch"
+ "${FILESDIR}/2.0.4-scrub-timers.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 && use test-suite; then
+ if use kernel_linux; then
linux-info_pkg_setup
if ! linux_config_exists; then
@@ -104,13 +120,9 @@ pkg_setup() {
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
+ eautoreconf
+ # Set revision number
+ sed -i "s/\(Release:\)\(.*\)1/\1\2${PR}-gentoo/" META || die "Could not set Gentoo release"
if use python; then
pushd contrib/pyzfs >/dev/null || die
@@ -194,6 +206,15 @@ src_install() {
}
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"
diff --git a/sys-fs/zfs/zfs-2.1.0_rc6.ebuild b/sys-fs/zfs/zfs-2.1.0_rc7.ebuild
index 621ef35d32be..957b611b7ef5 100644
--- a/sys-fs/zfs/zfs-2.1.0_rc6.ebuild
+++ b/sys-fs/zfs/zfs-2.1.0_rc7.ebuild
@@ -7,7 +7,7 @@ DISTUTILS_OPTIONAL=1
DISTUTILS_USE_SETUPTOOLS=manual
PYTHON_COMPAT=( python3_{7,8,9} )
-inherit autotools bash-completion-r1 distutils-r1 flag-o-matic linux-info pam systemd toolchain-funcs udev usr-ldscript
+inherit autotools bash-completion-r1 dist-kernel-utils distutils-r1 flag-o-matic linux-info pam systemd toolchain-funcs udev usr-ldscript
DESCRIPTION="Userland utilities for ZFS Linux kernel module"
HOMEPAGE="https://github.com/openzfs/zfs"
@@ -34,7 +34,7 @@ LICENSE="BSD-2 CDDL MIT"
# 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 kernel-builtin minimal nls pam python +rootfs test-suite static-libs"
+IUSE="custom-cflags debug dist-kernel kernel-builtin minimal nls pam python +rootfs test-suite static-libs"
DEPEND="
net-libs/libtirpc[static-libs?]
@@ -63,10 +63,11 @@ fi
# awk is used for some scripts, completions, and the Dracut module
RDEPEND="${DEPEND}
- !kernel-builtin? ( ~sys-fs/zfs-kmod-${PV} )
+ !kernel-builtin? ( ~sys-fs/zfs-kmod-${PV}:=[dist-kernel?] )
!prefix? ( virtual/udev )
sys-fs/udev-init-scripts
virtual/awk
+ dist-kernel? ( virtual/dist-kernel:= )
rootfs? (
app-arch/cpio
app-misc/pax-utils
@@ -91,8 +92,19 @@ REQUIRED_USE="
RESTRICT="test"
+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 && use test-suite; then
+ if use kernel_linux; then
linux-info_pkg_setup
if ! linux_config_exists; then
@@ -141,9 +153,10 @@ src_prepare() {
default
libsoversion_check
- if [[ ${PV} == "9999" ]]; then
- eautoreconf
- else
+ # 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
@@ -230,6 +243,15 @@ src_install() {
}
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"
diff --git a/sys-fs/zfs/zfs-9999.ebuild b/sys-fs/zfs/zfs-9999.ebuild
index 621ef35d32be..957b611b7ef5 100644
--- a/sys-fs/zfs/zfs-9999.ebuild
+++ b/sys-fs/zfs/zfs-9999.ebuild
@@ -7,7 +7,7 @@ DISTUTILS_OPTIONAL=1
DISTUTILS_USE_SETUPTOOLS=manual
PYTHON_COMPAT=( python3_{7,8,9} )
-inherit autotools bash-completion-r1 distutils-r1 flag-o-matic linux-info pam systemd toolchain-funcs udev usr-ldscript
+inherit autotools bash-completion-r1 dist-kernel-utils distutils-r1 flag-o-matic linux-info pam systemd toolchain-funcs udev usr-ldscript
DESCRIPTION="Userland utilities for ZFS Linux kernel module"
HOMEPAGE="https://github.com/openzfs/zfs"
@@ -34,7 +34,7 @@ LICENSE="BSD-2 CDDL MIT"
# 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 kernel-builtin minimal nls pam python +rootfs test-suite static-libs"
+IUSE="custom-cflags debug dist-kernel kernel-builtin minimal nls pam python +rootfs test-suite static-libs"
DEPEND="
net-libs/libtirpc[static-libs?]
@@ -63,10 +63,11 @@ fi
# awk is used for some scripts, completions, and the Dracut module
RDEPEND="${DEPEND}
- !kernel-builtin? ( ~sys-fs/zfs-kmod-${PV} )
+ !kernel-builtin? ( ~sys-fs/zfs-kmod-${PV}:=[dist-kernel?] )
!prefix? ( virtual/udev )
sys-fs/udev-init-scripts
virtual/awk
+ dist-kernel? ( virtual/dist-kernel:= )
rootfs? (
app-arch/cpio
app-misc/pax-utils
@@ -91,8 +92,19 @@ REQUIRED_USE="
RESTRICT="test"
+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 && use test-suite; then
+ if use kernel_linux; then
linux-info_pkg_setup
if ! linux_config_exists; then
@@ -141,9 +153,10 @@ src_prepare() {
default
libsoversion_check
- if [[ ${PV} == "9999" ]]; then
- eautoreconf
- else
+ # 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
@@ -230,6 +243,15 @@ src_install() {
}
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"