* [gentoo-commits] repo/gentoo:master commit in: sys-fs/zfs/, sys-fs/zfs/files/
@ 2018-02-14 20:39 Matt Thode
0 siblings, 0 replies; 22+ messages in thread
From: Matt Thode @ 2018-02-14 20:39 UTC (permalink / raw
To: gentoo-commits
commit: c756381a157ee8c3de2924685791d962eeb3d341
Author: Matthew Thode <prometheanfire <AT> gentoo <DOT> org>
AuthorDate: Wed Feb 14 20:38:27 2018 +0000
Commit: Matt Thode <prometheanfire <AT> gentoo <DOT> org>
CommitDate: Wed Feb 14 20:39:11 2018 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c756381a
sys-fs/zfs: make modprobe optional for systemd unit files
Package-Manager: Portage-2.3.19, Repoman-2.3.6
sys-fs/zfs/files/zfs.service.in | 2 +-
sys-fs/zfs/zfs-9999.ebuild | 10 ----------
2 files changed, 1 insertion(+), 11 deletions(-)
diff --git a/sys-fs/zfs/files/zfs.service.in b/sys-fs/zfs/files/zfs.service.in
index c390a480708..ae2eff170a7 100644
--- a/sys-fs/zfs/files/zfs.service.in
+++ b/sys-fs/zfs/files/zfs.service.in
@@ -6,7 +6,7 @@ After=systemd-udev-settle.target local-fs.target
[Service]
Type=oneshot
RemainAfterExit=yes
-ExecStartPre=/sbin/modprobe zfs
+ExecStartPre=-/sbin/modprobe zfs
ExecStartPre=/usr/bin/test -c /dev/zfs
ExecStart=/usr/libexec/zfs-init.sh
ExecStop=@sbindir@/zfs umount -a
diff --git a/sys-fs/zfs/zfs-9999.ebuild b/sys-fs/zfs/zfs-9999.ebuild
index 7b8d2f94a45..5cfa93fa4c5 100644
--- a/sys-fs/zfs/zfs-9999.ebuild
+++ b/sys-fs/zfs/zfs-9999.ebuild
@@ -87,12 +87,6 @@ src_prepare() {
-e "s|/sbin/parted|/usr/sbin/parted|" \
-i scripts/common.sh.in
- if use kernel-builtin
- then
- einfo "kernel-builtin enabled, removing module loading from"
- einfo "systemd units."
- sed -i -e '/modprobe\ zfs/d' etc/systemd/system/*.service.in || die
- fi
autotools-utils_src_prepare
}
@@ -120,10 +114,6 @@ src_configure() {
sed -e "s:@sbindir@:${EPREFIX}/sbin:g" \
-e "s:@sysconfdir@:${EPREFIX}/etc:g" \
> "${T}/zfs-init.sh" || die
- if use kernel-builtin
- then
- sed -i -e '/modprobe\ zfs/d' "${T}/zfs.service" || die
- fi
}
src_install() {
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-fs/zfs/, sys-fs/zfs/files/
@ 2019-03-31 3:53 Georgy Yakovlev
0 siblings, 0 replies; 22+ messages in thread
From: Georgy Yakovlev @ 2019-03-31 3:53 UTC (permalink / raw
To: gentoo-commits
commit: b0c6076e0f64f1a8a798b1f7b2b74a180f7eb5e8
Author: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
AuthorDate: Sat Mar 23 04:52:57 2019 +0000
Commit: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
CommitDate: Sun Mar 31 03:53:42 2019 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b0c6076e
sys-fs/zfs: rework live ebuild
major rework
bump eapi to 7
add multi-python pyzfs installation behind python useflag
use provided systemd unit, since upstream systemd handling changed
use upstream bash-completion (with local patch)
fix sed->zed typo in postinst code
Closes: https://bugs.gentoo.org/548856
Package-Manager: Portage-2.3.62, Repoman-2.3.12
Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org>
sys-fs/zfs/files/bash-completion-sudo.patch | 35 ++++++
sys-fs/zfs/zfs-9999.ebuild | 185 ++++++++++++++++------------
2 files changed, 138 insertions(+), 82 deletions(-)
diff --git a/sys-fs/zfs/files/bash-completion-sudo.patch b/sys-fs/zfs/files/bash-completion-sudo.patch
new file mode 100644
index 00000000000..8ae9d25d276
--- /dev/null
+++ b/sys-fs/zfs/files/bash-completion-sudo.patch
@@ -0,0 +1,35 @@
+From 3829d0b867f6aa4bde8798147dee74a86435d12c Mon Sep 17 00:00:00 2001
+From: Georgy Yakovlev <gyakovlev@gentoo.org>
+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/sys-fs/zfs/zfs-9999.ebuild b/sys-fs/zfs/zfs-9999.ebuild
index 0d0c1cf5b26..bde2d9e06bc 100644
--- a/sys-fs/zfs/zfs-9999.ebuild
+++ b/sys-fs/zfs/zfs-9999.ebuild
@@ -1,43 +1,61 @@
-# Copyright 1999-2018 Gentoo Authors
+# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-EAPI="5"
-PYTHON_COMPAT=( python{2_7,3_4,3_5,3_6} )
+EAPI=7
-if [ ${PV} == "9999" ] ; then
- inherit git-r3 linux-mod
- AUTOTOOLS_AUTORECONF="1"
- EGIT_REPO_URI="https://github.com/zfsonlinux/${PN}.git"
-else
- SRC_URI="https://github.com/zfsonlinux/${PN}/releases/download/${P}/${P}.tar.gz"
- KEYWORDS="~amd64 ~arm ~ppc ~ppc64"
-fi
+DISTUTILS_OPTIONAL=1
+PYTHON_COMPAT=( python{2_7,3_{5,6,7}} )
-inherit autotools-utils bash-completion-r1 flag-o-matic linux-info python-r1 systemd toolchain-funcs udev
+inherit bash-completion-r1 flag-o-matic linux-info linux-mod distutils-r1 systemd toolchain-funcs udev
DESCRIPTION="Userland utilities for ZFS Linux kernel module"
HOMEPAGE="https://zfsonlinux.org/"
+if [[ ${PV} == "9999" ]] ; then
+ inherit autotools git-r3
+ EGIT_REPO_URI="https://github.com/zfsonlinux/zfs.git"
+else
+ SRC_URI="https://github.com/zfsonlinux/${PN}/releases/download/${P}/${P}.tar.gz"
+ KEYWORDS="~amd64"
+fi
+
LICENSE="BSD-2 CDDL MIT"
SLOT="0"
-IUSE="custom-cflags debug kernel-builtin +rootfs test-suite static-libs"
-RESTRICT="test"
+IUSE="custom-cflags debug kernel-builtin python +rootfs test-suite static-libs"
COMMON_DEPEND="
+ ${PYTHON_DEPS}
net-libs/libtirpc
sys-apps/util-linux[static-libs?]
sys-libs/zlib[static-libs(+)?]
virtual/awk
+ python? (
+ virtual/python-cffi[${PYTHON_USEDEP}]
+ )
"
-DEPEND="${COMMON_DEPEND}
+
+BDEPEND="${COMMON_DEPEND}
virtual/pkgconfig
+ python? (
+ dev-python/setuptools[${PYTHON_USEDEP}]
+ )
"
RDEPEND="${COMMON_DEPEND}
!=sys-apps/grep-2.13*
- !kernel-builtin? ( =sys-fs/zfs-kmod-${PV}* )
+ !kernel-builtin? ( ~sys-fs/zfs-kmod-${PV} )
!sys-fs/zfs-fuse
!prefix? ( virtual/udev )
+ sys-fs/udev-init-scripts
+ rootfs? (
+ app-arch/cpio
+ app-misc/pax-utils
+ !<sys-boot/grub-2.00-r2:2
+ !<sys-kernel/genkernel-3.5.1.1
+ !<sys-kernel/genkernel-next-67
+ !<sys-kernel/bliss-initramfs-7.1.0
+ !<sys-kernel/dracut-044-r1
+ )
test-suite? (
sys-apps/util-linux
sys-devel/bc
@@ -46,24 +64,22 @@ RDEPEND="${COMMON_DEPEND}
sys-fs/mdadm
sys-process/procps
virtual/modutils
- )
- rootfs? (
- app-arch/cpio
- app-misc/pax-utils
- !<sys-boot/grub-2.00-r2:2
- )
+ )
"
-AT_M4DIR="config"
-AUTOTOOLS_IN_SOURCE_BUILD="1"
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+RESTRICT="test"
+
+PATCHES=( "${FILESDIR}/bash-completion-sudo.patch" )
pkg_setup() {
if use kernel_linux && use test-suite; then
linux-info_pkg_setup
+
if ! linux_config_exists; then
ewarn "Cannot check the linux kernel configuration."
else
- # recheck that we don't have usblp to collide with libusb
if use test-suite; then
if linux_chkconfig_present BLK_DEV_LOOP; then
eerror "The ZFS test suite requires loop device support enabled."
@@ -72,34 +88,38 @@ pkg_setup() {
eerror "in /usr/src/linux/.config or"
eerror " Device Drivers --->"
eerror " Block devices --->"
- eerror " [ ] Loopback device support"
+ eerror " [X] Loopback device support"
fi
fi
fi
fi
-
}
src_prepare() {
+ default
+
+ [[ ${PV} == "9999" ]] && eautoreconf
+
# Update paths
sed -e "s|/sbin/lsmod|/bin/lsmod|" \
-e "s|/usr/bin/scsi-rescan|/usr/sbin/rescan-scsi-bus|" \
-e "s|/sbin/parted|/usr/sbin/parted|" \
- -i scripts/common.sh.in
+ -i scripts/common.sh.in || die
- if use kernel-builtin
- then
- einfo "kernel-builtin enabled, removing module loading from"
- einfo "systemd units."
- sed -i -e '/modprobe\ zfs/d' etc/systemd/system/*.service.in || die
+ if use python; then
+ pushd contrib/pyzfs >/dev/null || die
+ distutils-r1_src_prepare
+ popd >/dev/null || die
fi
- autotools-utils_src_prepare
}
src_configure() {
use custom-cflags || strip-flags
- local myeconfargs=(
+
+ local myconf=(
--bindir="${EPREFIX}/bin"
+ --enable-systemd
+ --enable-sysvinit
--sbindir="${EPREFIX}/sbin"
--with-config=user
--with-dracutdir="${EPREFIX}/usr/lib/dracut"
@@ -109,47 +129,53 @@ src_configure() {
--with-systemdunitdir="$(systemd_get_systemunitdir)"
--with-systemdpresetdir="${EPREFIX}/lib/systemd/system-preset"
$(use_enable debug)
+ $(use_enable python pyzfs)
)
- autotools-utils_src_configure
-
- # prepare systemd unit and helper script
- cat "${FILESDIR}/zfs.service.in" | \
- sed -e "s:@sbindir@:${EPREFIX}/sbin:g" \
- -e "s:@sysconfdir@:${EPREFIX}/etc:g" \
- > "${T}/zfs.service" || die
- cat "${FILESDIR}/zfs-init.sh.in" | \
- sed -e "s:@sbindir@:${EPREFIX}/sbin:g" \
- -e "s:@sysconfdir@:${EPREFIX}/etc:g" \
- > "${T}/zfs-init.sh" || die
- if use kernel-builtin
- then
- sed -i -e '/modprobe\ zfs/d' "${T}/zfs.service" || die
+
+ 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() {
- autotools-utils_src_install
+ default
+
gen_usr_ldscript -a uutil nvpair zpool zfs zfs_core
- use test-suite || rm -rf "${ED}usr/share/zfs"
- newbashcomp "${FILESDIR}/bash-completion-r1" zfs
+ use test-suite || rm -rf "${ED}/usr/share/zfs"
+
+ dobashcomp contrib/bash_completion.d/zfs
bashcomp_alias zfs zpool
- exeinto /usr/libexec
- doexe "${T}/zfs-init.sh"
- systemd_dounit "${T}/zfs.service"
+ # 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
+ python_setup
+ python_fix_shebang "${ED}/bin"
}
pkg_postinst() {
- if ! use kernel-builtin && [ ${PV} = "9999" ]
- then
+ 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 [ -e "${EROOT}etc/runlevels/boot/zfs" ]
- then
+ if [[ -e "${EROOT}/etc/runlevels/boot/zfs" ]]; then
einfo 'The zfs boot script has been split into the zfs-import,'
einfo 'zfs-mount and zfs-share scripts.'
einfo
@@ -159,24 +185,23 @@ pkg_postinst() {
einfo 'The zfs-import and zfs-mount scripts have been added to the boot'
einfo 'runlevel while the zfs-share script is in the default runlevel.'
- rm "${EROOT}etc/runlevels/boot/zfs"
- ln -snf "${EROOT}etc/init.d/zfs-import" \
- "${EROOT}etc/runlevels/boot/zfs-import"
- ln -snf "${EROOT}etc/init.d/zfs-mount" \
- "${EROOT}etc/runlevels/boot/zfs-mount"
- ln -snf "${EROOT}etc/init.d/zfs-share" \
- "${EROOT}etc/runlevels/default/zfs-share"
+ rm "${EROOT}/etc/runlevels/boot/zfs"
+ ln -snf "${EROOT}/etc/init.d/zfs-import" \
+ "${EROOT}/etc/runlevels/boot/zfs-import"
+ ln -snf "${EROOT}/etc/init.d/zfs-mount" \
+ "${EROOT}/etc/runlevels/boot/zfs-mount"
+ ln -snf "${EROOT}/etc/init.d/zfs-share" \
+ "${EROOT}/etc/runlevels/default/zfs-share"
else
- [ -e "${EROOT}etc/runlevels/boot/zfs-import" ] || \
+ [[ -e "${EROOT}/etc/runlevels/boot/zfs-import" ]] || \
einfo "You should add zfs-import to the boot runlevel."
- [ -e "${EROOT}etc/runlevels/boot/zfs-mount" ] || \
+ [[ -e "${EROOT}/etc/runlevels/boot/zfs-mount" ]]|| \
einfo "You should add zfs-mount to the boot runlevel."
- [ -e "${EROOT}etc/runlevels/default/zfs-share" ] || \
+ [[ -e "${EROOT}/etc/runlevels/default/zfs-share" ]] || \
einfo "You should add zfs-share to the default runlevel."
fi
- if [ -e "${EROOT}etc/runlevels/default/zed" ]
- then
+ if [[ -e "${EROOT}/etc/runlevels/default/zed" ]]; then
einfo 'The downstream OpenRC zed script has replaced by the upstream'
einfo 'OpenRC zfs-zed script.'
einfo
@@ -184,18 +209,17 @@ pkg_postinst() {
einfo 'convenience, it has been automatically removed and the zfs-zed'
einfo 'script that replaced it has been configured to start.'
- rm "${EROOT}etc/runlevels/boot/zed"
- ln -snf "${EROOT}etc/init.d/zfs-sed" \
- "${EROOT}etc/runlevels/default/zfs-zed"
+ rm "${EROOT}/etc/runlevels/boot/zed"
+ ln -snf "${EROOT}/etc/init.d/zfs-zed" \
+ "${EROOT}/etc/runlevels/default/zfs-zed"
else
- [ -e "${EROOT}etc/runlevels/default/zfs-zed" ] || \
+ [[ -e "${EROOT}/etc/runlevels/default/zfs-zed" ]] || \
einfo "You should add zfs-zed to the default runlevel."
fi
- if [ -e "${EROOT}etc/runlevels/shutdown/zfs-shutdown" ]
- then
+ if [[ -e "${EROOT}/etc/runlevels/shutdown/zfs-shutdown" ]]; then
einfo "The zfs-shutdown script is obsolete. Removing it from runlevel."
- rm "${EROOT}etc/runlevels/shutdown/zfs-shutdown"
+ rm "${EROOT}/etc/runlevels/shutdown/zfs-shutdown"
fi
systemd_reenable zfs-zed.service
@@ -205,13 +229,10 @@ pkg_postinst() {
systemd_reenable zfs-share.service
systemd_reenable zfs-import.target
systemd_reenable zfs.target
- systemd_reenable zfs.service
-
}
pkg_postrm() {
- if ! use kernel-builtin && [ ${PV} = "9999" ]
- then
+ if ! use kernel-builtin && [[ ${PV} == "9999" ]]; then
remove_moduledb
fi
}
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-fs/zfs/, sys-fs/zfs/files/
@ 2019-09-27 19:16 Georgy Yakovlev
0 siblings, 0 replies; 22+ messages in thread
From: Georgy Yakovlev @ 2019-09-27 19:16 UTC (permalink / raw
To: gentoo-commits
commit: c87de1ae3f3027a29c7d1db353c5faa17442a21b
Author: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
AuthorDate: Fri Sep 27 18:28:37 2019 +0000
Commit: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
CommitDate: Fri Sep 27 19:16:19 2019 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c87de1ae
sys-fs/zfs: bump to 0.8.2
Package-Manager: Portage-2.3.76, Repoman-2.3.17
RepoMan-Options: --ignore-arches
Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org>
sys-fs/zfs/Manifest | 1 +
.../files/0.8.2-ZPOOL_IMPORT_UDEV_TIMEOUT_MS.patch | 68 +++++++
sys-fs/zfs/zfs-0.8.2.ebuild | 223 +++++++++++++++++++++
3 files changed, 292 insertions(+)
diff --git a/sys-fs/zfs/Manifest b/sys-fs/zfs/Manifest
index daccededfad..1c908ae93b7 100644
--- a/sys-fs/zfs/Manifest
+++ b/sys-fs/zfs/Manifest
@@ -1,2 +1,3 @@
DIST zfs-0.7.13.tar.gz 6614047 BLAKE2B c59c46287715779eb04d69333b0a417fa9865eb0d61c642b043188c4c97d4eed369f76a48327326ed1d4dd608ff95d91d20d26c80ed0b120a8fcd5f83cea638f SHA512 457d8f110b68c9656194cd3738b216d5d807d680e5cfc6ed1f3cf5ebde67860476387c6b862ba3ba7f972d8945075963e6c325543ab84468e3eff5dbce68476e
DIST zfs-0.8.1.tar.gz 8668360 BLAKE2B f18268656381c20af6bd18421636a1c56633c7eafaf91b1308d15508d5f4bdcfa5dfbb4e09d0302ac3de9d6a4f69718fe9c3d083ed5b3ab2a32c6fb7a1db624b SHA512 1fb3957f65dbe94edaffcedb5b2694390dc14e472c11f7e63184a9ea6a774e79a43d47a2d789b7ced233fc67c76583bf7d5c1bda0692bb07929673e2a57f4667
+DIST zfs-0.8.2.tar.gz 8738111 BLAKE2B 5c15f6664ca70f0deeb5b9e32f2bcff68f9821529e5203ff18612ce88473fee9af369354c442f3db7882d301cf17c805c9635b05bfd3460833ed8e5ff8004dd0 SHA512 1424b1a030b814f812b5da422100669db5b8c3ccae14c2fdd62a5e0df28e7255247fe5ca99c95a14f08c92cc1574c22dd132093e4a1dd81e38c95b10cc5e2496
diff --git a/sys-fs/zfs/files/0.8.2-ZPOOL_IMPORT_UDEV_TIMEOUT_MS.patch b/sys-fs/zfs/files/0.8.2-ZPOOL_IMPORT_UDEV_TIMEOUT_MS.patch
new file mode 100644
index 00000000000..6c4054ddb66
--- /dev/null
+++ b/sys-fs/zfs/files/0.8.2-ZPOOL_IMPORT_UDEV_TIMEOUT_MS.patch
@@ -0,0 +1,68 @@
+From d7037d2a2fd57504070eba14634b8a7ea159de32 Mon Sep 17 00:00:00 2001
+From: Richard Yao <ryao@gentoo.org>
+Date: Thu, 1 Aug 2019 15:54:30 -0400
+Subject: [PATCH] Implement ZPOOL_IMPORT_UDEV_TIMEOUT_MS
+
+Since 0.7.0, zpool import would unconditionally block on udev for 30
+seconds. This introduced a regression in initramfs environments that
+lack udev (particularly mdev based environments), yet use a zfs userland
+tools intended for the system that had been built against udev. Gentoo's
+genkernel is the main example, although custom user initramfs
+environments would be similarly impacted unless special builds of the
+ZFS userland utilities were done for them. Such environments already
+have their own mechanisms for blocking until device nodes are ready
+(such as genkernel's scandelay parameter), so it is unnecessary for
+zpool import to block on a non-existent udev until a timeout is reached
+inside of them.
+
+Rather than trying to intelligently determine whether udev is avaliable
+on the system to avoid unnecessarily blocking in such environments, it
+seems best to just allow the environment to override the timeout. I
+propose that we add an environment variable called
+ZPOOL_IMPORT_UDEV_TIMEOUT_MS. Setting it to 0 would restore the 0.6.x
+behavior that was more desireable in mdev based initramfs environments.
+This allows the system userland utilities to be reused when building
+mdev-based initramfs archives.
+
+Reviewed-by: Georgy Yakovlev <gyakovlev@gentoo.org>
+Signed-off-by: Richard Yao <ryao@gentoo.org>
+---
+ lib/libzutil/zutil_import.c | 10 +++++++++-
+ 1 file changed, 9 insertions(+), 1 deletion(-)
+
+diff --git a/lib/libzutil/zutil_import.c b/lib/libzutil/zutil_import.c
+index e82744383dc..8c4d8c5cb5c 100644
+--- a/lib/libzutil/zutil_import.c
++++ b/lib/libzutil/zutil_import.c
+@@ -58,6 +58,7 @@
+ #endif
+ #include <stddef.h>
+ #include <stdlib.h>
++#include <stdio.h>
+ #include <string.h>
+ #include <sys/stat.h>
+ #include <unistd.h>
+@@ -1653,15 +1654,22 @@ zpool_open_func(void *arg)
+ char *devid = NULL;
+ rdsk_node_t *slice;
+ avl_index_t where;
++ char *env;
++ int timeout;
+ int error;
+
+ if (label_paths(rn->rn_hdl, rn->rn_config, &path, &devid))
+ return;
+
++ env = getenv("ZPOOL_IMPORT_UDEV_TIMEOUT_MS");
++
++ if ((env == NULL) || sscanf(env, "%d", &timeout) != 1)
++ timeout = DISK_LABEL_WAIT;
++
+ /*
+ * Allow devlinks to stabilize so all paths are available.
+ */
+- zpool_label_disk_wait(rn->rn_name, DISK_LABEL_WAIT);
++ zpool_label_disk_wait(rn->rn_name, timeout);
+
+ if (path != NULL) {
+ slice = zfs_alloc(hdl, sizeof (rdsk_node_t));
diff --git a/sys-fs/zfs/zfs-0.8.2.ebuild b/sys-fs/zfs/zfs-0.8.2.ebuild
new file mode 100644
index 00000000000..dd0ca35654d
--- /dev/null
+++ b/sys-fs/zfs/zfs-0.8.2.ebuild
@@ -0,0 +1,223 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+DISTUTILS_OPTIONAL=1
+PYTHON_COMPAT=( python{2_7,3_{5,6,7}} )
+
+inherit bash-completion-r1 flag-o-matic linux-info linux-mod distutils-r1 systemd toolchain-funcs udev usr-ldscript
+
+DESCRIPTION="Userland utilities for ZFS Linux kernel module"
+HOMEPAGE="https://zfsonlinux.org/"
+
+if [[ ${PV} == "9999" ]] ; then
+ inherit autotools git-r3
+ EGIT_REPO_URI="https://github.com/zfsonlinux/zfs.git"
+else
+ SRC_URI="https://github.com/zfsonlinux/${PN}/releases/download/${P}/${P}.tar.gz"
+ KEYWORDS="~amd64 ~arm64 ~ppc64"
+fi
+
+LICENSE="BSD-2 CDDL MIT"
+SLOT="0"
+IUSE="custom-cflags debug kernel-builtin libressl python +rootfs test-suite static-libs"
+
+DEPEND="
+ ${PYTHON_DEPS}
+ net-libs/libtirpc[static-libs?]
+ sys-apps/util-linux[static-libs?]
+ sys-libs/zlib[static-libs(+)?]
+ virtual/awk
+ virtual/libudev[static-libs?]
+ libressl? ( dev-libs/libressl:0=[static-libs?] )
+ !libressl? ( dev-libs/openssl:0=[static-libs?] )
+ python? (
+ virtual/python-cffi[${PYTHON_USEDEP}]
+ )
+"
+
+BDEPEND="virtual/awk
+ virtual/pkgconfig
+ python? (
+ dev-python/setuptools[${PYTHON_USEDEP}]
+ )
+"
+
+RDEPEND="${DEPEND}
+ !=sys-apps/grep-2.13*
+ !kernel-builtin? ( ~sys-fs/zfs-kmod-${PV} )
+ !sys-fs/zfs-fuse
+ !prefix? ( virtual/udev )
+ sys-fs/udev-init-scripts
+ rootfs? (
+ app-arch/cpio
+ app-misc/pax-utils
+ !<sys-boot/grub-2.00-r2:2
+ !<sys-kernel/genkernel-3.5.1.1
+ !<sys-kernel/genkernel-next-67
+ !<sys-kernel/bliss-initramfs-7.1.0
+ !<sys-kernel/dracut-044-r1
+ )
+ test-suite? (
+ sys-apps/util-linux
+ sys-devel/bc
+ sys-block/parted
+ sys-fs/lsscsi
+ sys-fs/mdadm
+ sys-process/procps
+ virtual/modutils
+ )
+"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+RESTRICT="test"
+
+PATCHES=(
+ "${FILESDIR}/bash-completion-sudo.patch"
+ "${FILESDIR}/0.8.2-ZPOOL_IMPORT_UDEV_TIMEOUT_MS.patch" # https://github.com/zfsonlinux/zfs/pull/9109
+)
+
+pkg_setup() {
+ if use kernel_linux && use test-suite; 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
+}
+
+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/init.d/zfs.in || die
+}
+
+src_configure() {
+ use custom-cflags || strip-flags
+
+ 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="${EPREFIX}/lib/systemd/system-preset"
+ $(use_enable debug)
+ $(use_enable python pyzfs)
+ $(use_enable static-libs static)
+ )
+
+ 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"
+
+ 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
+ python_setup
+ 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
+
+ if has_version "<=sys-kernel/genkernel-3.5.3.3"; then
+ einfo "genkernel version 3.5.3.3 and earlier does NOT support"
+ einfo " unlocking pools with native zfs encryption enabled at boot"
+ einfo " use dracut or >=genkernel-4 if you requre this functionality"
+ 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
+
+ [[ -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."
+}
+
+pkg_postrm() {
+ if ! use kernel-builtin && [[ ${PV} == "9999" ]]; then
+ remove_moduledb
+ fi
+}
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-fs/zfs/, sys-fs/zfs/files/
@ 2019-11-26 20:32 Georgy Yakovlev
0 siblings, 0 replies; 22+ messages in thread
From: Georgy Yakovlev @ 2019-11-26 20:32 UTC (permalink / raw
To: gentoo-commits
commit: 8c0c0208fdee299ea64250ea933c2a108a587f98
Author: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
AuthorDate: Tue Nov 26 19:54:20 2019 +0000
Commit: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
CommitDate: Tue Nov 26 20:30:39 2019 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8c0c0208
sys-fs/zfs: revbump 0.8.2, include updated udev timeout patch
Package-Manager: Portage-2.3.79, Repoman-2.3.18
Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org>
.../files/0.8.2-ZPOOL_IMPORT_UDEV_TIMEOUT_MS.patch | 61 +++++++++++++++-------
.../{zfs-0.8.2-r1.ebuild => zfs-0.8.2-r2.ebuild} | 0
2 files changed, 43 insertions(+), 18 deletions(-)
diff --git a/sys-fs/zfs/files/0.8.2-ZPOOL_IMPORT_UDEV_TIMEOUT_MS.patch b/sys-fs/zfs/files/0.8.2-ZPOOL_IMPORT_UDEV_TIMEOUT_MS.patch
index 6c4054ddb66..be88f7bfee8 100644
--- a/sys-fs/zfs/files/0.8.2-ZPOOL_IMPORT_UDEV_TIMEOUT_MS.patch
+++ b/sys-fs/zfs/files/0.8.2-ZPOOL_IMPORT_UDEV_TIMEOUT_MS.patch
@@ -1,6 +1,6 @@
-From d7037d2a2fd57504070eba14634b8a7ea159de32 Mon Sep 17 00:00:00 2001
+From 803884217f9b9b5fb235d7c5e78a809d271f6387 Mon Sep 17 00:00:00 2001
From: Richard Yao <ryao@gentoo.org>
-Date: Thu, 1 Aug 2019 15:54:30 -0400
+Date: Wed, 9 Oct 2019 12:16:12 -0700
Subject: [PATCH] Implement ZPOOL_IMPORT_UDEV_TIMEOUT_MS
Since 0.7.0, zpool import would unconditionally block on udev for 30
@@ -15,38 +15,45 @@ have their own mechanisms for blocking until device nodes are ready
zpool import to block on a non-existent udev until a timeout is reached
inside of them.
-Rather than trying to intelligently determine whether udev is avaliable
+Rather than trying to intelligently determine whether udev is available
on the system to avoid unnecessarily blocking in such environments, it
seems best to just allow the environment to override the timeout. I
propose that we add an environment variable called
ZPOOL_IMPORT_UDEV_TIMEOUT_MS. Setting it to 0 would restore the 0.6.x
-behavior that was more desireable in mdev based initramfs environments.
-This allows the system userland utilities to be reused when building
+behavior that was more desirable in mdev based initramfs environments.
+This allows the system user land utilities to be reused when building
mdev-based initramfs archives.
+Reviewed-by: Igor Kozhukhov <igor@dilos.org>
+Reviewed-by: Jorgen Lundman <lundman@lundman.net>
+Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Georgy Yakovlev <gyakovlev@gentoo.org>
Signed-off-by: Richard Yao <ryao@gentoo.org>
+Closes #9436
---
- lib/libzutil/zutil_import.c | 10 +++++++++-
- 1 file changed, 9 insertions(+), 1 deletion(-)
+ lib/libzutil/os/linux/zutil_import_os.c | 11 ++++++++++-
+ man/man8/zpool.8 | 6 ++++++
+ 2 files changed, 16 insertions(+), 1 deletion(-)
-diff --git a/lib/libzutil/zutil_import.c b/lib/libzutil/zutil_import.c
-index e82744383dc..8c4d8c5cb5c 100644
---- a/lib/libzutil/zutil_import.c
-+++ b/lib/libzutil/zutil_import.c
-@@ -58,6 +58,7 @@
- #endif
+diff --git a/lib/libzutil/os/linux/zutil_import_os.c b/lib/libzutil/os/linux/zutil_import_os.c
+index 811eae397c9..e51004edc68 100644
+--- a/lib/libzutil/os/linux/zutil_import_os.c
++++ b/lib/libzutil/os/linux/zutil_import_os.c
+@@ -53,6 +53,7 @@
+ #include <libgen.h>
#include <stddef.h>
#include <stdlib.h>
+#include <stdio.h>
#include <string.h>
#include <sys/stat.h>
#include <unistd.h>
-@@ -1653,15 +1654,22 @@ zpool_open_func(void *arg)
+@@ -181,17 +182,25 @@ zpool_open_func(void *arg)
+ if (rn->rn_labelpaths) {
+ char *path = NULL;
char *devid = NULL;
++ char *env = NULL;
rdsk_node_t *slice;
avl_index_t where;
-+ char *env;
+ int timeout;
int error;
@@ -54,9 +61,10 @@ index e82744383dc..8c4d8c5cb5c 100644
return;
+ env = getenv("ZPOOL_IMPORT_UDEV_TIMEOUT_MS");
-+
-+ if ((env == NULL) || sscanf(env, "%d", &timeout) != 1)
++ if ((env == NULL) || sscanf(env, "%d", &timeout) != 1 ||
++ timeout < 0) {
+ timeout = DISK_LABEL_WAIT;
++ }
+
/*
* Allow devlinks to stabilize so all paths are available.
@@ -65,4 +73,21 @@ index e82744383dc..8c4d8c5cb5c 100644
+ zpool_label_disk_wait(rn->rn_name, timeout);
if (path != NULL) {
- slice = zfs_alloc(hdl, sizeof (rdsk_node_t));
+ slice = zutil_alloc(hdl, sizeof (rdsk_node_t));
+diff --git a/man/man8/zpool.8 b/man/man8/zpool.8
+index 467d2411d40..df30b7ca05c 100644
+--- a/man/man8/zpool.8
++++ b/man/man8/zpool.8
+@@ -2813,6 +2813,12 @@ Similar to the
+ option in
+ .Nm zpool import .
+ .El
++.Bl -tag -width "ZPOOL_IMPORT_UDEV_TIMEOUT_MS"
++.It Ev ZPOOL_IMPORT_UDEV_TIMEOUT_MS
++The maximum time in milliseconds that
++.Nm zpool import
++will wait for an expected device to be available.
++.El
+ .Bl -tag -width "ZPOOL_VDEV_NAME_GUID"
+ .It Ev ZPOOL_VDEV_NAME_GUID
+ Cause
diff --git a/sys-fs/zfs/zfs-0.8.2-r1.ebuild b/sys-fs/zfs/zfs-0.8.2-r2.ebuild
similarity index 100%
rename from sys-fs/zfs/zfs-0.8.2-r1.ebuild
rename to sys-fs/zfs/zfs-0.8.2-r2.ebuild
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-fs/zfs/, sys-fs/zfs/files/
@ 2020-05-26 23:58 Georgy Yakovlev
0 siblings, 0 replies; 22+ messages in thread
From: Georgy Yakovlev @ 2020-05-26 23:58 UTC (permalink / raw
To: gentoo-commits
commit: 20207419457c676f156e212bf03cf27982eea494
Author: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
AuthorDate: Tue May 26 23:56:58 2020 +0000
Commit: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
CommitDate: Tue May 26 23:57:11 2020 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=20207419
sys-fs/zfs: revbump 0.8.4, fix not loading /etc/conf.d/zfs
Upstream issue: https://github.com/openzfs/zfs/issues/10375
Upstream issue: https://github.com/openzfs/zfs/issues/10341
Bug: https://bugs.gentoo.org/647688
Package-Manager: Portage-2.3.100, Repoman-2.3.22
Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org>
sys-fs/zfs/files/0.8.4-initconfdir.patch | 35 ++++++++++++++++++++++
.../zfs/{zfs-0.8.4.ebuild => zfs-0.8.4-r1.ebuild} | 5 +++-
2 files changed, 39 insertions(+), 1 deletion(-)
diff --git a/sys-fs/zfs/files/0.8.4-initconfdir.patch b/sys-fs/zfs/files/0.8.4-initconfdir.patch
new file mode 100644
index 00000000000..aac40896f39
--- /dev/null
+++ b/sys-fs/zfs/files/0.8.4-initconfdir.patch
@@ -0,0 +1,35 @@
+From 5dbe98184278878746a5f548fead1d2ef1e98dbe Mon Sep 17 00:00:00 2001
+From: Georgy Yakovlev <gyakovlev@gentoo.org>
+Date: Tue, 26 May 2020 16:44:54 -0700
+Subject: [PATCH] 0.8.4 initconfdir
+
+fix for https://github.com/openzfs/zfs/issues/10375
+
+---
+ etc/zfs/Makefile.am | 1 +
+ etc/zfs/Makefile.in | 9 +++++----
+ 2 files changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/etc/zfs/Makefile.am b/openzfs/etc/zfs/Makefile.am
+index 81567a4..5370f41 100644
+--- a/etc/zfs/Makefile.am
++++ b/etc/zfs/Makefile.am
+@@ -1,4 +1,5 @@
+ pkgsysconfdir = $(sysconfdir)/zfs
++initconfdir = $(DEFAULT_INITCONF_DIR)
+
+ pkgsysconf_DATA = \
+ vdev_id.conf.alias.example \
+diff --git a/etc/zfs/Makefile.in b/etc/zfs/Makefile.in
+index fb02811..795d3b1 100644
+@@ -571,6 +571,7 @@ udevdir = @udevdir@
+ udevruledir = @udevruledir@
+ zfsexecdir = @zfsexecdir@
+ pkgsysconfdir = $(sysconfdir)/zfs
++initconfdir = $(DEFAULT_INITCONF_DIR)
+ pkgsysconf_DATA = \
+ vdev_id.conf.alias.example \
+ vdev_id.conf.sas_direct.example \
+--
+2.26.2
+
diff --git a/sys-fs/zfs/zfs-0.8.4.ebuild b/sys-fs/zfs/zfs-0.8.4-r1.ebuild
similarity index 98%
rename from sys-fs/zfs/zfs-0.8.4.ebuild
rename to sys-fs/zfs/zfs-0.8.4-r1.ebuild
index c7cc180b9ea..5f7c23109c0 100644
--- a/sys-fs/zfs/zfs-0.8.4.ebuild
+++ b/sys-fs/zfs/zfs-0.8.4-r1.ebuild
@@ -68,7 +68,10 @@ REQUIRED_USE="${PYTHON_REQUIRED_USE}"
RESTRICT="test"
-PATCHES=( "${FILESDIR}/bash-completion-sudo.patch" )
+PATCHES=(
+ "${FILESDIR}/bash-completion-sudo.patch"
+ "${FILESDIR}/${PV}-initconfdir.patch"
+)
pkg_setup() {
if use kernel_linux && use test-suite; then
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-fs/zfs/, sys-fs/zfs/files/
@ 2020-09-25 20:28 Georgy Yakovlev
0 siblings, 0 replies; 22+ messages in thread
From: Georgy Yakovlev @ 2020-09-25 20:28 UTC (permalink / raw
To: gentoo-commits
commit: c10c708ba999cd9aa08aae373d4103522ad7d358
Author: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
AuthorDate: Fri Sep 25 20:24:26 2020 +0000
Commit: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
CommitDate: Fri Sep 25 20:28:20 2020 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c10c708b
sys-fs/zfs: add exports.d patch
Closes: https://bugs.gentoo.org/742503
Package-Manager: Portage-3.0.8, Repoman-3.0.1
Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org>
.../files/2.0.0_rc2-exports-d-permissions.patch | 189 +++++++++++++++++++++
...fs-2.0.0_rc2.ebuild => zfs-2.0.0_rc2-r1.ebuild} | 5 +-
2 files changed, 193 insertions(+), 1 deletion(-)
diff --git a/sys-fs/zfs/files/2.0.0_rc2-exports-d-permissions.patch b/sys-fs/zfs/files/2.0.0_rc2-exports-d-permissions.patch
new file mode 100644
index 00000000000..4acaf465a7b
--- /dev/null
+++ b/sys-fs/zfs/files/2.0.0_rc2-exports-d-permissions.patch
@@ -0,0 +1,189 @@
+From fe413a4d901a243d98cfef16ea330f7114a104ea Mon Sep 17 00:00:00 2001
+From: George Wilson <george.wilson@delphix.com>
+Date: Tue, 15 Sep 2020 22:57:16 -0400
+Subject: [PATCH] zpool command complains about /etc/exports.d
+
+If the /etc/exports.d directory does not exist, then we should only
+create it when we're performing an action which already requires root
+privileges.
+
+This commit moves the directory creation to the enable/disable code
+path which ensures that we have the appropriate privileges.
+
+Signed-off-by: George Wilson <gwilson@delphix.com>
+Closes #10785
+---
+ lib/libshare/os/freebsd/nfs.c | 36 +++++++++++-------
+ lib/libshare/os/linux/nfs.c | 71 ++++++++++++++++++++---------------
+ 2 files changed, 64 insertions(+), 43 deletions(-)
+
+diff --git a/lib/libshare/os/freebsd/nfs.c b/lib/libshare/os/freebsd/nfs.c
+index 65f3b11bf9b..5951b9eafa2 100644
+--- a/lib/libshare/os/freebsd/nfs.c
++++ b/lib/libshare/os/freebsd/nfs.c
+@@ -228,21 +228,33 @@ nfs_copy_entries(char *filename, const char *mountpoint)
+ int error = SA_OK;
+ char *line;
+
+- /*
+- * If the file doesn't exist then there is nothing more
+- * we need to do.
+- */
+ FILE *oldfp = fopen(ZFS_EXPORTS_FILE, "r");
+- if (oldfp == NULL)
+- return (SA_OK);
+-
+ FILE *newfp = fopen(filename, "w+");
++ if (newfp == NULL) {
++ fprintf(stderr, "failed to open %s file: %s", filename,
++ strerror(errno));
++ fclose(oldfp);
++ return (SA_SYSTEM_ERR);
++ }
+ fputs(FILE_HEADER, newfp);
+- while ((line = zgetline(oldfp, mountpoint)) != NULL)
+- fprintf(newfp, "%s\n", line);
+- if (ferror(oldfp) != 0) {
+- error = ferror(oldfp);
++
++ /*
++ * The ZFS_EXPORTS_FILE may not exist yet. If that's the
++ * case then just write out the new file.
++ */
++ if (oldfp != NULL) {
++ while ((line = zgetline(oldfp, mountpoint)) != NULL)
++ fprintf(newfp, "%s\n", line);
++ if (ferror(oldfp) != 0) {
++ error = ferror(oldfp);
++ }
++ if (fclose(oldfp) != 0) {
++ fprintf(stderr, "Unable to close file %s: %s\n",
++ filename, strerror(errno));
++ error = error != 0 ? error : SA_SYSTEM_ERR;
++ }
+ }
++
+ if (error == 0 && ferror(newfp) != 0) {
+ error = ferror(newfp);
+ }
+@@ -252,8 +264,6 @@ nfs_copy_entries(char *filename, const char *mountpoint)
+ filename, strerror(errno));
+ error = error != 0 ? error : SA_SYSTEM_ERR;
+ }
+- fclose(oldfp);
+-
+ return (error);
+ }
+
+diff --git a/lib/libshare/os/linux/nfs.c b/lib/libshare/os/linux/nfs.c
+index a6a9b33d765..1efa321b7bc 100644
+--- a/lib/libshare/os/linux/nfs.c
++++ b/lib/libshare/os/linux/nfs.c
+@@ -393,6 +393,14 @@ static char *
+ nfs_init_tmpfile(void)
+ {
+ char *tmpfile = NULL;
++ struct stat sb;
++
++ if (stat(ZFS_EXPORTS_DIR, &sb) < 0 &&
++ mkdir(ZFS_EXPORTS_DIR, 0755) < 0) {
++ fprintf(stderr, "failed to create %s: %s\n",
++ ZFS_EXPORTS_DIR, strerror(errno));
++ return (NULL);
++ }
+
+ if (asprintf(&tmpfile, "%s%s", ZFS_EXPORTS_FILE, ".XXXXXXXX") == -1) {
+ fprintf(stderr, "Unable to allocate temporary file\n");
+@@ -481,36 +489,49 @@ nfs_copy_entries(char *filename, const char *mountpoint)
+ size_t buflen = 0;
+ int error = SA_OK;
+
+- /*
+- * If the file doesn't exist then there is nothing more
+- * we need to do.
+- */
+ FILE *oldfp = fopen(ZFS_EXPORTS_FILE, "r");
+- if (oldfp == NULL)
+- return (SA_OK);
+-
+ FILE *newfp = fopen(filename, "w+");
++ if (newfp == NULL) {
++ fprintf(stderr, "failed to open %s file: %s", filename,
++ strerror(errno));
++ fclose(oldfp);
++ return (SA_SYSTEM_ERR);
++ }
+ fputs(FILE_HEADER, newfp);
+- while ((getline(&buf, &buflen, oldfp)) != -1) {
+- char *space = NULL;
+
+- if (buf[0] == '\n' || buf[0] == '#')
+- continue;
+-
+- if ((space = strchr(buf, ' ')) != NULL) {
+- int mountpoint_len = strlen(mountpoint);
++ /*
++ * The ZFS_EXPORTS_FILE may not exist yet. If that's the
++ * case then just write out the new file.
++ */
++ if (oldfp != NULL) {
++ while (getline(&buf, &buflen, oldfp) != -1) {
++ char *space = NULL;
+
+- if (space - buf == mountpoint_len &&
+- strncmp(mountpoint, buf, mountpoint_len) == 0) {
++ if (buf[0] == '\n' || buf[0] == '#')
+ continue;
++
++ if ((space = strchr(buf, ' ')) != NULL) {
++ int mountpoint_len = strlen(mountpoint);
++
++ if (space - buf == mountpoint_len &&
++ strncmp(mountpoint, buf,
++ mountpoint_len) == 0) {
++ continue;
++ }
+ }
++ fputs(buf, newfp);
+ }
+- fputs(buf, newfp);
+- }
+
+- if (oldfp != NULL && ferror(oldfp) != 0) {
+- error = ferror(oldfp);
++ if (ferror(oldfp) != 0) {
++ error = ferror(oldfp);
++ }
++ if (fclose(oldfp) != 0) {
++ fprintf(stderr, "Unable to close file %s: %s\n",
++ filename, strerror(errno));
++ error = error != 0 ? error : SA_SYSTEM_ERR;
++ }
+ }
++
+ if (error == 0 && ferror(newfp) != 0) {
+ error = ferror(newfp);
+ }
+@@ -521,8 +542,6 @@ nfs_copy_entries(char *filename, const char *mountpoint)
+ filename, strerror(errno));
+ error = error != 0 ? error : SA_SYSTEM_ERR;
+ }
+- fclose(oldfp);
+-
+ return (error);
+ }
+
+@@ -701,13 +720,5 @@ static const sa_share_ops_t nfs_shareops = {
+ void
+ libshare_nfs_init(void)
+ {
+- struct stat sb;
+-
+ nfs_fstype = register_fstype("nfs", &nfs_shareops);
+-
+- if (stat(ZFS_EXPORTS_DIR, &sb) < 0 &&
+- mkdir(ZFS_EXPORTS_DIR, 0755) < 0) {
+- fprintf(stderr, "failed to create %s: %s\n",
+- ZFS_EXPORTS_DIR, strerror(errno));
+- }
+ }
diff --git a/sys-fs/zfs/zfs-2.0.0_rc2.ebuild b/sys-fs/zfs/zfs-2.0.0_rc2-r1.ebuild
similarity index 98%
rename from sys-fs/zfs/zfs-2.0.0_rc2.ebuild
rename to sys-fs/zfs/zfs-2.0.0_rc2-r1.ebuild
index d2f00419b0c..1f9d81f16e6 100644
--- a/sys-fs/zfs/zfs-2.0.0_rc2.ebuild
+++ b/sys-fs/zfs/zfs-2.0.0_rc2-r1.ebuild
@@ -76,7 +76,10 @@ REQUIRED_USE="
RESTRICT="test"
-PATCHES=( "${FILESDIR}/bash-completion-sudo.patch" )
+PATCHES=(
+ "${FILESDIR}/bash-completion-sudo.patch"
+ "${FILESDIR}/${PV}-exports-d-permissions.patch"
+)
pkg_setup() {
if use kernel_linux && use test-suite; then
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-fs/zfs/, sys-fs/zfs/files/
@ 2020-11-03 20:07 Georgy Yakovlev
0 siblings, 0 replies; 22+ messages in thread
From: Georgy Yakovlev @ 2020-11-03 20:07 UTC (permalink / raw
To: gentoo-commits
commit: acbeee5df18e31c9dafab27ff6afaf62ae64071c
Author: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
AuthorDate: Tue Nov 3 19:57:35 2020 +0000
Commit: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
CommitDate: Tue Nov 3 20:04:10 2020 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=acbeee5d
sys-fs/zfs: drop 0.8.4
Package-Manager: Portage-3.0.9, Repoman-3.0.2
Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org>
sys-fs/zfs/Manifest | 1 -
sys-fs/zfs/files/0.8.4-initconfdir.patch | 35 -----
sys-fs/zfs/zfs-0.8.4-r2.ebuild | 223 -------------------------------
3 files changed, 259 deletions(-)
diff --git a/sys-fs/zfs/Manifest b/sys-fs/zfs/Manifest
index 128c485727a..103e10fa8d8 100644
--- a/sys-fs/zfs/Manifest
+++ b/sys-fs/zfs/Manifest
@@ -1,3 +1,2 @@
-DIST zfs-0.8.4.tar.gz 9285838 BLAKE2B 776bcd6dfab8825c07d315085e288b29bf543d6957325d5d566b7b78c04505dde9bd25eb6684cb4a1b6a657de8a4e1290d04d2b9079d26d6b834a70f1ec3b569 SHA512 9086dc6a6262dd93ca6ec43f1b4c2e5c804deba708c8a7460b8531aa4802b0bf8cac0917a1a00e6af2e96d4a21cd68b85e226bf571bd94041d0325c457106eb1
DIST zfs-0.8.5.tar.gz 9196381 BLAKE2B 8376f360369c4657ff1fc040fb2bba780bbd5d6a98d149d2fa4ba39478588e213dbf6db218c7bd970839f015a69ae00ac951b90afc1c26b34aadf666b2976cab SHA512 3e6e70b76f7cc5b018adb78ce7c3009f88faf5b3da0a03170b03577cd84a2937b6056621c41fc819fd08bf59b28053caf8fec375cf375816a6786bb5646ed773
DIST zfs-2.0.0-rc4.tar.gz 12861762 BLAKE2B 638eb426955de38efbbb390cb02642298dd73caa5d9c9e28d8aea89bb40967c251bbbe66fbd38e08c922fb1c6fa935c959572abf237ea57ee7d9a5982693e275 SHA512 3972b92c7c0e92416fcde1fa01e7d1c20046de2e21d83a6694d0dc8753f13009b38f0f656202364da85b798886feffd06292b5fd5d23b0b3afc4f81fd86a540b
diff --git a/sys-fs/zfs/files/0.8.4-initconfdir.patch b/sys-fs/zfs/files/0.8.4-initconfdir.patch
deleted file mode 100644
index aac40896f39..00000000000
--- a/sys-fs/zfs/files/0.8.4-initconfdir.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-From 5dbe98184278878746a5f548fead1d2ef1e98dbe Mon Sep 17 00:00:00 2001
-From: Georgy Yakovlev <gyakovlev@gentoo.org>
-Date: Tue, 26 May 2020 16:44:54 -0700
-Subject: [PATCH] 0.8.4 initconfdir
-
-fix for https://github.com/openzfs/zfs/issues/10375
-
----
- etc/zfs/Makefile.am | 1 +
- etc/zfs/Makefile.in | 9 +++++----
- 2 files changed, 6 insertions(+), 4 deletions(-)
-
-diff --git a/etc/zfs/Makefile.am b/openzfs/etc/zfs/Makefile.am
-index 81567a4..5370f41 100644
---- a/etc/zfs/Makefile.am
-+++ b/etc/zfs/Makefile.am
-@@ -1,4 +1,5 @@
- pkgsysconfdir = $(sysconfdir)/zfs
-+initconfdir = $(DEFAULT_INITCONF_DIR)
-
- pkgsysconf_DATA = \
- vdev_id.conf.alias.example \
-diff --git a/etc/zfs/Makefile.in b/etc/zfs/Makefile.in
-index fb02811..795d3b1 100644
-@@ -571,6 +571,7 @@ udevdir = @udevdir@
- udevruledir = @udevruledir@
- zfsexecdir = @zfsexecdir@
- pkgsysconfdir = $(sysconfdir)/zfs
-+initconfdir = $(DEFAULT_INITCONF_DIR)
- pkgsysconf_DATA = \
- vdev_id.conf.alias.example \
- vdev_id.conf.sas_direct.example \
---
-2.26.2
-
diff --git a/sys-fs/zfs/zfs-0.8.4-r2.ebuild b/sys-fs/zfs/zfs-0.8.4-r2.ebuild
deleted file mode 100644
index 3bcbb4af433..00000000000
--- a/sys-fs/zfs/zfs-0.8.4-r2.ebuild
+++ /dev/null
@@ -1,223 +0,0 @@
-# Copyright 1999-2020 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-DISTUTILS_OPTIONAL=1
-PYTHON_COMPAT=( python3_{6,7,8} )
-
-inherit autotools bash-completion-r1 flag-o-matic linux-info distutils-r1 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
- 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"
-IUSE="custom-cflags debug kernel-builtin libressl minimal nls 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(-)?]
- libressl? ( dev-libs/libressl:0=[static-libs?] )
- !libressl? ( dev-libs/openssl:0=[static-libs?] )
- !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
- rootfs? (
- app-arch/cpio
- app-misc/pax-utils
- !<sys-kernel/genkernel-3.5.1.1
- )
- test-suite? (
- sys-apps/kmod[tools]
- sys-apps/util-linux
- sys-devel/bc
- sys-block/parted
- sys-fs/lsscsi
- sys-fs/mdadm
- sys-process/procps
- )
-"
-
-REQUIRED_USE="
- !minimal? ( ${PYTHON_REQUIRED_USE} )
- python? ( !minimal )
- test-suite? ( !minimal )
-"
-
-RESTRICT="test"
-
-PATCHES=(
- "${FILESDIR}/bash-completion-sudo.patch"
- "${FILESDIR}/${PV}-initconfdir.patch"
-)
-
-pkg_setup() {
- if use kernel_linux && use test-suite; 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
-}
-
-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="${EPREFIX}/lib/systemd/system-preset"
- $(use_enable debug)
- $(use_enable nls)
- $(use_enable python pyzfs)
- $(use_enable static-libs 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"
-
- 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
-}
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-fs/zfs/, sys-fs/zfs/files/
@ 2021-06-04 2:14 Georgy Yakovlev
0 siblings, 0 replies; 22+ messages in thread
From: Georgy Yakovlev @ 2021-06-04 2:14 UTC (permalink / raw
To: gentoo-commits
commit: 4826c2e6f797cfeab33aad2542d402916653fd91
Author: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
AuthorDate: Fri Jun 4 02:12:24 2021 +0000
Commit: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
CommitDate: Fri Jun 4 02:12:24 2021 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4826c2e6
sys-fs/zfs: revbump 2.0.4, add scrub timers
to use with systemd
Pr: https://github.com/openzfs/zfs/pull/12193
Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org>
sys-fs/zfs/files/2.0.4-scrub-timers.patch | 97 +++++++++++++
sys-fs/zfs/zfs-2.0.4-r1.ebuild | 230 ++++++++++++++++++++++++++++++
2 files changed, 327 insertions(+)
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 00000000000..6aae1e4de59
--- /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-2.0.4-r1.ebuild b/sys-fs/zfs/zfs-2.0.4-r1.ebuild
new file mode 100644
index 00000000000..e22f834e451
--- /dev/null
+++ b/sys-fs/zfs/zfs-2.0.4-r1.ebuild
@@ -0,0 +1,230 @@
+# 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
+ !<sys-kernel/genkernel-3.5.1.1
+ )
+ test-suite? (
+ sys-apps/kmod[tools]
+ sys-apps/util-linux
+ sys-devel/bc
+ sys-block/parted
+ sys-fs/lsscsi
+ sys-fs/mdadm
+ sys-process/procps
+ )
+"
+
+REQUIRED_USE="
+ !minimal? ( ${PYTHON_REQUIRED_USE} )
+ python? ( !minimal )
+ test-suite? ( !minimal )
+"
+
+RESTRICT="test"
+
+PATCHES=(
+ "${FILESDIR}/bash-completion-sudo.patch"
+ "${FILESDIR}/2.0.4-scrub-timers.patch"
+)
+
+pkg_setup() {
+ if use kernel_linux && use test-suite; 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
+}
+
+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() {
+ 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
+}
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-fs/zfs/, sys-fs/zfs/files/
@ 2021-11-07 23:59 Georgy Yakovlev
0 siblings, 0 replies; 22+ messages in thread
From: Georgy Yakovlev @ 2021-11-07 23:59 UTC (permalink / raw
To: gentoo-commits
commit: 7c97da7804003db7be32a3c696f930ca5555ba24
Author: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
AuthorDate: Sun Nov 7 23:01:06 2021 +0000
Commit: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
CommitDate: Sun Nov 7 23:57:40 2021 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7c97da78
sys-fs/zfs: revbump 2.1.1, add patch and dist-kernel version limit
We don't really need patch in userspace package, but
patch also installs tests for test-suite and what's why we include it.
also remove coreutils blocker
Bug: https://bugs.gentoo.org/815469
Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org>
sys-fs/zfs/files/2.1.1-fix-lseek-mmap.patch | 594 ++++++++++++++++++++++++++++
sys-fs/zfs/zfs-2.1.1-r3.ebuild | 298 ++++++++++++++
2 files changed, 892 insertions(+)
diff --git a/sys-fs/zfs/files/2.1.1-fix-lseek-mmap.patch b/sys-fs/zfs/files/2.1.1-fix-lseek-mmap.patch
new file mode 100644
index 00000000000..2c3a66a97bf
--- /dev/null
+++ b/sys-fs/zfs/files/2.1.1-fix-lseek-mmap.patch
@@ -0,0 +1,594 @@
+From de198f2d9507b6dcf3d0d8f037ba33940208733e Mon Sep 17 00:00:00 2001
+From: Brian Behlendorf <behlendorf1@llnl.gov>
+Date: Sun, 7 Nov 2021 13:27:44 -0800
+Subject: [PATCH] Fix lseek(SEEK_DATA/SEEK_HOLE) mmap consistency
+
+When using lseek(2) to report data/holes memory mapped regions of
+the file were ignored. This could result in incorrect results.
+To handle this zfs_holey_common() was updated to asynchronously
+writeback any dirty mmap(2) regions prior to reporting holes.
+
+Additionally, while not strictly required, the dn_struct_rwlock is
+now held over the dirty check to prevent the dnode structure from
+changing. This ensures that a clean dnode can't be dirtied before
+the data/hole is located. The range lock is now also taken to
+ensure the call cannot race with zfs_write().
+
+Furthermore, the code was refactored to provide a dnode_is_dirty()
+helper function which checks the dnode for any dirty records to
+determine its dirtiness.
+
+Reviewed-by: Matthew Ahrens <mahrens@delphix.com>
+Reviewed-by: Tony Hutter <hutter2@llnl.gov>
+Reviewed-by: Rich Ercolani <rincebrain@gmail.com>
+Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
+Issue #11900
+Closes #12724
+---
+ configure.ac | 1 +
+ include/os/freebsd/spl/sys/vnode.h | 18 +++
+ include/os/freebsd/zfs/sys/zfs_znode_impl.h | 3 +-
+ include/os/linux/zfs/sys/zfs_znode_impl.h | 1 +
+ include/sys/dnode.h | 1 +
+ man/man4/zfs.4 | 2 +-
+ module/zfs/dmu.c | 53 ++++---
+ module/zfs/dnode.c | 20 +++
+ module/zfs/zfs_vnops.c | 9 +-
+ tests/runfiles/common.run | 2 +-
+ tests/zfs-tests/cmd/Makefile.am | 1 +
+ tests/zfs-tests/cmd/mmap_seek/.gitignore | 1 +
+ tests/zfs-tests/cmd/mmap_seek/Makefile.am | 6 +
+ tests/zfs-tests/cmd/mmap_seek/mmap_seek.c | 147 ++++++++++++++++++
+ tests/zfs-tests/include/commands.cfg | 1 +
+ tests/zfs-tests/include/tunables.cfg | 1 +
+ .../tests/functional/mmap/Makefile.am | 3 +-
+ .../functional/mmap/mmap_seek_001_pos.ksh | 67 ++++++++
+ 18 files changed, 305 insertions(+), 32 deletions(-)
+ create mode 100644 tests/zfs-tests/cmd/mmap_seek/.gitignore
+ create mode 100644 tests/zfs-tests/cmd/mmap_seek/Makefile.am
+ create mode 100644 tests/zfs-tests/cmd/mmap_seek/mmap_seek.c
+ create mode 100755 tests/zfs-tests/tests/functional/mmap/mmap_seek_001_pos.ksh
+
+diff --git a/configure.ac b/configure.ac
+index 6f34b210d2b..ebc7b276a64 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -221,6 +221,7 @@ AC_CONFIG_FILES([
+ tests/zfs-tests/cmd/mktree/Makefile
+ tests/zfs-tests/cmd/mmap_exec/Makefile
+ tests/zfs-tests/cmd/mmap_libaio/Makefile
++ tests/zfs-tests/cmd/mmap_seek/Makefile
+ tests/zfs-tests/cmd/mmapwrite/Makefile
+ tests/zfs-tests/cmd/nvlist_to_lua/Makefile
+ tests/zfs-tests/cmd/randfree_file/Makefile
+diff --git a/include/os/freebsd/spl/sys/vnode.h b/include/os/freebsd/spl/sys/vnode.h
+index 3670712a045..3bc8a18eeb7 100644
+--- a/include/os/freebsd/spl/sys/vnode.h
++++ b/include/os/freebsd/spl/sys/vnode.h
+@@ -59,6 +59,8 @@ enum symfollow { NO_FOLLOW = NOFOLLOW };
+ #include <sys/file.h>
+ #include <sys/filedesc.h>
+ #include <sys/syscallsubr.h>
++#include <sys/vm.h>
++#include <vm/vm_object.h>
+
+ typedef struct vop_vector vnodeops_t;
+ #define VOP_FID VOP_VPTOFH
+@@ -83,6 +85,22 @@ vn_is_readonly(vnode_t *vp)
+ #define vn_has_cached_data(vp) \
+ ((vp)->v_object != NULL && \
+ (vp)->v_object->resident_page_count > 0)
++
++static __inline void
++vn_flush_cached_data(vnode_t *vp, boolean_t sync)
++{
++#if __FreeBSD_version > 1300054
++ if (vm_object_mightbedirty(vp->v_object)) {
++#else
++ if (vp->v_object->flags & OBJ_MIGHTBEDIRTY) {
++#endif
++ int flags = sync ? OBJPC_SYNC : 0;
++ zfs_vmobject_wlock(vp->v_object);
++ vm_object_page_clean(vp->v_object, 0, 0, flags);
++ zfs_vmobject_wunlock(vp->v_object);
++ }
++}
++
+ #define vn_exists(vp) do { } while (0)
+ #define vn_invalid(vp) do { } while (0)
+ #define vn_renamepath(tdvp, svp, tnm, lentnm) do { } while (0)
+diff --git a/include/os/freebsd/zfs/sys/zfs_znode_impl.h b/include/os/freebsd/zfs/sys/zfs_znode_impl.h
+index 7d28bddbf51..4456046e6e4 100644
+--- a/include/os/freebsd/zfs/sys/zfs_znode_impl.h
++++ b/include/os/freebsd/zfs/sys/zfs_znode_impl.h
+@@ -116,7 +116,8 @@ typedef struct zfs_soft_state {
+ #define Z_ISLNK(type) ((type) == VLNK)
+ #define Z_ISDIR(type) ((type) == VDIR)
+
+-#define zn_has_cached_data(zp) vn_has_cached_data(ZTOV(zp))
++#define zn_has_cached_data(zp) vn_has_cached_data(ZTOV(zp))
++#define zn_flush_cached_data(zp, sync) vn_flush_cached_data(ZTOV(zp), sync)
+ #define zn_rlimit_fsize(zp, uio) \
+ vn_rlimit_fsize(ZTOV(zp), GET_UIO_STRUCT(uio), zfs_uio_td(uio))
+
+diff --git a/include/os/linux/zfs/sys/zfs_znode_impl.h b/include/os/linux/zfs/sys/zfs_znode_impl.h
+index 0a6273442b7..de46fc8f2bd 100644
+--- a/include/os/linux/zfs/sys/zfs_znode_impl.h
++++ b/include/os/linux/zfs/sys/zfs_znode_impl.h
+@@ -71,6 +71,7 @@ extern "C" {
+ #define Z_ISDIR(type) S_ISDIR(type)
+
+ #define zn_has_cached_data(zp) ((zp)->z_is_mapped)
++#define zn_flush_cached_data(zp, sync) write_inode_now(ZTOI(zp), sync)
+ #define zn_rlimit_fsize(zp, uio) (0)
+
+ /*
+diff --git a/include/sys/dnode.h b/include/sys/dnode.h
+index e7cccd044ab..3f5fcc958c3 100644
+--- a/include/sys/dnode.h
++++ b/include/sys/dnode.h
+@@ -425,6 +425,7 @@ boolean_t dnode_add_ref(dnode_t *dn, void *ref);
+ void dnode_rele(dnode_t *dn, void *ref);
+ void dnode_rele_and_unlock(dnode_t *dn, void *tag, boolean_t evicting);
+ int dnode_try_claim(objset_t *os, uint64_t object, int slots);
++boolean_t dnode_is_dirty(dnode_t *dn);
+ void dnode_setdirty(dnode_t *dn, dmu_tx_t *tx);
+ void dnode_set_dirtyctx(dnode_t *dn, dmu_tx_t *tx, void *tag);
+ void dnode_sync(dnode_t *dn, dmu_tx_t *tx);
+diff --git a/man/man4/zfs.4 b/man/man4/zfs.4
+index d7fc31bfde1..a136690c76e 100644
+--- a/man/man4/zfs.4
++++ b/man/man4/zfs.4
+@@ -1586,7 +1586,7 @@ Allow no-operation writes.
+ The occurrence of nopwrites will further depend on other pool properties
+ .Pq i.a. the checksumming and compression algorithms .
+ .
+-.It Sy zfs_dmu_offset_next_sync Ns = Ns Sy 0 Ns | ns 1 Pq int
++.It Sy zfs_dmu_offset_next_sync Ns = Ns Sy 0 Ns | Ns 1 Pq int
+ Enable forcing TXG sync to find holes.
+ When enabled forces ZFS to act like prior versions when
+ .Sy SEEK_HOLE No or Sy SEEK_DATA
+diff --git a/module/zfs/dmu.c b/module/zfs/dmu.c
+index b29d82fd793..f12c5eda8b5 100644
+--- a/module/zfs/dmu.c
++++ b/module/zfs/dmu.c
+@@ -2093,42 +2093,41 @@ int
+ dmu_offset_next(objset_t *os, uint64_t object, boolean_t hole, uint64_t *off)
+ {
+ dnode_t *dn;
+- int i, err;
+- boolean_t clean = B_TRUE;
++ int err;
+
++restart:
+ err = dnode_hold(os, object, FTAG, &dn);
+ if (err)
+ return (err);
+
+- /*
+- * Check if dnode is dirty
+- */
+- for (i = 0; i < TXG_SIZE; i++) {
+- if (multilist_link_active(&dn->dn_dirty_link[i])) {
+- clean = B_FALSE;
+- break;
+- }
+- }
++ rw_enter(&dn->dn_struct_rwlock, RW_READER);
+
+- /*
+- * If compatibility option is on, sync any current changes before
+- * we go trundling through the block pointers.
+- */
+- if (!clean && zfs_dmu_offset_next_sync) {
+- clean = B_TRUE;
+- dnode_rele(dn, FTAG);
+- txg_wait_synced(dmu_objset_pool(os), 0);
+- err = dnode_hold(os, object, FTAG, &dn);
+- if (err)
+- return (err);
+- }
++ if (dnode_is_dirty(dn)) {
++ /*
++ * If the zfs_dmu_offset_next_sync module option is enabled
++ * then strict hole reporting has been requested. Dirty
++ * dnodes must be synced to disk to accurately report all
++ * holes. When disabled (the default) dirty dnodes are
++ * reported to not have any holes which is always safe.
++ *
++ * When called by zfs_holey_common() the zp->z_rangelock
++ * is held to prevent zfs_write() and mmap writeback from
++ * re-dirtying the dnode after txg_wait_synced().
++ */
++ if (zfs_dmu_offset_next_sync) {
++ rw_exit(&dn->dn_struct_rwlock);
++ dnode_rele(dn, FTAG);
++ txg_wait_synced(dmu_objset_pool(os), 0);
++ goto restart;
++ }
+
+- if (clean)
+- err = dnode_next_offset(dn,
+- (hole ? DNODE_FIND_HOLE : 0), off, 1, 1, 0);
+- else
+ err = SET_ERROR(EBUSY);
++ } else {
++ err = dnode_next_offset(dn, DNODE_FIND_HAVELOCK |
++ (hole ? DNODE_FIND_HOLE : 0), off, 1, 1, 0);
++ }
+
++ rw_exit(&dn->dn_struct_rwlock);
+ dnode_rele(dn, FTAG);
+
+ return (err);
+diff --git a/module/zfs/dnode.c b/module/zfs/dnode.c
+index 900240479c7..6f87f49f89f 100644
+--- a/module/zfs/dnode.c
++++ b/module/zfs/dnode.c
+@@ -1648,6 +1648,26 @@ dnode_try_claim(objset_t *os, uint64_t object, int slots)
+ slots, NULL, NULL));
+ }
+
++/*
++ * Checks if the dnode contains any uncommitted dirty records.
++ */
++boolean_t
++dnode_is_dirty(dnode_t *dn)
++{
++ mutex_enter(&dn->dn_mtx);
++
++ for (int i = 0; i < TXG_SIZE; i++) {
++ if (list_head(&dn->dn_dirty_records[i]) != NULL) {
++ mutex_exit(&dn->dn_mtx);
++ return (B_TRUE);
++ }
++ }
++
++ mutex_exit(&dn->dn_mtx);
++
++ return (B_FALSE);
++}
++
+ void
+ dnode_setdirty(dnode_t *dn, dmu_tx_t *tx)
+ {
+diff --git a/module/zfs/zfs_vnops.c b/module/zfs/zfs_vnops.c
+index a83f0b02ab5..7cbb70f499a 100644
+--- a/module/zfs/zfs_vnops.c
++++ b/module/zfs/zfs_vnops.c
+@@ -85,6 +85,7 @@ zfs_fsync(znode_t *zp, int syncflag, cred_t *cr)
+ static int
+ zfs_holey_common(znode_t *zp, ulong_t cmd, loff_t *off)
+ {
++ zfs_locked_range_t *lr;
+ uint64_t noff = (uint64_t)*off; /* new offset */
+ uint64_t file_sz;
+ int error;
+@@ -100,12 +101,18 @@ zfs_holey_common(znode_t *zp, ulong_t cmd, loff_t *off)
+ else
+ hole = B_FALSE;
+
++ /* Flush any mmap()'d data to disk */
++ if (zn_has_cached_data(zp))
++ zn_flush_cached_data(zp, B_FALSE);
++
++ lr = zfs_rangelock_enter(&zp->z_rangelock, 0, file_sz, RL_READER);
+ error = dmu_offset_next(ZTOZSB(zp)->z_os, zp->z_id, hole, &noff);
++ zfs_rangelock_exit(lr);
+
+ if (error == ESRCH)
+ return (SET_ERROR(ENXIO));
+
+- /* file was dirty, so fall back to using generic logic */
++ /* File was dirty, so fall back to using generic logic */
+ if (error == EBUSY) {
+ if (hole)
+ *off = file_sz;
+diff --git a/tests/runfiles/common.run b/tests/runfiles/common.run
+index 7f7d161be35..9f181b53e15 100644
+--- a/tests/runfiles/common.run
++++ b/tests/runfiles/common.run
+@@ -675,7 +675,7 @@ tests = ['migration_001_pos', 'migration_002_pos', 'migration_003_pos',
+ tags = ['functional', 'migration']
+
+ [tests/functional/mmap]
+-tests = ['mmap_write_001_pos', 'mmap_read_001_pos']
++tests = ['mmap_write_001_pos', 'mmap_read_001_pos', 'mmap_seek_001_pos']
+ tags = ['functional', 'mmap']
+
+ [tests/functional/mount]
+diff --git a/tests/zfs-tests/cmd/Makefile.am b/tests/zfs-tests/cmd/Makefile.am
+index 2b965ca7000..d1c29fcd1c6 100644
+--- a/tests/zfs-tests/cmd/Makefile.am
++++ b/tests/zfs-tests/cmd/Makefile.am
+@@ -19,6 +19,7 @@ SUBDIRS = \
+ mktree \
+ mmap_exec \
+ mmap_libaio \
++ mmap_seek \
+ mmapwrite \
+ nvlist_to_lua \
+ randwritecomp \
+diff --git a/tests/zfs-tests/cmd/mmap_seek/.gitignore b/tests/zfs-tests/cmd/mmap_seek/.gitignore
+new file mode 100644
+index 00000000000..6b05a791750
+--- /dev/null
++++ b/tests/zfs-tests/cmd/mmap_seek/.gitignore
+@@ -0,0 +1 @@
++/mmap_seek
+diff --git a/tests/zfs-tests/cmd/mmap_seek/Makefile.am b/tests/zfs-tests/cmd/mmap_seek/Makefile.am
+new file mode 100644
+index 00000000000..b938931125f
+--- /dev/null
++++ b/tests/zfs-tests/cmd/mmap_seek/Makefile.am
+@@ -0,0 +1,6 @@
++include $(top_srcdir)/config/Rules.am
++
++pkgexecdir = $(datadir)/@PACKAGE@/zfs-tests/bin
++
++pkgexec_PROGRAMS = mmap_seek
++mmap_seek_SOURCES = mmap_seek.c
+diff --git a/tests/zfs-tests/cmd/mmap_seek/mmap_seek.c b/tests/zfs-tests/cmd/mmap_seek/mmap_seek.c
+new file mode 100644
+index 00000000000..f476e1dba9a
+--- /dev/null
++++ b/tests/zfs-tests/cmd/mmap_seek/mmap_seek.c
+@@ -0,0 +1,147 @@
++/*
++ * 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) 2021 by Lawrence Livermore National Security, LLC.
++ */
++
++#include <unistd.h>
++#include <fcntl.h>
++#include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
++#include <sys/mman.h>
++#include <errno.h>
++
++static void
++seek_data(int fd, off_t offset, off_t expected)
++{
++ off_t data_offset = lseek(fd, offset, SEEK_DATA);
++ if (data_offset != expected) {
++ fprintf(stderr, "lseek(fd, %d, SEEK_DATA) = %d (expected %d)\n",
++ (int)offset, (int)data_offset, (int)expected);
++ exit(2);
++ }
++}
++
++static void
++seek_hole(int fd, off_t offset, off_t expected)
++{
++ off_t hole_offset = lseek(fd, offset, SEEK_HOLE);
++ if (hole_offset != expected) {
++ fprintf(stderr, "lseek(fd, %d, SEEK_HOLE) = %d (expected %d)\n",
++ (int)offset, (int)hole_offset, (int)expected);
++ exit(2);
++ }
++}
++
++int
++main(int argc, char **argv)
++{
++ char *execname = argv[0];
++ char *file_path = argv[1];
++ char *buf = NULL;
++ int err;
++
++ if (argc != 4) {
++ (void) printf("usage: %s <file name> <file size> "
++ "<block size>\n", argv[0]);
++ exit(1);
++ }
++
++ int fd = open(file_path, O_RDWR | O_CREAT, 0666);
++ if (fd == -1) {
++ (void) fprintf(stderr, "%s: %s: ", execname, file_path);
++ perror("open");
++ exit(2);
++ }
++
++ off_t file_size = atoi(argv[2]);
++ off_t block_size = atoi(argv[3]);
++
++ if (block_size * 2 > file_size) {
++ (void) fprintf(stderr, "file size must be at least "
++ "double the block size\n");
++ exit(2);
++ }
++
++ err = ftruncate(fd, file_size);
++ if (err == -1) {
++ perror("ftruncate");
++ exit(2);
++ }
++
++ if ((buf = mmap(NULL, file_size, PROT_READ | PROT_WRITE,
++ MAP_SHARED, fd, 0)) == MAP_FAILED) {
++ perror("mmap");
++ exit(2);
++ }
++
++ /* Verify the file is sparse and reports no data. */
++ seek_data(fd, 0, -1);
++
++ /* Verify the file is reported as a hole. */
++ seek_hole(fd, 0, 0);
++
++ /* Verify search beyond end of file is an error. */
++ seek_data(fd, 2 * file_size, -1);
++ seek_hole(fd, 2 * file_size, -1);
++
++ /* Dirty the first byte. */
++ memset(buf, 'a', 1);
++ seek_data(fd, 0, 0);
++ seek_data(fd, block_size, -1);
++ seek_hole(fd, 0, block_size);
++ seek_hole(fd, block_size, block_size);
++
++ /* Dirty the first half of the file. */
++ memset(buf, 'b', file_size / 2);
++ seek_data(fd, 0, 0);
++ seek_data(fd, block_size, block_size);
++ seek_hole(fd, 0, P2ROUNDUP(file_size / 2, block_size));
++ seek_hole(fd, block_size, P2ROUNDUP(file_size / 2, block_size));
++
++ /* Dirty the whole file. */
++ memset(buf, 'c', file_size);
++ seek_data(fd, 0, 0);
++ seek_data(fd, file_size * 3 / 4,
++ P2ROUNDUP(file_size * 3 / 4, block_size));
++ seek_hole(fd, 0, file_size);
++ seek_hole(fd, file_size / 2, file_size);
++
++ /* Punch a hole (required compression be enabled). */
++ memset(buf + block_size, 0, block_size);
++ seek_data(fd, 0, 0);
++ seek_data(fd, block_size, 2 * block_size);
++ seek_hole(fd, 0, block_size);
++ seek_hole(fd, block_size, block_size);
++ seek_hole(fd, 2 * block_size, file_size);
++
++ err = munmap(buf, file_size);
++ if (err == -1) {
++ perror("munmap");
++ exit(2);
++ }
++
++ close(fd);
++
++ return (0);
++}
+diff --git a/tests/zfs-tests/include/commands.cfg b/tests/zfs-tests/include/commands.cfg
+index 1ec73f25bae..4497a6248b4 100644
+--- a/tests/zfs-tests/include/commands.cfg
++++ b/tests/zfs-tests/include/commands.cfg
+@@ -209,6 +209,7 @@ export ZFSTEST_FILES='badsend
+ mktree
+ mmap_exec
+ mmap_libaio
++ mmap_seek
+ mmapwrite
+ nvlist_to_lua
+ randfree_file
+diff --git a/tests/zfs-tests/include/tunables.cfg b/tests/zfs-tests/include/tunables.cfg
+index 56d430a3987..fff43e46916 100644
+--- a/tests/zfs-tests/include/tunables.cfg
++++ b/tests/zfs-tests/include/tunables.cfg
+@@ -33,6 +33,7 @@ DEADMAN_FAILMODE deadman.failmode zfs_deadman_failmode
+ DEADMAN_SYNCTIME_MS deadman.synctime_ms zfs_deadman_synctime_ms
+ DEADMAN_ZIOTIME_MS deadman.ziotime_ms zfs_deadman_ziotime_ms
+ DISABLE_IVSET_GUID_CHECK disable_ivset_guid_check zfs_disable_ivset_guid_check
++DMU_OFFSET_NEXT_SYNC dmu_offset_next_sync zfs_dmu_offset_next_sync
+ INITIALIZE_CHUNK_SIZE initialize_chunk_size zfs_initialize_chunk_size
+ INITIALIZE_VALUE initialize_value zfs_initialize_value
+ KEEP_LOG_SPACEMAPS_AT_EXPORT keep_log_spacemaps_at_export zfs_keep_log_spacemaps_at_export
+diff --git a/tests/zfs-tests/tests/functional/mmap/Makefile.am b/tests/zfs-tests/tests/functional/mmap/Makefile.am
+index 2adc398b8c0..b26791ee7ce 100644
+--- a/tests/zfs-tests/tests/functional/mmap/Makefile.am
++++ b/tests/zfs-tests/tests/functional/mmap/Makefile.am
+@@ -4,7 +4,8 @@ dist_pkgdata_SCRIPTS = \
+ cleanup.ksh \
+ mmap_read_001_pos.ksh \
+ mmap_write_001_pos.ksh \
+- mmap_libaio_001_pos.ksh
++ mmap_libaio_001_pos.ksh \
++ mmap_seek_001_pos.ksh
+
+ dist_pkgdata_DATA = \
+ mmap.cfg
+diff --git a/tests/zfs-tests/tests/functional/mmap/mmap_seek_001_pos.ksh b/tests/zfs-tests/tests/functional/mmap/mmap_seek_001_pos.ksh
+new file mode 100755
+index 00000000000..6188549ad8d
+--- /dev/null
++++ b/tests/zfs-tests/tests/functional/mmap/mmap_seek_001_pos.ksh
+@@ -0,0 +1,67 @@
++#!/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) 2021 by Lawrence Livermore National Security, LLC.
++#
++
++. $STF_SUITE/include/libtest.shlib
++. $STF_SUITE/tests/functional/mmap/mmap.cfg
++
++#
++# DESCRIPTION:
++# lseek() data/holes for an mmap()'d file.
++#
++# STRATEGY:
++# 1. Enable compression and hole reporting for dirty files.
++# 2. Call mmap_seek binary test case for various record sizes.
++#
++
++verify_runnable "global"
++
++function cleanup
++{
++ log_must zfs set compression=off $TESTPOOL/$TESTFS
++ log_must zfs set recordsize=128k $TESTPOOL/$TESTFS
++ log_must rm -f $TESTDIR/test-mmap-file
++ log_must set_tunable64 DMU_OFFSET_NEXT_SYNC $dmu_offset_next_sync
++}
++
++log_assert "lseek() data/holes for an mmap()'d file."
++
++log_onexit cleanup
++
++# Enable hole reporting for dirty files.
++typeset dmu_offset_next_sync=$(get_tunable DMU_OFFSET_NEXT_SYNC)
++log_must set_tunable64 DMU_OFFSET_NEXT_SYNC 1
++
++# Compression must be enabled to convert zero'd blocks to holes.
++# This behavior is checked by the mmap_seek test.
++log_must zfs set compression=on $TESTPOOL/$TESTFS
++
++for bs in 4096 8192 16384 32768 65536 131072; do
++ log_must zfs set recordsize=$bs $TESTPOOL/$TESTFS
++ log_must mmap_seek $TESTDIR/test-mmap-file $((1024*1024)) $bs
++ log_must rm $TESTDIR/test-mmap-file
++done
++
++log_pass "lseek() data/holes for an mmap()'d file succeeded."
diff --git a/sys-fs/zfs/zfs-2.1.1-r3.ebuild b/sys-fs/zfs/zfs-2.1.1-r3.ebuild
new file mode 100644
index 00000000000..9b78e0fc383
--- /dev/null
+++ b/sys-fs/zfs/zfs-2.1.1-r3.ebuild
@@ -0,0 +1,298 @@
+# 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_{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}]
+ )
+"
+
+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
+ dist-kernel? ( virtual/dist-kernel:= )
+ rootfs? (
+ app-arch/cpio
+ app-misc/pax-utils
+ !<sys-kernel/genkernel-3.5.1.1
+ )
+ test-suite? (
+ 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.0.4-scrub-timers.patch"
+ "${FILESDIR}/2.1.1-fix-lseek-mmap.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
+
+ 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="${EPREFIX}/lib/systemd/system-preset"
+ --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"
+ 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
+}
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-fs/zfs/, sys-fs/zfs/files/
@ 2021-12-16 2:51 Georgy Yakovlev
0 siblings, 0 replies; 22+ messages in thread
From: Georgy Yakovlev @ 2021-12-16 2:51 UTC (permalink / raw
To: gentoo-commits
commit: 52257c6d64aa3817575311016151e29ca46be0b9
Author: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
AuthorDate: Thu Dec 16 02:29:05 2021 +0000
Commit: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
CommitDate: Thu Dec 16 02:51:03 2021 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=52257c6d
sys-fs/zfs: add 2.1.2
Bug: https://bugs.gentoo.org/815817
Closes: https://bugs.gentoo.org/820278
Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org>
sys-fs/zfs/Manifest | 2 +
sys-fs/zfs/files/2.1.2-openrc-vendor.patch | 42 ++++
sys-fs/zfs/files/2.1.2-scrub-timers.patch | 147 ++++++++++++++
sys-fs/zfs/zfs-2.1.2.ebuild | 303 +++++++++++++++++++++++++++++
4 files changed, 494 insertions(+)
diff --git a/sys-fs/zfs/Manifest b/sys-fs/zfs/Manifest
index 2901db693d59..e5cc220e8b89 100644
--- a/sys-fs/zfs/Manifest
+++ b/sys-fs/zfs/Manifest
@@ -3,3 +3,5 @@ DIST zfs-2.0.6.tar.gz 13192941 BLAKE2B 3a83303b016ec4259c286af8a9ceb281829d26508
DIST zfs-2.0.6.tar.gz.asc 836 BLAKE2B 065eba3361ef4234acc67df0236ab9a6737ba9fe5a706be98b55dd64d10360160ca787d8873f27451a2107225ae657dc4cab20a7c2a268cd2de64c8d82d0327a SHA512 123569ecfcee22ac462160acf61b120144c774bc5c0d46a50d2b7312f7565da1a9d780e1a6207dba5834917c66d5b852763e4a3162378d5c9bb90b0dfde35c5c
DIST zfs-2.1.1.tar.gz 34836374 BLAKE2B 09ee6bd30e8266342bd975454086049c3fd9142e7dacfe52166575c20e3c92688f9b457d75b2a2068fc281e65f78e1d47450545504cdf8bc31e23663545d7800 SHA512 b69ce764a9f7438ec2c90f86be02abfd684c67cd38de876374e3e6f4b2f82a75d86fa70205def2ba454ad27e52ec8d955ebc4ba456e91d397129a54ea849c19c
DIST zfs-2.1.1.tar.gz.asc 195 BLAKE2B d886e7dc74270228f98dfc5ca85bbbe897d5a87a5ae8bbfde28e2af1b36218227bc9f1b5902e97beebe160a298857d6e4673829d87cd8039332dc1858cfcffc0 SHA512 d76956b5c1bd547a319e70dd33d50beae39f65fca54532731426d2ef209385a556c51b3936051f75bc3800623c42da5b8d279c51f501a896f5fdfb7b4ed7fb94
+DIST zfs-2.1.2.tar.gz 34829045 BLAKE2B ab4e2d85200438373c7eeeaa5256a712dbfb2862b85de1fb7554ad0cc2b9f8e1255ab4564bca62f65a81a823adb8c112957e6e8771b8e5e6944c3731bc894584 SHA512 3e3932259da2a27f1c4cca8da62b909edc43bf51ab0229d2d5d0234d9a7eaa7b63b67c06a98cbe2d29ba1eb5cbcaab16e5062c2a2bc8e84cab770be10ebf2102
+DIST zfs-2.1.2.tar.gz.asc 836 BLAKE2B 8f5666f5c3d7016a4d79191f42d0a220fe8c654a0d64e3da3b575644fe52c83dcb9f9ef49ba0553771a127bba44e2802f1d366a7a38f670e73612deef76755c3 SHA512 da6bfccd19a249a6891f5e1de6c4b332e98ce4f125f638c046b9cedac3fd79c56a99dd9a620105a40741e5f04b382f5d5996b56cbe576fb268b31e57e0fed6eb
diff --git a/sys-fs/zfs/files/2.1.2-openrc-vendor.patch b/sys-fs/zfs/files/2.1.2-openrc-vendor.patch
new file mode 100644
index 000000000000..abe222aa5b84
--- /dev/null
+++ b/sys-fs/zfs/files/2.1.2-openrc-vendor.patch
@@ -0,0 +1,42 @@
+From 6ef28c526ba7199a3740407d764b6505618ca8ba Mon Sep 17 00:00:00 2001
+From: Peter Levine <plevine457@gmail.com>
+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 <behlendorf1@llnl.gov>
+Signed-off-by: Peter Levine <plevine457@gmail.com>
+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/sys-fs/zfs/files/2.1.2-scrub-timers.patch b/sys-fs/zfs/files/2.1.2-scrub-timers.patch
new file mode 100644
index 000000000000..58d1c3b6968d
--- /dev/null
+++ b/sys-fs/zfs/files/2.1.2-scrub-timers.patch
@@ -0,0 +1,147 @@
+From 2c9844d159024d4c742d24639a218213fb53d537 Mon Sep 17 00:00:00 2001
+From: Georgy Yakovlev <gyakovlev@gentoo.org>
+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 <gyakovlev@gentoo.org>
+---
+ 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 'exec @sbindir@/zpool scrub -p %i 2>/dev/null || true'
+--
+2.34.1
+
+From 4bac4eae0345fb322337b66a9b4923e9f3f52b0f Mon Sep 17 00:00:00 2001
+From: Georgy Yakovlev <gyakovlev@gentoo.org>
+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 <gyakovlev@gentoo.org>
+---
+ 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/sys-fs/zfs/zfs-2.1.2.ebuild b/sys-fs/zfs/zfs-2.1.2.ebuild
new file mode 100644
index 000000000000..578128d1e2d1
--- /dev/null
+++ b/sys-fs/zfs/zfs-2.1.2.ebuild
@@ -0,0 +1,303 @@
+# 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_{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? ( 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
+ dist-kernel? ( virtual/dist-kernel:= )
+ rootfs? (
+ app-arch/cpio
+ app-misc/pax-utils
+ !<sys-kernel/genkernel-3.5.1.1
+ )
+ 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.2-scrub-timers.patch"
+ "${FILESDIR}/2.1.2-openrc-vendor.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
+
+ 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="${EPREFIX}/lib/systemd/system-preset"
+ --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"
+ 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
+}
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-fs/zfs/, sys-fs/zfs/files/
@ 2021-12-23 22:28 Georgy Yakovlev
0 siblings, 0 replies; 22+ messages in thread
From: Georgy Yakovlev @ 2021-12-23 22:28 UTC (permalink / raw
To: gentoo-commits
commit: 94a129e0e7930ec5537be5f4fc5c84cb0e7a48bd
Author: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
AuthorDate: Thu Dec 23 22:08:39 2021 +0000
Commit: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
CommitDate: Thu Dec 23 22:27:12 2021 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=94a129e0
sys-fs/zfs: add 2.0.7
Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org>
sys-fs/zfs/Manifest | 2 +
sys-fs/zfs/files/2.0.7-scrub-timers.patch | 99 ++++++++++
sys-fs/zfs/zfs-2.0.7.ebuild | 303 ++++++++++++++++++++++++++++++
3 files changed, 404 insertions(+)
diff --git a/sys-fs/zfs/Manifest b/sys-fs/zfs/Manifest
index 1d9cb77a48f7..8c426ab5ccc7 100644
--- a/sys-fs/zfs/Manifest
+++ b/sys-fs/zfs/Manifest
@@ -1,5 +1,7 @@
DIST zfs-0.8.6.tar.gz 9295260 BLAKE2B 45424d710aaf75a05f766ae523ae157a24b5cbdcefe72a59e4cede81e42f7a92ae7f01150388437b78cd49f3d28b9664599f2a624516e6b3f1073497194a99f2 SHA512 626b172554f39a5c70f6ea5c599a92fae52534590d1b0273de2bbfc3676d29dff0eade8ca17e5f179a59870c12bc758fb53b7900f8a1fdbdef3a9161b93f9cce
DIST zfs-2.0.6.tar.gz 13192941 BLAKE2B 3a83303b016ec4259c286af8a9ceb281829d26508d411df91dd94193bca8c3155ef0ba63604e95f6add5f0c6cf6d100b0f567efc33b6c484c9ff811924da6ccd SHA512 52a5576eed21868b2a3d63d05d3d8c35b5e59ee88c7ddab1dc070644539f9acd56bde43ba5e965ad951a6d50a014fb429a7977d2ab1a2bfcadd92ea78dd57bf8
DIST zfs-2.0.6.tar.gz.asc 836 BLAKE2B 065eba3361ef4234acc67df0236ab9a6737ba9fe5a706be98b55dd64d10360160ca787d8873f27451a2107225ae657dc4cab20a7c2a268cd2de64c8d82d0327a SHA512 123569ecfcee22ac462160acf61b120144c774bc5c0d46a50d2b7312f7565da1a9d780e1a6207dba5834917c66d5b852763e4a3162378d5c9bb90b0dfde35c5c
+DIST zfs-2.0.7.tar.gz 14550055 BLAKE2B 80f7297f04a21cd8f3f2043d895b0325512ba0cea3bb9223561237754495c8233d29af5a9418a3c06a87510100240a45ef3d59c7ce776fffb5aafdcd18167c21 SHA512 1135abf74bf74685439018f7cd65fc52088f179d113bdd2e6481689bb0f4a016716a07d859107b74501fda00689e80b2488c7c2c53d5f058d6b659909ed85f6f
+DIST zfs-2.0.7.tar.gz.asc 836 BLAKE2B 65e7df58c33ccadc4e0ca9dbc1e8c006abbec8442e2da50872a1ab0cbb841fc45152298e8d3b93ee4320ddae6416e3a856caf80d8efb21b19db53dfedbf00e38 SHA512 b901d8e92faa6cfe6010bd54de88c7d18057f434cb07f8a89672d6c446a0a97b23209ee8f02cfd3b2a8f431c68ec977e7dc9f95fe5d385dba0bb6d37338ba682
DIST zfs-2.1.2.tar.gz 34829045 BLAKE2B ab4e2d85200438373c7eeeaa5256a712dbfb2862b85de1fb7554ad0cc2b9f8e1255ab4564bca62f65a81a823adb8c112957e6e8771b8e5e6944c3731bc894584 SHA512 3e3932259da2a27f1c4cca8da62b909edc43bf51ab0229d2d5d0234d9a7eaa7b63b67c06a98cbe2d29ba1eb5cbcaab16e5062c2a2bc8e84cab770be10ebf2102
DIST zfs-2.1.2.tar.gz.asc 836 BLAKE2B 8f5666f5c3d7016a4d79191f42d0a220fe8c654a0d64e3da3b575644fe52c83dcb9f9ef49ba0553771a127bba44e2802f1d366a7a38f670e73612deef76755c3 SHA512 da6bfccd19a249a6891f5e1de6c4b332e98ce4f125f638c046b9cedac3fd79c56a99dd9a620105a40741e5f04b382f5d5996b56cbe576fb268b31e57e0fed6eb
diff --git a/sys-fs/zfs/files/2.0.7-scrub-timers.patch b/sys-fs/zfs/files/2.0.7-scrub-timers.patch
new file mode 100644
index 000000000000..7c7bd1b874ea
--- /dev/null
+++ b/sys-fs/zfs/files/2.0.7-scrub-timers.patch
@@ -0,0 +1,99 @@
+From 2c9844d159024d4c742d24639a218213fb53d537 Mon Sep 17 00:00:00 2001
+From: Georgy Yakovlev <gyakovlev@gentoo.org>
+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 <gyakovlev@gentoo.org>
+---
+ 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/sys-fs/zfs/zfs-2.0.7.ebuild b/sys-fs/zfs/zfs-2.0.7.ebuild
new file mode 100644
index 000000000000..52e731767cc5
--- /dev/null
+++ b/sys-fs/zfs/zfs-2.0.7.ebuild
@@ -0,0 +1,303 @@
+# 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_{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
+ !<sys-kernel/genkernel-3.5.1.1
+ )
+ 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}/bash-completion-sudo.patch"
+ "${FILESDIR}/2.0.7-scrub-timers.patch"
+ "${FILESDIR}/2.1.2-openrc-vendor.patch"
+ "${FILESDIR}/2.1.2-musl-tests.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
+
+ 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
+}
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-fs/zfs/, sys-fs/zfs/files/
@ 2021-12-26 22:35 Georgy Yakovlev
0 siblings, 0 replies; 22+ messages in thread
From: Georgy Yakovlev @ 2021-12-26 22:35 UTC (permalink / raw
To: gentoo-commits
commit: 75a131e7d043e3e3ff0e15aa2038ebdf47997dc3
Author: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
AuthorDate: Sun Dec 26 22:30:57 2021 +0000
Commit: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
CommitDate: Sun Dec 26 22:35:03 2021 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=75a131e7
sys-fs/zfs: drop 2.0.6-r1
Bug: https://bugs.gentoo.org/820278
Closes: https://bugs.gentoo.org/815817
Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org>
sys-fs/zfs/Manifest | 2 -
sys-fs/zfs/files/2.0.4-scrub-timers.patch | 97 ----------
sys-fs/zfs/zfs-2.0.6-r1.ebuild | 302 ------------------------------
3 files changed, 401 deletions(-)
diff --git a/sys-fs/zfs/Manifest b/sys-fs/zfs/Manifest
index 8c426ab5ccc7..e2556e93d2e6 100644
--- a/sys-fs/zfs/Manifest
+++ b/sys-fs/zfs/Manifest
@@ -1,6 +1,4 @@
DIST zfs-0.8.6.tar.gz 9295260 BLAKE2B 45424d710aaf75a05f766ae523ae157a24b5cbdcefe72a59e4cede81e42f7a92ae7f01150388437b78cd49f3d28b9664599f2a624516e6b3f1073497194a99f2 SHA512 626b172554f39a5c70f6ea5c599a92fae52534590d1b0273de2bbfc3676d29dff0eade8ca17e5f179a59870c12bc758fb53b7900f8a1fdbdef3a9161b93f9cce
-DIST zfs-2.0.6.tar.gz 13192941 BLAKE2B 3a83303b016ec4259c286af8a9ceb281829d26508d411df91dd94193bca8c3155ef0ba63604e95f6add5f0c6cf6d100b0f567efc33b6c484c9ff811924da6ccd SHA512 52a5576eed21868b2a3d63d05d3d8c35b5e59ee88c7ddab1dc070644539f9acd56bde43ba5e965ad951a6d50a014fb429a7977d2ab1a2bfcadd92ea78dd57bf8
-DIST zfs-2.0.6.tar.gz.asc 836 BLAKE2B 065eba3361ef4234acc67df0236ab9a6737ba9fe5a706be98b55dd64d10360160ca787d8873f27451a2107225ae657dc4cab20a7c2a268cd2de64c8d82d0327a SHA512 123569ecfcee22ac462160acf61b120144c774bc5c0d46a50d2b7312f7565da1a9d780e1a6207dba5834917c66d5b852763e4a3162378d5c9bb90b0dfde35c5c
DIST zfs-2.0.7.tar.gz 14550055 BLAKE2B 80f7297f04a21cd8f3f2043d895b0325512ba0cea3bb9223561237754495c8233d29af5a9418a3c06a87510100240a45ef3d59c7ce776fffb5aafdcd18167c21 SHA512 1135abf74bf74685439018f7cd65fc52088f179d113bdd2e6481689bb0f4a016716a07d859107b74501fda00689e80b2488c7c2c53d5f058d6b659909ed85f6f
DIST zfs-2.0.7.tar.gz.asc 836 BLAKE2B 65e7df58c33ccadc4e0ca9dbc1e8c006abbec8442e2da50872a1ab0cbb841fc45152298e8d3b93ee4320ddae6416e3a856caf80d8efb21b19db53dfedbf00e38 SHA512 b901d8e92faa6cfe6010bd54de88c7d18057f434cb07f8a89672d6c446a0a97b23209ee8f02cfd3b2a8f431c68ec977e7dc9f95fe5d385dba0bb6d37338ba682
DIST zfs-2.1.2.tar.gz 34829045 BLAKE2B ab4e2d85200438373c7eeeaa5256a712dbfb2862b85de1fb7554ad0cc2b9f8e1255ab4564bca62f65a81a823adb8c112957e6e8771b8e5e6944c3731bc894584 SHA512 3e3932259da2a27f1c4cca8da62b909edc43bf51ab0229d2d5d0234d9a7eaa7b63b67c06a98cbe2d29ba1eb5cbcaab16e5062c2a2bc8e84cab770be10ebf2102
diff --git a/sys-fs/zfs/files/2.0.4-scrub-timers.patch b/sys-fs/zfs/files/2.0.4-scrub-timers.patch
deleted file mode 100644
index 6aae1e4de596..000000000000
--- a/sys-fs/zfs/files/2.0.4-scrub-timers.patch
+++ /dev/null
@@ -1,97 +0,0 @@
-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-2.0.6-r1.ebuild b/sys-fs/zfs/zfs-2.0.6-r1.ebuild
deleted file mode 100644
index f5ad730973d9..000000000000
--- a/sys-fs/zfs/zfs-2.0.6-r1.ebuild
+++ /dev/null
@@ -1,302 +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 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}]
- )
-"
-
-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
- !<sys-kernel/genkernel-3.5.1.1
- )
- test-suite? (
- 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] )"
-
-# temporary block new coreutils
-# https://github.com/openzfs/zfs/issues/11900
-RDEPEND+="
- <sys-apps/coreutils-9
-"
-
-REQUIRED_USE="
- !minimal? ( ${PYTHON_REQUIRED_USE} )
- python? ( !minimal )
- test-suite? ( !minimal )
-"
-
-RESTRICT="test"
-
-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; 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
-
- 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
-}
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-fs/zfs/, sys-fs/zfs/files/
@ 2022-06-07 18:56 Georgy Yakovlev
0 siblings, 0 replies; 22+ messages in thread
From: Georgy Yakovlev @ 2022-06-07 18:56 UTC (permalink / raw
To: gentoo-commits
commit: 66f46ece9b462f673a8ad1f7d94f02e10186e60f
Author: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
AuthorDate: Tue Jun 7 18:54:49 2022 +0000
Commit: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
CommitDate: Tue Jun 7 18:54:49 2022 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=66f46ece
sys-fs/zfs: drop 2.1.2-r1
Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org>
sys-fs/zfs/Manifest | 2 -
sys-fs/zfs/files/2.1.2-scrub-timers.patch | 147 ---------------
sys-fs/zfs/zfs-2.1.2-r1.ebuild | 303 ------------------------------
3 files changed, 452 deletions(-)
diff --git a/sys-fs/zfs/Manifest b/sys-fs/zfs/Manifest
index fbb9a55c3dc1..e7fff2635157 100644
--- a/sys-fs/zfs/Manifest
+++ b/sys-fs/zfs/Manifest
@@ -1,6 +1,4 @@
DIST zfs-2.0.7.tar.gz 14550055 BLAKE2B 80f7297f04a21cd8f3f2043d895b0325512ba0cea3bb9223561237754495c8233d29af5a9418a3c06a87510100240a45ef3d59c7ce776fffb5aafdcd18167c21 SHA512 1135abf74bf74685439018f7cd65fc52088f179d113bdd2e6481689bb0f4a016716a07d859107b74501fda00689e80b2488c7c2c53d5f058d6b659909ed85f6f
DIST zfs-2.0.7.tar.gz.asc 836 BLAKE2B 65e7df58c33ccadc4e0ca9dbc1e8c006abbec8442e2da50872a1ab0cbb841fc45152298e8d3b93ee4320ddae6416e3a856caf80d8efb21b19db53dfedbf00e38 SHA512 b901d8e92faa6cfe6010bd54de88c7d18057f434cb07f8a89672d6c446a0a97b23209ee8f02cfd3b2a8f431c68ec977e7dc9f95fe5d385dba0bb6d37338ba682
-DIST zfs-2.1.2.tar.gz 34829045 BLAKE2B ab4e2d85200438373c7eeeaa5256a712dbfb2862b85de1fb7554ad0cc2b9f8e1255ab4564bca62f65a81a823adb8c112957e6e8771b8e5e6944c3731bc894584 SHA512 3e3932259da2a27f1c4cca8da62b909edc43bf51ab0229d2d5d0234d9a7eaa7b63b67c06a98cbe2d29ba1eb5cbcaab16e5062c2a2bc8e84cab770be10ebf2102
-DIST zfs-2.1.2.tar.gz.asc 836 BLAKE2B 8f5666f5c3d7016a4d79191f42d0a220fe8c654a0d64e3da3b575644fe52c83dcb9f9ef49ba0553771a127bba44e2802f1d366a7a38f670e73612deef76755c3 SHA512 da6bfccd19a249a6891f5e1de6c4b332e98ce4f125f638c046b9cedac3fd79c56a99dd9a620105a40741e5f04b382f5d5996b56cbe576fb268b31e57e0fed6eb
DIST zfs-2.1.4.tar.gz 34896310 BLAKE2B be303f1181f604770536aa4aa61d5319ec408abbd04964cedadd15b3101a15deba6539bb5d833f4fed357f323d74f622d035305df699b213df41ae45bffdd200 SHA512 c7b57c43fc287b22905067ab022df4133d32e1a5dc335f7baf743b4ef88f64c2bf9d41318c2083230d077dd49e68f7d9e6172266e13d4b1eee29d359860f969e
DIST zfs-2.1.4.tar.gz.asc 836 BLAKE2B b311730f72d534c87a782515f35a354bfbefba0513dc0cee5b0b497cf742590f13be6a49ff8a70d7d6503d0ba06b0266e7d290d718337add614812c3d1b0731a SHA512 53880cd5369f468551bab685eb83739ed76aa286886fdd2cbad4270755fe809da730082a91bba61011f59594fac297ce05645ae32c2c73b4a9aa835f2991a1ee
diff --git a/sys-fs/zfs/files/2.1.2-scrub-timers.patch b/sys-fs/zfs/files/2.1.2-scrub-timers.patch
deleted file mode 100644
index f1c5b5699f62..000000000000
--- a/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 <gyakovlev@gentoo.org>
-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 <gyakovlev@gentoo.org>
----
- 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 <gyakovlev@gentoo.org>
-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 <gyakovlev@gentoo.org>
----
- 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/sys-fs/zfs/zfs-2.1.2-r1.ebuild b/sys-fs/zfs/zfs-2.1.2-r1.ebuild
deleted file mode 100644
index d119026f5c74..000000000000
--- a/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
- !<sys-kernel/genkernel-3.5.1.1
- )
- 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.2-scrub-timers.patch"
- "${FILESDIR}/2.1.2-openrc-vendor.patch"
- "${FILESDIR}/2.1.2-musl-tests.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
-
- 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
-}
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-fs/zfs/, sys-fs/zfs/files/
@ 2022-07-01 7:34 Sam James
0 siblings, 0 replies; 22+ messages in thread
From: Sam James @ 2022-07-01 7:34 UTC (permalink / raw
To: gentoo-commits
commit: 25f80a2eafbe1eae88d053b507ee7200f31c42dc
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Jul 1 07:33:01 2022 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Jul 1 07:34:38 2022 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=25f80a2e
sys-fs/zfs: more Dracut fixes
- Backport the merged version of non-root fix (one we used should be fine,
but upstream went with another)
- Revert commit which breaks dist-kernel initramfs building (breaks
with USE=initramfs on gentoo-kernel b/c zfs isn't yet rebuilt when
gentoo-kernel's pkg_postinst builds dracut).
Bug: https://github.com/openzfs/zfs/issues/13595
Bug: https://bugs.gentoo.org/854333
Signed-off-by: Sam James <sam <AT> gentoo.org>
sys-fs/zfs/files/2.1.5-dracut-zfs-missing.patch | 14 +++++
sys-fs/zfs/files/2.1.5-r2-dracut-non-root.patch | 60 ++++++++++++++++++++++
.../zfs/{zfs-9999.ebuild => zfs-2.1.5-r2.ebuild} | 9 ++++
sys-fs/zfs/zfs-9999.ebuild | 4 ++
4 files changed, 87 insertions(+)
diff --git a/sys-fs/zfs/files/2.1.5-dracut-zfs-missing.patch b/sys-fs/zfs/files/2.1.5-dracut-zfs-missing.patch
new file mode 100644
index 000000000000..077bcd55f6d5
--- /dev/null
+++ b/sys-fs/zfs/files/2.1.5-dracut-zfs-missing.patch
@@ -0,0 +1,14 @@
+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/sys-fs/zfs/files/2.1.5-r2-dracut-non-root.patch b/sys-fs/zfs/files/2.1.5-r2-dracut-non-root.patch
new file mode 100644
index 000000000000..a9c6130f5b00
--- /dev/null
+++ b/sys-fs/zfs/files/2.1.5-r2-dracut-non-root.patch
@@ -0,0 +1,60 @@
+https://github.com/openzfs/zfs/commit/eefe83eaa68f7cb4a49c580dd940d3688e42c849
+https://bugs.gentoo.org/854333
+
+From eefe83eaa68f7cb4a49c580dd940d3688e42c849 Mon Sep 17 00:00:00 2001
+From: Toyam Cox <aviator45003@gmail.com>
+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 <ajh@sideband.org>
+Signed-off-by: Toyam Cox <vaelatern@voidlinux.org>
+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/sys-fs/zfs/zfs-9999.ebuild b/sys-fs/zfs/zfs-2.1.5-r2.ebuild
similarity index 97%
copy from sys-fs/zfs/zfs-9999.ebuild
copy to sys-fs/zfs/zfs-2.1.5-r2.ebuild
index 6e0b78a9c125..37907ff20733 100644
--- a/sys-fs/zfs/zfs-9999.ebuild
+++ b/sys-fs/zfs/zfs-2.1.5-r2.ebuild
@@ -100,6 +100,15 @@ REQUIRED_USE="
RESTRICT="test"
+PATCHES=(
+ # bug #855182
+ "${FILESDIR}"/${PV}-build-issues.patch
+ # bug #854333
+ "${FILESDIR}"/${PV}-r2-dracut-non-root.patch
+ #
+ "${FILESDIR}"/2.1.5-dracut-zfs-missing.patch
+)
+
pkg_pretend() {
use rootfs || return 0
diff --git a/sys-fs/zfs/zfs-9999.ebuild b/sys-fs/zfs/zfs-9999.ebuild
index 6e0b78a9c125..b3a9d416fb6e 100644
--- a/sys-fs/zfs/zfs-9999.ebuild
+++ b/sys-fs/zfs/zfs-9999.ebuild
@@ -100,6 +100,10 @@ REQUIRED_USE="
RESTRICT="test"
+PATCHES=(
+ "${FILESDIR}"/2.1.5-dracut-zfs-missing.patch
+)
+
pkg_pretend() {
use rootfs || return 0
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-fs/zfs/, sys-fs/zfs/files/
@ 2022-09-16 23:09 Georgy Yakovlev
0 siblings, 0 replies; 22+ messages in thread
From: Georgy Yakovlev @ 2022-09-16 23:09 UTC (permalink / raw
To: gentoo-commits
commit: 0cab28e0c7458d3ca75a0b08a23ff19e273e7432
Author: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
AuthorDate: Fri Sep 16 23:08:21 2022 +0000
Commit: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
CommitDate: Fri Sep 16 23:09:14 2022 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0cab28e0
sys-fs/zfs: revbump 2.1.5-r5, add zfs-snapshot-bootfs fixes
Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org>
.../2.1.5-dracut-zfs-bootfs-snapshot-fixes.patch | 78 ++++++++++++++++++++++
.../{zfs-2.1.5-r5.ebuild => zfs-2.1.5-r6.ebuild} | 4 ++
2 files changed, 82 insertions(+)
diff --git a/sys-fs/zfs/files/2.1.5-dracut-zfs-bootfs-snapshot-fixes.patch b/sys-fs/zfs/files/2.1.5-dracut-zfs-bootfs-snapshot-fixes.patch
new file mode 100644
index 000000000000..05c44faf9d93
--- /dev/null
+++ b/sys-fs/zfs/files/2.1.5-dracut-zfs-bootfs-snapshot-fixes.patch
@@ -0,0 +1,78 @@
+From 2d434e8ae4139ce14a1b058839a144bf952e79ea Mon Sep 17 00:00:00 2001
+From: gregory-lee-bartholomew <gregory.lee.bartholomew@gmail.com>
+Date: Wed, 29 Jun 2022 18:56:04 -0500
+Subject: [PATCH] contrib: dracut: zfs-{rollback,snapshot}-bootfs: explicit
+ snapname fix
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Due to a missing semicolon on the ExecStart line, it wasn't possible
+to specify the snapshot name on the bootfs.{rollback,snapshot}
+kernel parameters if the boot dataset name was obtained from the
+root=zfs:... kernel parameter.
+
+Reviewed-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
+Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
+Signed-off-by: Gregory Bartholomew <gregory.lee.bartholomew@gmail.com>
+Closes #13585
+---
+ contrib/dracut/90zfs/zfs-rollback-bootfs.service.in | 2 +-
+ contrib/dracut/90zfs/zfs-snapshot-bootfs.service.in | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/contrib/dracut/90zfs/zfs-rollback-bootfs.service.in b/contrib/dracut/90zfs/zfs-rollback-bootfs.service.in
+index b4f5707516c..a29cf3a3dd8 100644
+--- a/contrib/dracut/90zfs/zfs-rollback-bootfs.service.in
++++ b/contrib/dracut/90zfs/zfs-rollback-bootfs.service.in
+@@ -8,5 +8,5 @@ ConditionKernelCommandLine=bootfs.rollback
+
+ [Service]
+ Type=oneshot
+-ExecStart=/bin/sh -c '. /lib/dracut-zfs-lib.sh; decode_root_args || exit; [ "$root" = "zfs:AUTO" ] && root="$BOOTFS" SNAPNAME="$(getarg bootfs.rollback)"; exec @sbindir@/zfs rollback -Rf "$root@${SNAPNAME:-%v}"'
++ExecStart=/bin/sh -c '. /lib/dracut-zfs-lib.sh; decode_root_args || exit; [ "$root" = "zfs:AUTO" ] && root="$BOOTFS"; SNAPNAME="$(getarg bootfs.rollback)"; exec @sbindir@/zfs rollback -Rf "$root@${SNAPNAME:-%v}"'
+ RemainAfterExit=yes
+diff --git a/contrib/dracut/90zfs/zfs-snapshot-bootfs.service.in b/contrib/dracut/90zfs/zfs-snapshot-bootfs.service.in
+index afdba2c9d19..befd163b653 100644
+--- a/contrib/dracut/90zfs/zfs-snapshot-bootfs.service.in
++++ b/contrib/dracut/90zfs/zfs-snapshot-bootfs.service.in
+@@ -8,5 +8,5 @@ ConditionKernelCommandLine=bootfs.snapshot
+
+ [Service]
+ Type=oneshot
+-ExecStart=/bin/sh -c '. /lib/dracut-zfs-lib.sh; decode_root_args || exit; [ "$root" = "zfs:AUTO" ] && root="$BOOTFS" SNAPNAME="$(getarg bootfs.snapshot)"; exec @sbindir@/zfs snapshot "$root@${SNAPNAME:-%v}"'
++ExecStart=/bin/sh -c '. /lib/dracut-zfs-lib.sh; decode_root_args || exit; [ "$root" = "zfs:AUTO" ] && root="$BOOTFS"; SNAPNAME="$(getarg bootfs.snapshot)"; exec @sbindir@/zfs snapshot "$root@${SNAPNAME:-%v}"'
+ RemainAfterExit=yes
+From d22dd77c4d4556373b995121412c4abac02bcf8a Mon Sep 17 00:00:00 2001
+From: gregory-lee-bartholomew <gregory.lee.bartholomew@gmail.com>
+Date: Fri, 12 Aug 2022 16:28:15 -0500
+Subject: [PATCH] contrib: dracut: zfs-snapshot-bootfs: exit status fix
+
+When the zfs-snapshot-bootfs service attempts to create a snapshot
+that already exists, the exit status of the command is non-zero and
+the service reports failed to the systemd service manager. This is a
+common occurrence if bootfs.snapshot is left set on the kernel command
+line and it should not be considered a failure.
+
+This service was originally set to ignore this error by prefixing
+the command with - on the ExecStart line, but the leading - appears
+to have been dropped in #13359.
+
+Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
+Signed-off-by: Gregory Bartholomew <gregory.lee.bartholomew@gmail.com>
+Closes #13769
+---
+ contrib/dracut/90zfs/zfs-snapshot-bootfs.service.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/contrib/dracut/90zfs/zfs-snapshot-bootfs.service.in b/contrib/dracut/90zfs/zfs-snapshot-bootfs.service.in
+index befd163b653..9e73d1a7872 100644
+--- a/contrib/dracut/90zfs/zfs-snapshot-bootfs.service.in
++++ b/contrib/dracut/90zfs/zfs-snapshot-bootfs.service.in
+@@ -8,5 +8,5 @@ ConditionKernelCommandLine=bootfs.snapshot
+
+ [Service]
+ Type=oneshot
+-ExecStart=/bin/sh -c '. /lib/dracut-zfs-lib.sh; decode_root_args || exit; [ "$root" = "zfs:AUTO" ] && root="$BOOTFS"; SNAPNAME="$(getarg bootfs.snapshot)"; exec @sbindir@/zfs snapshot "$root@${SNAPNAME:-%v}"'
++ExecStart=-/bin/sh -c '. /lib/dracut-zfs-lib.sh; decode_root_args || exit; [ "$root" = "zfs:AUTO" ] && root="$BOOTFS"; SNAPNAME="$(getarg bootfs.snapshot)"; exec @sbindir@/zfs snapshot "$root@${SNAPNAME:-%v}"'
+ RemainAfterExit=yes
diff --git a/sys-fs/zfs/zfs-2.1.5-r5.ebuild b/sys-fs/zfs/zfs-2.1.5-r6.ebuild
similarity index 98%
rename from sys-fs/zfs/zfs-2.1.5-r5.ebuild
rename to sys-fs/zfs/zfs-2.1.5-r6.ebuild
index cec989b82da5..e2b1dac94560 100644
--- a/sys-fs/zfs/zfs-2.1.5-r5.ebuild
+++ b/sys-fs/zfs/zfs-2.1.5-r6.ebuild
@@ -112,6 +112,10 @@ PATCHES=(
# bug #863212, bug #855182
"${WORKDIR}"/${P}-patches/
+
+ # https://github.com/openzfs/zfs/pull/13769
+ # https://github.com/openzfs/zfs/pull/13585
+ "${FILESDIR}"/2.1.5-dracut-zfs-bootfs-snapshot-fixes.patch
)
pkg_pretend() {
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-fs/zfs/, sys-fs/zfs/files/
@ 2022-09-17 22:16 Georgy Yakovlev
0 siblings, 0 replies; 22+ messages in thread
From: Georgy Yakovlev @ 2022-09-17 22:16 UTC (permalink / raw
To: gentoo-commits
commit: 33344d7dd6b44bd93c17485d77d60c0e25ef71ee
Author: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
AuthorDate: Sat Sep 17 22:10:37 2022 +0000
Commit: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
CommitDate: Sat Sep 17 22:14:00 2022 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=33344d7d
sys-fs/zfs: drop 2.0.7-r1
Closes: https://bugs.gentoo.org/850508
Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org>
sys-fs/zfs/Manifest | 2 -
sys-fs/zfs/files/2.0.7-scrub-timers.patch | 99 ---------
sys-fs/zfs/files/2.1.2-musl-tests.patch | 58 ------
sys-fs/zfs/files/2.1.2-openrc-vendor.patch | 42 ----
sys-fs/zfs/files/bash-completion-sudo.patch | 35 ----
sys-fs/zfs/zfs-2.0.7-r1.ebuild | 313 ----------------------------
6 files changed, 549 deletions(-)
diff --git a/sys-fs/zfs/Manifest b/sys-fs/zfs/Manifest
index 7b982f51e740..e252f0fccc10 100644
--- a/sys-fs/zfs/Manifest
+++ b/sys-fs/zfs/Manifest
@@ -1,5 +1,3 @@
-DIST zfs-2.0.7.tar.gz 14550055 BLAKE2B 80f7297f04a21cd8f3f2043d895b0325512ba0cea3bb9223561237754495c8233d29af5a9418a3c06a87510100240a45ef3d59c7ce776fffb5aafdcd18167c21 SHA512 1135abf74bf74685439018f7cd65fc52088f179d113bdd2e6481689bb0f4a016716a07d859107b74501fda00689e80b2488c7c2c53d5f058d6b659909ed85f6f
-DIST zfs-2.0.7.tar.gz.asc 836 BLAKE2B 65e7df58c33ccadc4e0ca9dbc1e8c006abbec8442e2da50872a1ab0cbb841fc45152298e8d3b93ee4320ddae6416e3a856caf80d8efb21b19db53dfedbf00e38 SHA512 b901d8e92faa6cfe6010bd54de88c7d18057f434cb07f8a89672d6c446a0a97b23209ee8f02cfd3b2a8f431c68ec977e7dc9f95fe5d385dba0bb6d37338ba682
DIST zfs-2.1.4.tar.gz 34896310 BLAKE2B be303f1181f604770536aa4aa61d5319ec408abbd04964cedadd15b3101a15deba6539bb5d833f4fed357f323d74f622d035305df699b213df41ae45bffdd200 SHA512 c7b57c43fc287b22905067ab022df4133d32e1a5dc335f7baf743b4ef88f64c2bf9d41318c2083230d077dd49e68f7d9e6172266e13d4b1eee29d359860f969e
DIST zfs-2.1.4.tar.gz.asc 836 BLAKE2B b311730f72d534c87a782515f35a354bfbefba0513dc0cee5b0b497cf742590f13be6a49ff8a70d7d6503d0ba06b0266e7d290d718337add614812c3d1b0731a SHA512 53880cd5369f468551bab685eb83739ed76aa286886fdd2cbad4270755fe809da730082a91bba61011f59594fac297ce05645ae32c2c73b4a9aa835f2991a1ee
DIST zfs-2.1.5-patches.tar.xz 13324 BLAKE2B bfef8abd298cebd54491272b8c1deacace901d9a1acce67cb927bab6447eafd985352fd09f64336aa9d6611bab0e5c761d7973f0a65c408d77bb735a94c60253 SHA512 d2b009664f8eb4f2a8596693011fde578b6eae123c6169e5dfb70bd920c0f987f5177f7b1be008705a421574a8a9bc930f99823785c69e81573f18b0350cb9bd
diff --git a/sys-fs/zfs/files/2.0.7-scrub-timers.patch b/sys-fs/zfs/files/2.0.7-scrub-timers.patch
deleted file mode 100644
index 7c7bd1b874ea..000000000000
--- a/sys-fs/zfs/files/2.0.7-scrub-timers.patch
+++ /dev/null
@@ -1,99 +0,0 @@
-From 2c9844d159024d4c742d24639a218213fb53d537 Mon Sep 17 00:00:00 2001
-From: Georgy Yakovlev <gyakovlev@gentoo.org>
-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 <gyakovlev@gentoo.org>
----
- 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/sys-fs/zfs/files/2.1.2-musl-tests.patch b/sys-fs/zfs/files/2.1.2-musl-tests.patch
deleted file mode 100644
index 3d2c563f8c51..000000000000
--- a/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 <gyakovlev@gentoo.org>
-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 <gyakovlev@gentoo.org>
----
- 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 <stdlib.h>
- #include <string.h>
- #include <sys/mman.h>
-+#include <sys/sysmacros.h>
- #include <errno.h>
-+#ifdef __linux__
-+#include <linux/fs.h>
-+#endif
-
- static void
- seek_data(int fd, off_t offset, off_t expected)
diff --git a/sys-fs/zfs/files/2.1.2-openrc-vendor.patch b/sys-fs/zfs/files/2.1.2-openrc-vendor.patch
deleted file mode 100644
index abe222aa5b84..000000000000
--- a/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 <plevine457@gmail.com>
-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 <behlendorf1@llnl.gov>
-Signed-off-by: Peter Levine <plevine457@gmail.com>
-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/sys-fs/zfs/files/bash-completion-sudo.patch b/sys-fs/zfs/files/bash-completion-sudo.patch
deleted file mode 100644
index 8ae9d25d2761..000000000000
--- a/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 <gyakovlev@gentoo.org>
-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/sys-fs/zfs/zfs-2.0.7-r1.ebuild b/sys-fs/zfs/zfs-2.0.7-r1.ebuild
deleted file mode 100644
index 68d9116fd3de..000000000000
--- a/sys-fs/zfs/zfs-2.0.7-r1.ebuild
+++ /dev/null
@@ -1,313 +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
- !<sys-kernel/genkernel-3.5.1.1
- )
- 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}/bash-completion-sudo.patch"
- "${FILESDIR}/2.0.7-scrub-timers.patch"
- "${FILESDIR}/2.1.2-openrc-vendor.patch"
- "${FILESDIR}/2.1.2-musl-tests.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-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() {
- 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-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
-}
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-fs/zfs/, sys-fs/zfs/files/
@ 2022-10-04 5:07 Sam James
0 siblings, 0 replies; 22+ messages in thread
From: Sam James @ 2022-10-04 5:07 UTC (permalink / raw
To: gentoo-commits
commit: d16509499d6059f3d58b89952fdb056702325704
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Tue Oct 4 04:24:37 2022 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Oct 4 05:06:49 2022 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d1650949
sys-fs/zfs: add 2.1.6
Signed-off-by: Sam James <sam <AT> gentoo.org>
sys-fs/zfs/Manifest | 2 +
sys-fs/zfs/files/2.1.6-fgrep.patch | 53 ++++++
sys-fs/zfs/zfs-2.1.6.ebuild | 330 +++++++++++++++++++++++++++++++++++++
3 files changed, 385 insertions(+)
diff --git a/sys-fs/zfs/Manifest b/sys-fs/zfs/Manifest
index 9e6e521d9fef..894b7751ea9b 100644
--- a/sys-fs/zfs/Manifest
+++ b/sys-fs/zfs/Manifest
@@ -1,3 +1,5 @@
DIST zfs-2.1.5-patches.tar.xz 13324 BLAKE2B bfef8abd298cebd54491272b8c1deacace901d9a1acce67cb927bab6447eafd985352fd09f64336aa9d6611bab0e5c761d7973f0a65c408d77bb735a94c60253 SHA512 d2b009664f8eb4f2a8596693011fde578b6eae123c6169e5dfb70bd920c0f987f5177f7b1be008705a421574a8a9bc930f99823785c69e81573f18b0350cb9bd
DIST zfs-2.1.5.tar.gz 34951632 BLAKE2B c6e3efd9c0cda91654767eaad0eaaa05cd9a5daf1cb0384c9c78b30062f5c29142ac37ab9dbdaf96c91456d11c317d782d3524ade293f03fda983e5992b79e49 SHA512 d9ccf1049cefa9167d25f71fbdca70092cd02368b60f09341e6489fb68dc5f89e87b026b0191f4d81181a8851449124d824a1d959d0e2fb29c8a3d624edc4f03
DIST zfs-2.1.5.tar.gz.asc 836 BLAKE2B 4a81c266967540850a2cc824e79555ca9d05b2e17e45fa2723893cbd85b55e3d7d791986d6667b7ee1530e7692c03818f15e8b6798393b54989f90801b775786 SHA512 224b0dcf4982c63a8eff0a39d054537e7d023f7c35e154e4d20490b8daf184c076bc8e4de7d2c5af4059f8a802b747e637aad4479cd8d1330cf5b26da2f19c94
+DIST zfs-2.1.6.tar.gz 34951282 BLAKE2B 615fe7a2128af77c6c855ea52b6503a78f0c992ea845b02875ac19aa9dd155c5d4110b668da91c463f96a54767ab92e67e5303572337352484c055c0a0ff9e46 SHA512 75639e4cecb281fe73a6e6bd116693f6609ace9b358385450297d175087b10938c2f489a08c657cf0a64250a8db995cbd19abc808a8523cb4c5344b3f76668d6
+DIST zfs-2.1.6.tar.gz.asc 836 BLAKE2B d85a79f8824a92c4d0a9682646f79c14871ebe27764289dc87cd9b0a773b7295538780401e70c492a9e4e7097ff2b3e459f7e0a7fdce2e2a59d3f467c41d88b3 SHA512 a83fcc00a8b35f1a1f9b94097d453019333a5351a3d78656dbd9ef732655ee817ccc88068c5ba11b5ff4a285e02250aee4169cc1450025edf547a2329fca7e15
diff --git a/sys-fs/zfs/files/2.1.6-fgrep.patch b/sys-fs/zfs/files/2.1.6-fgrep.patch
new file mode 100644
index 000000000000..2e47c5bcc093
--- /dev/null
+++ b/sys-fs/zfs/files/2.1.6-fgrep.patch
@@ -0,0 +1,53 @@
+https://github.com/openzfs/zfs/commit/d30577c9dd811688f2609ad532b011b99bceb485
+
+From d30577c9dd811688f2609ad532b011b99bceb485 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?=D0=BD=D0=B0=D0=B1?= <nabijaczleweli@nabijaczleweli.xyz>
+Date: Sat, 12 Mar 2022 00:26:46 +0100
+Subject: [PATCH] fgrep -> grep -F
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
+Reviewed-by: John Kennedy <john.kennedy@delphix.com>
+Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
+Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
+Closes #13259
+--- a/config/kernel.m4
++++ b/config/kernel.m4
+@@ -394,11 +394,11 @@ AC_DEFUN([ZFS_AC_KERNEL], [
+ utsrelease1=$kernelbuild/include/linux/version.h
+ utsrelease2=$kernelbuild/include/linux/utsrelease.h
+ utsrelease3=$kernelbuild/include/generated/utsrelease.h
+- AS_IF([test -r $utsrelease1 && fgrep -q UTS_RELEASE $utsrelease1], [
++ AS_IF([test -r $utsrelease1 && grep -qF UTS_RELEASE $utsrelease1], [
+ utsrelease=$utsrelease1
+- ], [test -r $utsrelease2 && fgrep -q UTS_RELEASE $utsrelease2], [
++ ], [test -r $utsrelease2 && grep -qF UTS_RELEASE $utsrelease2], [
+ utsrelease=$utsrelease2
+- ], [test -r $utsrelease3 && fgrep -q UTS_RELEASE $utsrelease3], [
++ ], [test -r $utsrelease3 && grep -qF UTS_RELEASE $utsrelease3], [
+ utsrelease=$utsrelease3
+ ])
+
+--- a/config/zfs-build.m4
++++ b/config/zfs-build.m4
+@@ -173,7 +173,7 @@ AC_DEFUN([ZFS_AC_DEBUG_KMEM_TRACKING], [
+ ])
+
+ AC_DEFUN([ZFS_AC_DEBUG_INVARIANTS_DETECT_FREEBSD], [
+- AS_IF([sysctl -n kern.conftxt | fgrep -qx $'options\tINVARIANTS'],
++ AS_IF([sysctl -n kern.conftxt | grep -Fqx $'options\tINVARIANTS'],
+ [enable_invariants="yes"],
+ [enable_invariants="no"])
+ ])
+--- a/tests/zfs-tests/tests/functional/cli_root/zpool_wait/zpool_wait.kshlib
++++ b/tests/zfs-tests/tests/functional/cli_root/zpool_wait/zpool_wait.kshlib
+@@ -120,5 +120,5 @@ function check_while_waiting
+ # Whether any vdev in the given pool is initializing
+ function is_vdev_initializing # pool
+ {
+- zpool status -i "$1" | grep 'initialized, started' >/dev/null
++ zpool status -i "$1" | grep -q 'initialized, started'
+ }
+
diff --git a/sys-fs/zfs/zfs-2.1.6.ebuild b/sys-fs/zfs/zfs-2.1.6.ebuild
new file mode 100644
index 000000000000..554cb0d418dc
--- /dev/null
+++ b/sys-fs/zfs/zfs-2.1.6.ebuild
@@ -0,0 +1,330 @@
+# 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 ~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
+ )
+ 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
+
+ # bug #857228
+ "${FILESDIR}"/2.1.5-dracut-mount.patch
+
+ "${FILESDIR}"/2.1.6-fgrep.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
+}
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-fs/zfs/, sys-fs/zfs/files/
@ 2022-12-08 19:48 Georgy Yakovlev
0 siblings, 0 replies; 22+ messages in thread
From: Georgy Yakovlev @ 2022-12-08 19:48 UTC (permalink / raw
To: gentoo-commits
commit: 1cbfcd27de8a7bf209f791f5ef326c66743a6996
Author: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
AuthorDate: Thu Dec 8 19:30:43 2022 +0000
Commit: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
CommitDate: Thu Dec 8 19:47:32 2022 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1cbfcd27
sys-fs/zfs: drop 2.1.5-r6
Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org>
sys-fs/zfs/Manifest | 3 -
.../2.1.5-dracut-zfs-bootfs-snapshot-fixes.patch | 78 -----
sys-fs/zfs/zfs-2.1.5-r6.ebuild | 336 ---------------------
3 files changed, 417 deletions(-)
diff --git a/sys-fs/zfs/Manifest b/sys-fs/zfs/Manifest
index b1f070f79fb9..5622cc6ec71f 100644
--- a/sys-fs/zfs/Manifest
+++ b/sys-fs/zfs/Manifest
@@ -1,6 +1,3 @@
-DIST zfs-2.1.5-patches.tar.xz 13324 BLAKE2B bfef8abd298cebd54491272b8c1deacace901d9a1acce67cb927bab6447eafd985352fd09f64336aa9d6611bab0e5c761d7973f0a65c408d77bb735a94c60253 SHA512 d2b009664f8eb4f2a8596693011fde578b6eae123c6169e5dfb70bd920c0f987f5177f7b1be008705a421574a8a9bc930f99823785c69e81573f18b0350cb9bd
-DIST zfs-2.1.5.tar.gz 34951632 BLAKE2B c6e3efd9c0cda91654767eaad0eaaa05cd9a5daf1cb0384c9c78b30062f5c29142ac37ab9dbdaf96c91456d11c317d782d3524ade293f03fda983e5992b79e49 SHA512 d9ccf1049cefa9167d25f71fbdca70092cd02368b60f09341e6489fb68dc5f89e87b026b0191f4d81181a8851449124d824a1d959d0e2fb29c8a3d624edc4f03
-DIST zfs-2.1.5.tar.gz.asc 836 BLAKE2B 4a81c266967540850a2cc824e79555ca9d05b2e17e45fa2723893cbd85b55e3d7d791986d6667b7ee1530e7692c03818f15e8b6798393b54989f90801b775786 SHA512 224b0dcf4982c63a8eff0a39d054537e7d023f7c35e154e4d20490b8daf184c076bc8e4de7d2c5af4059f8a802b747e637aad4479cd8d1330cf5b26da2f19c94
DIST zfs-2.1.6.tar.gz 34951282 BLAKE2B 615fe7a2128af77c6c855ea52b6503a78f0c992ea845b02875ac19aa9dd155c5d4110b668da91c463f96a54767ab92e67e5303572337352484c055c0a0ff9e46 SHA512 75639e4cecb281fe73a6e6bd116693f6609ace9b358385450297d175087b10938c2f489a08c657cf0a64250a8db995cbd19abc808a8523cb4c5344b3f76668d6
DIST zfs-2.1.6.tar.gz.asc 836 BLAKE2B d85a79f8824a92c4d0a9682646f79c14871ebe27764289dc87cd9b0a773b7295538780401e70c492a9e4e7097ff2b3e459f7e0a7fdce2e2a59d3f467c41d88b3 SHA512 a83fcc00a8b35f1a1f9b94097d453019333a5351a3d78656dbd9ef732655ee817ccc88068c5ba11b5ff4a285e02250aee4169cc1450025edf547a2329fca7e15
DIST zfs-2.1.7.tar.gz 35092436 BLAKE2B 9c85c3eb72f3bb39bc4fd44aaa80338ca197a4e8183436fee73cd56705abfdaecfaf1b6fbe8dd508ccce707c8259c7ab6e1733b60b17757f0a7ff92d4e52bbad SHA512 6a31eb8fbee90ad1abcfedb9000991761aff7591b11362eb5ec6e0bb4b785a7004a251439409d7bd3f51fc995c859614da6313655337952f70bae07ac8ee0140
diff --git a/sys-fs/zfs/files/2.1.5-dracut-zfs-bootfs-snapshot-fixes.patch b/sys-fs/zfs/files/2.1.5-dracut-zfs-bootfs-snapshot-fixes.patch
deleted file mode 100644
index 05c44faf9d93..000000000000
--- a/sys-fs/zfs/files/2.1.5-dracut-zfs-bootfs-snapshot-fixes.patch
+++ /dev/null
@@ -1,78 +0,0 @@
-From 2d434e8ae4139ce14a1b058839a144bf952e79ea Mon Sep 17 00:00:00 2001
-From: gregory-lee-bartholomew <gregory.lee.bartholomew@gmail.com>
-Date: Wed, 29 Jun 2022 18:56:04 -0500
-Subject: [PATCH] contrib: dracut: zfs-{rollback,snapshot}-bootfs: explicit
- snapname fix
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Due to a missing semicolon on the ExecStart line, it wasn't possible
-to specify the snapshot name on the bootfs.{rollback,snapshot}
-kernel parameters if the boot dataset name was obtained from the
-root=zfs:... kernel parameter.
-
-Reviewed-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
-Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
-Signed-off-by: Gregory Bartholomew <gregory.lee.bartholomew@gmail.com>
-Closes #13585
----
- contrib/dracut/90zfs/zfs-rollback-bootfs.service.in | 2 +-
- contrib/dracut/90zfs/zfs-snapshot-bootfs.service.in | 2 +-
- 2 files changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/contrib/dracut/90zfs/zfs-rollback-bootfs.service.in b/contrib/dracut/90zfs/zfs-rollback-bootfs.service.in
-index b4f5707516c..a29cf3a3dd8 100644
---- a/contrib/dracut/90zfs/zfs-rollback-bootfs.service.in
-+++ b/contrib/dracut/90zfs/zfs-rollback-bootfs.service.in
-@@ -8,5 +8,5 @@ ConditionKernelCommandLine=bootfs.rollback
-
- [Service]
- Type=oneshot
--ExecStart=/bin/sh -c '. /lib/dracut-zfs-lib.sh; decode_root_args || exit; [ "$root" = "zfs:AUTO" ] && root="$BOOTFS" SNAPNAME="$(getarg bootfs.rollback)"; exec @sbindir@/zfs rollback -Rf "$root@${SNAPNAME:-%v}"'
-+ExecStart=/bin/sh -c '. /lib/dracut-zfs-lib.sh; decode_root_args || exit; [ "$root" = "zfs:AUTO" ] && root="$BOOTFS"; SNAPNAME="$(getarg bootfs.rollback)"; exec @sbindir@/zfs rollback -Rf "$root@${SNAPNAME:-%v}"'
- RemainAfterExit=yes
-diff --git a/contrib/dracut/90zfs/zfs-snapshot-bootfs.service.in b/contrib/dracut/90zfs/zfs-snapshot-bootfs.service.in
-index afdba2c9d19..befd163b653 100644
---- a/contrib/dracut/90zfs/zfs-snapshot-bootfs.service.in
-+++ b/contrib/dracut/90zfs/zfs-snapshot-bootfs.service.in
-@@ -8,5 +8,5 @@ ConditionKernelCommandLine=bootfs.snapshot
-
- [Service]
- Type=oneshot
--ExecStart=/bin/sh -c '. /lib/dracut-zfs-lib.sh; decode_root_args || exit; [ "$root" = "zfs:AUTO" ] && root="$BOOTFS" SNAPNAME="$(getarg bootfs.snapshot)"; exec @sbindir@/zfs snapshot "$root@${SNAPNAME:-%v}"'
-+ExecStart=/bin/sh -c '. /lib/dracut-zfs-lib.sh; decode_root_args || exit; [ "$root" = "zfs:AUTO" ] && root="$BOOTFS"; SNAPNAME="$(getarg bootfs.snapshot)"; exec @sbindir@/zfs snapshot "$root@${SNAPNAME:-%v}"'
- RemainAfterExit=yes
-From d22dd77c4d4556373b995121412c4abac02bcf8a Mon Sep 17 00:00:00 2001
-From: gregory-lee-bartholomew <gregory.lee.bartholomew@gmail.com>
-Date: Fri, 12 Aug 2022 16:28:15 -0500
-Subject: [PATCH] contrib: dracut: zfs-snapshot-bootfs: exit status fix
-
-When the zfs-snapshot-bootfs service attempts to create a snapshot
-that already exists, the exit status of the command is non-zero and
-the service reports failed to the systemd service manager. This is a
-common occurrence if bootfs.snapshot is left set on the kernel command
-line and it should not be considered a failure.
-
-This service was originally set to ignore this error by prefixing
-the command with - on the ExecStart line, but the leading - appears
-to have been dropped in #13359.
-
-Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
-Signed-off-by: Gregory Bartholomew <gregory.lee.bartholomew@gmail.com>
-Closes #13769
----
- contrib/dracut/90zfs/zfs-snapshot-bootfs.service.in | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/contrib/dracut/90zfs/zfs-snapshot-bootfs.service.in b/contrib/dracut/90zfs/zfs-snapshot-bootfs.service.in
-index befd163b653..9e73d1a7872 100644
---- a/contrib/dracut/90zfs/zfs-snapshot-bootfs.service.in
-+++ b/contrib/dracut/90zfs/zfs-snapshot-bootfs.service.in
-@@ -8,5 +8,5 @@ ConditionKernelCommandLine=bootfs.snapshot
-
- [Service]
- Type=oneshot
--ExecStart=/bin/sh -c '. /lib/dracut-zfs-lib.sh; decode_root_args || exit; [ "$root" = "zfs:AUTO" ] && root="$BOOTFS"; SNAPNAME="$(getarg bootfs.snapshot)"; exec @sbindir@/zfs snapshot "$root@${SNAPNAME:-%v}"'
-+ExecStart=-/bin/sh -c '. /lib/dracut-zfs-lib.sh; decode_root_args || exit; [ "$root" = "zfs:AUTO" ] && root="$BOOTFS"; SNAPNAME="$(getarg bootfs.snapshot)"; exec @sbindir@/zfs snapshot "$root@${SNAPNAME:-%v}"'
- RemainAfterExit=yes
diff --git a/sys-fs/zfs/zfs-2.1.5-r6.ebuild b/sys-fs/zfs/zfs-2.1.5-r6.ebuild
deleted file mode 100644
index dbfd77a25323..000000000000
--- a/sys-fs/zfs/zfs-2.1.5-r6.ebuild
+++ /dev/null
@@ -1,336 +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+=" https://dev.gentoo.org/~sam/distfiles/sys-fs/zfs/${P}-patches.tar.xz"
- 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="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
- )
- 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}"/${PV}-r2-dracut-non-root.patch
-
- "${FILESDIR}"/2.1.5-dracut-zfs-missing.patch
-
- # bug #857228
- "${FILESDIR}"/${PV}-dracut-mount.patch
-
- # bug #863212, bug #855182
- "${WORKDIR}"/${P}-patches/
-
- # https://github.com/openzfs/zfs/pull/13769
- # https://github.com/openzfs/zfs/pull/13585
- "${FILESDIR}"/2.1.5-dracut-zfs-bootfs-snapshot-fixes.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
-}
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-fs/zfs/, sys-fs/zfs/files/
@ 2022-12-25 0:24 Georgy Yakovlev
0 siblings, 0 replies; 22+ messages in thread
From: Georgy Yakovlev @ 2022-12-25 0:24 UTC (permalink / raw
To: gentoo-commits
commit: 6abcc1c2237833c42306aa3091a5da76abfb3deb
Author: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
AuthorDate: Sat Dec 24 06:42:45 2022 +0000
Commit: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
CommitDate: Sun Dec 25 00:23:11 2022 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6abcc1c2
sys-fs/zfs: revbump 2.1.7, add some systemd patches.
Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org>
.../2.1.7-dracut-include-systemd-overrides.patch | 44 +++
.../files/2.1.7-systemd-zed-restart-always.patch | 27 ++
sys-fs/zfs/zfs-2.1.7-r1.ebuild | 333 +++++++++++++++++++++
3 files changed, 404 insertions(+)
diff --git a/sys-fs/zfs/files/2.1.7-dracut-include-systemd-overrides.patch b/sys-fs/zfs/files/2.1.7-dracut-include-systemd-overrides.patch
new file mode 100644
index 000000000000..2a50dc658876
--- /dev/null
+++ b/sys-fs/zfs/files/2.1.7-dracut-include-systemd-overrides.patch
@@ -0,0 +1,44 @@
+From b10f73f78eb223dd799a87474c537a69113edee1 Mon Sep 17 00:00:00 2001
+From: Vince van Oosten <techhazard@codeforyouand.me>
+Date: Sun, 23 Oct 2022 10:55:46 +0200
+Subject: [PATCH] include systemd overrides to zfs-dracut module
+
+If a user that uses systemd and dracut wants to overide certain
+settings, they typically use `systemctl edit [unit]` or place a file in
+`/etc/systemd/system/[unit].d/override.conf` directly.
+
+The zfs-dracut module did not include those overrides however, so this
+did not have any effect at boot time.
+
+For zfs-import-scan.service and zfs-import-cache.service, overrides are
+now included in the dracut initramfs image.
+
+Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
+Signed-off-by: Vince van Oosten <techhazard@codeforyouand.me>
+Closes #14075
+Closes #14076
+---
+ contrib/dracut/90zfs/module-setup.sh.in | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+diff --git a/contrib/dracut/90zfs/module-setup.sh.in b/contrib/dracut/90zfs/module-setup.sh.in
+index 81d7d2abe49..b16529de905 100755
+--- a/contrib/dracut/90zfs/module-setup.sh.in
++++ b/contrib/dracut/90zfs/module-setup.sh.in
+@@ -86,6 +86,16 @@ install() {
+ "zfs-import-cache.service"; do
+ inst_simple "${systemdsystemunitdir}/${_service}"
+ systemctl -q --root "${initdir}" add-wants zfs-import.target "${_service}"
++
++ # Add user-provided unit overrides
++ # - /etc/systemd/system/zfs-import-{scan,cache}.service
++ # - /etc/systemd/system/zfs-import-{scan,cache}.service.d/overrides.conf
++ # -H ensures they are marked host-only
++ # -o ensures there is no error upon absence of these files
++ inst_multiple -o -H \
++ "${systemdsystemconfdir}/${_service}" \
++ "${systemdsystemconfdir}/${_service}.d/"*.conf
++
+ done
+
+ for _service in \
diff --git a/sys-fs/zfs/files/2.1.7-systemd-zed-restart-always.patch b/sys-fs/zfs/files/2.1.7-systemd-zed-restart-always.patch
new file mode 100644
index 000000000000..2d4b92d5c66a
--- /dev/null
+++ b/sys-fs/zfs/files/2.1.7-systemd-zed-restart-always.patch
@@ -0,0 +1,27 @@
+From f505cd53fd9cb6e6efb1e23a9d77e38bba754695 Mon Sep 17 00:00:00 2001
+From: George Melikov <mail@gmelikov.ru>
+Date: Fri, 16 Dec 2022 01:11:02 +0300
+Subject: [PATCH] systemd: set restart=always for zfs-zed.service
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: George Melikov <mail@gmelikov.ru>
+Co-authored-by: Attila Fülöp <attila@fueloep.org>
+---
+ etc/systemd/system/zfs-zed.service.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/etc/systemd/system/zfs-zed.service.in b/etc/systemd/system/zfs-zed.service.in
+index 73a83e59e51..be2fc67348f 100644
+--- a/etc/systemd/system/zfs-zed.service.in
++++ b/etc/systemd/system/zfs-zed.service.in
+@@ -6,7 +6,7 @@ ConditionPathIsDirectory=/sys/module/zfs
+ [Service]
+ EnvironmentFile=-@initconfdir@/zfs
+ ExecStart=@sbindir@/zed -F
+-Restart=on-abort
++Restart=always
+
+ [Install]
+ Alias=zed.service
diff --git a/sys-fs/zfs/zfs-2.1.7-r1.ebuild b/sys-fs/zfs/zfs-2.1.7-r1.ebuild
new file mode 100644
index 000000000000..7bcc6ae4a771
--- /dev/null
+++ b/sys-fs/zfs/zfs-2.1.7-r1.ebuild
@@ -0,0 +1,333 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+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 ~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 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
+ )
+ 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
+
+ # bug #857228
+ "${FILESDIR}"/2.1.5-dracut-mount.patch
+
+ "${FILESDIR}"/2.1.6-fgrep.patch
+ # systemd fixups
+ "${FILESDIR}"/2.1.7-dracut-include-systemd-overrides.patch
+ "${FILESDIR}"/2.1.7-systemd-zed-restart-always.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
+}
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-fs/zfs/, sys-fs/zfs/files/
@ 2023-07-03 21:03 Sam James
0 siblings, 0 replies; 22+ messages in thread
From: Sam James @ 2023-07-03 21:03 UTC (permalink / raw
To: gentoo-commits
commit: 16b8ce28ee4bcdc9c97eb56a6b9fd4ebe39a3f86
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Jul 3 21:02:12 2023 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Jul 3 21:02:12 2023 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=16b8ce28
sys-fs/zfs: drop 2.1.7-r1, 2.1.10
Signed-off-by: Sam James <sam <AT> gentoo.org>
sys-fs/zfs/Manifest | 4 -
sys-fs/zfs/files/2.1.5-dracut-mount.patch | 29 --
sys-fs/zfs/files/2.1.7-ppc64-ieee128-compat.patch | 217 --------------
sys-fs/zfs/zfs-2.1.10.ebuild | 326 ---------------------
sys-fs/zfs/zfs-2.1.7-r1.ebuild | 337 ----------------------
5 files changed, 913 deletions(-)
diff --git a/sys-fs/zfs/Manifest b/sys-fs/zfs/Manifest
index c2835e7dc8d2..591c3082e3c1 100644
--- a/sys-fs/zfs/Manifest
+++ b/sys-fs/zfs/Manifest
@@ -1,11 +1,7 @@
-DIST zfs-2.1.10.tar.gz 35101856 BLAKE2B 5b1a17d192097f5eab1ef3192217fa34b276b6f344a5114a5411be43208616ac682ae2129ae9da15b4ba6207171ae82140f823041a8067441459d51d994df271 SHA512 3189c6f822c7b6caba650a43f321114ef0bd42b72f566c44ba2400005c61cc3d420149a72520aed5b94494c51c35629a6f645273941774d964f2b61c31c366b2
-DIST zfs-2.1.10.tar.gz.asc 836 BLAKE2B 5a6b408932cb4f39f5a226598527115aa4fa6c105c8b8ad9f236a5909a948150db712bb1f35e4e16a2b7fc7e434530f93c6a6cd2aab40d628b1ded9891694578 SHA512 a45bcce13e7261f90feda51a131fa0c86e2d3c2711286a462072fb120ccbc85719c2bbecb441147a057accffb841ca82df0ba65e1abc0ece9dea8a97cfa31af5
DIST zfs-2.1.11.tar.gz 35100716 BLAKE2B 991ac2347bcd452812e247358e2c44a04a88e700d25878b5b95f86939e6114e1205e7afabfd2a1ea9220947876511374d7224aa587d3d66184838d705f71a89a SHA512 335a543644d2dbba919213a28cc5922bf6a118fc19069db84562ce056449a2d6ca4ba827e54f304ab7d9be22260aa9b255134f1b12e2bc98890f757f35e48bd7
DIST zfs-2.1.11.tar.gz.asc 836 BLAKE2B 0b904d8e1de2dd08a377efc94e32862192d6b9ccb8628af058a71b3ea51f5e483e0cf527906cd222fe9b41b28ca0b30b0efa07d97c480e5546f6e2bed8cbcb01 SHA512 7329e62012ba64288345d8959611de82502ef1da4020e215462fbb2ed209413ec8638d211a31dd6e70be71c998f1da1d8a0d19e5df1f2778782ebb988c94aa41
DIST zfs-2.1.12.tar.gz 35155013 BLAKE2B 652780e6bf7b63f45909110726d53795fada034f6044c8393fa3980e30217ada6931e3c2bb57210719e3c78c16f973f69287b7e2b475601f4ce12d701d9d96ae SHA512 f48493a21883e441cda705fb085353bed033f1620a1d0f93069c345c76cf2c0759a2e6f7a80c47c9398e9878abfe1d90d931fe5ceaf2588770a71491a434631e
DIST zfs-2.1.12.tar.gz.asc 836 BLAKE2B 9215e732981a82254115cd17ec3c9810d4e9e5d5f7bb848778848f911478fc2e4bdbfc563e9835a2e876c26d9e0e8755724a0995baf9ad24e9265123e10cfddf SHA512 69c8b618947fd966eba0bba1c7326ddd463861f051a6cf1d06e23bd6d840fe7503f02adec2c3cbb203fa7b1cced51500f3689c224b653d13d227edd51b5a44f6
-DIST zfs-2.1.7.tar.gz 35092436 BLAKE2B 9c85c3eb72f3bb39bc4fd44aaa80338ca197a4e8183436fee73cd56705abfdaecfaf1b6fbe8dd508ccce707c8259c7ab6e1733b60b17757f0a7ff92d4e52bbad SHA512 6a31eb8fbee90ad1abcfedb9000991761aff7591b11362eb5ec6e0bb4b785a7004a251439409d7bd3f51fc995c859614da6313655337952f70bae07ac8ee0140
-DIST zfs-2.1.7.tar.gz.asc 836 BLAKE2B 648fb818860a1cecc2ec42f23102e0466c038bfe48f5feca1ab58afb9cb439a0fe51cb89941f63a05c14d3b6f95c64dd3910c9a06b9cac14c467b963c65c2948 SHA512 4d4fef707bdfc37a82eb79aa0a21c71e30779bcf2ac54fe2df45a03e3302e2a45cb9f4e4ff0122b892b1e608a9f09e86d1334e0c7d9bf681780505f6e1439f9f
DIST zfs-2.1.9.tar.gz 35106538 BLAKE2B d7553cc162687531b254089e29e2e15e2eb6b362cecd8e70c24bbb5dbffbde82036ad2d416f4caeceaa324bee8a2e59d9e3cd8a3bf55a2e3c0718c7af9562812 SHA512 a3c410abe911be7d3d66af8ad7023a810eb4ae3284001e544c3a34275eb17a4916a7c094936a2628a590007c007eea84673efa9f3201fd9f24c499fd5ed3ed75
DIST zfs-2.1.9.tar.gz.asc 836 BLAKE2B 1e76525eab338398dd6ff7539ea4e7d18847d0f40e9093d813ec93fce5fa4c16e09f91c0805ba01a29190f673d131f85442c13035166d6f2d007a7e42dc15486 SHA512 35e1213fcac0458e1243355beba021dfefef455df2b341fbc4b10047f9ed4747df84e319d10ffe4bbcd572fbf014019e0dec200eb4e7d3c116fb805369182cb0
DIST zfs-2.2.0-rc1.tar.gz 33656024 BLAKE2B 1157db51d2736905b787a2627e599d7ac527be281edc9a76da0f746ae39483df3b4b8b31e5af504b9b06cd99a3776cd16670a8774d0e68f50014b09971209437 SHA512 22285ea1b34d4dbed311e3855449cad51c6f6ddb29c906f106fa6f4816d8e478f073b29fbc4d9636bf783558e041b20d2f2c5c0c33f65153d3b21da6cd9b7689
diff --git a/sys-fs/zfs/files/2.1.5-dracut-mount.patch b/sys-fs/zfs/files/2.1.5-dracut-mount.patch
deleted file mode 100644
index 758f4b3a3e99..000000000000
--- a/sys-fs/zfs/files/2.1.5-dracut-mount.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-https://github.com/openzfs/zfs/commit/07f2793e869196fcbcd5057d9ada377674262fe3
-https://bugs.gentoo.org/857228
-
-From: Brian Behlendorf <behlendorf1@llnl.gov>
-Date: Wed, 29 Jun 2022 15:33:38 -0700
-Subject: [PATCH] dracut: fix typo in mount-zfs.sh.in
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Format the `zpool get` command correctly. The -o option must
-be followed by "all" or the requested field name.
-
-Reviewed-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
-Reviewed-by: George Melikov <mail@gmelikov.ru>
-Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
-Closes #13602
---- a/contrib/dracut/90zfs/mount-zfs.sh.in
-+++ b/contrib/dracut/90zfs/mount-zfs.sh.in
-@@ -82,7 +82,7 @@ ZFS_DATASET="${ZFS_DATASET:-${root}}"
- ZFS_POOL="${ZFS_DATASET%%/*}"
-
-
--if ! zpool get -Ho name "${ZFS_POOL}" > /dev/null 2>&1; then
-+if ! zpool get -Ho value name "${ZFS_POOL}" > /dev/null 2>&1; then
- info "ZFS: Importing pool ${ZFS_POOL}..."
- # shellcheck disable=SC2086
- if ! zpool import -N ${ZPOOL_IMPORT_OPTS} "${ZFS_POOL}"; then
-
diff --git a/sys-fs/zfs/files/2.1.7-ppc64-ieee128-compat.patch b/sys-fs/zfs/files/2.1.7-ppc64-ieee128-compat.patch
deleted file mode 100644
index 5613cb8ca9d1..000000000000
--- a/sys-fs/zfs/files/2.1.7-ppc64-ieee128-compat.patch
+++ /dev/null
@@ -1,217 +0,0 @@
-From 8324d738fdb3096bd97336476bb399e6c312289a Mon Sep 17 00:00:00 2001
-From: Richard Yao <richard.yao@alumni.stonybrook.edu>
-Date: Thu, 12 Jan 2023 11:06:57 -0500
-Subject: [PATCH] Linux ppc64le ieee128 compat: Do not redefine __asm on
- external headers
-
-There is an external assembly declaration extension in GNU C that glibc
-uses when building with ieee128 floating point support on ppc64le.
-Marking that as volatile makes no sense, so the build breaks.
-
-It does not make sense to only mark this as volatile on Linux, since if
-do not want the compiler reordering things on Linux, we do not want the
-compiler reordering things on any other platform, so we stop treating
-Linux specially and just manually inline the CPP macro so that we can
-eliminate it. This should fix the build on ppc64le.
-
-Closes openzfs/zfs#14308
-Signed-off-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
----
- .../vdev_raidz_math_powerpc_altivec_common.h | 44 +++++++++----------
- 1 file changed, 20 insertions(+), 24 deletions(-)
-
-diff --git a/module/zfs/vdev_raidz_math_powerpc_altivec_common.h b/module/zfs/vdev_raidz_math_powerpc_altivec_common.h
-index 46d42c5e241..f76eb47a9c6 100644
---- a/module/zfs/vdev_raidz_math_powerpc_altivec_common.h
-+++ b/module/zfs/vdev_raidz_math_powerpc_altivec_common.h
-@@ -26,10 +26,6 @@
- #include <sys/types.h>
- #include <sys/simd.h>
-
--#ifdef __linux__
--#define __asm __asm__ __volatile__
--#endif
--
- #define _REG_CNT(_0, _1, _2, _3, _4, _5, _6, _7, N, ...) N
- #define REG_CNT(r...) _REG_CNT(r, 8, 7, 6, 5, 4, 3, 2, 1)
-
-@@ -142,7 +138,7 @@ typedef struct v {
- { \
- switch (REG_CNT(r)) { \
- case 8: \
-- __asm( \
-+ __asm__ __volatile__( \
- "lvx 21,0,%[SRC0]\n" \
- "lvx 20,0,%[SRC1]\n" \
- "lvx 19,0,%[SRC2]\n" \
-@@ -172,7 +168,7 @@ typedef struct v {
- : "v18", "v19", "v20", "v21"); \
- break; \
- case 4: \
-- __asm( \
-+ __asm__ __volatile__( \
- "lvx 21,0,%[SRC0]\n" \
- "lvx 20,0,%[SRC1]\n" \
- "lvx 19,0,%[SRC2]\n" \
-@@ -189,7 +185,7 @@ typedef struct v {
- : "v18", "v19", "v20", "v21"); \
- break; \
- case 2: \
-- __asm( \
-+ __asm__ __volatile__( \
- "lvx 21,0,%[SRC0]\n" \
- "lvx 20,0,%[SRC1]\n" \
- "vxor " VR0(r) "," VR0(r) ",21\n" \
-@@ -208,7 +204,7 @@ typedef struct v {
- { \
- switch (REG_CNT(r)) { \
- case 8: \
-- __asm( \
-+ __asm__ __volatile__( \
- "vxor " VR4(r) "," VR4(r) "," VR0(r) "\n" \
- "vxor " VR5(r) "," VR5(r) "," VR1(r) "\n" \
- "vxor " VR6(r) "," VR6(r) "," VR2(r) "\n" \
-@@ -217,7 +213,7 @@ typedef struct v {
- : RVR0(r), RVR1(r), RVR2(r), RVR3(r)); \
- break; \
- case 4: \
-- __asm( \
-+ __asm__ __volatile__( \
- "vxor " VR2(r) "," VR2(r) "," VR0(r) "\n" \
- "vxor " VR3(r) "," VR3(r) "," VR1(r) "\n" \
- : UVR2(r), UVR3(r) \
-@@ -232,7 +228,7 @@ typedef struct v {
- { \
- switch (REG_CNT(r)) { \
- case 8: \
-- __asm( \
-+ __asm__ __volatile__( \
- "vxor " VR0(r) "," VR0(r) "," VR0(r) "\n" \
- "vxor " VR1(r) "," VR1(r) "," VR1(r) "\n" \
- "vxor " VR2(r) "," VR2(r) "," VR2(r) "\n" \
-@@ -245,7 +241,7 @@ typedef struct v {
- WVR4(r), WVR5(r), WVR6(r), WVR7(r)); \
- break; \
- case 4: \
-- __asm( \
-+ __asm__ __volatile__( \
- "vxor " VR0(r) "," VR0(r) "," VR0(r) "\n" \
- "vxor " VR1(r) "," VR1(r) "," VR1(r) "\n" \
- "vxor " VR2(r) "," VR2(r) "," VR2(r) "\n" \
-@@ -253,7 +249,7 @@ typedef struct v {
- : WVR0(r), WVR1(r), WVR2(r), WVR3(r)); \
- break; \
- case 2: \
-- __asm( \
-+ __asm__ __volatile__( \
- "vxor " VR0(r) "," VR0(r) "," VR0(r) "\n" \
- "vxor " VR1(r) "," VR1(r) "," VR1(r) "\n" \
- : WVR0(r), WVR1(r)); \
-@@ -267,7 +263,7 @@ typedef struct v {
- { \
- switch (REG_CNT(r)) { \
- case 8: \
-- __asm( \
-+ __asm__ __volatile__( \
- "vor " VR4(r) "," VR0(r) "," VR0(r) "\n" \
- "vor " VR5(r) "," VR1(r) "," VR1(r) "\n" \
- "vor " VR6(r) "," VR2(r) "," VR2(r) "\n" \
-@@ -276,7 +272,7 @@ typedef struct v {
- : RVR0(r), RVR1(r), RVR2(r), RVR3(r)); \
- break; \
- case 4: \
-- __asm( \
-+ __asm__ __volatile__( \
- "vor " VR2(r) "," VR0(r) "," VR0(r) "\n" \
- "vor " VR3(r) "," VR1(r) "," VR1(r) "\n" \
- : WVR2(r), WVR3(r) \
-@@ -291,7 +287,7 @@ typedef struct v {
- { \
- switch (REG_CNT(r)) { \
- case 8: \
-- __asm( \
-+ __asm__ __volatile__( \
- "lvx " VR0(r) " ,0,%[SRC0]\n" \
- "lvx " VR1(r) " ,0,%[SRC1]\n" \
- "lvx " VR2(r) " ,0,%[SRC2]\n" \
-@@ -312,7 +308,7 @@ typedef struct v {
- [SRC7] "r" ((OFFSET(src, 112)))); \
- break; \
- case 4: \
-- __asm( \
-+ __asm__ __volatile__( \
- "lvx " VR0(r) " ,0,%[SRC0]\n" \
- "lvx " VR1(r) " ,0,%[SRC1]\n" \
- "lvx " VR2(r) " ,0,%[SRC2]\n" \
-@@ -324,7 +320,7 @@ typedef struct v {
- [SRC3] "r" ((OFFSET(src, 48)))); \
- break; \
- case 2: \
-- __asm( \
-+ __asm__ __volatile__( \
- "lvx " VR0(r) " ,0,%[SRC0]\n" \
- "lvx " VR1(r) " ,0,%[SRC1]\n" \
- : WVR0(r), WVR1(r) \
-@@ -340,7 +336,7 @@ typedef struct v {
- { \
- switch (REG_CNT(r)) { \
- case 8: \
-- __asm( \
-+ __asm__ __volatile__( \
- "stvx " VR0(r) " ,0,%[DST0]\n" \
- "stvx " VR1(r) " ,0,%[DST1]\n" \
- "stvx " VR2(r) " ,0,%[DST2]\n" \
-@@ -362,7 +358,7 @@ typedef struct v {
- : "memory"); \
- break; \
- case 4: \
-- __asm( \
-+ __asm__ __volatile__( \
- "stvx " VR0(r) " ,0,%[DST0]\n" \
- "stvx " VR1(r) " ,0,%[DST1]\n" \
- "stvx " VR2(r) " ,0,%[DST2]\n" \
-@@ -375,7 +371,7 @@ typedef struct v {
- : "memory"); \
- break; \
- case 2: \
-- __asm( \
-+ __asm__ __volatile__( \
- "stvx " VR0(r) " ,0,%[DST0]\n" \
- "stvx " VR1(r) " ,0,%[DST1]\n" \
- : : [DST0] "r" ((OFFSET(dst, 0))), \
-@@ -400,7 +396,7 @@ typedef struct v {
-
- #define MUL2_SETUP() \
- { \
-- __asm( \
-+ __asm__ __volatile__( \
- "vspltisb " VR(16) ",14\n" \
- "vspltisb " VR(17) ",15\n" \
- "vaddubm " VR(16) "," VR(17) "," VR(16) "\n" \
-@@ -412,7 +408,7 @@ typedef struct v {
- { \
- switch (REG_CNT(r)) { \
- case 4: \
-- __asm( \
-+ __asm__ __volatile__( \
- "vcmpgtsb 19," VR(17) "," VR0(r) "\n" \
- "vcmpgtsb 18," VR(17) "," VR1(r) "\n" \
- "vcmpgtsb 21," VR(17) "," VR2(r) "\n" \
-@@ -434,7 +430,7 @@ typedef struct v {
- : "v18", "v19", "v20", "v21"); \
- break; \
- case 2: \
-- __asm( \
-+ __asm__ __volatile__( \
- "vcmpgtsb 19," VR(17) "," VR0(r) "\n" \
- "vcmpgtsb 18," VR(17) "," VR1(r) "\n" \
- "vand 19,19," VR(16) "\n" \
-@@ -478,7 +474,7 @@ typedef struct v {
- { \
- switch (REG_CNT(r)) { \
- case 2: \
-- __asm( \
-+ __asm__ __volatile__( \
- /* lts for upper part */ \
- "vspltisb 15,15\n" \
- "lvx 10,0,%[lt0]\n" \
diff --git a/sys-fs/zfs/zfs-2.1.10.ebuild b/sys-fs/zfs/zfs-2.1.10.ebuild
deleted file mode 100644
index e70bffe327e0..000000000000
--- a/sys-fs/zfs/zfs-2.1.10.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/sys-fs/zfs/zfs-2.1.7-r1.ebuild b/sys-fs/zfs/zfs-2.1.7-r1.ebuild
deleted file mode 100644
index bff5bc82cb80..000000000000
--- a/sys-fs/zfs/zfs-2.1.7-r1.ebuild
+++ /dev/null
@@ -1,337 +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..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 ~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
-
- # bug #857228
- "${FILESDIR}"/2.1.5-dracut-mount.patch
-
- "${FILESDIR}"/2.1.6-fgrep.patch
- # systemd fixups
- "${FILESDIR}"/2.1.7-dracut-include-systemd-overrides.patch
- "${FILESDIR}"/2.1.7-systemd-zed-restart-always.patch
-
- # https://github.com/openzfs/zfs/issues/14308
- "${FILESDIR}"/2.1.7-ppc64-ieee128-compat.patch
-)
-
-pkg_pretend() {
- use rootfs || return 0
-
- if has_version virtual/dist-kernel && ! use dist-kernel; then
- ewarn "You have virtual/dist-kernel installed, but"
- ewarn "USE=\"dist-kernel\" is not enabled for ${CATEGORY}/${PN}"
- ewarn "It's recommended to globally enable dist-kernel USE flag"
- ewarn "to auto-trigger initrd rebuilds with kernel updates"
- fi
-}
-
-pkg_setup() {
- 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
-}
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-fs/zfs/, sys-fs/zfs/files/
@ 2023-12-16 10:06 Sam James
0 siblings, 0 replies; 22+ messages in thread
From: Sam James @ 2023-12-16 10:06 UTC (permalink / raw
To: gentoo-commits
commit: 1558e62d2db5a3c783628fcca2c4cd9cd3cb4144
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sat Dec 16 10:05:32 2023 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Dec 16 10:06:07 2023 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1558e62d
sys-fs/zfs: fix runtime breakage w/o CONFIG_USER_NS
Prompted by https://forums.gentoo.org/viewtopic-p-8810010.html.
Bug: https://github.com/openzfs/zfs/issues/15241
Signed-off-by: Sam James <sam <AT> gentoo.org>
sys-fs/zfs/files/2.2.2-no-USER_NS.patch | 39 ++++
sys-fs/zfs/zfs-2.2.2-r1.ebuild | 307 ++++++++++++++++++++++++++++++++
2 files changed, 346 insertions(+)
diff --git a/sys-fs/zfs/files/2.2.2-no-USER_NS.patch b/sys-fs/zfs/files/2.2.2-no-USER_NS.patch
new file mode 100644
index 000000000000..b132db9d4bf6
--- /dev/null
+++ b/sys-fs/zfs/files/2.2.2-no-USER_NS.patch
@@ -0,0 +1,39 @@
+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 <github@ilkka.kapsi.fi>
+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 <github@ilkka.kapsi.fi>
+--- 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/sys-fs/zfs/zfs-2.2.2-r1.ebuild b/sys-fs/zfs/zfs-2.2.2-r1.ebuild
new file mode 100644
index 000000000000..086ac897e35e
--- /dev/null
+++ b/sys-fs/zfs/zfs-2.2.2-r1.ebuild
@@ -0,0 +1,307 @@
+# 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=/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
+ "${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
+}
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-fs/zfs/, sys-fs/zfs/files/
@ 2024-02-23 6:33 Sam James
0 siblings, 0 replies; 22+ messages in thread
From: Sam James @ 2024-02-23 6:33 UTC (permalink / raw
To: gentoo-commits
commit: bda8ae7ff2bba3e341c010c67009aa403985656d
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Feb 23 05:04:44 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Feb 23 06:33:04 2024 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bda8ae7f
sys-fs/zfs: add 2.2.3
Bug: https://bugs.gentoo.org/925290
Closes: https://bugs.gentoo.org/925281
Signed-off-by: Sam James <sam <AT> gentoo.org>
sys-fs/zfs/Manifest | 2 ++
sys-fs/zfs/files/2.2.3-musl.patch | 34 ++++++++++++++++++++++++
sys-fs/zfs/{zfs-9999.ebuild => zfs-2.2.3.ebuild} | 4 ++-
sys-fs/zfs/zfs-9999.ebuild | 2 +-
4 files changed, 40 insertions(+), 2 deletions(-)
diff --git a/sys-fs/zfs/Manifest b/sys-fs/zfs/Manifest
index 4591d964e4e4..15f09f09fd54 100644
--- a/sys-fs/zfs/Manifest
+++ b/sys-fs/zfs/Manifest
@@ -2,3 +2,5 @@ DIST zfs-2.1.14.tar.gz 35167471 BLAKE2B a7b22eaf05e4fbf416ebe4d7b884c515942fc937
DIST zfs-2.1.14.tar.gz.asc 836 BLAKE2B f01bc58bf6c3d367c494ed4ea9f3fb1141f3aafdbf4f913b9e0d60d31557076d5ae0e25ca93b013f5fd85e21ba5ae9f61e1a03af54bb0c743869c0ce3d5519df SHA512 be0f386cce952b4047dc2448e356078668e8d4392802dd3bb1a426741f15f4d9fb689cd1cb09972bdbc9fe2e4e782ec4b4754fe811c5657bc1f5308bd38e3926
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
diff --git a/sys-fs/zfs/files/2.2.3-musl.patch b/sys-fs/zfs/files/2.2.3-musl.patch
new file mode 100644
index 000000000000..41ce14633667
--- /dev/null
+++ b/sys-fs/zfs/files/2.2.3-musl.patch
@@ -0,0 +1,34 @@
+https://github.com/openzfs/zfs/pull/15925
+
+From 3fa84afb3f4334b6609f0dcb141e5d10095e585b Mon Sep 17 00:00:00 2001
+From: Sam James <sam@gentoo.org>
+Date: Fri, 23 Feb 2024 05:12:09 +0000
+Subject: [PATCH] tests: use <fcntl.h> instead of <sys/fcntl.h>
+
+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 <sys/fcntl.h> to <fcntl.h> [-Werror=cpp]
+ 1 | #warning redirecting incorrect #include <sys/fcntl.h> to <fcntl.h>
+ | ^~~~~~~
+```
+
+There's some other use of <sys/fcntl.h> in the codebase, but they're on the
+module side, where libspl seems to handle it all, so not touching that.
+
+Bug: https://bugs.gentoo.org/925235
+Signed-off-by: Sam James <sam@gentoo.org>
+--- a/tests/zfs-tests/cmd/getversion.c
++++ b/tests/zfs-tests/cmd/getversion.c
+@@ -19,9 +19,9 @@
+ */
+
+ #include <sys/ioctl.h>
+-#include <sys/fcntl.h>
+ #include <linux/fs.h>
+ #include <err.h>
++#include <fcntl.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <unistd.h>
+
diff --git a/sys-fs/zfs/zfs-9999.ebuild b/sys-fs/zfs/zfs-2.2.3.ebuild
similarity index 98%
copy from sys-fs/zfs/zfs-9999.ebuild
copy to sys-fs/zfs/zfs-2.2.3.ebuild
index 3f4ecf0f9b94..71e2889ab794 100644
--- a/sys-fs/zfs/zfs-9999.ebuild
+++ b/sys-fs/zfs/zfs-2.2.3.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() {
diff --git a/sys-fs/zfs/zfs-9999.ebuild b/sys-fs/zfs/zfs-9999.ebuild
index 3f4ecf0f9b94..7b38a676beca 100644
--- a/sys-fs/zfs/zfs-9999.ebuild
+++ b/sys-fs/zfs/zfs-9999.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
^ permalink raw reply related [flat|nested] 22+ messages in thread
end of thread, other threads:[~2024-02-23 6:33 UTC | newest]
Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-08 19:48 [gentoo-commits] repo/gentoo:master commit in: sys-fs/zfs/, sys-fs/zfs/files/ Georgy Yakovlev
-- strict thread matches above, loose matches on Subject: below --
2024-02-23 6:33 Sam James
2023-12-16 10:06 Sam James
2023-07-03 21:03 Sam James
2022-12-25 0:24 Georgy Yakovlev
2022-10-04 5:07 Sam James
2022-09-17 22:16 Georgy Yakovlev
2022-09-16 23:09 Georgy Yakovlev
2022-07-01 7:34 Sam James
2022-06-07 18:56 Georgy Yakovlev
2021-12-26 22:35 Georgy Yakovlev
2021-12-23 22:28 Georgy Yakovlev
2021-12-16 2:51 Georgy Yakovlev
2021-11-07 23:59 Georgy Yakovlev
2021-06-04 2:14 Georgy Yakovlev
2020-11-03 20:07 Georgy Yakovlev
2020-09-25 20:28 Georgy Yakovlev
2020-05-26 23:58 Georgy Yakovlev
2019-11-26 20:32 Georgy Yakovlev
2019-09-27 19:16 Georgy Yakovlev
2019-03-31 3:53 Georgy Yakovlev
2018-02-14 20:39 Matt Thode
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox