* [gentoo-commits] repo/gentoo:master commit in: sys-fs/zfs/files/, sys-fs/zfs/
@ 2019-11-26 20:32 Georgy Yakovlev
0 siblings, 0 replies; 11+ messages in thread
From: Georgy Yakovlev @ 2019-11-26 20:32 UTC (permalink / raw
To: gentoo-commits
commit: 0d44f61a3dcb6e943edb307c7196cd0f7044af79
Author: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
AuthorDate: Tue Nov 26 20:13:37 2019 +0000
Commit: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
CommitDate: Tue Nov 26 20:30:41 2019 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0d44f61a
sys-fs/zfs: unkeyworded revbump of 0.7.13, udev timeout patch
Bug: https://bugs.gentoo.org/627320
Package-Manager: Portage-2.3.79, Repoman-2.3.18
Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org>
.../0.7.13-ZPOOL_IMPORT_UDEV_TIMEOUT_MS.patch | 70 +++++++
sys-fs/zfs/zfs-0.7.13-r2.ebuild | 220 +++++++++++++++++++++
2 files changed, 290 insertions(+)
diff --git a/sys-fs/zfs/files/0.7.13-ZPOOL_IMPORT_UDEV_TIMEOUT_MS.patch b/sys-fs/zfs/files/0.7.13-ZPOOL_IMPORT_UDEV_TIMEOUT_MS.patch
new file mode 100644
index 00000000000..922e5951bdf
--- /dev/null
+++ b/sys-fs/zfs/files/0.7.13-ZPOOL_IMPORT_UDEV_TIMEOUT_MS.patch
@@ -0,0 +1,70 @@
+From a0767672aac01f41516550e3808ff72da893102f Mon Sep 17 00:00:00 2001
+From: Georgy Yakovlev <gyakovlev@gentoo.org>
+Date: Tue, 26 Nov 2019 12:07:36 -0800
+Subject: [PATCH] backport udev timeout patch
+
+https://github.com/zfsonlinux/zfs/commit/803884217f9b9b5fb235d7c5e78a809d271f6387
+---
+ lib/libzfs/libzfs_import.c | 11 ++++++++++-
+ man/man8/zpool.8 | 6 ++++++
+ 2 files changed, 16 insertions(+), 1 deletion(-)
+
+diff --git a/lib/libzfs/libzfs_import.c b/lib/libzfs/libzfs_import.c
+index 9dbf207..cd08806 100644
+--- a/lib/libzfs/libzfs_import.c
++++ b/lib/libzfs/libzfs_import.c
+@@ -53,6 +53,7 @@
+ #endif
+ #include <stddef.h>
+ #include <stdlib.h>
++#include <stdio.h>
+ #include <string.h>
+ #include <sys/stat.h>
+ #include <unistd.h>
+@@ -1594,17 +1595,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;
++ 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 < 0) {
++ 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/man/man8/zpool.8 b/man/man8/zpool.8
+index 46e531e..10a19b5 100644
+--- a/man/man8/zpool.8
++++ b/man/man8/zpool.8
+@@ -2291,6 +2291,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
+--
+2.24.0
+
diff --git a/sys-fs/zfs/zfs-0.7.13-r2.ebuild b/sys-fs/zfs/zfs-0.7.13-r2.ebuild
new file mode 100644
index 00000000000..928b6e1c532
--- /dev/null
+++ b/sys-fs/zfs/zfs-0.7.13-r2.ebuild
@@ -0,0 +1,220 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+PYTHON_COMPAT=( python{2_7,3_5,3_6} )
+
+if [ ${PV} == "9999" ] ; then
+ inherit git-r3 linux-mod
+ AUTOTOOLS_AUTORECONF="1"
+ EGIT_REPO_URI="git://github.com/zfsonlinux/${PN}.git"
+else
+ SRC_URI="https://github.com/zfsonlinux/${PN}/releases/download/${P}/${P}.tar.gz"
+ KEYWORDS=""
+fi
+
+inherit autotools-utils bash-completion-r1 flag-o-matic linux-info python-single-r1 systemd toolchain-funcs udev usr-ldscript
+
+DESCRIPTION="Userland utilities for ZFS Linux kernel module"
+HOMEPAGE="https://zfsonlinux.org/"
+
+LICENSE="BSD-2 CDDL MIT"
+SLOT="0"
+IUSE="custom-cflags debug kernel-builtin +rootfs systemd test-suite static-libs"
+RESTRICT="test"
+
+COMMON_DEPEND="
+ net-libs/libtirpc
+ sys-apps/util-linux[static-libs?]
+ sys-libs/zlib[static-libs(+)?]
+ virtual/awk
+"
+DEPEND="${COMMON_DEPEND}
+ virtual/pkgconfig
+"
+
+RDEPEND="${COMMON_DEPEND}
+ ${PYTHON_DEPS}
+ !=sys-apps/grep-2.13*
+ !kernel-builtin? ( =sys-fs/zfs-kmod-${PV}* )
+ !sys-fs/zfs-fuse
+ !prefix? ( virtual/udev )
+ test-suite? (
+ sys-apps/util-linux
+ sys-devel/bc
+ sys-block/parted
+ sys-fs/lsscsi
+ sys-fs/mdadm
+ sys-process/procps
+ virtual/modutils
+ )
+ 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
+ )
+ sys-fs/udev-init-scripts
+"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+AT_M4DIR="config"
+AUTOTOOLS_IN_SOURCE_BUILD="1"
+
+PATCHES=( "${FILESDIR}/0.7.13-ZPOOL_IMPORT_UDEV_TIMEOUT_MS.patch" )
+
+pkg_setup() {
+ python-single-r1_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."
+ eerror "Please enable it:"
+ eerror " CONFIG_BLK_DEV_LOOP=y"
+ eerror "in /usr/src/linux/.config or"
+ eerror " Device Drivers --->"
+ eerror " Block devices --->"
+ eerror " [ ] Loopback device support"
+ fi
+ fi
+ fi
+ fi
+}
+
+src_prepare() {
+ # 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 || die
+
+ autotools-utils_src_prepare
+}
+
+src_configure() {
+ use custom-cflags || strip-flags
+ local myeconfargs=(
+ --bindir="${EPREFIX}/bin"
+ --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 systemd)
+ )
+ 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
+}
+
+src_install() {
+ autotools-utils_src_install
+ 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
+ bashcomp_alias zfs zpool
+
+ exeinto /usr/libexec
+ doexe "${T}/zfs-init.sh"
+ systemd_dounit "${T}/zfs.service"
+
+ # enforce selected python implementation
+ python_fix_shebang "${ED}/bin"
+}
+
+pkg_postinst() {
+ 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
+ einfo 'The zfs boot script has been split into the zfs-import,'
+ einfo 'zfs-mount and zfs-share scripts.'
+ einfo
+ einfo 'You had the zfs script in your boot runlevel. For your'
+ einfo 'convenience, it has been automatically removed and the three'
+ einfo 'scripts that replace it have been configured to start.'
+ 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"
+ 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."
+ fi
+
+ 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
+ einfo 'You had the zed script in your default runlevel. For your'
+ 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"
+ else
+ [ -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
+ einfo "The zfs-shutdown script is obsolete. Removing it from runlevel."
+ rm "${EROOT}etc/runlevels/shutdown/zfs-shutdown"
+ fi
+
+ systemd_reenable zfs-zed.service
+ systemd_reenable zfs-import-cache.service
+ systemd_reenable zfs-import-scan.service
+ systemd_reenable zfs-mount.service
+ 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
+ remove_moduledb
+ fi
+}
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-fs/zfs/files/, sys-fs/zfs/
@ 2020-02-07 5:37 Georgy Yakovlev
0 siblings, 0 replies; 11+ messages in thread
From: Georgy Yakovlev @ 2020-02-07 5:37 UTC (permalink / raw
To: gentoo-commits
commit: 2a8fc3d832d03e405a2dcfae98fd246012b63c7a
Author: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
AuthorDate: Fri Feb 7 04:37:58 2020 +0000
Commit: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
CommitDate: Fri Feb 7 05:11:19 2020 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2a8fc3d8
sys-fs/zfs: revbump 0.8.3, drop py2, gcc10 compat, fixes
Bug: https://bugs.gentoo.org/693678
Bug: https://bugs.gentoo.org/706534
Package-Manager: Portage-2.3.87, Repoman-2.3.20
Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org>
sys-fs/zfs/files/0.8.3-fno-common.patch | 83 ++++++++++++++++++++++
sys-fs/zfs/files/0.8.3-zfs-functions.patch | 51 +++++++++++++
.../zfs/{zfs-0.8.3.ebuild => zfs-0.8.3-r1.ebuild} | 19 +++--
3 files changed, 146 insertions(+), 7 deletions(-)
diff --git a/sys-fs/zfs/files/0.8.3-fno-common.patch b/sys-fs/zfs/files/0.8.3-fno-common.patch
new file mode 100644
index 00000000000..3b09d8bbc59
--- /dev/null
+++ b/sys-fs/zfs/files/0.8.3-fno-common.patch
@@ -0,0 +1,83 @@
+From af09c050e95bebbaeca52156218f3f91e8c9951a Mon Sep 17 00:00:00 2001
+From: Romain Dolbeau <romain.dolbeau@european-processor-initiative.eu>
+Date: Thu, 6 Feb 2020 18:25:29 +0100
+Subject: [PATCH] Fix static data to link with -fno-common
+
+-fno-common is the new default in GCC 10, replacing -fcommon in
+GCC <= 9, so static data must only be allocated once.
+
+Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
+Signed-off-by: Romain Dolbeau <romain.dolbeau@european-processor-initiative.eu>
+Closes #9943
+---
+ cmd/zfs/zfs_util.h | 2 +-
+ cmd/zpool/zpool_main.c | 2 ++
+ cmd/zpool/zpool_util.h | 2 +-
+ lib/libshare/smb.c | 2 ++
+ lib/libshare/smb.h | 2 +-
+ 5 files changed, 7 insertions(+), 3 deletions(-)
+
+diff --git a/cmd/zfs/zfs_util.h b/cmd/zfs/zfs_util.h
+index 3ddff9e22d7..a56af59adb1 100644
+--- a/cmd/zfs/zfs_util.h
++++ b/cmd/zfs/zfs_util.h
+@@ -33,7 +33,7 @@ extern "C" {
+
+ void * safe_malloc(size_t size);
+ void nomem(void);
+-libzfs_handle_t *g_zfs;
++extern libzfs_handle_t *g_zfs;
+
+ #ifdef __cplusplus
+ }
+diff --git a/cmd/zpool/zpool_main.c b/cmd/zpool/zpool_main.c
+index ae5e8a370fc..ff4f44d4652 100644
+--- a/cmd/zpool/zpool_main.c
++++ b/cmd/zpool/zpool_main.c
+@@ -76,6 +76,8 @@
+
+ #include "statcommon.h"
+
++libzfs_handle_t *g_zfs;
++
+ static int zpool_do_create(int, char **);
+ static int zpool_do_destroy(int, char **);
+
+diff --git a/cmd/zpool/zpool_util.h b/cmd/zpool/zpool_util.h
+index ce760df723c..1f23f61aaa4 100644
+--- a/cmd/zpool/zpool_util.h
++++ b/cmd/zpool/zpool_util.h
+@@ -79,7 +79,7 @@ void pool_list_free(zpool_list_t *);
+ int pool_list_count(zpool_list_t *);
+ void pool_list_remove(zpool_list_t *, zpool_handle_t *);
+
+-libzfs_handle_t *g_zfs;
++extern libzfs_handle_t *g_zfs;
+
+
+ typedef struct vdev_cmd_data
+diff --git a/lib/libshare/smb.c b/lib/libshare/smb.c
+index a95607ee032..f567f7c49d7 100644
+--- a/lib/libshare/smb.c
++++ b/lib/libshare/smb.c
+@@ -65,6 +65,8 @@ static boolean_t smb_available(void);
+
+ static sa_fstype_t *smb_fstype;
+
++smb_share_t *smb_shares;
++
+ /*
+ * Retrieve the list of SMB shares.
+ */
+diff --git a/lib/libshare/smb.h b/lib/libshare/smb.h
+index 7a0c0fd162d..8ea44677f9a 100644
+--- a/lib/libshare/smb.h
++++ b/lib/libshare/smb.h
+@@ -44,6 +44,6 @@ typedef struct smb_share_s {
+ struct smb_share_s *next;
+ } smb_share_t;
+
+-smb_share_t *smb_shares;
++extern smb_share_t *smb_shares;
+
+ void libshare_smb_init(void);
diff --git a/sys-fs/zfs/files/0.8.3-zfs-functions.patch b/sys-fs/zfs/files/0.8.3-zfs-functions.patch
new file mode 100644
index 00000000000..9cce3e1c1a7
--- /dev/null
+++ b/sys-fs/zfs/files/0.8.3-zfs-functions.patch
@@ -0,0 +1,51 @@
+From 00478e1b5141f8b6ceaf14c173382d1aa11878b9 Mon Sep 17 00:00:00 2001
+From: Tony Hutter <hutter2@llnl.gov>
+Date: Thu, 6 Feb 2020 09:28:20 -0800
+Subject: [PATCH] Fix zfs-functions packaging bug
+
+This fixes a bug where the generated zfs-functions was being included along
+with original zfs-functions.in in the make dist tarball. This caused an
+unfortunate series of events during build/packaging that resulted in the
+RPM-installed /etc/zfs/zfs-functions listing the paths as:
+
+ZFS="/usr/local/sbin/zfs"
+ZED="/usr/local/sbin/zed"
+ZPOOL="/usr/local/sbin/zpool"
+
+When they should have been:
+
+ZFS="/sbin/zfs"
+ZED="/sbin/zed"
+ZPOOL="/sbin/zpool"
+
+This affects init.d (non-systemd) distros like CentOS 6.
+
+Fixes: #9443
+
+Signed-off-by: Tony Hutter <hutter2@llnl.gov>
+---
+ contrib/initramfs/Makefile.am | 7 ++-----
+ 1 file changed, 2 insertions(+), 5 deletions(-)
+
+diff --git a/contrib/initramfs/Makefile.am b/contrib/initramfs/Makefile.am
+index 52bdeb2afe5..4e52e8ea5e9 100644
+--- a/contrib/initramfs/Makefile.am
++++ b/contrib/initramfs/Makefile.am
+@@ -6,15 +6,12 @@ initrd_SCRIPTS = \
+ SUBDIRS = hooks scripts
+
+ EXTRA_DIST = \
+- $(top_srcdir)/etc/init.d/zfs \
+- $(top_srcdir)/etc/init.d/zfs-functions \
++ $(top_srcdir)/etc/init.d/zfs.in \
++ $(top_srcdir)/etc/init.d/zfs-functions.in \
+ $(top_srcdir)/contrib/initramfs/conf.d/zfs \
+ $(top_srcdir)/contrib/initramfs/conf-hooks.d/zfs \
+ $(top_srcdir)/contrib/initramfs/README.initramfs.markdown
+
+-$(top_srcdir)/etc/init.d/zfs $(top_srcdir)/etc/init.d/zfs-functions:
+- $(MAKE) -C $(top_srcdir)/etc/init.d zfs zfs-functions
+-
+ install-initrdSCRIPTS: $(EXTRA_DIST)
+ for d in conf.d conf-hooks.d scripts/local-top; do \
+ $(MKDIR_P) $(DESTDIR)$(initrddir)/$$d; \
diff --git a/sys-fs/zfs/zfs-0.8.3.ebuild b/sys-fs/zfs/zfs-0.8.3-r1.ebuild
similarity index 92%
rename from sys-fs/zfs/zfs-0.8.3.ebuild
rename to sys-fs/zfs/zfs-0.8.3-r1.ebuild
index 9ac492e30ce..df59d685573 100644
--- a/sys-fs/zfs/zfs-0.8.3.ebuild
+++ b/sys-fs/zfs/zfs-0.8.3-r1.ebuild
@@ -4,15 +4,15 @@
EAPI=7
DISTUTILS_OPTIONAL=1
-PYTHON_COMPAT=( python{2_7,3_{6,7}} )
+PYTHON_COMPAT=( python3_{6,7} )
-inherit bash-completion-r1 flag-o-matic linux-info linux-mod distutils-r1 systemd toolchain-funcs udev usr-ldscript
+inherit 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://zfsonlinux.org/"
if [[ ${PV} == "9999" ]] ; then
- inherit autotools git-r3
+ inherit autotools git-r3 linux-mod
EGIT_REPO_URI="https://github.com/zfsonlinux/zfs.git"
else
SRC_URI="https://github.com/zfsonlinux/${PN}/releases/download/${P}/${P}.tar.gz"
@@ -68,7 +68,11 @@ REQUIRED_USE="${PYTHON_REQUIRED_USE}"
RESTRICT="test"
-PATCHES=( "${FILESDIR}/bash-completion-sudo.patch" )
+PATCHES=(
+ "${FILESDIR}/bash-completion-sudo.patch"
+ "${FILESDIR}/${PV}-fno-common.patch"
+ "${FILESDIR}/${PV}-zfs-functions.patch"
+)
pkg_setup() {
if use kernel_linux && use test-suite; then
@@ -111,6 +115,10 @@ src_prepare() {
# 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
+
+ # needed to get files regenerated
+ # https://github.com/zfsonlinux/zfs/issues/9443
+ rm -v etc/init.d/zfs{,-functions} || die
}
src_configure() {
@@ -138,9 +146,6 @@ src_configure() {
)
econf "${myconf[@]}"
-
- # temp hack for https://github.com/zfsonlinux/zfs/issues/9443
- sed -i "s@/usr/local/@"${EPREFIX}/"@g" etc/init.d/zfs-functions || die
}
src_compile() {
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-fs/zfs/files/, sys-fs/zfs/
@ 2020-03-30 21:08 Georgy Yakovlev
0 siblings, 0 replies; 11+ messages in thread
From: Georgy Yakovlev @ 2020-03-30 21:08 UTC (permalink / raw
To: gentoo-commits
commit: 3467e746deb5cbf5ae4c07a82a91c600712304bc
Author: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
AuthorDate: Mon Mar 30 19:14:34 2020 +0000
Commit: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
CommitDate: Mon Mar 30 21:07:45 2020 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3467e746
sys-fs/zfs: drop 0.8.2
Closes: https://bugs.gentoo.org/706534
Package-Manager: Portage-2.3.96, Repoman-2.3.22
Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org>
sys-fs/zfs/Manifest | 1 -
.../files/0.8.2-ZPOOL_IMPORT_UDEV_TIMEOUT_MS.patch | 93 ---------
sys-fs/zfs/zfs-0.8.2-r2.ebuild | 224 ---------------------
3 files changed, 318 deletions(-)
diff --git a/sys-fs/zfs/Manifest b/sys-fs/zfs/Manifest
index 84cfb1d2a3e..5de6d1f5c77 100644
--- a/sys-fs/zfs/Manifest
+++ b/sys-fs/zfs/Manifest
@@ -1,3 +1,2 @@
DIST zfs-0.7.13.tar.gz 6614047 BLAKE2B c59c46287715779eb04d69333b0a417fa9865eb0d61c642b043188c4c97d4eed369f76a48327326ed1d4dd608ff95d91d20d26c80ed0b120a8fcd5f83cea638f SHA512 457d8f110b68c9656194cd3738b216d5d807d680e5cfc6ed1f3cf5ebde67860476387c6b862ba3ba7f972d8945075963e6c325543ab84468e3eff5dbce68476e
-DIST zfs-0.8.2.tar.gz 8738111 BLAKE2B 5c15f6664ca70f0deeb5b9e32f2bcff68f9821529e5203ff18612ce88473fee9af369354c442f3db7882d301cf17c805c9635b05bfd3460833ed8e5ff8004dd0 SHA512 1424b1a030b814f812b5da422100669db5b8c3ccae14c2fdd62a5e0df28e7255247fe5ca99c95a14f08c92cc1574c22dd132093e4a1dd81e38c95b10cc5e2496
DIST zfs-0.8.3.tar.gz 8779385 BLAKE2B 8b51b9d5b61543566bc7839d8452fdf9358442155e95f93a011531338824bbd4fc8879500e276b02d5d49d504a046728ecc0c6154f69eb7b47180b9bb0e46958 SHA512 aded632e6b04180560d4f2ff283260016e883dadae4e7fda9070b7113dee948099cb7a7b183f1c8139654389a2610fb9cc6f997acdc846040e605125cf016010
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
deleted file mode 100644
index 00dda6de55c..00000000000
--- a/sys-fs/zfs/files/0.8.2-ZPOOL_IMPORT_UDEV_TIMEOUT_MS.patch
+++ /dev/null
@@ -1,93 +0,0 @@
-From 803884217f9b9b5fb235d7c5e78a809d271f6387 Mon Sep 17 00:00:00 2001
-From: Richard Yao <ryao@gentoo.org>
-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
-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 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 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/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 811eae397c9..e51004edc68 100644
---- a/lib/libzutil/zutil_import.c
-+++ b/lib/libzutil/zutil_import.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>
-@@ -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;
-+ 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 < 0) {
-+ 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 = 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-r2.ebuild b/sys-fs/zfs/zfs-0.8.2-r2.ebuild
deleted file mode 100644
index c744e615de4..00000000000
--- a/sys-fs/zfs/zfs-0.8.2-r2.ebuild
+++ /dev/null
@@ -1,224 +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} )
-
-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
- 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-python="${EPYTHON}"
- --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_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] 11+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-fs/zfs/files/, sys-fs/zfs/
@ 2020-10-07 0:00 Georgy Yakovlev
0 siblings, 0 replies; 11+ messages in thread
From: Georgy Yakovlev @ 2020-10-07 0:00 UTC (permalink / raw
To: gentoo-commits
commit: 7446901e6d95c269957690ad0ded4a901bb2174f
Author: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
AuthorDate: Tue Oct 6 23:55:12 2020 +0000
Commit: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
CommitDate: Tue Oct 6 23:57:21 2020 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7446901e
sys-fs/zfs: drop old rc
Package-Manager: Portage-3.0.8, Repoman-3.0.1
Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org>
sys-fs/zfs/Manifest | 1 -
.../files/2.0.0_rc2-exports-d-permissions.patch | 189 -----------------
sys-fs/zfs/zfs-2.0.0_rc2-r1.ebuild | 232 ---------------------
3 files changed, 422 deletions(-)
diff --git a/sys-fs/zfs/Manifest b/sys-fs/zfs/Manifest
index e722910db54..238f7e1e23d 100644
--- a/sys-fs/zfs/Manifest
+++ b/sys-fs/zfs/Manifest
@@ -1,4 +1,3 @@
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-rc2.tar.gz 12854085 BLAKE2B 73cabd565c11eef1bebbc391f8c4ba18acd1610f98f1b8afb507bc844f4b6a64ba32d9727e634c7f26c48fe365a841bf071513df234b9b7a87e954610a6d7f3b SHA512 14b17d06124890efef15b3b073e103c9faeecaea761779fff9a8420e3ab72fa611df9875fa766a323d69646e9025f8b19f918ded4c6705af116cf9f14eea4f40
DIST zfs-2.0.0-rc3.tar.gz 12860212 BLAKE2B bd29ceb17938180ffda9a26cfee97f4b9b42752cd7a3bf5d72705d94967d219889cc84a71d4c0f59aaf718d596011ecdbf07000788aa39a424087eb7cf62a944 SHA512 c09bebb1d1b19079b51305eea1b3d1a428a46bf1301afc9dfa20871ac670d94dc9f7f9127384b2db501fd909f22a16fad0c1b7383eb9ce31a7c0e696e66a097f
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
deleted file mode 100644
index 4acaf465a7b..00000000000
--- a/sys-fs/zfs/files/2.0.0_rc2-exports-d-permissions.patch
+++ /dev/null
@@ -1,189 +0,0 @@
-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-r1.ebuild b/sys-fs/zfs/zfs-2.0.0_rc2-r1.ebuild
deleted file mode 100644
index 1f9d81f16e6..00000000000
--- a/sys-fs/zfs/zfs-2.0.0_rc2-r1.ebuild
+++ /dev/null
@@ -1,232 +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 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"
-SLOT="0"
-IUSE="custom-cflags debug kernel-builtin libressl 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(-)?]
- libressl? ( dev-libs/libressl:0=[static-libs?] )
- !libressl? ( 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}/${PV}-exports-d-permissions.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-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 uutil nvpair zpool zfs zfs_core
-
- 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] 11+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-fs/zfs/files/, sys-fs/zfs/
@ 2021-11-08 6:09 Sam James
0 siblings, 0 replies; 11+ messages in thread
From: Sam James @ 2021-11-08 6:09 UTC (permalink / raw
To: gentoo-commits
commit: fd5b037d61a1c58a59ad989992321c4aae578e90
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Nov 8 06:08:44 2021 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Nov 8 06:08:58 2021 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fd5b037d
sys-fs/zfs: yank SEEK_HOLE patch for now
Preliminary investigation suggests this patch (and earlier iterations)
may introduce regressions. Let's yank it for now while we continue
the investigation with upstream.
Bug: https://bugs.gentoo.org/815469
See: https://github.com/openzfs/zfs/issues/11900
Signed-off-by: Sam James <sam <AT> gentoo.org>
sys-fs/zfs/files/2.1.1-fix-lseek-mmap.patch | 594 ---------------------
.../{zfs-2.1.1-r4.ebuild => zfs-2.1.1-r5.ebuild} | 1 -
2 files changed, 595 deletions(-)
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
deleted file mode 100644
index 2c3a66a97bf..00000000000
--- a/sys-fs/zfs/files/2.1.1-fix-lseek-mmap.patch
+++ /dev/null
@@ -1,594 +0,0 @@
-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-r4.ebuild b/sys-fs/zfs/zfs-2.1.1-r5.ebuild
similarity index 99%
rename from sys-fs/zfs/zfs-2.1.1-r4.ebuild
rename to sys-fs/zfs/zfs-2.1.1-r5.ebuild
index 1a9c32e479e..2f2920a75e0 100644
--- a/sys-fs/zfs/zfs-2.1.1-r4.ebuild
+++ b/sys-fs/zfs/zfs-2.1.1-r5.ebuild
@@ -104,7 +104,6 @@ RESTRICT="test"
PATCHES=(
"${FILESDIR}/2.0.4-scrub-timers.patch"
- "${FILESDIR}/2.1.1-fix-lseek-mmap.patch"
)
pkg_pretend() {
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-fs/zfs/files/, sys-fs/zfs/
@ 2021-12-21 2:07 Georgy Yakovlev
0 siblings, 0 replies; 11+ messages in thread
From: Georgy Yakovlev @ 2021-12-21 2:07 UTC (permalink / raw
To: gentoo-commits
commit: 64eb52417158266e183780b3f1f92743bac97e64
Author: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
AuthorDate: Tue Dec 21 02:05:37 2021 +0000
Commit: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
CommitDate: Tue Dec 21 02:06:30 2021 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=64eb5241
sys-fs/zfs: fix test build failure on musl in 2.1.2
PR: https://github.com/openzfs/zfs/pull/12891
Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org>
sys-fs/zfs/files/2.1.2-musl-tests.patch | 58 +++++++++++++++++++++++++++++++++
sys-fs/zfs/zfs-2.1.2-r1.ebuild | 1 +
2 files changed, 59 insertions(+)
diff --git a/sys-fs/zfs/files/2.1.2-musl-tests.patch b/sys-fs/zfs/files/2.1.2-musl-tests.patch
new file mode 100644
index 000000000000..3d2c563f8c51
--- /dev/null
+++ b/sys-fs/zfs/files/2.1.2-musl-tests.patch
@@ -0,0 +1,58 @@
+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/zfs-2.1.2-r1.ebuild b/sys-fs/zfs/zfs-2.1.2-r1.ebuild
index c274ee49ba4b..a5b0419a7ed8 100644
--- a/sys-fs/zfs/zfs-2.1.2-r1.ebuild
+++ b/sys-fs/zfs/zfs-2.1.2-r1.ebuild
@@ -104,6 +104,7 @@ 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() {
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-fs/zfs/files/, sys-fs/zfs/
@ 2022-06-30 10:37 Sam James
0 siblings, 0 replies; 11+ messages in thread
From: Sam James @ 2022-06-30 10:37 UTC (permalink / raw
To: gentoo-commits
commit: cfd4165530beb09e3e75d91fe56b2dcce910aadc
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Thu Jun 30 01:55:16 2022 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Jun 30 10:37:49 2022 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cfd41655
sys-fs/zfs: backport build fixes and non-root dracut boot fix
Closes: https://bugs.gentoo.org/855182
Closes: https://bugs.gentoo.org/854333
Signed-off-by: Sam James <sam <AT> gentoo.org>
sys-fs/zfs/files/2.1.5-build-issues.patch | 74 +++++++
sys-fs/zfs/files/2.1.5-dracut-non-root.patch | 33 +++
sys-fs/zfs/zfs-2.1.5-r1.ebuild | 310 +++++++++++++++++++++++++++
3 files changed, 417 insertions(+)
diff --git a/sys-fs/zfs/files/2.1.5-build-issues.patch b/sys-fs/zfs/files/2.1.5-build-issues.patch
new file mode 100644
index 000000000000..cca6561b16f7
--- /dev/null
+++ b/sys-fs/zfs/files/2.1.5-build-issues.patch
@@ -0,0 +1,74 @@
+https://github.com/openzfs/zfs/commit/a6e8113fed8a508ffda13cf1c4d8da99a4e8133a
+https://github.com/openzfs/zfs/commit/60e389ca10085acfa7cd35f79ab4465d968a942f
+Cherry-picked from https://github.com/openzfs/zfs/pull/13575
+
+https://bugs.gentoo.org/855182
+--- a/config/always-compiler-options.m4
++++ b/config/always-compiler-options.m4
+@@ -205,6 +205,29 @@ AC_DEFUN([ZFS_AC_CONFIG_ALWAYS_CC_NO_OMIT_FRAME_POINTER], [
+ AC_SUBST([NO_OMIT_FRAME_POINTER])
+ ])
+
++dnl #
++dnl # Check if cc supports -Winfinite-recursion option.
++dnl #
++AC_DEFUN([ZFS_AC_CONFIG_ALWAYS_CC_INFINITE_RECURSION], [
++ AC_MSG_CHECKING([whether $CC supports -Winfinite-recursion])
++
++ saved_flags="$CFLAGS"
++ CFLAGS="$CFLAGS -Werror -Winfinite-recursion"
++
++ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [])], [
++ INFINITE_RECURSION=-Winfinite-recursion
++ AC_DEFINE([HAVE_INFINITE_RECURSION], 1,
++ [Define if compiler supports -Winfinite-recursion])
++ AC_MSG_RESULT([yes])
++ ], [
++ INFINITE_RECURSION=
++ AC_MSG_RESULT([no])
++ ])
++
++ CFLAGS="$saved_flags"
++ AC_SUBST([INFINITE_RECURSION])
++])
++
+ dnl #
+ dnl # Check if cc supports -fno-ipa-sra option.
+ dnl #
+--- a/config/zfs-build.m4
++++ b/config/zfs-build.m4
+@@ -211,6 +211,7 @@ AC_DEFUN([ZFS_AC_CONFIG_ALWAYS], [
+
+ ZFS_AC_CONFIG_ALWAYS_CC_NO_UNUSED_BUT_SET_VARIABLE
+ ZFS_AC_CONFIG_ALWAYS_CC_NO_BOOL_COMPARE
++ ZFS_AC_CONFIG_ALWAYS_CC_INFINITE_RECURSION
+ ZFS_AC_CONFIG_ALWAYS_CC_IMPLICIT_FALLTHROUGH
+ ZFS_AC_CONFIG_ALWAYS_CC_FRAME_LARGER_THAN
+ ZFS_AC_CONFIG_ALWAYS_CC_NO_FORMAT_TRUNCATION
+--- a/module/lua/ldo.c
++++ b/module/lua/ldo.c
+@@ -168,6 +168,13 @@ static void seterrorobj (lua_State *L, int errcode, StkId oldtop) {
+ L->top = oldtop + 1;
+ }
+
++/*
++ * Silence infinite recursion warning which was added to -Wall in gcc 12.1
++ */
++#if defined(HAVE_INFINITE_RECURSION)
++#pragma GCC diagnostic push
++#pragma GCC diagnostic ignored "-Winfinite-recursion"
++#endif
+
+ l_noret luaD_throw (lua_State *L, int errcode) {
+ if (L->errorJmp) { /* thread has an error handler? */
+@@ -190,6 +197,10 @@ l_noret luaD_throw (lua_State *L, int errcode) {
+ }
+ }
+
++#if defined(HAVE_INFINITE_RECURSION)
++#pragma GCC diagnostic pop
++#endif
++
+
+ int luaD_rawrunprotected (lua_State *L, Pfunc f, void *ud) {
+ unsigned short oldnCcalls = L->nCcalls;
diff --git a/sys-fs/zfs/files/2.1.5-dracut-non-root.patch b/sys-fs/zfs/files/2.1.5-dracut-non-root.patch
new file mode 100644
index 000000000000..6d1caf92cd2d
--- /dev/null
+++ b/sys-fs/zfs/files/2.1.5-dracut-non-root.patch
@@ -0,0 +1,33 @@
+https://github.com/openzfs/zfs/pull/13589
+https://bugs.gentoo.org/854333
+
+From ef9d996669cc2ec596d4e90753b89b32a3f0ce59 Mon Sep 17 00:00:00 2001
+From: "Andrew J. Hesford" <ajh@sideband.org>
+Date: Fri, 24 Jun 2022 11:05:53 -0400
+Subject: [PATCH] Dracut module: fix parsing of root= kernel command-line
+ argument
+
+Some Dracut modules may read the `root=` kernel command-line argument
+and rewrite it; in particular, `rootfs-block` installs a command-line
+hook that to canonicalize arguments that specify block devices. If the
+`zfs` module is added to an initramfs (which it is, by default, as long
+as the core ZFS utilities are available) on a system that does not use a
+ZFS root filesystem, the `zfs` module will overwrite the `root` shell
+variable with the contents of the kernel command-line in the process of
+determining if it should control mounting the root. This breaks the
+initramfs. To solve this problem, only parse the kernel command-line
+directly if the `root` shell variable is empty; otherwise, rely on the
+parsing (and possible rewriting) done by other modules.
+
+Signed-off-by: Andrew J. Hesford <ajh@sideband.org>
+--- a/contrib/dracut/90zfs/zfs-lib.sh.in
++++ b/contrib/dracut/90zfs/zfs-lib.sh.in
+@@ -88,7 +88,7 @@ decode_root_args() {
+ return
+ fi
+
+- root=$(getarg root=)
++ [ -n "$root" ] || root=$(getarg root=)
+ rootfstype=$(getarg rootfstype=)
+
+ # shellcheck disable=SC2249
diff --git a/sys-fs/zfs/zfs-2.1.5-r1.ebuild b/sys-fs/zfs/zfs-2.1.5-r1.ebuild
new file mode 100644
index 000000000000..7f0466ea0e20
--- /dev/null
+++ b/sys-fs/zfs/zfs-2.1.5-r1.ebuild
@@ -0,0 +1,310 @@
+# 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
+ !<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=(
+ # bug #855182
+ "${FILESDIR}"/${PV}-build-issues.patch
+ # bug #854333
+ "${FILESDIR}"/${PV}-dracut-non-root.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() {
+ 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] 11+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-fs/zfs/files/, sys-fs/zfs/
@ 2022-07-10 20:46 Sam James
0 siblings, 0 replies; 11+ messages in thread
From: Sam James @ 2022-07-10 20:46 UTC (permalink / raw
To: gentoo-commits
commit: ca35a02bc3a81c4e2ce525251f8260eba5721e0f
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sun Jul 10 20:46:23 2022 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Jul 10 20:46:23 2022 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ca35a02b
sys-fs/zfs: backport another dracut boot patch
Closes: https://bugs.gentoo.org/857228
Signed-off-by: Sam James <sam <AT> gentoo.org>
sys-fs/zfs/files/2.1.5-dracut-mount.patch | 29 +++
sys-fs/zfs/zfs-2.1.5-r4.ebuild | 321 ++++++++++++++++++++++++++++++
2 files changed, 350 insertions(+)
diff --git a/sys-fs/zfs/files/2.1.5-dracut-mount.patch b/sys-fs/zfs/files/2.1.5-dracut-mount.patch
new file mode 100644
index 000000000000..758f4b3a3e99
--- /dev/null
+++ b/sys-fs/zfs/files/2.1.5-dracut-mount.patch
@@ -0,0 +1,29 @@
+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/zfs-2.1.5-r4.ebuild b/sys-fs/zfs/zfs-2.1.5-r4.ebuild
new file mode 100644
index 000000000000..2cf49118a4f5
--- /dev/null
+++ b/sys-fs/zfs/zfs-2.1.5-r4.ebuild
@@ -0,0 +1,321 @@
+# 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
+ !<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=(
+ # bug #855182
+ "${FILESDIR}"/${PV}-build-issues.patch
+ # bug #854333
+ "${FILESDIR}"/${PV}-r2-dracut-non-root.patch
+ #
+ "${FILESDIR}"/2.1.5-dracut-zfs-missing.patch
+ # bug #857228
+ "${FILESDIR}"/${PV}-dracut-mount.patch
+)
+
+pkg_pretend() {
+ use rootfs || return 0
+
+ if has_version virtual/dist-kernel && ! use dist-kernel; then
+ ewarn "You have virtual/dist-kernel installed, but"
+ ewarn "USE=\"dist-kernel\" is not enabled for ${CATEGORY}/${PN}"
+ ewarn "It's recommended to globally enable dist-kernel USE flag"
+ ewarn "to auto-trigger initrd rebuilds with kernel updates"
+ fi
+}
+
+pkg_setup() {
+ if use kernel_linux; then
+ linux-info_pkg_setup
+
+ if ! linux_config_exists; then
+ ewarn "Cannot check the linux kernel configuration."
+ else
+ if use test-suite; then
+ if linux_chkconfig_present BLK_DEV_LOOP; then
+ eerror "The ZFS test suite requires loop device support enabled."
+ eerror "Please enable it:"
+ eerror " CONFIG_BLK_DEV_LOOP=y"
+ eerror "in /usr/src/linux/.config or"
+ eerror " Device Drivers --->"
+ eerror " Block devices --->"
+ eerror " [X] Loopback device support"
+ fi
+ fi
+ fi
+ fi
+}
+
+libsoversion_check() {
+ local bugurl libzfs_sover
+ bugurl="https://bugs.gentoo.org/enter_bug.cgi?form_name=enter_bug&product=Gentoo+Linux&component=Current+packages"
+
+ libzfs_sover="$(grep 'libzfs_la_LDFLAGS += -version-info' lib/libzfs/Makefile.am \
+ | grep -Eo '[0-9]+:[0-9]+:[0-9]+')"
+ libzfs_sover="${libzfs_sover%%:*}"
+
+ if [[ ${libzfs_sover} -ne $(ver_cut 2 ${SLOT}) ]]; then
+ echo
+ eerror "BUG BUG BUG BUG BUG BUG BUG BUG"
+ eerror "ebuild subslot does not match libzfs soversion!"
+ eerror "libzfs soversion: ${libzfs_sover}"
+ eerror "ebuild value: $(ver_cut 2 ${SLOT})"
+ eerror "This is a bug in the ebuild, please use the following URL to report it"
+ eerror "${bugurl}&short_desc=${CATEGORY}%2F${P}+update+subslot"
+ echo
+ # we want to abort for releases, but just print a warning for live ebuild
+ # to keep package installable
+ [[ ${PV} == "9999" ]] || die
+ fi
+}
+
+src_prepare() {
+ default
+ libsoversion_check
+
+ # Run unconditionally (bug #792627)
+ eautoreconf
+
+ if [[ ${PV} != "9999" ]]; then
+ # Set revision number
+ sed -i "s/\(Release:\)\(.*\)1/\1\2${PR}-gentoo/" META || die "Could not set Gentoo release"
+ fi
+
+ if use python; then
+ pushd contrib/pyzfs >/dev/null || die
+ distutils-r1_src_prepare
+ popd >/dev/null || die
+ fi
+
+ # prevent errors showing up on zfs-mount stop, #647688
+ # openrc will unmount all filesystems anyway.
+ sed -i "/^ZFS_UNMOUNT=/ s/yes/no/" "etc/default/zfs.in" || die
+}
+
+src_configure() {
+ use custom-cflags || strip-flags
+ use minimal || python_setup
+
+ # All the same issue:
+ # Segfaults w/ GCC 12 and 'zfs send'
+ # bug #856373
+ # https://github.com/openzfs/zfs/issues/13620
+ # https://github.com/openzfs/zfs/issues/13605
+ append-flags -fno-tree-vectorize
+
+ local myconf=(
+ --bindir="${EPREFIX}/bin"
+ --enable-shared
+ --enable-sysvinit
+ --localstatedir="${EPREFIX}/var"
+ --sbindir="${EPREFIX}/sbin"
+ --with-config=user
+ --with-dracutdir="${EPREFIX}/usr/lib/dracut"
+ --with-linux="${KV_DIR}"
+ --with-linux-obj="${KV_OUT_DIR}"
+ --with-udevdir="$(get_udevdir)"
+ --with-pamconfigsdir="${EPREFIX}/unwanted_files"
+ --with-pammoduledir="$(getpam_mod_dir)"
+ --with-systemdunitdir="$(systemd_get_systemunitdir)"
+ --with-systemdpresetdir="$(systemd_get_systempresetdir)"
+ --with-vendor=gentoo
+ # Building zfs-mount-generator.c on musl breaks as strndupa
+ # isn't available. But systemd doesn't support musl anyway, so
+ # just disable building it.
+ $(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] 11+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-fs/zfs/files/, sys-fs/zfs/
@ 2023-01-13 4:33 Georgy Yakovlev
0 siblings, 0 replies; 11+ messages in thread
From: Georgy Yakovlev @ 2023-01-13 4:33 UTC (permalink / raw
To: gentoo-commits
commit: 00f3356bdcdda9d3b00d7fa3209a05790335179c
Author: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
AuthorDate: Fri Jan 13 04:27:21 2023 +0000
Commit: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
CommitDate: Fri Jan 13 04:31:33 2023 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=00f3356b
sys-fs/zfs: add ieee-long-double patch to 2.1.7-r1
Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org>
sys-fs/zfs/files/2.1.7-ppc64-ieee128-compat.patch | 217 ++++++++++++++++++++++
sys-fs/zfs/zfs-2.1.7-r1.ebuild | 5 +-
2 files changed, 221 insertions(+), 1 deletion(-)
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
new file mode 100644
index 000000000000..5613cb8ca9d1
--- /dev/null
+++ b/sys-fs/zfs/files/2.1.7-ppc64-ieee128-compat.patch
@@ -0,0 +1,217 @@
+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.7-r1.ebuild b/sys-fs/zfs/zfs-2.1.7-r1.ebuild
index 219f1c6e1d88..efb93b4236f3 100644
--- a/sys-fs/zfs/zfs-2.1.7-r1.ebuild
+++ b/sys-fs/zfs/zfs-2.1.7-r1.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2022 Gentoo Authors
+# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
@@ -113,6 +113,9 @@ PATCHES=(
# 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() {
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-fs/zfs/files/, sys-fs/zfs/
@ 2023-10-08 1:04 Sam James
0 siblings, 0 replies; 11+ messages in thread
From: Sam James @ 2023-10-08 1:04 UTC (permalink / raw
To: gentoo-commits
commit: ac3b8bc87c1494bfdb18e40cd5fa876a5e8168b4
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sun Oct 8 00:53:10 2023 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Oct 8 01:04:02 2023 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ac3b8bc8
sys-fs/zfs: add 2.2.0_rc5
Signed-off-by: Sam James <sam <AT> gentoo.org>
sys-fs/zfs/Manifest | 2 ++
.../zfs/files/2.2.0_rc5-bash-completion-path.patch | 24 ++++++++++++++++++++++
.../zfs/{zfs-9999.ebuild => zfs-2.2.0_rc5.ebuild} | 1 +
sys-fs/zfs/zfs-9999.ebuild | 1 +
4 files changed, 28 insertions(+)
diff --git a/sys-fs/zfs/Manifest b/sys-fs/zfs/Manifest
index 8d72400873aa..c032b3e43f79 100644
--- a/sys-fs/zfs/Manifest
+++ b/sys-fs/zfs/Manifest
@@ -10,3 +10,5 @@ DIST zfs-2.2.0-rc3.tar.gz 33666688 BLAKE2B 37c47bcbf34d9238f42bbc80e2b0712a9e64a
DIST zfs-2.2.0-rc3.tar.gz.asc 195 BLAKE2B cbbced9255a3b6a5ec0190806b73e62533600975dad073b82532fb1e488bf81b8d056c7a4f59b9e212a9825ec4900d6f2e2c0141b3d4d58577fe36d9bc3c15b9 SHA512 45424815e39b33107805da737ecfcb95c761ab774143e72449dacfe98a851ddf52c7cb08a587548159305b4c4fe51a0fb9cfbf30fdadf093518eb4c8ce49e12c
DIST zfs-2.2.0-rc4.tar.gz 33660298 BLAKE2B c8179cf7a8caaa07e6898d9169fa3f825d070d1e7f26552797ebaeb4a6cdddd122072903f93113b4bf817acc47911d6c32b4f4801f09382b7a6376369086f329 SHA512 ae389b24616d1800cff2df1e06b22d0fc507ccd573cda47cd84c7aa3271a5e3b78668a135224e8d0747eb63104544fc284d814073e4061908553faf3d2b0f075
DIST zfs-2.2.0-rc4.tar.gz.asc 195 BLAKE2B 496f5163235f743e64da3862245a8dfabd95d06071183514ab11f7dd7792b32823b73864888d7a2fbf2dee16ca374772b07139287a1e66416dbd82e062b25ba9 SHA512 6a0ce528e0b15b4c1b8f02db9aaa9ce61bdf9a7c1c88336b91042802535618fd95aa4f59211bef0d1d79f833d8ae2030c4be8ee5a2244b13ec3f684aa1cdee4e
+DIST zfs-2.2.0-rc5.tar.gz 33674415 BLAKE2B 89187462b9f544779e331fe06a84763918bfedcccb3ecfe28cfef00f6ee30690e5a1983bc670a73f0b9db809f4aa23b59255b66907b5ca2c9e236b471b9a8a63 SHA512 68610a68526c79486b7cd8ca28abd0d8dd42814c37a82ea2be05b0044998ef36c5aaa3fc7598c1a8426b73116351a9b00c8ffdab3e5ae3aecc4954fb9378c422
+DIST zfs-2.2.0-rc5.tar.gz.asc 195 BLAKE2B 59c204bb0eb2140a82cb4066e5bb2b66c1331aabf65c807869fbab89a177b0e09aa8b23bdbc46bb18785db554405a085841605885b3931119d1e3eb0335e257a SHA512 83101a1e350db4276296f9ed52a556ea36f4238c272ab565926ec69dca495c645a7b41164baee39768123c5982459d10b54819ba9d9ac6c37fe851952db29887
diff --git a/sys-fs/zfs/files/2.2.0_rc5-bash-completion-path.patch b/sys-fs/zfs/files/2.2.0_rc5-bash-completion-path.patch
new file mode 100644
index 000000000000..abfc80e07ff8
--- /dev/null
+++ b/sys-fs/zfs/files/2.2.0_rc5-bash-completion-path.patch
@@ -0,0 +1,24 @@
+https://github.com/openzfs/zfs/pull/15372
+
+From bb6ce273b2e04b609cc3d75d60afc3105251bc1f Mon Sep 17 00:00:00 2001
+From: Sam James <sam@gentoo.org>
+Date: Sun, 8 Oct 2023 02:00:29 +0100
+Subject: [PATCH] config/zfs-build.m4: add Gentoo's bash-completion path
+
+Followup e69ade32e116e72d03068c03799924c3f1a15c95 by adding Gentoo's
+bash completion path.
+
+We should probably consider using/honouring the standard --with-bashcompletiondir
+autoconf option as well, but that's something to do later.
+
+Signed-off-by: Sam James <sam@gentoo.org>
+--- a/config/zfs-build.m4
++++ b/config/zfs-build.m4
+@@ -626,6 +626,7 @@ AC_DEFUN([ZFS_AC_DEFAULT_PACKAGE], [
+ ubuntu) bashcompletiondir=/usr/share/bash-completion/completions ;;
+ debian) bashcompletiondir=/usr/share/bash-completion/completions ;;
+ freebsd) bashcompletiondir=$sysconfdir/bash_completion.d;;
++ gentoo) bashcompletiondir=/usr/share/bash-completion/completions ;;
+ *) bashcompletiondir=/etc/bash_completion.d ;;
+ esac
+ AC_MSG_RESULT([$bashcompletiondir])
diff --git a/sys-fs/zfs/zfs-9999.ebuild b/sys-fs/zfs/zfs-2.2.0_rc5.ebuild
similarity index 99%
copy from sys-fs/zfs/zfs-9999.ebuild
copy to sys-fs/zfs/zfs-2.2.0_rc5.ebuild
index ce763553b647..28557faa6f92 100644
--- a/sys-fs/zfs/zfs-9999.ebuild
+++ b/sys-fs/zfs/zfs-2.2.0_rc5.ebuild
@@ -105,6 +105,7 @@ RESTRICT="test"
PATCHES=(
"${FILESDIR}"/2.1.5-dracut-zfs-missing.patch
+ "${FILESDIR}"/2.2.0_rc5-bash-completion-path.patch
)
pkg_pretend() {
diff --git a/sys-fs/zfs/zfs-9999.ebuild b/sys-fs/zfs/zfs-9999.ebuild
index ce763553b647..28557faa6f92 100644
--- a/sys-fs/zfs/zfs-9999.ebuild
+++ b/sys-fs/zfs/zfs-9999.ebuild
@@ -105,6 +105,7 @@ RESTRICT="test"
PATCHES=(
"${FILESDIR}"/2.1.5-dracut-zfs-missing.patch
+ "${FILESDIR}"/2.2.0_rc5-bash-completion-path.patch
)
pkg_pretend() {
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-fs/zfs/files/, sys-fs/zfs/
@ 2023-10-14 1:53 Sam James
0 siblings, 0 replies; 11+ messages in thread
From: Sam James @ 2023-10-14 1:53 UTC (permalink / raw
To: gentoo-commits
commit: ea4f0c53501a6c1e2fd912c23690b70a003f006f
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sat Oct 14 01:50:53 2023 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Oct 14 01:50:53 2023 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ea4f0c53
sys-fs/zfs: drop 2.2.0_rc3, 2.2.0_rc4, 2.2.0_rc5
Signed-off-by: Sam James <sam <AT> gentoo.org>
sys-fs/zfs/Manifest | 6 -
.../zfs/files/2.2.0_rc5-bash-completion-path.patch | 24 --
sys-fs/zfs/zfs-2.2.0_rc3.ebuild | 306 --------------------
sys-fs/zfs/zfs-2.2.0_rc4.ebuild | 306 --------------------
sys-fs/zfs/zfs-2.2.0_rc5.ebuild | 307 ---------------------
5 files changed, 949 deletions(-)
diff --git a/sys-fs/zfs/Manifest b/sys-fs/zfs/Manifest
index 737c2dcab6a1..954ebd1511f4 100644
--- a/sys-fs/zfs/Manifest
+++ b/sys-fs/zfs/Manifest
@@ -6,11 +6,5 @@ DIST zfs-2.1.13.tar.gz 35170063 BLAKE2B 88f4b27a872071590294cf2a93d19633bacfaf12
DIST zfs-2.1.13.tar.gz.asc 836 BLAKE2B 35d3299cfe1d37848f1a0e75a00e08a49a37356ccfc2f47fa1c5c64a1e16adc8030c35047fb45347ec4328d90703ed1623de1c799bef9b6297553aa7b357e8da SHA512 f35c89fd6b1019098b103427b525e32a691c796debde743f9d99953623d8c2bc6deb1ed88865e519d5fa60b259b1d74cce3c829dd1e2eb59aa29abc20046a0db
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-rc3.tar.gz 33666688 BLAKE2B 37c47bcbf34d9238f42bbc80e2b0712a9e64a48196a390e30cfc02a510e0a8c28da5aa52eb3963a2363d2d23881628cadad13e2121cf54a0582cfc7d55685313 SHA512 d82991e6ff63910b38aa0d9b79fce19d1deb79a214adca4bec3fd468077674ef1de264b6f5b0acf9dc0418ce1ed4c9e98d1ad4596274a1769061ae20e017fb92
-DIST zfs-2.2.0-rc3.tar.gz.asc 195 BLAKE2B cbbced9255a3b6a5ec0190806b73e62533600975dad073b82532fb1e488bf81b8d056c7a4f59b9e212a9825ec4900d6f2e2c0141b3d4d58577fe36d9bc3c15b9 SHA512 45424815e39b33107805da737ecfcb95c761ab774143e72449dacfe98a851ddf52c7cb08a587548159305b4c4fe51a0fb9cfbf30fdadf093518eb4c8ce49e12c
-DIST zfs-2.2.0-rc4.tar.gz 33660298 BLAKE2B c8179cf7a8caaa07e6898d9169fa3f825d070d1e7f26552797ebaeb4a6cdddd122072903f93113b4bf817acc47911d6c32b4f4801f09382b7a6376369086f329 SHA512 ae389b24616d1800cff2df1e06b22d0fc507ccd573cda47cd84c7aa3271a5e3b78668a135224e8d0747eb63104544fc284d814073e4061908553faf3d2b0f075
-DIST zfs-2.2.0-rc4.tar.gz.asc 195 BLAKE2B 496f5163235f743e64da3862245a8dfabd95d06071183514ab11f7dd7792b32823b73864888d7a2fbf2dee16ca374772b07139287a1e66416dbd82e062b25ba9 SHA512 6a0ce528e0b15b4c1b8f02db9aaa9ce61bdf9a7c1c88336b91042802535618fd95aa4f59211bef0d1d79f833d8ae2030c4be8ee5a2244b13ec3f684aa1cdee4e
-DIST zfs-2.2.0-rc5.tar.gz 33674415 BLAKE2B 89187462b9f544779e331fe06a84763918bfedcccb3ecfe28cfef00f6ee30690e5a1983bc670a73f0b9db809f4aa23b59255b66907b5ca2c9e236b471b9a8a63 SHA512 68610a68526c79486b7cd8ca28abd0d8dd42814c37a82ea2be05b0044998ef36c5aaa3fc7598c1a8426b73116351a9b00c8ffdab3e5ae3aecc4954fb9378c422
-DIST zfs-2.2.0-rc5.tar.gz.asc 195 BLAKE2B 59c204bb0eb2140a82cb4066e5bb2b66c1331aabf65c807869fbab89a177b0e09aa8b23bdbc46bb18785db554405a085841605885b3931119d1e3eb0335e257a SHA512 83101a1e350db4276296f9ed52a556ea36f4238c272ab565926ec69dca495c645a7b41164baee39768123c5982459d10b54819ba9d9ac6c37fe851952db29887
DIST zfs-2.2.0.tar.gz 33826037 BLAKE2B 80d94cd5ef0bbeaa570853c10f480e3cd64cb852b53aced2e7d382d097130fcf8f94060126a04321f913bca5d9158813a74e97f1dd0f110359d911a33e4a0d77 SHA512 6a45419d2cd30a4f65c50410568972ba9a27f87e745d7a46c0757d7deb4377150f9bd752d54b4bda26badfc40922c34dc5d5bf50f76c84398811784243606829
DIST zfs-2.2.0.tar.gz.asc 195 BLAKE2B c3e665380060b605c5f8ce120f8cc00457053b8adaf44307500a47ff5cd00be04306920820c7a8c1832eb770d5189fd747a52cf13d8bdd8fccbcb171b9b4afad SHA512 b52a11d3e27adf606c24fab46307153c9f81cd8ac504aa8995f7add3e25cd3c00fcb8e2faae3c1a70e29f5901117f961ded7fc26ae5701098a6bcf9710d216f7
diff --git a/sys-fs/zfs/files/2.2.0_rc5-bash-completion-path.patch b/sys-fs/zfs/files/2.2.0_rc5-bash-completion-path.patch
deleted file mode 100644
index abfc80e07ff8..000000000000
--- a/sys-fs/zfs/files/2.2.0_rc5-bash-completion-path.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-https://github.com/openzfs/zfs/pull/15372
-
-From bb6ce273b2e04b609cc3d75d60afc3105251bc1f Mon Sep 17 00:00:00 2001
-From: Sam James <sam@gentoo.org>
-Date: Sun, 8 Oct 2023 02:00:29 +0100
-Subject: [PATCH] config/zfs-build.m4: add Gentoo's bash-completion path
-
-Followup e69ade32e116e72d03068c03799924c3f1a15c95 by adding Gentoo's
-bash completion path.
-
-We should probably consider using/honouring the standard --with-bashcompletiondir
-autoconf option as well, but that's something to do later.
-
-Signed-off-by: Sam James <sam@gentoo.org>
---- a/config/zfs-build.m4
-+++ b/config/zfs-build.m4
-@@ -626,6 +626,7 @@ AC_DEFUN([ZFS_AC_DEFAULT_PACKAGE], [
- ubuntu) bashcompletiondir=/usr/share/bash-completion/completions ;;
- debian) bashcompletiondir=/usr/share/bash-completion/completions ;;
- freebsd) bashcompletiondir=$sysconfdir/bash_completion.d;;
-+ gentoo) bashcompletiondir=/usr/share/bash-completion/completions ;;
- *) bashcompletiondir=/etc/bash_completion.d ;;
- esac
- AC_MSG_RESULT([$bashcompletiondir])
diff --git a/sys-fs/zfs/zfs-2.2.0_rc3.ebuild b/sys-fs/zfs/zfs-2.2.0_rc3.ebuild
deleted file mode 100644
index ce763553b647..000000000000
--- a/sys-fs/zfs/zfs-2.2.0_rc3.ebuild
+++ /dev/null
@@ -1,306 +0,0 @@
-# Copyright 1999-2023 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-DISTUTILS_OPTIONAL=1
-DISTUTILS_USE_PEP517=setuptools
-PYTHON_COMPAT=( python3_{10..11} )
-
-inherit autotools bash-completion-r1 dist-kernel-utils distutils-r1 flag-o-matic linux-info pam systemd udev usr-ldscript
-
-DESCRIPTION="Userland utilities for ZFS Linux kernel module"
-HOMEPAGE="https://github.com/openzfs/zfs"
-
-if [[ ${PV} == "9999" ]]; then
- inherit git-r3
- EGIT_REPO_URI="https://github.com/openzfs/zfs.git"
-else
- VERIFY_SIG_OPENPGP_KEY_PATH=${BROOT}/usr/share/openpgp-keys/openzfs.asc
- inherit verify-sig
-
- MY_P="${P/_rc/-rc}"
- SRC_URI="https://github.com/openzfs/${PN}/releases/download/${MY_P}/${MY_P}.tar.gz"
- SRC_URI+=" verify-sig? ( https://github.com/openzfs/${PN}/releases/download/${MY_P}/${MY_P}.tar.gz.asc )"
- S="${WORKDIR}/${MY_P}"
-
- if [[ ${PV} != *_rc* ]]; then
- KEYWORDS="~amd64 ~arm64 ~ppc64 ~riscv ~sparc"
- fi
-fi
-
-LICENSE="BSD-2 CDDL MIT"
-# just libzfs soname major for now.
-# possible candidates: libuutil, libzpool, libnvpair. Those do not provide stable abi, but are considered.
-# see libsoversion_check() below as well
-SLOT="0/5"
-IUSE="custom-cflags debug dist-kernel kernel-builtin minimal nls pam python +rootfs selinux test-suite"
-
-DEPEND="
- dev-libs/openssl:=
- net-libs/libtirpc:=
- sys-apps/util-linux
- sys-libs/zlib
- virtual/libudev:=
- !minimal? ( ${PYTHON_DEPS} )
- pam? ( sys-libs/pam )
- python? (
- $(python_gen_cond_dep 'dev-python/cffi[${PYTHON_USEDEP}]' 'python*')
- )
-"
-
-BDEPEND="
- app-alternatives/awk
- virtual/pkgconfig
- nls? ( sys-devel/gettext )
- python? (
- ${DISTUTILS_DEPS}
- || (
- dev-python/packaging[${PYTHON_USEDEP}]
- dev-python/distlib[${PYTHON_USEDEP}]
- )
- )
-"
-
-if [[ ${PV} != "9999" ]] ; then
- BDEPEND+=" verify-sig? ( sec-keys/openpgp-keys-openzfs )"
-fi
-
-# awk is used for some scripts, completions, and the Dracut module
-RDEPEND="
- ${DEPEND}
- !kernel-builtin? ( ~sys-fs/zfs-kmod-${PV}:= )
- !prefix? ( virtual/udev )
- app-alternatives/awk
- sys-fs/udev-init-scripts
- dist-kernel? ( virtual/dist-kernel:= )
- rootfs? (
- app-arch/cpio
- app-misc/pax-utils
- )
- selinux? ( sec-policy/selinux-zfs )
- test-suite? (
- app-shells/ksh
- sys-apps/kmod[tools]
- sys-apps/util-linux
- sys-devel/bc
- sys-block/parted
- sys-fs/lsscsi
- sys-fs/mdadm
- sys-process/procps
- )
-"
-
-# PDEPEND in this form is needed to trick portage suggest
-# enabling dist-kernel if only 1 package have it set, without suggesting to disable
-PDEPEND="dist-kernel? ( ~sys-fs/zfs-kmod-${PV}[dist-kernel] )"
-
-REQUIRED_USE="
- !minimal? ( ${PYTHON_REQUIRED_USE} )
- python? ( !minimal )
- test-suite? ( !minimal )
-"
-
-RESTRICT="test"
-
-PATCHES=(
- "${FILESDIR}"/2.1.5-dracut-zfs-missing.patch
-)
-
-pkg_pretend() {
- use rootfs || return 0
-
- if has_version virtual/dist-kernel && ! use dist-kernel; then
- ewarn "You have virtual/dist-kernel installed, but"
- ewarn "USE=\"dist-kernel\" is not enabled for ${CATEGORY}/${PN}"
- ewarn "It's recommended to globally enable dist-kernel USE flag"
- ewarn "to auto-trigger initrd rebuilds with kernel updates"
- fi
-}
-
-pkg_setup() {
- if use kernel_linux; then
- linux-info_pkg_setup
-
- if ! linux_config_exists; then
- ewarn "Cannot check the linux kernel configuration."
- else
- if use test-suite; then
- if linux_chkconfig_present BLK_DEV_LOOP; then
- eerror "The ZFS test suite requires loop device support enabled."
- eerror "Please enable it:"
- eerror " CONFIG_BLK_DEV_LOOP=y"
- eerror "in /usr/src/linux/.config or"
- eerror " Device Drivers --->"
- eerror " Block devices --->"
- eerror " [X] Loopback device support"
- fi
- fi
- fi
- fi
-}
-
-libsoversion_check() {
- local bugurl libzfs_sover
- bugurl="https://bugs.gentoo.org/enter_bug.cgi?form_name=enter_bug&product=Gentoo+Linux&component=Current+packages"
-
- libzfs_sover="$(grep 'libzfs_la_LDFLAGS += -version-info' lib/libzfs/Makefile.am \
- | grep -Eo '[0-9]+:[0-9]+:[0-9]+')"
- libzfs_sover="${libzfs_sover%%:*}"
-
- if [[ ${libzfs_sover} -ne $(ver_cut 2 ${SLOT}) ]]; then
- echo
- eerror "BUG BUG BUG BUG BUG BUG BUG BUG"
- eerror "ebuild subslot does not match libzfs soversion!"
- eerror "libzfs soversion: ${libzfs_sover}"
- eerror "ebuild value: $(ver_cut 2 ${SLOT})"
- eerror "This is a bug in the ebuild, please use the following URL to report it"
- eerror "${bugurl}&short_desc=${CATEGORY}%2F${P}+update+subslot"
- echo
- # we want to abort for releases, but just print a warning for live ebuild
- # to keep package installable
- [[ ${PV} == "9999" ]] || die
- fi
-}
-
-src_prepare() {
- default
- libsoversion_check
-
- # Run unconditionally (bug #792627)
- eautoreconf
-
- if [[ ${PV} != "9999" ]]; then
- # Set revision number
- sed -i "s/\(Release:\)\(.*\)1/\1\2${PR}-gentoo/" META || die "Could not set Gentoo release"
- fi
-
- if use python; then
- pushd contrib/pyzfs >/dev/null || die
- distutils-r1_src_prepare
- popd >/dev/null || die
- fi
-
- # Tries to use /etc/conf.d which we reserve for OpenRC
- sed -i -e '/EnvironmentFile/d' etc/systemd/system/zfs*.in || die
-
- # prevent errors showing up on zfs-mount stop, #647688
- # openrc will unmount all filesystems anyway.
- sed -i "/^ZFS_UNMOUNT=/ s/yes/no/" "etc/default/zfs.in" || die
-}
-
-src_configure() {
- use custom-cflags || strip-flags
- use minimal || python_setup
-
- local myconf=(
- --bindir="${EPREFIX}/bin"
- --enable-shared
- --enable-sysvinit
- --localstatedir="${EPREFIX}/var"
- --sbindir="${EPREFIX}/sbin"
- --with-config=user
- --with-dracutdir="${EPREFIX}/usr/lib/dracut"
- --with-linux="${KV_DIR}"
- --with-linux-obj="${KV_OUT_DIR}"
- --with-udevdir="$(get_udevdir)"
- --with-pamconfigsdir="${EPREFIX}/unwanted_files"
- --with-pammoduledir="$(getpam_mod_dir)"
- --with-systemdunitdir="$(systemd_get_systemunitdir)"
- --with-systemdpresetdir="$(systemd_get_systempresetdir)"
- --with-vendor=gentoo
- # Building zfs-mount-generator.c on musl breaks as strndupa
- # isn't available. But systemd doesn't support musl anyway, so
- # just disable building it.
- # UPDATE: it has been fixed since,
- # https://github.com/openzfs/zfs/commit/1f19826c9ac85835cbde61a7439d9d1fefe43a4a
- # but we still leave it as this for now.
- $(use_enable !elibc_musl systemd)
- $(use_enable debug)
- $(use_enable nls)
- $(use_enable pam)
- $(use_enable python pyzfs)
- --disable-static
- $(usex minimal --without-python --with-python="${EPYTHON}")
- )
-
- econf "${myconf[@]}"
-}
-
-src_compile() {
- default
- if use python; then
- pushd contrib/pyzfs >/dev/null || die
- distutils-r1_src_compile
- popd >/dev/null || die
- fi
-}
-
-src_install() {
- default
-
- gen_usr_ldscript -a nvpair uutil zfsbootenv zfs zfs_core zpool
-
- use pam && { rm -rv "${ED}/unwanted_files" || die ; }
-
- use test-suite || { rm -r "${ED}"/usr/share/zfs/{test-runner,zfs-tests,runfiles,*sh} || die ; }
-
- find "${ED}" -name '*.la' -delete || die
-
- dobashcomp contrib/bash_completion.d/zfs
- bashcomp_alias zfs zpool
-
- # strip executable bit from conf.d file
- fperms 0644 /etc/conf.d/zfs
-
- if use python; then
- pushd contrib/pyzfs >/dev/null || die
- distutils-r1_src_install
- popd >/dev/null || die
- fi
-
- # enforce best available python implementation
- use minimal || python_fix_shebang "${ED}/bin"
-}
-
-pkg_postinst() {
- udev_reload
-
- # we always need userspace utils in sync with zfs-kmod
- # so force initrd update for userspace as well, to avoid
- # situation when zfs-kmod trigger initrd rebuild before
- # userspace component is rebuilt
- # KV_* variables are provided by linux-info.eclass
- if [[ -z ${ROOT} ]] && use dist-kernel; then
- dist-kernel_reinstall_initramfs "${KV_DIR}" "${KV_FULL}"
- fi
-
- if use rootfs; then
- if ! has_version sys-kernel/genkernel && ! has_version sys-kernel/dracut; then
- elog "Root on zfs requires an initramfs to boot"
- elog "The following packages provide one and are tested on a regular basis:"
- elog " sys-kernel/dracut ( preferred, module maintained by zfs developers )"
- elog " sys-kernel/genkernel"
- fi
- fi
-
- if systemd_is_booted || has_version sys-apps/systemd; then
- einfo "Please refer to ${EROOT}/$(systemd_get_systempresetdir)/50-zfs.preset"
- einfo "for default zfs systemd service configuration"
- else
- [[ -e "${EROOT}/etc/runlevels/boot/zfs-import" ]] || \
- einfo "You should add zfs-import to the boot runlevel."
- [[ -e "${EROOT}/etc/runlevels/boot/zfs-load-key" ]] || \
- einfo "You should add zfs-load-key to the boot runlevel."
- [[ -e "${EROOT}/etc/runlevels/boot/zfs-mount" ]]|| \
- einfo "You should add zfs-mount to the boot runlevel."
- [[ -e "${EROOT}/etc/runlevels/default/zfs-share" ]] || \
- einfo "You should add zfs-share to the default runlevel."
- [[ -e "${EROOT}/etc/runlevels/default/zfs-zed" ]] || \
- einfo "You should add zfs-zed to the default runlevel."
- fi
-}
-
-pkg_postrm() {
- udev_reload
-}
diff --git a/sys-fs/zfs/zfs-2.2.0_rc4.ebuild b/sys-fs/zfs/zfs-2.2.0_rc4.ebuild
deleted file mode 100644
index ce763553b647..000000000000
--- a/sys-fs/zfs/zfs-2.2.0_rc4.ebuild
+++ /dev/null
@@ -1,306 +0,0 @@
-# Copyright 1999-2023 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-DISTUTILS_OPTIONAL=1
-DISTUTILS_USE_PEP517=setuptools
-PYTHON_COMPAT=( python3_{10..11} )
-
-inherit autotools bash-completion-r1 dist-kernel-utils distutils-r1 flag-o-matic linux-info pam systemd udev usr-ldscript
-
-DESCRIPTION="Userland utilities for ZFS Linux kernel module"
-HOMEPAGE="https://github.com/openzfs/zfs"
-
-if [[ ${PV} == "9999" ]]; then
- inherit git-r3
- EGIT_REPO_URI="https://github.com/openzfs/zfs.git"
-else
- VERIFY_SIG_OPENPGP_KEY_PATH=${BROOT}/usr/share/openpgp-keys/openzfs.asc
- inherit verify-sig
-
- MY_P="${P/_rc/-rc}"
- SRC_URI="https://github.com/openzfs/${PN}/releases/download/${MY_P}/${MY_P}.tar.gz"
- SRC_URI+=" verify-sig? ( https://github.com/openzfs/${PN}/releases/download/${MY_P}/${MY_P}.tar.gz.asc )"
- S="${WORKDIR}/${MY_P}"
-
- if [[ ${PV} != *_rc* ]]; then
- KEYWORDS="~amd64 ~arm64 ~ppc64 ~riscv ~sparc"
- fi
-fi
-
-LICENSE="BSD-2 CDDL MIT"
-# just libzfs soname major for now.
-# possible candidates: libuutil, libzpool, libnvpair. Those do not provide stable abi, but are considered.
-# see libsoversion_check() below as well
-SLOT="0/5"
-IUSE="custom-cflags debug dist-kernel kernel-builtin minimal nls pam python +rootfs selinux test-suite"
-
-DEPEND="
- dev-libs/openssl:=
- net-libs/libtirpc:=
- sys-apps/util-linux
- sys-libs/zlib
- virtual/libudev:=
- !minimal? ( ${PYTHON_DEPS} )
- pam? ( sys-libs/pam )
- python? (
- $(python_gen_cond_dep 'dev-python/cffi[${PYTHON_USEDEP}]' 'python*')
- )
-"
-
-BDEPEND="
- app-alternatives/awk
- virtual/pkgconfig
- nls? ( sys-devel/gettext )
- python? (
- ${DISTUTILS_DEPS}
- || (
- dev-python/packaging[${PYTHON_USEDEP}]
- dev-python/distlib[${PYTHON_USEDEP}]
- )
- )
-"
-
-if [[ ${PV} != "9999" ]] ; then
- BDEPEND+=" verify-sig? ( sec-keys/openpgp-keys-openzfs )"
-fi
-
-# awk is used for some scripts, completions, and the Dracut module
-RDEPEND="
- ${DEPEND}
- !kernel-builtin? ( ~sys-fs/zfs-kmod-${PV}:= )
- !prefix? ( virtual/udev )
- app-alternatives/awk
- sys-fs/udev-init-scripts
- dist-kernel? ( virtual/dist-kernel:= )
- rootfs? (
- app-arch/cpio
- app-misc/pax-utils
- )
- selinux? ( sec-policy/selinux-zfs )
- test-suite? (
- app-shells/ksh
- sys-apps/kmod[tools]
- sys-apps/util-linux
- sys-devel/bc
- sys-block/parted
- sys-fs/lsscsi
- sys-fs/mdadm
- sys-process/procps
- )
-"
-
-# PDEPEND in this form is needed to trick portage suggest
-# enabling dist-kernel if only 1 package have it set, without suggesting to disable
-PDEPEND="dist-kernel? ( ~sys-fs/zfs-kmod-${PV}[dist-kernel] )"
-
-REQUIRED_USE="
- !minimal? ( ${PYTHON_REQUIRED_USE} )
- python? ( !minimal )
- test-suite? ( !minimal )
-"
-
-RESTRICT="test"
-
-PATCHES=(
- "${FILESDIR}"/2.1.5-dracut-zfs-missing.patch
-)
-
-pkg_pretend() {
- use rootfs || return 0
-
- if has_version virtual/dist-kernel && ! use dist-kernel; then
- ewarn "You have virtual/dist-kernel installed, but"
- ewarn "USE=\"dist-kernel\" is not enabled for ${CATEGORY}/${PN}"
- ewarn "It's recommended to globally enable dist-kernel USE flag"
- ewarn "to auto-trigger initrd rebuilds with kernel updates"
- fi
-}
-
-pkg_setup() {
- if use kernel_linux; then
- linux-info_pkg_setup
-
- if ! linux_config_exists; then
- ewarn "Cannot check the linux kernel configuration."
- else
- if use test-suite; then
- if linux_chkconfig_present BLK_DEV_LOOP; then
- eerror "The ZFS test suite requires loop device support enabled."
- eerror "Please enable it:"
- eerror " CONFIG_BLK_DEV_LOOP=y"
- eerror "in /usr/src/linux/.config or"
- eerror " Device Drivers --->"
- eerror " Block devices --->"
- eerror " [X] Loopback device support"
- fi
- fi
- fi
- fi
-}
-
-libsoversion_check() {
- local bugurl libzfs_sover
- bugurl="https://bugs.gentoo.org/enter_bug.cgi?form_name=enter_bug&product=Gentoo+Linux&component=Current+packages"
-
- libzfs_sover="$(grep 'libzfs_la_LDFLAGS += -version-info' lib/libzfs/Makefile.am \
- | grep -Eo '[0-9]+:[0-9]+:[0-9]+')"
- libzfs_sover="${libzfs_sover%%:*}"
-
- if [[ ${libzfs_sover} -ne $(ver_cut 2 ${SLOT}) ]]; then
- echo
- eerror "BUG BUG BUG BUG BUG BUG BUG BUG"
- eerror "ebuild subslot does not match libzfs soversion!"
- eerror "libzfs soversion: ${libzfs_sover}"
- eerror "ebuild value: $(ver_cut 2 ${SLOT})"
- eerror "This is a bug in the ebuild, please use the following URL to report it"
- eerror "${bugurl}&short_desc=${CATEGORY}%2F${P}+update+subslot"
- echo
- # we want to abort for releases, but just print a warning for live ebuild
- # to keep package installable
- [[ ${PV} == "9999" ]] || die
- fi
-}
-
-src_prepare() {
- default
- libsoversion_check
-
- # Run unconditionally (bug #792627)
- eautoreconf
-
- if [[ ${PV} != "9999" ]]; then
- # Set revision number
- sed -i "s/\(Release:\)\(.*\)1/\1\2${PR}-gentoo/" META || die "Could not set Gentoo release"
- fi
-
- if use python; then
- pushd contrib/pyzfs >/dev/null || die
- distutils-r1_src_prepare
- popd >/dev/null || die
- fi
-
- # Tries to use /etc/conf.d which we reserve for OpenRC
- sed -i -e '/EnvironmentFile/d' etc/systemd/system/zfs*.in || die
-
- # prevent errors showing up on zfs-mount stop, #647688
- # openrc will unmount all filesystems anyway.
- sed -i "/^ZFS_UNMOUNT=/ s/yes/no/" "etc/default/zfs.in" || die
-}
-
-src_configure() {
- use custom-cflags || strip-flags
- use minimal || python_setup
-
- local myconf=(
- --bindir="${EPREFIX}/bin"
- --enable-shared
- --enable-sysvinit
- --localstatedir="${EPREFIX}/var"
- --sbindir="${EPREFIX}/sbin"
- --with-config=user
- --with-dracutdir="${EPREFIX}/usr/lib/dracut"
- --with-linux="${KV_DIR}"
- --with-linux-obj="${KV_OUT_DIR}"
- --with-udevdir="$(get_udevdir)"
- --with-pamconfigsdir="${EPREFIX}/unwanted_files"
- --with-pammoduledir="$(getpam_mod_dir)"
- --with-systemdunitdir="$(systemd_get_systemunitdir)"
- --with-systemdpresetdir="$(systemd_get_systempresetdir)"
- --with-vendor=gentoo
- # Building zfs-mount-generator.c on musl breaks as strndupa
- # isn't available. But systemd doesn't support musl anyway, so
- # just disable building it.
- # UPDATE: it has been fixed since,
- # https://github.com/openzfs/zfs/commit/1f19826c9ac85835cbde61a7439d9d1fefe43a4a
- # but we still leave it as this for now.
- $(use_enable !elibc_musl systemd)
- $(use_enable debug)
- $(use_enable nls)
- $(use_enable pam)
- $(use_enable python pyzfs)
- --disable-static
- $(usex minimal --without-python --with-python="${EPYTHON}")
- )
-
- econf "${myconf[@]}"
-}
-
-src_compile() {
- default
- if use python; then
- pushd contrib/pyzfs >/dev/null || die
- distutils-r1_src_compile
- popd >/dev/null || die
- fi
-}
-
-src_install() {
- default
-
- gen_usr_ldscript -a nvpair uutil zfsbootenv zfs zfs_core zpool
-
- use pam && { rm -rv "${ED}/unwanted_files" || die ; }
-
- use test-suite || { rm -r "${ED}"/usr/share/zfs/{test-runner,zfs-tests,runfiles,*sh} || die ; }
-
- find "${ED}" -name '*.la' -delete || die
-
- dobashcomp contrib/bash_completion.d/zfs
- bashcomp_alias zfs zpool
-
- # strip executable bit from conf.d file
- fperms 0644 /etc/conf.d/zfs
-
- if use python; then
- pushd contrib/pyzfs >/dev/null || die
- distutils-r1_src_install
- popd >/dev/null || die
- fi
-
- # enforce best available python implementation
- use minimal || python_fix_shebang "${ED}/bin"
-}
-
-pkg_postinst() {
- udev_reload
-
- # we always need userspace utils in sync with zfs-kmod
- # so force initrd update for userspace as well, to avoid
- # situation when zfs-kmod trigger initrd rebuild before
- # userspace component is rebuilt
- # KV_* variables are provided by linux-info.eclass
- if [[ -z ${ROOT} ]] && use dist-kernel; then
- dist-kernel_reinstall_initramfs "${KV_DIR}" "${KV_FULL}"
- fi
-
- if use rootfs; then
- if ! has_version sys-kernel/genkernel && ! has_version sys-kernel/dracut; then
- elog "Root on zfs requires an initramfs to boot"
- elog "The following packages provide one and are tested on a regular basis:"
- elog " sys-kernel/dracut ( preferred, module maintained by zfs developers )"
- elog " sys-kernel/genkernel"
- fi
- fi
-
- if systemd_is_booted || has_version sys-apps/systemd; then
- einfo "Please refer to ${EROOT}/$(systemd_get_systempresetdir)/50-zfs.preset"
- einfo "for default zfs systemd service configuration"
- else
- [[ -e "${EROOT}/etc/runlevels/boot/zfs-import" ]] || \
- einfo "You should add zfs-import to the boot runlevel."
- [[ -e "${EROOT}/etc/runlevels/boot/zfs-load-key" ]] || \
- einfo "You should add zfs-load-key to the boot runlevel."
- [[ -e "${EROOT}/etc/runlevels/boot/zfs-mount" ]]|| \
- einfo "You should add zfs-mount to the boot runlevel."
- [[ -e "${EROOT}/etc/runlevels/default/zfs-share" ]] || \
- einfo "You should add zfs-share to the default runlevel."
- [[ -e "${EROOT}/etc/runlevels/default/zfs-zed" ]] || \
- einfo "You should add zfs-zed to the default runlevel."
- fi
-}
-
-pkg_postrm() {
- udev_reload
-}
diff --git a/sys-fs/zfs/zfs-2.2.0_rc5.ebuild b/sys-fs/zfs/zfs-2.2.0_rc5.ebuild
deleted file mode 100644
index 28557faa6f92..000000000000
--- a/sys-fs/zfs/zfs-2.2.0_rc5.ebuild
+++ /dev/null
@@ -1,307 +0,0 @@
-# Copyright 1999-2023 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-DISTUTILS_OPTIONAL=1
-DISTUTILS_USE_PEP517=setuptools
-PYTHON_COMPAT=( python3_{10..11} )
-
-inherit autotools bash-completion-r1 dist-kernel-utils distutils-r1 flag-o-matic linux-info pam systemd udev usr-ldscript
-
-DESCRIPTION="Userland utilities for ZFS Linux kernel module"
-HOMEPAGE="https://github.com/openzfs/zfs"
-
-if [[ ${PV} == "9999" ]]; then
- inherit git-r3
- EGIT_REPO_URI="https://github.com/openzfs/zfs.git"
-else
- VERIFY_SIG_OPENPGP_KEY_PATH=${BROOT}/usr/share/openpgp-keys/openzfs.asc
- inherit verify-sig
-
- MY_P="${P/_rc/-rc}"
- SRC_URI="https://github.com/openzfs/${PN}/releases/download/${MY_P}/${MY_P}.tar.gz"
- SRC_URI+=" verify-sig? ( https://github.com/openzfs/${PN}/releases/download/${MY_P}/${MY_P}.tar.gz.asc )"
- S="${WORKDIR}/${MY_P}"
-
- if [[ ${PV} != *_rc* ]]; then
- KEYWORDS="~amd64 ~arm64 ~ppc64 ~riscv ~sparc"
- fi
-fi
-
-LICENSE="BSD-2 CDDL MIT"
-# just libzfs soname major for now.
-# possible candidates: libuutil, libzpool, libnvpair. Those do not provide stable abi, but are considered.
-# see libsoversion_check() below as well
-SLOT="0/5"
-IUSE="custom-cflags debug dist-kernel kernel-builtin minimal nls pam python +rootfs selinux test-suite"
-
-DEPEND="
- dev-libs/openssl:=
- net-libs/libtirpc:=
- sys-apps/util-linux
- sys-libs/zlib
- virtual/libudev:=
- !minimal? ( ${PYTHON_DEPS} )
- pam? ( sys-libs/pam )
- python? (
- $(python_gen_cond_dep 'dev-python/cffi[${PYTHON_USEDEP}]' 'python*')
- )
-"
-
-BDEPEND="
- app-alternatives/awk
- virtual/pkgconfig
- nls? ( sys-devel/gettext )
- python? (
- ${DISTUTILS_DEPS}
- || (
- dev-python/packaging[${PYTHON_USEDEP}]
- dev-python/distlib[${PYTHON_USEDEP}]
- )
- )
-"
-
-if [[ ${PV} != "9999" ]] ; then
- BDEPEND+=" verify-sig? ( sec-keys/openpgp-keys-openzfs )"
-fi
-
-# awk is used for some scripts, completions, and the Dracut module
-RDEPEND="
- ${DEPEND}
- !kernel-builtin? ( ~sys-fs/zfs-kmod-${PV}:= )
- !prefix? ( virtual/udev )
- app-alternatives/awk
- sys-fs/udev-init-scripts
- dist-kernel? ( virtual/dist-kernel:= )
- rootfs? (
- app-arch/cpio
- app-misc/pax-utils
- )
- selinux? ( sec-policy/selinux-zfs )
- test-suite? (
- app-shells/ksh
- sys-apps/kmod[tools]
- sys-apps/util-linux
- sys-devel/bc
- sys-block/parted
- sys-fs/lsscsi
- sys-fs/mdadm
- sys-process/procps
- )
-"
-
-# PDEPEND in this form is needed to trick portage suggest
-# enabling dist-kernel if only 1 package have it set, without suggesting to disable
-PDEPEND="dist-kernel? ( ~sys-fs/zfs-kmod-${PV}[dist-kernel] )"
-
-REQUIRED_USE="
- !minimal? ( ${PYTHON_REQUIRED_USE} )
- python? ( !minimal )
- test-suite? ( !minimal )
-"
-
-RESTRICT="test"
-
-PATCHES=(
- "${FILESDIR}"/2.1.5-dracut-zfs-missing.patch
- "${FILESDIR}"/2.2.0_rc5-bash-completion-path.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] 11+ messages in thread
end of thread, other threads:[~2023-10-14 1:53 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-08 1:04 [gentoo-commits] repo/gentoo:master commit in: sys-fs/zfs/files/, sys-fs/zfs/ Sam James
-- strict thread matches above, loose matches on Subject: below --
2023-10-14 1:53 Sam James
2023-01-13 4:33 Georgy Yakovlev
2022-07-10 20:46 Sam James
2022-06-30 10:37 Sam James
2021-12-21 2:07 Georgy Yakovlev
2021-11-08 6:09 Sam James
2020-10-07 0:00 Georgy Yakovlev
2020-03-30 21:08 Georgy Yakovlev
2020-02-07 5:37 Georgy Yakovlev
2019-11-26 20:32 Georgy Yakovlev
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox