summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorgy Yakovlev <gyakovlev@gentoo.org>2021-06-08 01:04:13 -0700
committerGeorgy Yakovlev <gyakovlev@gentoo.org>2021-06-08 22:19:53 -0700
commit80c9b77b4b7dd9355a28b7067f5d84687775beb6 (patch)
tree1439739ae66596289e293e73a6f2840b467bb770 /sys-fs/zfs
parentsys-fs/zfs: use subslot dep for zfs-kmod (diff)
downloadgentoo-80c9b77b4b7dd9355a28b7067f5d84687775beb6.tar.gz
gentoo-80c9b77b4b7dd9355a28b7067f5d84687775beb6.tar.bz2
gentoo-80c9b77b4b7dd9355a28b7067f5d84687775beb6.zip
sys-fs/zfs*: consistently require dist-kernel flag to be in sync
Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org>
Diffstat (limited to 'sys-fs/zfs')
-rw-r--r--sys-fs/zfs/zfs-0.8.6.ebuild30
-rw-r--r--sys-fs/zfs/zfs-2.0.4-r1.ebuild30
-rw-r--r--sys-fs/zfs/zfs-2.1.0_rc6.ebuild29
-rw-r--r--sys-fs/zfs/zfs-9999.ebuild29
4 files changed, 102 insertions, 16 deletions
diff --git a/sys-fs/zfs/zfs-0.8.6.ebuild b/sys-fs/zfs/zfs-0.8.6.ebuild
index 6a772829a368..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-r1.ebuild b/sys-fs/zfs/zfs-2.0.4-r1.ebuild
index 98198b67e82c..e6152b9eb7e4 100644
--- a/sys-fs/zfs/zfs-2.0.4-r1.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
@@ -83,8 +85,19 @@ PATCHES=(
"${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
@@ -193,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_rc6.ebuild
index fbc90164dad9..1cd4e63b4e68 100644
--- a/sys-fs/zfs/zfs-2.1.0_rc6.ebuild
+++ b/sys-fs/zfs/zfs-2.1.0_rc6.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
@@ -230,6 +242,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 fbc90164dad9..1cd4e63b4e68 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
@@ -230,6 +242,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"