From d18bf1e01b65ee4bf0c804e2843b282d3d4e5d7c Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Tue, 15 Jun 2021 14:57:03 +0100 Subject: gentoo resync : 15.06.2021 --- sys-fs/zfs/Manifest | 13 +- sys-fs/zfs/files/2.0.4-scrub-timers.patch | 97 ++++++++++ sys-fs/zfs/zfs-0.8.6.ebuild | 30 +++- sys-fs/zfs/zfs-2.0.4-r1.ebuild | 252 ++++++++++++++++++++++++++ sys-fs/zfs/zfs-2.0.4.ebuild | 231 ------------------------ sys-fs/zfs/zfs-2.1.0_rc6.ebuild | 267 --------------------------- sys-fs/zfs/zfs-2.1.0_rc7.ebuild | 289 ++++++++++++++++++++++++++++++ sys-fs/zfs/zfs-9999.ebuild | 36 +++- 8 files changed, 700 insertions(+), 515 deletions(-) create mode 100644 sys-fs/zfs/files/2.0.4-scrub-timers.patch create mode 100644 sys-fs/zfs/zfs-2.0.4-r1.ebuild delete mode 100644 sys-fs/zfs/zfs-2.0.4.ebuild delete mode 100644 sys-fs/zfs/zfs-2.1.0_rc6.ebuild create mode 100644 sys-fs/zfs/zfs-2.1.0_rc7.ebuild (limited to 'sys-fs/zfs') 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 +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 +--- + 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-r1.ebuild b/sys-fs/zfs/zfs-2.0.4-r1.ebuild new file mode 100644 index 000000000000..e6152b9eb7e4 --- /dev/null +++ b/sys-fs/zfs/zfs-2.0.4-r1.ebuild @@ -0,0 +1,252 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +DISTUTILS_OPTIONAL=1 +DISTUTILS_USE_SETUPTOOLS=manual +PYTHON_COMPAT=( python3_{7,8,9} ) + +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" + +if [[ ${PV} == "9999" ]] ; then + inherit git-r3 linux-mod + EGIT_REPO_URI="https://github.com/openzfs/zfs.git" +else + MY_P="${P/_rc/-rc}" + SRC_URI="https://github.com/openzfs/${PN}/releases/download/${MY_P}/${MY_P}.tar.gz" + KEYWORDS="~amd64 ~arm64 ~ppc64" + S="${WORKDIR}/${P%_rc?}" +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. +SLOT="0/4" +IUSE="custom-cflags debug dist-kernel kernel-builtin minimal nls pam python +rootfs test-suite static-libs" + +DEPEND=" + net-libs/libtirpc[static-libs?] + sys-apps/util-linux[static-libs?] + sys-libs/zlib[static-libs(+)?] + virtual/awk + virtual/libudev[static-libs(-)?] + dev-libs/openssl:0=[static-libs?] + !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}] + ) +" + +RDEPEND="${DEPEND} + !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 + !" + eerror " Block devices --->" + eerror " [X] Loopback device support" + fi + fi + fi + fi +} + +src_prepare() { + default + 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 + 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="${EPREFIX}/lib/systemd/system-preset" + --with-vendor=gentoo + $(use_enable debug) + $(use_enable nls) + $(use_enable pam) + $(use_enable python pyzfs) + $(use_enable static-libs 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 ; } + + if ! use static-libs; then + find "${ED}/" -name '*.la' -delete || die + fi + + 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" + 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}/lib/systemd/system-preset/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/sys-fs/zfs/zfs-2.0.4.ebuild b/sys-fs/zfs/zfs-2.0.4.ebuild deleted file mode 100644 index 597374f40d48..000000000000 --- a/sys-fs/zfs/zfs-2.0.4.ebuild +++ /dev/null @@ -1,231 +0,0 @@ -# Copyright 1999-2021 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=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 - -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 - MY_P="${P/_rc/-rc}" - SRC_URI="https://github.com/openzfs/${PN}/releases/download/${MY_P}/${MY_P}.tar.gz" - KEYWORDS="~amd64 ~arm64 ~ppc64" - S="${WORKDIR}/${P%_rc?}" -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. -SLOT="0/4" -IUSE="custom-cflags debug kernel-builtin minimal nls pam python +rootfs test-suite static-libs" - -DEPEND=" - net-libs/libtirpc[static-libs?] - sys-apps/util-linux[static-libs?] - sys-libs/zlib[static-libs(+)?] - virtual/awk - virtual/libudev[static-libs(-)?] - dev-libs/openssl:0=[static-libs?] - !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}] - ) -" - -RDEPEND="${DEPEND} - !kernel-builtin? ( ~sys-fs/zfs-kmod-${PV} ) - !prefix? ( virtual/udev ) - sys-fs/udev-init-scripts - 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-pamconfigsdir="${EPREFIX}/unwanted_files" - --with-pammoduledir="$(getpam_mod_dir)" - --with-systemdunitdir="$(systemd_get_systemunitdir)" - --with-systemdpresetdir="${EPREFIX}/lib/systemd/system-preset" - --with-vendor=gentoo - $(use_enable debug) - $(use_enable nls) - $(use_enable pam) - $(use_enable python pyzfs) - $(use_enable static-libs 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 ; } - - if ! use static-libs; then - find "${ED}/" -name '*.la' -delete || die - fi - - 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() { - 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" - 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}/lib/systemd/system-preset/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/sys-fs/zfs/zfs-2.1.0_rc6.ebuild b/sys-fs/zfs/zfs-2.1.0_rc6.ebuild deleted file mode 100644 index 621ef35d32be..000000000000 --- a/sys-fs/zfs/zfs-2.1.0_rc6.ebuild +++ /dev/null @@ -1,267 +0,0 @@ -# Copyright 1999-2021 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=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 - -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=/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/5" -IUSE="custom-cflags debug kernel-builtin minimal nls pam python +rootfs test-suite static-libs" - -DEPEND=" - net-libs/libtirpc[static-libs?] - sys-apps/util-linux[static-libs?] - sys-libs/zlib[static-libs(+)?] - virtual/libudev[static-libs(-)?] - dev-libs/openssl:0=[static-libs?] - !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}] - ) -" - -if [[ ${PV} != "9999" ]] ; then - BDEPEND+=" verify-sig? ( app-crypt/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 - 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 - - 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-pamconfigsdir="${EPREFIX}/unwanted_files" - --with-pammoduledir="$(getpam_mod_dir)" - --with-systemdunitdir="$(systemd_get_systemunitdir)" - --with-systemdpresetdir="${EPREFIX}/lib/systemd/system-preset" - --with-vendor=gentoo - $(use_enable debug) - $(use_enable nls) - $(use_enable pam) - $(use_enable python pyzfs) - $(use_enable static-libs 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 ; } - - if ! use static-libs; then - find "${ED}" -name '*.la' -delete || die - fi - - 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() { - 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" - 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}/lib/systemd/system-preset/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/sys-fs/zfs/zfs-2.1.0_rc7.ebuild b/sys-fs/zfs/zfs-2.1.0_rc7.ebuild new file mode 100644 index 000000000000..957b611b7ef5 --- /dev/null +++ b/sys-fs/zfs/zfs-2.1.0_rc7.ebuild @@ -0,0 +1,289 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +DISTUTILS_OPTIONAL=1 +DISTUTILS_USE_SETUPTOOLS=manual +PYTHON_COMPAT=( python3_{7,8,9} ) + +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" + +if [[ ${PV} == "9999" ]]; then + inherit git-r3 linux-mod + 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" + 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 static-libs" + +DEPEND=" + net-libs/libtirpc[static-libs?] + sys-apps/util-linux[static-libs?] + sys-libs/zlib[static-libs(+)?] + virtual/libudev[static-libs(-)?] + dev-libs/openssl:0=[static-libs?] + !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}] + ) +" + +if [[ ${PV} != "9999" ]] ; then + BDEPEND+=" verify-sig? ( app-crypt/openpgp-keys-openzfs )" +fi + +# awk is used for some scripts, completions, and the Dracut module +RDEPEND="${DEPEND} + !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 + !" + 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="${EPREFIX}/lib/systemd/system-preset" + --with-vendor=gentoo + $(use_enable debug) + $(use_enable nls) + $(use_enable pam) + $(use_enable python pyzfs) + $(use_enable static-libs 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 ; } + + if ! use static-libs; then + find "${ED}" -name '*.la' -delete || die + fi + + 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" + 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}/lib/systemd/system-preset/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/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" -- cgit v1.2.3