public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: sys-fs/lvm2/, sys-fs/lvm2/files/
@ 2015-12-03 11:33 Lars Wendler
  0 siblings, 0 replies; 29+ messages in thread
From: Lars Wendler @ 2015-12-03 11:33 UTC (permalink / raw
  To: gentoo-commits

commit:     e98c6edabec9e0b0e9b21da01c2ea2e0df89897b
Author:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
AuthorDate: Thu Dec  3 11:33:24 2015 +0000
Commit:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
CommitDate: Thu Dec  3 11:33:44 2015 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e98c6eda

sys-fs/lvm2: Bump to version 2.02.136

Package-Manager: portage-2.2.26
Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>

 sys-fs/lvm2/Manifest                               |   1 +
 .../lvm2-2.02.129-dynamic-static-ldflags.patch     |  59 +++++
 .../lvm2/files/lvm2-2.02.129-example.conf.in.patch |  52 ++++
 .../lvm2-2.02.129-static-pkgconfig-libs.patch      | 102 ++++++++
 .../files/lvm2-2.02.130-pthread-pkgconfig.patch    |  32 +++
 sys-fs/lvm2/lvm2-2.02.136.ebuild                   | 275 +++++++++++++++++++++
 6 files changed, 521 insertions(+)

diff --git a/sys-fs/lvm2/Manifest b/sys-fs/lvm2/Manifest
index 6822526..750b75a 100644
--- a/sys-fs/lvm2/Manifest
+++ b/sys-fs/lvm2/Manifest
@@ -2,3 +2,4 @@ DIST LVM2.2.02.103.tgz 1343887 SHA256 71c5a2e8842ed2f13f52e02b44eb183110a3410ded
 DIST LVM2.2.02.109.tgz 1482167 SHA256 7bc95ba5209c8aa5bd492167b2e2797f156852ed11cfc63fb783070ade8e65e7 SHA512 210645cccf297112ffdbc63e0336385c31b2d17d226ae10813ba8ffd4f01ce07af44a4134e60644283e4360e10e925113e867378502ae0166f3fc91258caea68 WHIRLPOOL 7f2d91446f502440b2ed73df0f2ce29069364bbb198e675223b61c17e5cc6e1c162ce60a977cb07b71e44d672c688bbbf0247380f1b9c5adf325cf324f4c4bb7
 DIST LVM2.2.02.110.tgz 1487448 SHA256 3dad1aa04a71b8420b15f44c53f041001436539d3f8073490c2d0c52f6fecd11 SHA512 5b4dfa5ed877d34efa5b109dc712e8fa9154b4954b267b0243f1925f9d2fa8c67f4ce8da36a85f3bba6c117f6153fdbf150e3753587ab90584a86d2654dc0812 WHIRLPOOL ea221ed3e9d3f79009d7c341a7a75b52eacc5be79e28f2498e7cdc0f4a97c2bebff405b032eb8086d3b5b5aaf79da2f281c5734562355bddbe6004058e114ced
 DIST LVM2.2.02.116.tgz 1538340 SHA256 2479d6ea61c405efcfcd8a78390d00c1d2e9c92c0262f3ed599f2c0fb6f0b767 SHA512 992541339637d597257850b4ff7f5348fb7cdcccf806ac8d986a3be1ad1edc5f6bfaedeed5128690c541d1a485cdc75742e90a766363c39867901003518fb84d WHIRLPOOL 1e89ec941882fddba62c9649be46eb5bc6c9cb899669d4bbe4a4a1023c8bf7d8264c4815ef88bb39dedcb9637815411feb826aa102e629d77b80e45e099e398d
+DIST LVM2.2.02.136.tgz 1891010 SHA256 c6af90097d8f7cd851d38c4f57bb3ad7039cfa123f1e336dba957814a298bd8c SHA512 ebda683e7dbeb2c4860a583d47e60756d18127e37a373ab2958af8e54b9bee0d2e3370b7803d88fa4b08564345c88af55bfbac317081160118ce4b3733b69f9d WHIRLPOOL 8020fdddac648e32084801ffaf9b00b8a683870c8dd8dd5969851fd081eb1efd578decd82cd4a7a24fb6150c55afafdd819a76eb7eb6926cdc057455cc1d1618

diff --git a/sys-fs/lvm2/files/lvm2-2.02.129-dynamic-static-ldflags.patch b/sys-fs/lvm2/files/lvm2-2.02.129-dynamic-static-ldflags.patch
new file mode 100644
index 0000000..efdfb81
--- /dev/null
+++ b/sys-fs/lvm2/files/lvm2-2.02.129-dynamic-static-ldflags.patch
@@ -0,0 +1,59 @@
+--- LVM2.2.02.129/configure.in
++++ LVM2.2.02.129/configure.in
+@@ -31,6 +31,7 @@
+ 	linux*)
+ 		CLDFLAGS="$CLDFLAGS -Wl,--version-script,.export.sym"
+ 		ELDFLAGS="-Wl,--export-dynamic"
++		STATIC_LDFLAGS="-Wl,--no-export-dynamic"
+ 		# FIXME Generate list and use --dynamic-list=.dlopen.sym
+ 		CLDWHOLEARCHIVE="-Wl,-whole-archive"
+ 		CLDNOWHOLEARCHIVE="-Wl,-no-whole-archive"
+@@ -2008,6 +2009,7 @@
+ AC_SUBST(SELINUX_PC)
+ AC_SUBST(SNAPSHOTS)
+ AC_SUBST(STATICDIR)
++AC_SUBST(STATIC_LDFLAGS)
+ AC_SUBST(STATIC_LINK)
+ AC_SUBST(TESTING)
+ AC_SUBST(TESTSUITE_DATA)
+--- LVM2.2.02.129/daemons/dmeventd/Makefile.in
++++ LVM2.2.02.129/daemons/dmeventd/Makefile.in
+@@ -66,7 +66,7 @@
+ 	$(DL_LIBS) $(LVMLIBS) $(LIBS) -rdynamic
+ 
+ dmeventd.static: $(LIB_STATIC) dmeventd.o $(interfacebuilddir)/libdevmapper.a
+-	$(CC) $(CFLAGS) $(LDFLAGS) $(ELDFLAGS) -static -L. -L$(interfacebuilddir) -o $@ \
++	$(CC) $(CFLAGS) $(LDFLAGS) $(ELDFLAGS) $(STATIC_LDFLAGS) -static -L. -L$(interfacebuilddir) -o $@ \
+ 	dmeventd.o $(DL_LIBS) $(LVMLIBS) $(LIBS) $(STATIC_LIBS)
+ 
+ ifeq ("@PKGCONFIG@", "yes")
+--- LVM2.2.02.129/make.tmpl.in
++++ LVM2.2.02.129/make.tmpl.in
+@@ -48,6 +48,7 @@
+ # FIXME set this only where it's needed, not globally?
+ CFLAGS ?= @COPTIMISE_FLAG@ @CFLAGS@
+ LDFLAGS ?= @COPTIMISE_FLAG@ @LDFLAGS@
++STATIC_LDFLAGS += @STATIC_LDFLAGS@
+ CLDFLAGS += @CLDFLAGS@
+ ELDFLAGS += @ELDFLAGS@
+ LDDEPS += @LDDEPS@
+--- LVM2.2.02.129/tools/Makefile.in
++++ LVM2.2.02.129/tools/Makefile.in
+@@ -129,7 +129,7 @@
+ 	      -o $@ dmsetup.o -ldevmapper $(LIBS)
+ 
+ dmsetup.static: dmsetup.o $(interfacebuilddir)/libdevmapper.a
+-	$(CC) $(CFLAGS) $(LDFLAGS) -static -L$(interfacebuilddir) \
++	$(CC) $(CFLAGS) $(LDFLAGS) $(STATIC_LDFLAGS) -static -L$(interfacebuilddir) \
+ 	      -o $@ dmsetup.o -ldevmapper $(STATIC_LIBS) $(LIBS)
+ 
+ all: device-mapper
+@@ -146,7 +146,7 @@
+ endif
+ 
+ lvm.static: $(OBJECTS) lvm-static.o $(top_builddir)/lib/liblvm-internal.a  $(interfacebuilddir)/libdevmapper.a
+-	$(CC) $(CFLAGS) $(LDFLAGS) -static -L$(interfacebuilddir) -o $@ \
++	$(CC) $(CFLAGS) $(LDFLAGS) $(STATIC_LDFLAGS) -static -L$(interfacebuilddir) -o $@ \
+ 	      $(OBJECTS) lvm-static.o $(LVMLIBS) $(STATIC_LIBS) $(LIBS)
+ 
+ liblvm2cmd.a: $(top_builddir)/lib/liblvm-internal.a $(OBJECTS) lvmcmdlib.o lvm2cmd.o

diff --git a/sys-fs/lvm2/files/lvm2-2.02.129-example.conf.in.patch b/sys-fs/lvm2/files/lvm2-2.02.129-example.conf.in.patch
new file mode 100644
index 0000000..076e060
--- /dev/null
+++ b/sys-fs/lvm2/files/lvm2-2.02.129-example.conf.in.patch
@@ -0,0 +1,52 @@
+Maintainer note: Forward ported without editing from lvm2-2.02.108-example.conf.in.patch to apply cleanly.
+
+--- LVM2.2.02.129/conf/example.conf.in
++++ LVM2.2.02.129/conf/example.conf.in
+@@ -128,6 +128,9 @@
+ 	# Example
+ 	# Accept every block device:
+ 	# filter = [ "a|.*/|" ]
++	# Gentoo: we exclude /dev/nbd by default, because it makes a lot of kernel
++	# noise when you probed while not available.
++	filter = [ "r|/dev/nbd.*|", "a/.*/" ]
+ 	# Reject the cdrom drive:
+ 	# filter = [ "r|/dev/cdrom|" ]
+ 	# Work with just loopback devices, e.g. for testing:
+@@ -620,7 +623,8 @@
+ 	# tools need to be installed with .lvm1 suffices, e.g. vgscan.lvm1.
+ 	# They will stop working once the lvm2 on-disk metadata format is used.
+ 	# This configuration option has an automatic default value.
+-	# fallback_to_lvm1 = @DEFAULT_FALLBACK_TO_LVM1@
++	# Gentoo: the LVM tools are a seperate package.
++	fallback_to_lvm1 = 0
+ 
+ 	# Configuration option global/format.
+ 	# The default metadata format that commands should use.
+@@ -1413,7 +1417,7 @@
+ 
+ # Configuration section metadata.
+ # This configuration section has an automatic default value.
+-# metadata {
++metadata {
+ 
+ 	# Configuration option metadata/pvmetadatacopies.
+ 	# Number of copies of metadata to store on each PV.
+@@ -1431,7 +1435,8 @@
+ 	# 
+ 	# This configuration option is advanced.
+ 	# This configuration option has an automatic default value.
+-	# pvmetadatacopies = 1
++	# Gentoo: enable for data safety, but PV resize is then disabled.
++	# pvmetadatacopies = 2
+ 
+ 	# Configuration option metadata/vgmetadatacopies.
+ 	# Number of copies of metadata to maintain for each VG.
+@@ -1486,7 +1491,7 @@
+ 	# 
+ 	# This configuration option is advanced.
+ 	# This configuration option does not have a default value defined.
+-# }
++}
+ 
+ # Configuration section report.
+ # LVM report command output formatting.

diff --git a/sys-fs/lvm2/files/lvm2-2.02.129-static-pkgconfig-libs.patch b/sys-fs/lvm2/files/lvm2-2.02.129-static-pkgconfig-libs.patch
new file mode 100644
index 0000000..2396945
--- /dev/null
+++ b/sys-fs/lvm2/files/lvm2-2.02.129-static-pkgconfig-libs.patch
@@ -0,0 +1,102 @@
+--- LVM2.2.02.129/configure.in
++++ LVM2.2.02.129/configure.in
+@@ -1287,6 +1287,7 @@
+ 			   fi])
+ 	if test "$BLKID_WIPING" = yes; then
+ 		BLKID_PC="blkid"
++		BLKID_STATIC_LIBS=`$PKG_CONFIG --static --libs $BLKID_PC`
+ 		DEFAULT_USE_BLKID_WIPING=1
+ 		AC_DEFINE([BLKID_WIPING_SUPPORT], 1, [Define to 1 to use libblkid detection of signatures when wiping.])
+ 	else
+@@ -1332,6 +1333,7 @@
+ if test "$UDEV_SYNC" = yes; then
+ 	pkg_config_init
+ 	PKG_CHECK_MODULES(UDEV, libudev >= 143, [UDEV_PC="libudev"])
++	UDEV_STATIC_LIBS=`$PKG_CONFIG --static --libs libudev`
+ 	AC_DEFINE([UDEV_SYNC_SUPPORT], 1, [Define to 1 to enable synchronisation with udev processing.])
+ fi
+ 
+@@ -1558,19 +1560,32 @@
+ if test "$SELINUX" = yes; then
+ 	AC_CHECK_LIB([sepol], [sepol_check_context], [
+ 		AC_DEFINE([HAVE_SEPOL], 1, [Define to 1 if sepol_check_context is available.])
+-		SELINUX_LIBS="-lsepol"])
++		SEPOL_LIBS="-lsepol"])
++
++	dnl -- init pkgconfig if required
++	if  test x$PKGCONFIG_INIT != x1; then
++		pkg_config_init
++	fi
++	PKG_CHECK_MODULES(SELINUX, libselinux, [
++		SELINUX_PC="libselinux"
++		SELINUX_STATIC_LIBS=`$PKG_CONFIG --static --libs libselinux`
++		SELINUX_LIBS="$SELINUX_LIBS $SEPOL_LIBS"
++		AC_DEFINE([HAVE_SELINUX], 1, [Define to 1 to include support for selinux.])
++	],[
++		dnl -- old non-pkgconfig method, is buggy with static builds
+ 
+ 	AC_CHECK_LIB([selinux], [is_selinux_enabled], [
+ 		AC_CHECK_HEADERS([selinux/selinux.h],, hard_bailout)
+ 		AC_CHECK_HEADERS([selinux/label.h])
+ 		AC_DEFINE([HAVE_SELINUX], 1, [Define to 1 to include support for selinux.])
+-		SELINUX_LIBS="-lselinux $SELINUX_LIBS"
++		SELINUX_LIBS="-lselinux $SEPOL_LIBS"
+ 		SELINUX_PC="libselinux"
+ 		HAVE_SELINUX=yes ], [
+ 		AC_MSG_WARN(Disabling selinux)
+ 		SELINUX_LIBS=
+ 		SELINUX_PC=
+ 		HAVE_SELINUX=no ])
++	])
+ fi
+ 
+ ################################################################################
+@@ -1902,6 +1917,7 @@
+ ################################################################################
+ AC_SUBST(APPLIB)
+ AC_SUBST(AWK)
++AC_SUBST(BLKID_STATIC_LIBS)
+ AC_SUBST(BLKID_PC)
+ AC_SUBST(BUILD_CMIRRORD)
+ AC_SUBST(BUILD_DMEVENTD)
+@@ -2005,6 +2021,7 @@
+ AC_SUBST(SALCK_CFLAGS)
+ AC_SUBST(SALCK_LIBS)
+ AC_SUBST(SELINUX_LIBS)
++AC_SUBST(SELINUX_STATIC_LIBS)
+ AC_SUBST(SELINUX_PC)
+ AC_SUBST(SNAPSHOTS)
+ AC_SUBST(STATICDIR)
+@@ -2020,6 +2037,7 @@
+ AC_SUBST(CACHE_DUMP_CMD)
+ AC_SUBST(CACHE_REPAIR_CMD)
+ AC_SUBST(CACHE_RESTORE_CMD)
++AC_SUBST(UDEV_STATIC_LIBS)
+ AC_SUBST(UDEV_PC)
+ AC_SUBST(UDEV_RULES)
+ AC_SUBST(UDEV_SYNC)
+--- LVM2.2.02.129/make.tmpl.in
++++ LVM2.2.02.129/make.tmpl.in
+@@ -43,7 +43,7 @@
+ 
+ LIBS = @LIBS@
+ # Extra libraries always linked with static binaries
+-STATIC_LIBS = $(SELINUX_LIBS) $(UDEV_LIBS) $(BLKID_LIBS)
++STATIC_LIBS = $(SELINUX_STATIC_LIBS) $(UDEV_STATIC_LIBS) $(BLKID_STATIC_LIBS)
+ DEFS += @DEFS@
+ # FIXME set this only where it's needed, not globally?
+ CFLAGS ?= @COPTIMISE_FLAG@ @CFLAGS@
+@@ -58,10 +58,13 @@
+ PTHREAD_LIBS = @PTHREAD_LIBS@
+ READLINE_LIBS = @READLINE_LIBS@
+ SELINUX_LIBS = @SELINUX_LIBS@
++SELINUX_STATIC_LIBS = @SELINUX_STATIC_LIBS@
+ UDEV_CFLAGS = @UDEV_CFLAGS@
+ UDEV_LIBS = @UDEV_LIBS@
++UDEV_STATIC_LIBS = @UDEV_STATIC_LIBS@
+ BLKID_CFLAGS = @BLKID_CFLAGS@
+ BLKID_LIBS = @BLKID_LIBS@
++BLKID_STATIC_LIBS = @BLKID_STATIC_LIBS@
+ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@
+ TESTING = @TESTING@
+ 

diff --git a/sys-fs/lvm2/files/lvm2-2.02.130-pthread-pkgconfig.patch b/sys-fs/lvm2/files/lvm2-2.02.130-pthread-pkgconfig.patch
new file mode 100644
index 0000000..11db632
--- /dev/null
+++ b/sys-fs/lvm2/files/lvm2-2.02.130-pthread-pkgconfig.patch
@@ -0,0 +1,32 @@
+Make sure that libdm usage always brings in pthread libraries, both in
+pkgconfig and during manual build.
+
+--- LVM2.2.02.130/libdm/libdevmapper.pc.in
++++ LVM2.2.02.130/libdm/libdevmapper.pc.in
+@@ -9,4 +9,4 @@
+ Cflags: -I${includedir} 
+ Libs: -L${libdir} -ldevmapper
+ Requires.private: @SELINUX_PC@ @UDEV_PC@
+-Libs.private: -lm @RT_LIB@
++Libs.private: -lm @RT_LIB@ @PTHREAD_LIBS@
+--- LVM2.2.02.130/tools/Makefile.in
++++ LVM2.2.02.130/tools/Makefile.in
+@@ -90,6 +90,7 @@
+   INSTALL_LVM_TARGETS += install_tools_static
+   INSTALL_DMSETUP_TARGETS += install_dmsetup_static
+   INSTALL_CMDLIB_TARGETS += install_cmdlib_static
++  STATIC_LIBS += @PTHREAD_LIBS@
+ endif
+ 
+ LVMLIBS = $(LVMINTERNAL_LIBS)
+@@ -120,6 +121,10 @@
+ 
+ include $(top_builddir)/make.tmpl
+ 
++ifeq ("@STATIC_LINK@", "yes")
++  STATIC_LIBS += @PTHREAD_LIBS@
++endif
++
+ device-mapper: $(TARGETS_DM)
+ 
+ CFLAGS_dmsetup.o += $(UDEV_CFLAGS) $(EXTRA_EXEC_CFLAGS)

diff --git a/sys-fs/lvm2/lvm2-2.02.136.ebuild b/sys-fs/lvm2/lvm2-2.02.136.ebuild
new file mode 100644
index 0000000..96c067b
--- /dev/null
+++ b/sys-fs/lvm2/lvm2-2.02.136.ebuild
@@ -0,0 +1,275 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit autotools eutils linux-info multilib systemd toolchain-funcs udev flag-o-matic
+
+DESCRIPTION="User-land utilities for LVM2 (device-mapper) software"
+HOMEPAGE="https://sources.redhat.com/lvm2/"
+SRC_URI="ftp://sources.redhat.com/pub/lvm2/${PN/lvm/LVM}.${PV}.tgz
+	ftp://sources.redhat.com/pub/lvm2/old/${PN/lvm/LVM}.${PV}.tgz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~x86-linux"
+IUSE="readline static static-libs systemd clvm cman lvm1 lvm2create_initrd selinux +udev +thin device-mapper-only"
+REQUIRED_USE="device-mapper-only? ( !clvm !cman !lvm1 !lvm2create_initrd !thin )
+	systemd? ( udev )
+	clvm? ( !systemd )"
+
+DEPEND_COMMON="clvm? ( cman? ( =sys-cluster/cman-3* ) =sys-cluster/libdlm-3* )
+	readline? ( sys-libs/readline:0= )
+	udev? ( >=virtual/libudev-208:=[static-libs?] )"
+# /run is now required for locking during early boot. /var cannot be assumed to
+# be available -- thus, pull in recent enough baselayout for /run.
+# This version of LVM is incompatible with cryptsetup <1.1.2.
+RDEPEND="${DEPEND_COMMON}
+	>=sys-apps/baselayout-2.2
+	!<sys-apps/openrc-0.11
+	!<sys-fs/cryptsetup-1.1.2
+	!!sys-fs/clvm
+	!!sys-fs/lvm-user
+	>=sys-apps/util-linux-2.16
+	lvm2create_initrd? ( sys-apps/makedev )
+	thin? ( >=sys-block/thin-provisioning-tools-0.3.0 )"
+# note: thin- 0.3.0 is required to avoid --disable-thin_check_needs_check
+# USE 'static' currently only works with eudev, bug 520450
+DEPEND="${DEPEND_COMMON}
+	virtual/pkgconfig
+	>=sys-devel/binutils-2.20.1-r1
+	static? (
+		selinux? ( sys-libs/libselinux[static-libs] )
+		udev? ( >=sys-fs/eudev-3.1.2[static-libs] )
+		>=sys-apps/util-linux-2.16[static-libs]
+	)"
+
+S=${WORKDIR}/${PN/lvm/LVM}.${PV}
+
+pkg_setup() {
+	local CONFIG_CHECK="~SYSVIPC"
+
+	if use udev; then
+		local WARNING_SYSVIPC="CONFIG_SYSVIPC:\tis not set (required for udev sync)\n"
+		if linux_config_exists; then
+			local uevent_helper_path=$(linux_chkconfig_string UEVENT_HELPER_PATH)
+			if [ -n "${uevent_helper_path}" ] && [ "${uevent_helper_path}" != '""' ]; then
+				ewarn "It's recommended to set an empty value to the following kernel config option:"
+				ewarn "CONFIG_UEVENT_HELPER_PATH=${uevent_helper_path}"
+			fi
+		fi
+	fi
+
+	check_extra_config
+
+	# 1. Genkernel no longer copies /sbin/lvm blindly.
+	if use static; then
+		elog "Warning, we no longer overwrite /sbin/lvm and /sbin/dmsetup with"
+		elog "their static versions. If you need the static binaries,"
+		elog "you must append .static to the filename!"
+	fi
+}
+
+src_prepare() {
+	# Gentoo specific modification(s):
+	epatch "${FILESDIR}"/${PN}-2.02.129-example.conf.in.patch
+
+	sed -i \
+		-e "1iAR = $(tc-getAR)" \
+		-e "s:CC ?= @CC@:CC = $(tc-getCC):" \
+		make.tmpl.in || die #444082
+
+	sed -i -e '/FLAG/s:-O2::' configure{.in,} || die #480212
+
+	if use udev && ! use device-mapper-only; then
+		sed -i -e '/use_lvmetad =/s:0:1:' conf/example.conf.in || die #514196
+		elog "Notice that \"use_lvmetad\" setting is enabled with USE=\"udev\" in"
+		elog "/etc/lvm/lvm.conf, which will require restart of udev, lvm, and lvmetad"
+		elog "if it was previously disabled."
+	fi
+
+	sed -i -e "s:/usr/bin/true:$(type -P true):" scripts/blk_availability_systemd_red_hat.service.in || die #517514
+
+	# For upstream -- review and forward:
+	epatch "${FILESDIR}"/${PN}-2.02.63-always-make-static-libdm.patch
+	epatch "${FILESDIR}"/${PN}-2.02.56-lvm2create_initrd.patch
+	epatch "${FILESDIR}"/${PN}-2.02.67-createinitrd.patch #301331
+	epatch "${FILESDIR}"/${PN}-2.02.99-locale-muck.patch #330373
+	epatch "${FILESDIR}"/${PN}-2.02.70-asneeded.patch # -Wl,--as-needed
+	epatch "${FILESDIR}"/${PN}-2.02.129-dynamic-static-ldflags.patch #332905
+	epatch "${FILESDIR}"/${PN}-2.02.129-static-pkgconfig-libs.patch #370217, #439414 + blkid
+	epatch "${FILESDIR}"/${PN}-2.02.130-pthread-pkgconfig.patch #492450
+
+	# Without thin-privision-tools, there is nothing to install for target install_man7:
+	use thin || { sed -i -e '/^install_lvm2/s:install_man7::' man/Makefile.in || die; }
+
+	eautoreconf
+}
+
+src_configure() {
+	filter-flags -flto
+	local myconf
+	local buildmode
+
+	myconf="${myconf} $(use_enable !device-mapper-only dmeventd)"
+	myconf="${myconf} $(use_enable !device-mapper-only cmdlib)"
+	myconf="${myconf} $(use_enable !device-mapper-only applib)"
+	myconf="${myconf} $(use_enable !device-mapper-only fsadm)"
+	myconf="${myconf} $(use_enable !device-mapper-only lvmetad)"
+	use device-mapper-only && myconf="${myconf} --disable-udev-systemd-background-jobs"
+
+	# Most of this package does weird stuff.
+	# The build options are tristate, and --without is NOT supported
+	# options: 'none', 'internal', 'shared'
+	if use static; then
+		buildmode="internal"
+		# This only causes the .static versions to become available
+		myconf="${myconf} --enable-static_link"
+	else
+		buildmode="shared"
+	fi
+	dmbuildmode=$(use !device-mapper-only && echo internal || echo none)
+
+	# dmeventd requires mirrors to be internal, and snapshot available
+	# so we cannot disable them
+	myconf="${myconf} --with-mirrors=${dmbuildmode}"
+	myconf="${myconf} --with-snapshots=${dmbuildmode}"
+	if use thin; then
+		myconf="${myconf} --with-thin=internal --with-cache=internal"
+		local texec
+		for texec in check dump repair restore; do
+			myconf="${myconf} --with-thin-${texec}=${EPREFIX}/sbin/thin_${texec}"
+			myconf="${myconf} --with-cache-${texec}=${EPREFIX}/sbin/cache_${texec}"
+		done
+	else
+		myconf="${myconf} --with-thin=none --with-cache=none"
+	fi
+
+	if use lvm1; then
+		myconf="${myconf} --with-lvm1=${buildmode}"
+	else
+		myconf="${myconf} --with-lvm1=none"
+	fi
+
+	# disable O_DIRECT support on hppa, breaks pv detection (#99532)
+	use hppa && myconf="${myconf} --disable-o_direct"
+
+	if use clvm; then
+		myconf="${myconf} --with-cluster=${buildmode}"
+		# 4-state! Make sure we get it right, per bug 210879
+		# Valid options are: none, cman, gulm, all
+		#
+		# 2009/02:
+		# gulm is removed now, now dual-state:
+		# cman, none
+		# all still exists, but is not needed
+		#
+		# 2009/07:
+		# TODO: add corosync and re-enable ALL
+		local clvmd=""
+		use cman && clvmd="cman"
+		#clvmd="${clvmd/cmangulm/all}"
+		[ -z "${clvmd}" ] && clvmd="none"
+		myconf="${myconf} --with-clvmd=${clvmd}"
+		myconf="${myconf} --with-pool=${buildmode}"
+	else
+		myconf="${myconf} --with-clvmd=none --with-cluster=none"
+	fi
+
+	econf \
+		$(use_enable readline) \
+		$(use_enable selinux) \
+		--enable-pkgconfig \
+		--with-confdir="${EPREFIX}"/etc \
+		--exec-prefix="${EPREFIX}" \
+		--sbindir="${EPREFIX}/sbin" \
+		--with-staticdir="${EPREFIX}"/sbin \
+		--libdir="${EPREFIX}/$(get_libdir)" \
+		--with-usrlibdir="${EPREFIX}/usr/$(get_libdir)" \
+		--with-default-dm-run-dir=/run \
+		--with-default-run-dir=/run/lvm \
+		--with-default-locking-dir=/run/lock/lvm \
+		--with-default-pid-dir=/run \
+		$(use_enable udev udev_rules) \
+		$(use_enable udev udev_sync) \
+		$(use_with udev udevdir "$(get_udevdir)"/rules.d) \
+		$(use_enable systemd udev-systemd-background-jobs) \
+		"$(systemd_with_unitdir)" \
+		${myconf} \
+		CLDFLAGS="${LDFLAGS}"
+}
+
+src_compile() {
+	pushd include >/dev/null
+	emake
+	popd >/dev/null
+
+	if use device-mapper-only ; then
+		emake device-mapper
+	else
+		emake
+		emake CC="$(tc-getCC)" -C scripts lvm2_activation_generator_systemd_red_hat
+	fi
+}
+
+src_install() {
+	local inst
+	INSTALL_TARGETS="install install_tmpfiles_configuration"
+	# install systemd related files only when requested, bug #522430
+	use systemd && INSTALL_TARGETS="${INSTALL_TARGETS} install_systemd_units install_systemd_generators"
+	use device-mapper-only && INSTALL_TARGETS="install_device-mapper"
+	for inst in ${INSTALL_TARGETS}; do
+		emake DESTDIR="${D}" ${inst}
+	done
+
+	newinitd "${FILESDIR}"/device-mapper.rc-2.02.105-r2 device-mapper
+	newconfd "${FILESDIR}"/device-mapper.conf-1.02.22-r3 device-mapper
+
+	if use !device-mapper-only ; then
+		newinitd "${FILESDIR}"/dmeventd.initd-2.02.67-r1 dmeventd
+		newinitd "${FILESDIR}"/lvm.rc-2.02.105-r2 lvm
+		newconfd "${FILESDIR}"/lvm.confd-2.02.28-r2 lvm
+
+		newinitd "${FILESDIR}"/lvm-monitoring.initd-2.02.105-r2 lvm-monitoring
+		newinitd "${FILESDIR}"/lvmetad.initd-2.02.105-r2 lvmetad
+	fi
+
+	if use clvm; then
+		newinitd "${FILESDIR}"/clvmd.rc-2.02.39 clvmd
+		newconfd "${FILESDIR}"/clvmd.confd-2.02.39 clvmd
+	fi
+
+	if use static-libs; then
+		dolib.a libdm/ioctl/libdevmapper.a
+		dolib.a libdaemon/client/libdaemonclient.a #462908
+		#gen_usr_ldscript libdevmapper.so
+		dolib.a daemons/dmeventd/libdevmapper-event.a
+		#gen_usr_ldscript libdevmapper-event.so
+	else
+		rm -f "${ED}"usr/$(get_libdir)/{libdevmapper-event,liblvm2cmd,liblvm2app,libdevmapper}.a
+	fi
+
+	if use lvm2create_initrd; then
+		dosbin scripts/lvm2create_initrd/lvm2create_initrd
+		doman scripts/lvm2create_initrd/lvm2create_initrd.8
+		newdoc scripts/lvm2create_initrd/README README.lvm2create_initrd
+	fi
+
+	insinto /etc
+	doins "${FILESDIR}"/dmtab
+
+	dodoc README VERSION* WHATS_NEW WHATS_NEW_DM doc/*.{c,txt} conf/*.conf
+}
+
+pkg_postinst() {
+	ewarn "Make sure the \"lvm\" init script is in the runlevels:"
+	ewarn "# rc-update add lvm boot"
+	ewarn
+	ewarn "Make sure to enable lvmetad in /etc/lvm/lvm.conf if you want"
+	ewarn "to enable lvm autoactivation and metadata caching."
+}
+
+src_test() {
+	einfo "Tests are disabled because of device-node mucking, if you want to"
+	einfo "run tests, compile the package and see ${S}/tests"
+}


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-fs/lvm2/, sys-fs/lvm2/files/
@ 2015-12-28  0:30 Robin H. Johnson
  0 siblings, 0 replies; 29+ messages in thread
From: Robin H. Johnson @ 2015-12-28  0:30 UTC (permalink / raw
  To: gentoo-commits

commit:     1d828236d11580a7fc057ff700b86e09e94cc188
Author:     Doug Goldstein <cardoe <AT> gentoo <DOT> org>
AuthorDate: Thu Dec 24 22:51:37 2015 +0000
Commit:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Mon Dec 28 00:28:57 2015 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1d828236

sys-fs/lvm2: fix missing dir for lvmetad

lvmetad fails to start up due to /run/lvm not existing when it the
system needs it to start. This ensures the directory is created.

Gentoo-Bug: 521960
Signed-off-by: Doug Goldstein <cardoe <AT> gentoo.org>
Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>

 sys-fs/lvm2/files/lvmetad.initd-2.02.116-r3 |  18 ++
 sys-fs/lvm2/lvm2-2.02.116-r3.ebuild         | 275 ++++++++++++++++++++++++++++
 2 files changed, 293 insertions(+)

diff --git a/sys-fs/lvm2/files/lvmetad.initd-2.02.116-r3 b/sys-fs/lvm2/files/lvmetad.initd-2.02.116-r3
new file mode 100644
index 0000000..db0b698
--- /dev/null
+++ b/sys-fs/lvm2/files/lvmetad.initd-2.02.116-r3
@@ -0,0 +1,18 @@
+#!/sbin/runscript
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+pidfile="/run/lvmetad.pid"
+command="/sbin/lvmetad"
+command_args="${LVMETAD_OPTS:=-p ${pidfile}}"
+start_stop_daemon_args="--pidfile ${pidfile}"
+
+depend() {
+	:
+}
+
+start_pre()
+{
+	checkpath --directory /run/lvm || return 1
+}

diff --git a/sys-fs/lvm2/lvm2-2.02.116-r3.ebuild b/sys-fs/lvm2/lvm2-2.02.116-r3.ebuild
new file mode 100644
index 0000000..3146e3c
--- /dev/null
+++ b/sys-fs/lvm2/lvm2-2.02.116-r3.ebuild
@@ -0,0 +1,275 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit autotools eutils linux-info multilib systemd toolchain-funcs udev flag-o-matic
+
+DESCRIPTION="User-land utilities for LVM2 (device-mapper) software"
+HOMEPAGE="https://sources.redhat.com/lvm2/"
+SRC_URI="ftp://sources.redhat.com/pub/lvm2/${PN/lvm/LVM}.${PV}.tgz
+	ftp://sources.redhat.com/pub/lvm2/old/${PN/lvm/LVM}.${PV}.tgz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~x86-linux"
+IUSE="readline static static-libs systemd clvm cman lvm1 lvm2create_initrd selinux +udev +thin device-mapper-only"
+REQUIRED_USE="device-mapper-only? ( !clvm !cman !lvm1 !lvm2create_initrd !thin )
+	systemd? ( udev )
+	clvm? ( !systemd )"
+
+DEPEND_COMMON="clvm? ( cman? ( =sys-cluster/cman-3* ) =sys-cluster/libdlm-3* )
+	readline? ( sys-libs/readline:0= )
+	udev? ( >=virtual/libudev-208:=[static-libs?] )"
+# /run is now required for locking during early boot. /var cannot be assumed to
+# be available -- thus, pull in recent enough baselayout for /run.
+# This version of LVM is incompatible with cryptsetup <1.1.2.
+RDEPEND="${DEPEND_COMMON}
+	>=sys-apps/baselayout-2.2
+	!<sys-apps/openrc-0.11
+	!<sys-fs/cryptsetup-1.1.2
+	!!sys-fs/clvm
+	!!sys-fs/lvm-user
+	>=sys-apps/util-linux-2.16
+	lvm2create_initrd? ( sys-apps/makedev )
+	thin? ( >=sys-block/thin-provisioning-tools-0.3.0 )"
+# note: thin- 0.3.0 is required to avoid --disable-thin_check_needs_check
+# USE 'static' currently only works with eudev, bug 520450
+DEPEND="${DEPEND_COMMON}
+	virtual/pkgconfig
+	>=sys-devel/binutils-2.20.1-r1
+	static? (
+		selinux? ( sys-libs/libselinux[static-libs] )
+		udev? ( >=sys-fs/eudev-3.1.2[static-libs] )
+		>=sys-apps/util-linux-2.16[static-libs]
+	)"
+
+S=${WORKDIR}/${PN/lvm/LVM}.${PV}
+
+pkg_setup() {
+	local CONFIG_CHECK="~SYSVIPC"
+
+	if use udev; then
+		local WARNING_SYSVIPC="CONFIG_SYSVIPC:\tis not set (required for udev sync)\n"
+		if linux_config_exists; then
+			local uevent_helper_path=$(linux_chkconfig_string UEVENT_HELPER_PATH)
+			if [ -n "${uevent_helper_path}" ] && [ "${uevent_helper_path}" != '""' ]; then
+				ewarn "It's recommended to set an empty value to the following kernel config option:"
+				ewarn "CONFIG_UEVENT_HELPER_PATH=${uevent_helper_path}"
+			fi
+		fi
+	fi
+
+	check_extra_config
+
+	# 1. Genkernel no longer copies /sbin/lvm blindly.
+	if use static; then
+		elog "Warning, we no longer overwrite /sbin/lvm and /sbin/dmsetup with"
+		elog "their static versions. If you need the static binaries,"
+		elog "you must append .static to the filename!"
+	fi
+}
+
+src_prepare() {
+	# Gentoo specific modification(s):
+	epatch "${FILESDIR}"/${PN}-2.02.108-example.conf.in.patch
+
+	sed -i \
+		-e "1iAR = $(tc-getAR)" \
+		-e "s:CC ?= @CC@:CC = $(tc-getCC):" \
+		make.tmpl.in || die #444082
+
+	sed -i -e '/FLAG/s:-O2::' configure{.in,} || die #480212
+
+	if use udev && ! use device-mapper-only; then
+		sed -i -e '/use_lvmetad =/s:0:1:' conf/example.conf.in || die #514196
+		elog "Notice that \"use_lvmetad\" setting is enabled with USE=\"udev\" in"
+		elog "/etc/lvm/lvm.conf, which will require restart of udev, lvm, and lvmetad"
+		elog "if it was previously disabled."
+	fi
+
+	sed -i -e "s:/usr/bin/true:$(type -P true):" scripts/blk_availability_systemd_red_hat.service.in || die #517514
+
+	# For upstream -- review and forward:
+	epatch "${FILESDIR}"/${PN}-2.02.63-always-make-static-libdm.patch
+	epatch "${FILESDIR}"/${PN}-2.02.56-lvm2create_initrd.patch
+	epatch "${FILESDIR}"/${PN}-2.02.67-createinitrd.patch #301331
+	epatch "${FILESDIR}"/${PN}-2.02.99-locale-muck.patch #330373
+	epatch "${FILESDIR}"/${PN}-2.02.70-asneeded.patch # -Wl,--as-needed
+	epatch "${FILESDIR}"/${PN}-2.02.92-dynamic-static-ldflags.patch #332905
+	epatch "${FILESDIR}"/${PN}-2.02.108-static-pkgconfig-libs.patch #370217, #439414 + blkid
+	epatch "${FILESDIR}"/${PN}-2.02.106-pthread-pkgconfig.patch #492450
+
+	# Without thin-privision-tools, there is nothing to install for target install_man7:
+	use thin || { sed -i -e '/^install_lvm2/s:install_man7::' man/Makefile.in || die; }
+
+	eautoreconf
+}
+
+src_configure() {
+	filter-flags -flto
+	local myconf
+	local buildmode
+
+	myconf="${myconf} $(use_enable !device-mapper-only dmeventd)"
+	myconf="${myconf} $(use_enable !device-mapper-only cmdlib)"
+	myconf="${myconf} $(use_enable !device-mapper-only applib)"
+	myconf="${myconf} $(use_enable !device-mapper-only fsadm)"
+	myconf="${myconf} $(use_enable !device-mapper-only lvmetad)"
+	use device-mapper-only && myconf="${myconf} --disable-udev-systemd-background-jobs"
+
+	# Most of this package does weird stuff.
+	# The build options are tristate, and --without is NOT supported
+	# options: 'none', 'internal', 'shared'
+	if use static; then
+		buildmode="internal"
+		# This only causes the .static versions to become available
+		myconf="${myconf} --enable-static_link"
+	else
+		buildmode="shared"
+	fi
+	dmbuildmode=$(use !device-mapper-only && echo internal || echo none)
+
+	# dmeventd requires mirrors to be internal, and snapshot available
+	# so we cannot disable them
+	myconf="${myconf} --with-mirrors=${dmbuildmode}"
+	myconf="${myconf} --with-snapshots=${dmbuildmode}"
+	if use thin; then
+		myconf="${myconf} --with-thin=internal --with-cache=internal"
+		local texec
+		for texec in check dump repair restore; do
+			myconf="${myconf} --with-thin-${texec}=${EPREFIX}/sbin/thin_${texec}"
+			myconf="${myconf} --with-cache-${texec}=${EPREFIX}/sbin/cache_${texec}"
+		done
+	else
+		myconf="${myconf} --with-thin=none --with-cache=none"
+	fi
+
+	if use lvm1; then
+		myconf="${myconf} --with-lvm1=${buildmode}"
+	else
+		myconf="${myconf} --with-lvm1=none"
+	fi
+
+	# disable O_DIRECT support on hppa, breaks pv detection (#99532)
+	use hppa && myconf="${myconf} --disable-o_direct"
+
+	if use clvm; then
+		myconf="${myconf} --with-cluster=${buildmode}"
+		# 4-state! Make sure we get it right, per bug 210879
+		# Valid options are: none, cman, gulm, all
+		#
+		# 2009/02:
+		# gulm is removed now, now dual-state:
+		# cman, none
+		# all still exists, but is not needed
+		#
+		# 2009/07:
+		# TODO: add corosync and re-enable ALL
+		local clvmd=""
+		use cman && clvmd="cman"
+		#clvmd="${clvmd/cmangulm/all}"
+		[ -z "${clvmd}" ] && clvmd="none"
+		myconf="${myconf} --with-clvmd=${clvmd}"
+		myconf="${myconf} --with-pool=${buildmode}"
+	else
+		myconf="${myconf} --with-clvmd=none --with-cluster=none"
+	fi
+
+	econf \
+		$(use_enable readline) \
+		$(use_enable selinux) \
+		--enable-pkgconfig \
+		--with-confdir="${EPREFIX}"/etc \
+		--exec-prefix="${EPREFIX}" \
+		--sbindir="${EPREFIX}/sbin" \
+		--with-staticdir="${EPREFIX}"/sbin \
+		--libdir="${EPREFIX}/$(get_libdir)" \
+		--with-usrlibdir="${EPREFIX}/usr/$(get_libdir)" \
+		--with-default-dm-run-dir=/run \
+		--with-default-run-dir=/run/lvm \
+		--with-default-locking-dir=/run/lock/lvm \
+		--with-default-pid-dir=/run \
+		$(use_enable udev udev_rules) \
+		$(use_enable udev udev_sync) \
+		$(use_with udev udevdir "$(get_udevdir)"/rules.d) \
+		$(use_enable systemd udev-systemd-background-jobs) \
+		"$(systemd_with_unitdir)" \
+		${myconf} \
+		CLDFLAGS="${LDFLAGS}"
+}
+
+src_compile() {
+	pushd include >/dev/null
+	emake
+	popd >/dev/null
+
+	if use device-mapper-only ; then
+		emake device-mapper
+	else
+		emake
+		emake CC="$(tc-getCC)" -C scripts lvm2_activation_generator_systemd_red_hat
+	fi
+}
+
+src_install() {
+	local inst
+	INSTALL_TARGETS="install install_tmpfiles_configuration"
+	# install systemd related files only when requested, bug #522430
+	use systemd && INSTALL_TARGETS="${INSTALL_TARGETS} install_systemd_units install_systemd_generators"
+	use device-mapper-only && INSTALL_TARGETS="install_device-mapper"
+	for inst in ${INSTALL_TARGETS}; do
+		emake DESTDIR="${D}" ${inst}
+	done
+
+	newinitd "${FILESDIR}"/device-mapper.rc-2.02.105-r2 device-mapper
+	newconfd "${FILESDIR}"/device-mapper.conf-1.02.22-r3 device-mapper
+
+	if use !device-mapper-only ; then
+		newinitd "${FILESDIR}"/dmeventd.initd-2.02.67-r1 dmeventd
+		newinitd "${FILESDIR}"/lvm.rc-2.02.105-r2 lvm
+		newconfd "${FILESDIR}"/lvm.confd-2.02.28-r2 lvm
+
+		newinitd "${FILESDIR}"/lvm-monitoring.initd-2.02.105-r2 lvm-monitoring
+		newinitd "${FILESDIR}"/lvmetad.initd-2.02.116-r3 lvmetad
+	fi
+
+	if use clvm; then
+		newinitd "${FILESDIR}"/clvmd.rc-2.02.39 clvmd
+		newconfd "${FILESDIR}"/clvmd.confd-2.02.39 clvmd
+	fi
+
+	if use static-libs; then
+		dolib.a libdm/ioctl/libdevmapper.a
+		dolib.a libdaemon/client/libdaemonclient.a #462908
+		#gen_usr_ldscript libdevmapper.so
+		dolib.a daemons/dmeventd/libdevmapper-event.a
+		#gen_usr_ldscript libdevmapper-event.so
+	else
+		rm -f "${ED}"usr/$(get_libdir)/{libdevmapper-event,liblvm2cmd,liblvm2app,libdevmapper}.a
+	fi
+
+	if use lvm2create_initrd; then
+		dosbin scripts/lvm2create_initrd/lvm2create_initrd
+		doman scripts/lvm2create_initrd/lvm2create_initrd.8
+		newdoc scripts/lvm2create_initrd/README README.lvm2create_initrd
+	fi
+
+	insinto /etc
+	doins "${FILESDIR}"/dmtab
+
+	dodoc README VERSION* WHATS_NEW WHATS_NEW_DM doc/*.{c,txt} conf/*.conf
+}
+
+pkg_postinst() {
+	ewarn "Make sure the \"lvm\" init script is in the runlevels:"
+	ewarn "# rc-update add lvm boot"
+	ewarn
+	ewarn "Make sure to enable lvmetad in /etc/lvm/lvm.conf if you want"
+	ewarn "to enable lvm autoactivation and metadata caching."
+}
+
+src_test() {
+	einfo "Tests are disabled because of device-node mucking, if you want to"
+	einfo "run tests, compile the package and see ${S}/tests"
+}


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-fs/lvm2/, sys-fs/lvm2/files/
@ 2016-01-25  2:40 Marc Schiffbauer
  0 siblings, 0 replies; 29+ messages in thread
From: Marc Schiffbauer @ 2016-01-25  2:40 UTC (permalink / raw
  To: gentoo-commits

commit:     12075148731ca4a757856149001bccf4cbd60827
Author:     Marc Schiffbauer <mschiff <AT> gentoo <DOT> org>
AuthorDate: Mon Jan 25 02:40:18 2016 +0000
Commit:     Marc Schiffbauer <mschiff <AT> gentoo <DOT> org>
CommitDate: Mon Jan 25 02:40:38 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=12075148

sys-fs/lvm2: Add revbumps to fix #461564

Package-Manager: portage-2.2.26

 sys-fs/lvm2/files/clvmd.rc-2.02.39  |   2 +-
 sys-fs/lvm2/lvm2-2.02.116-r5.ebuild | 291 ++++++++++++++++++++++++++++++++++++
 sys-fs/lvm2/lvm2-2.02.136-r1.ebuild | 284 +++++++++++++++++++++++++++++++++++
 sys-fs/lvm2/metadata.xml            |   2 +
 4 files changed, 578 insertions(+), 1 deletion(-)

diff --git a/sys-fs/lvm2/files/clvmd.rc-2.02.39 b/sys-fs/lvm2/files/clvmd.rc-2.02.39
index 5bba99a..f1c157b 100644
--- a/sys-fs/lvm2/files/clvmd.rc-2.02.39
+++ b/sys-fs/lvm2/files/clvmd.rc-2.02.39
@@ -15,7 +15,7 @@ CLVMD_PIDFILE="/var/run/clvmd.pid"
 
 depend() {
 	use net dns logger dmeventd
-	need cman
+	want cman corosync openais
 }
 
 load_modules() {

diff --git a/sys-fs/lvm2/lvm2-2.02.116-r5.ebuild b/sys-fs/lvm2/lvm2-2.02.116-r5.ebuild
new file mode 100644
index 0000000..ca30d98
--- /dev/null
+++ b/sys-fs/lvm2/lvm2-2.02.116-r5.ebuild
@@ -0,0 +1,291 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit autotools eutils linux-info multilib systemd toolchain-funcs udev flag-o-matic
+
+DESCRIPTION="User-land utilities for LVM2 (device-mapper) software"
+HOMEPAGE="https://sources.redhat.com/lvm2/"
+SRC_URI="ftp://sources.redhat.com/pub/lvm2/${PN/lvm/LVM}.${PV}.tgz
+	ftp://sources.redhat.com/pub/lvm2/old/${PN/lvm/LVM}.${PV}.tgz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~x86-linux"
+IUSE="readline static static-libs systemd clvm cman corosync lvm1 lvm2create_initrd openais selinux +udev +thin device-mapper-only"
+REQUIRED_USE="device-mapper-only? ( !clvm !cman !corosync !lvm1 !lvm2create_initrd !openais !thin )
+	systemd? ( udev )
+	clvm? ( !systemd )"
+
+DEPEND_COMMON="
+	clvm? (
+		cman? ( =sys-cluster/cman-3* )
+		corosync? ( sys-cluster/corosync )
+		openais? ( sys-cluster/openais )
+		=sys-cluster/libdlm-3*
+	)
+
+	readline? ( sys-libs/readline:0= )
+	udev? ( >=virtual/libudev-208:=[static-libs?] )"
+# /run is now required for locking during early boot. /var cannot be assumed to
+# be available -- thus, pull in recent enough baselayout for /run.
+# This version of LVM is incompatible with cryptsetup <1.1.2.
+RDEPEND="${DEPEND_COMMON}
+	>=sys-apps/baselayout-2.2
+	!<sys-apps/openrc-0.11
+	!<sys-fs/cryptsetup-1.1.2
+	!!sys-fs/clvm
+	!!sys-fs/lvm-user
+	>=sys-apps/util-linux-2.16
+	lvm2create_initrd? (
+		app-arch/cpio
+		sys-apps/makedev
+	)
+	thin? ( >=sys-block/thin-provisioning-tools-0.3.0 )"
+# note: thin- 0.3.0 is required to avoid --disable-thin_check_needs_check
+# USE 'static' currently only works with eudev, bug 520450
+DEPEND="${DEPEND_COMMON}
+	virtual/pkgconfig
+	>=sys-devel/binutils-2.20.1-r1
+	static? (
+		selinux? ( sys-libs/libselinux[static-libs] )
+		udev? ( >=sys-fs/eudev-3.1.2[static-libs] )
+		>=sys-apps/util-linux-2.16[static-libs]
+	)"
+
+S=${WORKDIR}/${PN/lvm/LVM}.${PV}
+
+pkg_setup() {
+	local CONFIG_CHECK="~SYSVIPC"
+
+	if use udev; then
+		local WARNING_SYSVIPC="CONFIG_SYSVIPC:\tis not set (required for udev sync)\n"
+		if linux_config_exists; then
+			local uevent_helper_path=$(linux_chkconfig_string UEVENT_HELPER_PATH)
+			if [ -n "${uevent_helper_path}" ] && [ "${uevent_helper_path}" != '""' ]; then
+				ewarn "It's recommended to set an empty value to the following kernel config option:"
+				ewarn "CONFIG_UEVENT_HELPER_PATH=${uevent_helper_path}"
+			fi
+		fi
+	fi
+
+	check_extra_config
+
+	# 1. Genkernel no longer copies /sbin/lvm blindly.
+	if use static; then
+		elog "Warning, we no longer overwrite /sbin/lvm and /sbin/dmsetup with"
+		elog "their static versions. If you need the static binaries,"
+		elog "you must append .static to the filename!"
+	fi
+}
+
+src_prepare() {
+	# Gentoo specific modification(s):
+	epatch "${FILESDIR}"/${PN}-2.02.108-example.conf.in.patch
+
+	sed -i \
+		-e "1iAR = $(tc-getAR)" \
+		-e "s:CC ?= @CC@:CC = $(tc-getCC):" \
+		make.tmpl.in || die #444082
+
+	sed -i -e '/FLAG/s:-O2::' configure{.in,} || die #480212
+
+	if use udev && ! use device-mapper-only; then
+		sed -i -e '/use_lvmetad =/s:0:1:' conf/example.conf.in || die #514196
+		elog "Notice that \"use_lvmetad\" setting is enabled with USE=\"udev\" in"
+		elog "/etc/lvm/lvm.conf, which will require restart of udev, lvm, and lvmetad"
+		elog "if it was previously disabled."
+	fi
+
+	sed -i -e "s:/usr/bin/true:$(type -P true):" scripts/blk_availability_systemd_red_hat.service.in || die #517514
+
+	# For upstream -- review and forward:
+	epatch "${FILESDIR}"/${PN}-2.02.63-always-make-static-libdm.patch
+	epatch "${FILESDIR}"/${PN}-2.02.56-lvm2create_initrd.patch
+	epatch "${FILESDIR}"/${PN}-2.02.67-createinitrd.patch #301331
+	epatch "${FILESDIR}"/${PN}-2.02.99-locale-muck.patch #330373
+	epatch "${FILESDIR}"/${PN}-2.02.70-asneeded.patch # -Wl,--as-needed
+	epatch "${FILESDIR}"/${PN}-2.02.92-dynamic-static-ldflags.patch #332905
+	epatch "${FILESDIR}"/${PN}-2.02.108-static-pkgconfig-libs.patch #370217, #439414 + blkid
+	epatch "${FILESDIR}"/${PN}-2.02.106-pthread-pkgconfig.patch #492450
+
+	# Without thin-privision-tools, there is nothing to install for target install_man7:
+	use thin || { sed -i -e '/^install_lvm2/s:install_man7::' man/Makefile.in || die; }
+
+	eautoreconf
+}
+
+src_configure() {
+	filter-flags -flto
+	local myconf
+	local buildmode
+
+	myconf="${myconf} $(use_enable !device-mapper-only dmeventd)"
+	myconf="${myconf} $(use_enable !device-mapper-only cmdlib)"
+	myconf="${myconf} $(use_enable !device-mapper-only applib)"
+	myconf="${myconf} $(use_enable !device-mapper-only fsadm)"
+	myconf="${myconf} $(use_enable !device-mapper-only lvmetad)"
+	use device-mapper-only && myconf="${myconf} --disable-udev-systemd-background-jobs"
+
+	# Most of this package does weird stuff.
+	# The build options are tristate, and --without is NOT supported
+	# options: 'none', 'internal', 'shared'
+	if use static; then
+		buildmode="internal"
+		# This only causes the .static versions to become available
+		myconf="${myconf} --enable-static_link"
+	else
+		buildmode="shared"
+	fi
+	dmbuildmode=$(use !device-mapper-only && echo internal || echo none)
+
+	# dmeventd requires mirrors to be internal, and snapshot available
+	# so we cannot disable them
+	myconf="${myconf} --with-mirrors=${dmbuildmode}"
+	myconf="${myconf} --with-snapshots=${dmbuildmode}"
+	if use thin; then
+		myconf="${myconf} --with-thin=internal --with-cache=internal"
+		local texec
+		for texec in check dump repair restore; do
+			myconf="${myconf} --with-thin-${texec}=${EPREFIX}/sbin/thin_${texec}"
+			myconf="${myconf} --with-cache-${texec}=${EPREFIX}/sbin/cache_${texec}"
+		done
+	else
+		myconf="${myconf} --with-thin=none --with-cache=none"
+	fi
+
+	if use lvm1; then
+		myconf="${myconf} --with-lvm1=${buildmode}"
+	else
+		myconf="${myconf} --with-lvm1=none"
+	fi
+
+	# disable O_DIRECT support on hppa, breaks pv detection (#99532)
+	use hppa && myconf="${myconf} --disable-o_direct"
+
+	if use clvm; then
+		myconf="${myconf} --with-cluster=${buildmode}"
+		# 4-state! Make sure we get it right, per bug 210879
+		# Valid options are: none, cman, gulm, all
+		#
+		# 2009/02:
+		# gulm is removed now, now dual-state:
+		# cman, none
+		# all still exists, but is not needed
+		#
+		# 2009/07:
+		# TODO: add corosync and re-enable ALL
+		local clvmd=""
+		use cman && clvmd="cman"
+		#clvmd="${clvmd/cmangulm/all}"
+		use corosync && clvmd="${clvmd:+$clvmd,}corosync"
+		use openais && clvmd="${clvmd:+$clvmd,}openais"
+		[ -z "${clvmd}" ] && clvmd="none"
+		myconf="${myconf} --with-clvmd=${clvmd}"
+		myconf="${myconf} --with-pool=${buildmode}"
+	else
+		myconf="${myconf} --with-clvmd=none --with-cluster=none"
+	fi
+
+	econf \
+		$(use_enable readline) \
+		$(use_enable selinux) \
+		--enable-pkgconfig \
+		--with-confdir="${EPREFIX}"/etc \
+		--exec-prefix="${EPREFIX}" \
+		--sbindir="${EPREFIX}/sbin" \
+		--with-staticdir="${EPREFIX}"/sbin \
+		--libdir="${EPREFIX}/$(get_libdir)" \
+		--with-usrlibdir="${EPREFIX}/usr/$(get_libdir)" \
+		--with-default-dm-run-dir=/run \
+		--with-default-run-dir=/run/lvm \
+		--with-default-locking-dir=/run/lock/lvm \
+		--with-default-pid-dir=/run \
+		$(use_enable udev udev_rules) \
+		$(use_enable udev udev_sync) \
+		$(use_with udev udevdir "$(get_udevdir)"/rules.d) \
+		$(use_enable systemd udev-systemd-background-jobs) \
+		"$(systemd_with_unitdir)" \
+		${myconf} \
+		CLDFLAGS="${LDFLAGS}"
+}
+
+src_compile() {
+	pushd include >/dev/null
+	emake
+	popd >/dev/null
+
+	if use device-mapper-only ; then
+		emake device-mapper
+	else
+		emake
+		emake CC="$(tc-getCC)" -C scripts lvm2_activation_generator_systemd_red_hat
+	fi
+}
+
+src_install() {
+	local inst
+	INSTALL_TARGETS="install install_tmpfiles_configuration"
+	# install systemd related files only when requested, bug #522430
+	use systemd && INSTALL_TARGETS="${INSTALL_TARGETS} install_systemd_units install_systemd_generators"
+	use device-mapper-only && INSTALL_TARGETS="install_device-mapper"
+	for inst in ${INSTALL_TARGETS}; do
+		emake DESTDIR="${D}" ${inst}
+	done
+
+	newinitd "${FILESDIR}"/device-mapper.rc-2.02.105-r2 device-mapper
+	newconfd "${FILESDIR}"/device-mapper.conf-1.02.22-r3 device-mapper
+
+	if use !device-mapper-only ; then
+		newinitd "${FILESDIR}"/dmeventd.initd-2.02.67-r1 dmeventd
+		newinitd "${FILESDIR}"/lvm.rc-2.02.116-r4 lvm
+		newconfd "${FILESDIR}"/lvm.confd-2.02.28-r2 lvm
+
+		newinitd "${FILESDIR}"/lvm-monitoring.initd-2.02.105-r2 lvm-monitoring
+		newinitd "${FILESDIR}"/lvmetad.initd-2.02.116-r3 lvmetad
+	fi
+
+	if use clvm; then
+		newinitd "${FILESDIR}"/clvmd.rc-2.02.39 clvmd
+		newconfd "${FILESDIR}"/clvmd.confd-2.02.39 clvmd
+	fi
+
+	if use static-libs; then
+		dolib.a libdm/ioctl/libdevmapper.a
+		dolib.a libdaemon/client/libdaemonclient.a #462908
+		#gen_usr_ldscript libdevmapper.so
+		dolib.a daemons/dmeventd/libdevmapper-event.a
+		#gen_usr_ldscript libdevmapper-event.so
+	else
+		rm -f "${ED}"usr/$(get_libdir)/{libdevmapper-event,liblvm2cmd,liblvm2app,libdevmapper}.a
+	fi
+
+	if use lvm2create_initrd; then
+		dosbin scripts/lvm2create_initrd/lvm2create_initrd
+		doman scripts/lvm2create_initrd/lvm2create_initrd.8
+		newdoc scripts/lvm2create_initrd/README README.lvm2create_initrd
+	fi
+
+	insinto /etc
+	doins "${FILESDIR}"/dmtab
+
+	dodoc README VERSION* WHATS_NEW WHATS_NEW_DM doc/*.{c,txt} conf/*.conf
+}
+
+pkg_postinst() {
+	ewarn "Make sure the \"lvm\" init script is in the runlevels:"
+	ewarn "# rc-update add lvm boot"
+	ewarn
+	ewarn "Make sure to enable lvmetad in /etc/lvm/lvm.conf if you want"
+	ewarn "to enable lvm autoactivation and metadata caching."
+	ewarn
+	ewarn "After enabling or disabling lvmetad in /etc/lvm/lvm.conf you must"
+	ewarn "run the following to update the init script dependencies: "
+	ewarn "# rc-update -u"
+}
+
+src_test() {
+	einfo "Tests are disabled because of device-node mucking, if you want to"
+	einfo "run tests, compile the package and see ${S}/tests"
+}

diff --git a/sys-fs/lvm2/lvm2-2.02.136-r1.ebuild b/sys-fs/lvm2/lvm2-2.02.136-r1.ebuild
new file mode 100644
index 0000000..506eec5
--- /dev/null
+++ b/sys-fs/lvm2/lvm2-2.02.136-r1.ebuild
@@ -0,0 +1,284 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit autotools eutils linux-info multilib systemd toolchain-funcs udev flag-o-matic
+
+DESCRIPTION="User-land utilities for LVM2 (device-mapper) software"
+HOMEPAGE="https://sources.redhat.com/lvm2/"
+SRC_URI="ftp://sources.redhat.com/pub/lvm2/${PN/lvm/LVM}.${PV}.tgz
+	ftp://sources.redhat.com/pub/lvm2/old/${PN/lvm/LVM}.${PV}.tgz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~x86-linux"
+IUSE="readline static static-libs systemd clvm cman corosync lvm1 lvm2create_initrd openais selinux +udev +thin device-mapper-only"
+REQUIRED_USE="device-mapper-only? ( !clvm !cman !corosync !lvm1 !lvm2create_initrd !openais !thin )
+	systemd? ( udev )
+	clvm? ( !systemd )"
+
+DEPEND_COMMON="
+	clvm? (
+		cman? ( =sys-cluster/cman-3* )
+		corosync? ( sys-cluster/corosync )
+		openais? ( sys-cluster/openais )
+		=sys-cluster/libdlm-3*
+	)
+
+	readline? ( sys-libs/readline:0= )
+	udev? ( >=virtual/libudev-208:=[static-libs?] )"
+# /run is now required for locking during early boot. /var cannot be assumed to
+# be available -- thus, pull in recent enough baselayout for /run.
+# This version of LVM is incompatible with cryptsetup <1.1.2.
+RDEPEND="${DEPEND_COMMON}
+	>=sys-apps/baselayout-2.2
+	!<sys-apps/openrc-0.11
+	!<sys-fs/cryptsetup-1.1.2
+	!!sys-fs/clvm
+	!!sys-fs/lvm-user
+	>=sys-apps/util-linux-2.16
+	lvm2create_initrd? ( sys-apps/makedev )
+	thin? ( >=sys-block/thin-provisioning-tools-0.3.0 )"
+# note: thin- 0.3.0 is required to avoid --disable-thin_check_needs_check
+# USE 'static' currently only works with eudev, bug 520450
+DEPEND="${DEPEND_COMMON}
+	virtual/pkgconfig
+	>=sys-devel/binutils-2.20.1-r1
+	static? (
+		selinux? ( sys-libs/libselinux[static-libs] )
+		udev? ( >=sys-fs/eudev-3.1.2[static-libs] )
+		>=sys-apps/util-linux-2.16[static-libs]
+	)"
+
+S=${WORKDIR}/${PN/lvm/LVM}.${PV}
+
+pkg_setup() {
+	local CONFIG_CHECK="~SYSVIPC"
+
+	if use udev; then
+		local WARNING_SYSVIPC="CONFIG_SYSVIPC:\tis not set (required for udev sync)\n"
+		if linux_config_exists; then
+			local uevent_helper_path=$(linux_chkconfig_string UEVENT_HELPER_PATH)
+			if [ -n "${uevent_helper_path}" ] && [ "${uevent_helper_path}" != '""' ]; then
+				ewarn "It's recommended to set an empty value to the following kernel config option:"
+				ewarn "CONFIG_UEVENT_HELPER_PATH=${uevent_helper_path}"
+			fi
+		fi
+	fi
+
+	check_extra_config
+
+	# 1. Genkernel no longer copies /sbin/lvm blindly.
+	if use static; then
+		elog "Warning, we no longer overwrite /sbin/lvm and /sbin/dmsetup with"
+		elog "their static versions. If you need the static binaries,"
+		elog "you must append .static to the filename!"
+	fi
+}
+
+src_prepare() {
+	# Gentoo specific modification(s):
+	epatch "${FILESDIR}"/${PN}-2.02.129-example.conf.in.patch
+
+	sed -i \
+		-e "1iAR = $(tc-getAR)" \
+		-e "s:CC ?= @CC@:CC = $(tc-getCC):" \
+		make.tmpl.in || die #444082
+
+	sed -i -e '/FLAG/s:-O2::' configure{.in,} || die #480212
+
+	if use udev && ! use device-mapper-only; then
+		sed -i -e '/use_lvmetad =/s:0:1:' conf/example.conf.in || die #514196
+		elog "Notice that \"use_lvmetad\" setting is enabled with USE=\"udev\" in"
+		elog "/etc/lvm/lvm.conf, which will require restart of udev, lvm, and lvmetad"
+		elog "if it was previously disabled."
+	fi
+
+	sed -i -e "s:/usr/bin/true:$(type -P true):" scripts/blk_availability_systemd_red_hat.service.in || die #517514
+
+	# For upstream -- review and forward:
+	epatch "${FILESDIR}"/${PN}-2.02.63-always-make-static-libdm.patch
+	epatch "${FILESDIR}"/${PN}-2.02.56-lvm2create_initrd.patch
+	epatch "${FILESDIR}"/${PN}-2.02.67-createinitrd.patch #301331
+	epatch "${FILESDIR}"/${PN}-2.02.99-locale-muck.patch #330373
+	epatch "${FILESDIR}"/${PN}-2.02.70-asneeded.patch # -Wl,--as-needed
+	epatch "${FILESDIR}"/${PN}-2.02.129-dynamic-static-ldflags.patch #332905
+	epatch "${FILESDIR}"/${PN}-2.02.129-static-pkgconfig-libs.patch #370217, #439414 + blkid
+	epatch "${FILESDIR}"/${PN}-2.02.130-pthread-pkgconfig.patch #492450
+
+	# Without thin-privision-tools, there is nothing to install for target install_man7:
+	use thin || { sed -i -e '/^install_lvm2/s:install_man7::' man/Makefile.in || die; }
+
+	eautoreconf
+}
+
+src_configure() {
+	filter-flags -flto
+	local myconf
+	local buildmode
+
+	myconf="${myconf} $(use_enable !device-mapper-only dmeventd)"
+	myconf="${myconf} $(use_enable !device-mapper-only cmdlib)"
+	myconf="${myconf} $(use_enable !device-mapper-only applib)"
+	myconf="${myconf} $(use_enable !device-mapper-only fsadm)"
+	myconf="${myconf} $(use_enable !device-mapper-only lvmetad)"
+	use device-mapper-only && myconf="${myconf} --disable-udev-systemd-background-jobs"
+
+	# Most of this package does weird stuff.
+	# The build options are tristate, and --without is NOT supported
+	# options: 'none', 'internal', 'shared'
+	if use static; then
+		buildmode="internal"
+		# This only causes the .static versions to become available
+		myconf="${myconf} --enable-static_link"
+	else
+		buildmode="shared"
+	fi
+	dmbuildmode=$(use !device-mapper-only && echo internal || echo none)
+
+	# dmeventd requires mirrors to be internal, and snapshot available
+	# so we cannot disable them
+	myconf="${myconf} --with-mirrors=${dmbuildmode}"
+	myconf="${myconf} --with-snapshots=${dmbuildmode}"
+	if use thin; then
+		myconf="${myconf} --with-thin=internal --with-cache=internal"
+		local texec
+		for texec in check dump repair restore; do
+			myconf="${myconf} --with-thin-${texec}=${EPREFIX}/sbin/thin_${texec}"
+			myconf="${myconf} --with-cache-${texec}=${EPREFIX}/sbin/cache_${texec}"
+		done
+	else
+		myconf="${myconf} --with-thin=none --with-cache=none"
+	fi
+
+	if use lvm1; then
+		myconf="${myconf} --with-lvm1=${buildmode}"
+	else
+		myconf="${myconf} --with-lvm1=none"
+	fi
+
+	# disable O_DIRECT support on hppa, breaks pv detection (#99532)
+	use hppa && myconf="${myconf} --disable-o_direct"
+
+	if use clvm; then
+		myconf="${myconf} --with-cluster=${buildmode}"
+		# 4-state! Make sure we get it right, per bug 210879
+		# Valid options are: none, cman, gulm, all
+		#
+		# 2009/02:
+		# gulm is removed now, now dual-state:
+		# cman, none
+		# all still exists, but is not needed
+		#
+		# 2009/07:
+		# TODO: add corosync and re-enable ALL
+		local clvmd=""
+		use cman && clvmd="cman"
+		#clvmd="${clvmd/cmangulm/all}"
+		use corosync && clvmd="${clvmd:+$clvmd,}corosync"
+		use openais && clvmd="${clvmd:+$clvmd,}openais"
+		[ -z "${clvmd}" ] && clvmd="none"
+		myconf="${myconf} --with-clvmd=${clvmd}"
+		myconf="${myconf} --with-pool=${buildmode}"
+	else
+		myconf="${myconf} --with-clvmd=none --with-cluster=none"
+	fi
+
+	econf \
+		$(use_enable readline) \
+		$(use_enable selinux) \
+		--enable-pkgconfig \
+		--with-confdir="${EPREFIX}"/etc \
+		--exec-prefix="${EPREFIX}" \
+		--sbindir="${EPREFIX}/sbin" \
+		--with-staticdir="${EPREFIX}"/sbin \
+		--libdir="${EPREFIX}/$(get_libdir)" \
+		--with-usrlibdir="${EPREFIX}/usr/$(get_libdir)" \
+		--with-default-dm-run-dir=/run \
+		--with-default-run-dir=/run/lvm \
+		--with-default-locking-dir=/run/lock/lvm \
+		--with-default-pid-dir=/run \
+		$(use_enable udev udev_rules) \
+		$(use_enable udev udev_sync) \
+		$(use_with udev udevdir "$(get_udevdir)"/rules.d) \
+		$(use_enable systemd udev-systemd-background-jobs) \
+		"$(systemd_with_unitdir)" \
+		${myconf} \
+		CLDFLAGS="${LDFLAGS}"
+}
+
+src_compile() {
+	pushd include >/dev/null
+	emake
+	popd >/dev/null
+
+	if use device-mapper-only ; then
+		emake device-mapper
+	else
+		emake
+		emake CC="$(tc-getCC)" -C scripts lvm2_activation_generator_systemd_red_hat
+	fi
+}
+
+src_install() {
+	local inst
+	INSTALL_TARGETS="install install_tmpfiles_configuration"
+	# install systemd related files only when requested, bug #522430
+	use systemd && INSTALL_TARGETS="${INSTALL_TARGETS} install_systemd_units install_systemd_generators"
+	use device-mapper-only && INSTALL_TARGETS="install_device-mapper"
+	for inst in ${INSTALL_TARGETS}; do
+		emake DESTDIR="${D}" ${inst}
+	done
+
+	newinitd "${FILESDIR}"/device-mapper.rc-2.02.105-r2 device-mapper
+	newconfd "${FILESDIR}"/device-mapper.conf-1.02.22-r3 device-mapper
+
+	if use !device-mapper-only ; then
+		newinitd "${FILESDIR}"/dmeventd.initd-2.02.67-r1 dmeventd
+		newinitd "${FILESDIR}"/lvm.rc-2.02.105-r2 lvm
+		newconfd "${FILESDIR}"/lvm.confd-2.02.28-r2 lvm
+
+		newinitd "${FILESDIR}"/lvm-monitoring.initd-2.02.105-r2 lvm-monitoring
+		newinitd "${FILESDIR}"/lvmetad.initd-2.02.105-r2 lvmetad
+	fi
+
+	if use clvm; then
+		newinitd "${FILESDIR}"/clvmd.rc-2.02.39 clvmd
+		newconfd "${FILESDIR}"/clvmd.confd-2.02.39 clvmd
+	fi
+
+	if use static-libs; then
+		dolib.a libdm/ioctl/libdevmapper.a
+		dolib.a libdaemon/client/libdaemonclient.a #462908
+		#gen_usr_ldscript libdevmapper.so
+		dolib.a daemons/dmeventd/libdevmapper-event.a
+		#gen_usr_ldscript libdevmapper-event.so
+	else
+		rm -f "${ED}"usr/$(get_libdir)/{libdevmapper-event,liblvm2cmd,liblvm2app,libdevmapper}.a
+	fi
+
+	if use lvm2create_initrd; then
+		dosbin scripts/lvm2create_initrd/lvm2create_initrd
+		doman scripts/lvm2create_initrd/lvm2create_initrd.8
+		newdoc scripts/lvm2create_initrd/README README.lvm2create_initrd
+	fi
+
+	insinto /etc
+	doins "${FILESDIR}"/dmtab
+
+	dodoc README VERSION* WHATS_NEW WHATS_NEW_DM doc/*.{c,txt} conf/*.conf
+}
+
+pkg_postinst() {
+	ewarn "Make sure the \"lvm\" init script is in the runlevels:"
+	ewarn "# rc-update add lvm boot"
+	ewarn
+	ewarn "Make sure to enable lvmetad in /etc/lvm/lvm.conf if you want"
+	ewarn "to enable lvm autoactivation and metadata caching."
+}
+
+src_test() {
+	einfo "Tests are disabled because of device-node mucking, if you want to"
+	einfo "run tests, compile the package and see ${S}/tests"
+}

diff --git a/sys-fs/lvm2/metadata.xml b/sys-fs/lvm2/metadata.xml
index 20a16f4..98de265 100644
--- a/sys-fs/lvm2/metadata.xml
+++ b/sys-fs/lvm2/metadata.xml
@@ -13,8 +13,10 @@
 	<use>
 		<flag name="clvm">Allow users to build clustered lvm2</flag>
 		<flag name="cman">Cman support for clustered lvm</flag>
+		<flag name="corosync">Corosync support for clustered lvm</flag>
 		<flag name="lvm1">Allow users to build lvm2 with lvm1 support</flag>
 		<flag name="lvm2create_initrd">Install lvm2create_initrd script and pull in <pkg>sys-apps/makedev</pkg> for the /sbin/MAKEDEV command</flag>
+		<flag name="openais">Openais support for clustered lvm</flag>
 		<flag name="thin">Support for thin volumes</flag>
 		<flag name="device-mapper-only">Build only device-mapper and not the rest of LVM2 (UNSUPPORTED)</flag>
 	</use>


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-fs/lvm2/, sys-fs/lvm2/files/
@ 2016-03-09 20:12 Robin H. Johnson
  0 siblings, 0 replies; 29+ messages in thread
From: Robin H. Johnson @ 2016-03-09 20:12 UTC (permalink / raw
  To: gentoo-commits

commit:     ba7e16f85f8a82447c425af037bcc85d9775f80d
Author:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
AuthorDate: Wed Mar  9 20:12:01 2016 +0000
Commit:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Wed Mar  9 20:12:01 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ba7e16f8

sys-fs/lvm2: bump per bug #572352.

Package-Manager: portage-2.2.27

 sys-fs/lvm2/Manifest                               |   2 +
 .../lvm2-2.02.139-dynamic-static-ldflags.patch     |  63 +++++
 sys-fs/lvm2/lvm2-2.02.139.ebuild                   | 284 ++++++++++++++++++++
 sys-fs/lvm2/lvm2-2.02.145.ebuild                   | 285 +++++++++++++++++++++
 4 files changed, 634 insertions(+)

diff --git a/sys-fs/lvm2/Manifest b/sys-fs/lvm2/Manifest
index 750b75a..b448852 100644
--- a/sys-fs/lvm2/Manifest
+++ b/sys-fs/lvm2/Manifest
@@ -3,3 +3,5 @@ DIST LVM2.2.02.109.tgz 1482167 SHA256 7bc95ba5209c8aa5bd492167b2e2797f156852ed11
 DIST LVM2.2.02.110.tgz 1487448 SHA256 3dad1aa04a71b8420b15f44c53f041001436539d3f8073490c2d0c52f6fecd11 SHA512 5b4dfa5ed877d34efa5b109dc712e8fa9154b4954b267b0243f1925f9d2fa8c67f4ce8da36a85f3bba6c117f6153fdbf150e3753587ab90584a86d2654dc0812 WHIRLPOOL ea221ed3e9d3f79009d7c341a7a75b52eacc5be79e28f2498e7cdc0f4a97c2bebff405b032eb8086d3b5b5aaf79da2f281c5734562355bddbe6004058e114ced
 DIST LVM2.2.02.116.tgz 1538340 SHA256 2479d6ea61c405efcfcd8a78390d00c1d2e9c92c0262f3ed599f2c0fb6f0b767 SHA512 992541339637d597257850b4ff7f5348fb7cdcccf806ac8d986a3be1ad1edc5f6bfaedeed5128690c541d1a485cdc75742e90a766363c39867901003518fb84d WHIRLPOOL 1e89ec941882fddba62c9649be46eb5bc6c9cb899669d4bbe4a4a1023c8bf7d8264c4815ef88bb39dedcb9637815411feb826aa102e629d77b80e45e099e398d
 DIST LVM2.2.02.136.tgz 1891010 SHA256 c6af90097d8f7cd851d38c4f57bb3ad7039cfa123f1e336dba957814a298bd8c SHA512 ebda683e7dbeb2c4860a583d47e60756d18127e37a373ab2958af8e54b9bee0d2e3370b7803d88fa4b08564345c88af55bfbac317081160118ce4b3733b69f9d WHIRLPOOL 8020fdddac648e32084801ffaf9b00b8a683870c8dd8dd5969851fd081eb1efd578decd82cd4a7a24fb6150c55afafdd819a76eb7eb6926cdc057455cc1d1618
+DIST LVM2.2.02.139.tgz 1897293 SHA256 f423b1f2eee70efd671afc0982caa92e9413a582404057244021314172ec3a07 SHA512 f112207d7447606915026495b931bffc4c0d68d36b9a8792fe4b7abf8b743bc4559da5c79145cb4d457337118e60552f9df511e31f2799001d29d006f7946cc0 WHIRLPOOL 8a1ca0bb6946b1f6761223a4a9e7c5e3e5247ff4b85bc08734258f4616fbabb0ea7a3b22b4a245367997ad810b4b304b747d8da0bd128c241fbafe645855b7f9
+DIST LVM2.2.02.145.tgz 1986370 SHA256 98b7c4c07c485a462c6a86e1a5265757133ceea36289ead8a419af29ef39560b SHA512 84e28b3efc940837ea9da70fce620744aea0945ba29383b76ad7bcd4b5259b897c714162a8e8b7cfe26ae736a3ad2eca633a3e0df4d6280a32b28bd4cf472d27 WHIRLPOOL b8c6f4b737625547d4c2994d055f3334e2954f160d10840f1405b6a78f25fc17ba1d270f574408c151140e2afceb007cbfa1c146ed105bbdeca001a03368d549

diff --git a/sys-fs/lvm2/files/lvm2-2.02.139-dynamic-static-ldflags.patch b/sys-fs/lvm2/files/lvm2-2.02.139-dynamic-static-ldflags.patch
new file mode 100644
index 0000000..312e546
--- /dev/null
+++ b/sys-fs/lvm2/files/lvm2-2.02.139-dynamic-static-ldflags.patch
@@ -0,0 +1,63 @@
+diff -ur LVM2.2.02.139_O/configure.in LVM2.2.02.139/configure.in
+--- LVM2.2.02.139_O/configure.in	2016-01-19 12:54:33.155187005 +0000
++++ LVM2.2.02.139/configure.in	2016-01-19 12:56:39.487181372 +0000
+@@ -31,6 +31,7 @@
+ 	linux*)
+ 		CLDFLAGS="$CLDFLAGS -Wl,--version-script,.export.sym"
+ 		ELDFLAGS="-Wl,--export-dynamic"
++		STATIC_LDFLAGS="-Wl,--no-export-dynamic"
+ 		# FIXME Generate list and use --dynamic-list=.dlopen.sym
+ 		CLDWHOLEARCHIVE="-Wl,-whole-archive"
+ 		CLDNOWHOLEARCHIVE="-Wl,-no-whole-archive"
+@@ -2009,6 +2010,7 @@
+ AC_SUBST(SELINUX_PC)
+ AC_SUBST(SNAPSHOTS)
+ AC_SUBST(STATICDIR)
++AC_SUBST(STATIC_LDFLAGS)
+ AC_SUBST(STATIC_LINK)
+ AC_SUBST(TESTING)
+ AC_SUBST(TESTSUITE_DATA)
+diff -ur LVM2.2.02.139_O/daemons/dmeventd/Makefile.in LVM2.2.02.139/daemons/dmeventd/Makefile.in
+--- LVM2.2.02.139_O/daemons/dmeventd/Makefile.in	2016-01-19 12:54:33.278186999 +0000
++++ LVM2.2.02.139/daemons/dmeventd/Makefile.in	2016-01-19 12:57:44.277178484 +0000
+@@ -67,7 +67,7 @@
+ 	$(DL_LIBS) $(LVMLIBS) $(LIBS) -rdynamic
+ 
+ dmeventd.static: $(LIB_STATIC) dmeventd.o $(interfacebuilddir)/libdevmapper.a
+-	$(CC) $(CFLAGS) $(LDFLAGS) $(ELDFLAGS) -static -L. -L$(interfacebuilddir) -o $@ \
++	$(CC) $(CFLAGS) $(LDFLAGS) $(ELDFLAGS) $(STATIC_LDFLAGS) -static -L. -L$(interfacebuilddir) -o $@ \
+ 	dmeventd.o $(DL_LIBS) $(LVMLIBS) $(LIBS) $(STATIC_LIBS)
+ 
+ ifeq ("@PKGCONFIG@", "yes")
+diff -ur LVM2.2.02.139_O/make.tmpl.in LVM2.2.02.139/make.tmpl.in
+--- LVM2.2.02.139_O/make.tmpl.in	2016-01-19 12:54:33.529186988 +0000
++++ LVM2.2.02.139/make.tmpl.in	2016-01-19 12:58:31.514176378 +0000
+@@ -49,6 +49,7 @@
+ # FIXME set this only where it's needed, not globally?
+ CFLAGS ?= @COPTIMISE_FLAG@ @CFLAGS@
+ LDFLAGS ?= @COPTIMISE_FLAG@ @LDFLAGS@
++STATIC_LDFLAGS += @STATIC_LDFLAGS@
+ CLDFLAGS += @CLDFLAGS@
+ ELDFLAGS += @ELDFLAGS@
+ LDDEPS += @LDDEPS@
+diff -ur LVM2.2.02.139_O/tools/Makefile.in LVM2.2.02.139/tools/Makefile.in
+--- LVM2.2.02.139_O/tools/Makefile.in	2016-01-08 18:51:21.000000000 +0000
++++ LVM2.2.02.139/tools/Makefile.in	2016-01-19 13:00:08.349172060 +0000
+@@ -129,7 +129,7 @@
+ 	      -o $@ dmsetup.o -ldevmapper $(LIBS)
+ 
+ dmsetup.static: dmsetup.o $(interfacebuilddir)/libdevmapper.a
+-	$(CC) $(CFLAGS) $(LDFLAGS) -static -L$(interfacebuilddir) \
++	$(CC) $(CFLAGS) $(LDFLAGS) $(STATIC_LDFLAGS) -static -L$(interfacebuilddir) \
+ 	      -o $@ dmsetup.o -ldevmapper $(M_LIBS) $(PTHREAD_LIBS) $(STATIC_LIBS) $(LIBS)
+ 
+ all: device-mapper
+@@ -146,7 +146,7 @@
+ endif
+ 
+ lvm.static: $(OBJECTS) lvm-static.o $(top_builddir)/lib/liblvm-internal.a  $(interfacebuilddir)/libdevmapper.a
+-	$(CC) $(CFLAGS) $(LDFLAGS) -static -L$(interfacebuilddir) -o $@ \
++	$(CC) $(CFLAGS) $(LDFLAGS) $(STATIC_LDFLAGS) -static -L$(interfacebuilddir) -o $@ \
+ 	      $(OBJECTS) lvm-static.o $(LVMLIBS) $(STATIC_LIBS) $(LIBS)
+ 
+ liblvm2cmd.a: $(top_builddir)/lib/liblvm-internal.a $(OBJECTS) lvmcmdlib.o lvm2cmd.o

diff --git a/sys-fs/lvm2/lvm2-2.02.139.ebuild b/sys-fs/lvm2/lvm2-2.02.139.ebuild
new file mode 100644
index 0000000..d975343
--- /dev/null
+++ b/sys-fs/lvm2/lvm2-2.02.139.ebuild
@@ -0,0 +1,284 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit autotools eutils linux-info multilib systemd toolchain-funcs udev flag-o-matic
+
+DESCRIPTION="User-land utilities for LVM2 (device-mapper) software"
+HOMEPAGE="https://sources.redhat.com/lvm2/"
+SRC_URI="ftp://sources.redhat.com/pub/lvm2/${PN/lvm/LVM}.${PV}.tgz
+	ftp://sources.redhat.com/pub/lvm2/old/${PN/lvm/LVM}.${PV}.tgz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~x86-linux"
+IUSE="readline static static-libs systemd clvm cman corosync lvm1 lvm2create_initrd openais selinux +udev +thin device-mapper-only"
+REQUIRED_USE="device-mapper-only? ( !clvm !cman !corosync !lvm1 !lvm2create_initrd !openais !thin )
+	systemd? ( udev )
+	clvm? ( !systemd )"
+
+DEPEND_COMMON="
+	clvm? (
+		cman? ( =sys-cluster/cman-3* )
+		corosync? ( sys-cluster/corosync )
+		openais? ( sys-cluster/openais )
+		=sys-cluster/libdlm-3*
+	)
+
+	readline? ( sys-libs/readline:0= )
+	udev? ( >=virtual/libudev-208:=[static-libs?] )"
+# /run is now required for locking during early boot. /var cannot be assumed to
+# be available -- thus, pull in recent enough baselayout for /run.
+# This version of LVM is incompatible with cryptsetup <1.1.2.
+RDEPEND="${DEPEND_COMMON}
+	>=sys-apps/baselayout-2.2
+	!<sys-apps/openrc-0.11
+	!<sys-fs/cryptsetup-1.1.2
+	!!sys-fs/clvm
+	!!sys-fs/lvm-user
+	>=sys-apps/util-linux-2.16
+	lvm2create_initrd? ( sys-apps/makedev )
+	thin? ( >=sys-block/thin-provisioning-tools-0.3.0 )"
+# note: thin- 0.3.0 is required to avoid --disable-thin_check_needs_check
+# USE 'static' currently only works with eudev, bug 520450
+DEPEND="${DEPEND_COMMON}
+	virtual/pkgconfig
+	>=sys-devel/binutils-2.20.1-r1
+	static? (
+		selinux? ( sys-libs/libselinux[static-libs] )
+		udev? ( >=sys-fs/eudev-3.1.2[static-libs] )
+		>=sys-apps/util-linux-2.16[static-libs]
+	)"
+
+S=${WORKDIR}/${PN/lvm/LVM}.${PV}
+
+pkg_setup() {
+	local CONFIG_CHECK="~SYSVIPC"
+
+	if use udev; then
+		local WARNING_SYSVIPC="CONFIG_SYSVIPC:\tis not set (required for udev sync)\n"
+		if linux_config_exists; then
+			local uevent_helper_path=$(linux_chkconfig_string UEVENT_HELPER_PATH)
+			if [ -n "${uevent_helper_path}" ] && [ "${uevent_helper_path}" != '""' ]; then
+				ewarn "It's recommended to set an empty value to the following kernel config option:"
+				ewarn "CONFIG_UEVENT_HELPER_PATH=${uevent_helper_path}"
+			fi
+		fi
+	fi
+
+	check_extra_config
+
+	# 1. Genkernel no longer copies /sbin/lvm blindly.
+	if use static; then
+		elog "Warning, we no longer overwrite /sbin/lvm and /sbin/dmsetup with"
+		elog "their static versions. If you need the static binaries,"
+		elog "you must append .static to the filename!"
+	fi
+}
+
+src_prepare() {
+	# Gentoo specific modification(s):
+	epatch "${FILESDIR}"/${PN}-2.02.129-example.conf.in.patch
+
+	sed -i \
+		-e "1iAR = $(tc-getAR)" \
+		-e "s:CC ?= @CC@:CC = $(tc-getCC):" \
+		make.tmpl.in || die #444082
+
+	sed -i -e '/FLAG/s:-O2::' configure{.in,} || die #480212
+
+	if use udev && ! use device-mapper-only; then
+		sed -i -e '/use_lvmetad =/s:0:1:' conf/example.conf.in || die #514196
+		elog "Notice that \"use_lvmetad\" setting is enabled with USE=\"udev\" in"
+		elog "/etc/lvm/lvm.conf, which will require restart of udev, lvm, and lvmetad"
+		elog "if it was previously disabled."
+	fi
+
+	sed -i -e "s:/usr/bin/true:$(type -P true):" scripts/blk_availability_systemd_red_hat.service.in || die #517514
+
+	# For upstream -- review and forward:
+	epatch "${FILESDIR}"/${PN}-2.02.63-always-make-static-libdm.patch
+	epatch "${FILESDIR}"/${PN}-2.02.56-lvm2create_initrd.patch
+	epatch "${FILESDIR}"/${PN}-2.02.67-createinitrd.patch #301331
+	epatch "${FILESDIR}"/${PN}-2.02.99-locale-muck.patch #330373
+	epatch "${FILESDIR}"/${PN}-2.02.70-asneeded.patch # -Wl,--as-needed
+	epatch "${FILESDIR}"/${PN}-2.02.139-dynamic-static-ldflags.patch #332905
+	epatch "${FILESDIR}"/${PN}-2.02.129-static-pkgconfig-libs.patch #370217, #439414 + blkid
+	epatch "${FILESDIR}"/${PN}-2.02.130-pthread-pkgconfig.patch #492450
+
+	# Without thin-privision-tools, there is nothing to install for target install_man7:
+	use thin || { sed -i -e '/^install_lvm2/s:install_man7::' man/Makefile.in || die; }
+
+	eautoreconf
+}
+
+src_configure() {
+	filter-flags -flto
+	local myconf
+	local buildmode
+
+	myconf="${myconf} $(use_enable !device-mapper-only dmeventd)"
+	myconf="${myconf} $(use_enable !device-mapper-only cmdlib)"
+	myconf="${myconf} $(use_enable !device-mapper-only applib)"
+	myconf="${myconf} $(use_enable !device-mapper-only fsadm)"
+	myconf="${myconf} $(use_enable !device-mapper-only lvmetad)"
+	use device-mapper-only && myconf="${myconf} --disable-udev-systemd-background-jobs"
+
+	# Most of this package does weird stuff.
+	# The build options are tristate, and --without is NOT supported
+	# options: 'none', 'internal', 'shared'
+	if use static; then
+		buildmode="internal"
+		# This only causes the .static versions to become available
+		myconf="${myconf} --enable-static_link"
+	else
+		buildmode="shared"
+	fi
+	dmbuildmode=$(use !device-mapper-only && echo internal || echo none)
+
+	# dmeventd requires mirrors to be internal, and snapshot available
+	# so we cannot disable them
+	myconf="${myconf} --with-mirrors=${dmbuildmode}"
+	myconf="${myconf} --with-snapshots=${dmbuildmode}"
+	if use thin; then
+		myconf="${myconf} --with-thin=internal --with-cache=internal"
+		local texec
+		for texec in check dump repair restore; do
+			myconf="${myconf} --with-thin-${texec}=${EPREFIX}/sbin/thin_${texec}"
+			myconf="${myconf} --with-cache-${texec}=${EPREFIX}/sbin/cache_${texec}"
+		done
+	else
+		myconf="${myconf} --with-thin=none --with-cache=none"
+	fi
+
+	if use lvm1; then
+		myconf="${myconf} --with-lvm1=${buildmode}"
+	else
+		myconf="${myconf} --with-lvm1=none"
+	fi
+
+	# disable O_DIRECT support on hppa, breaks pv detection (#99532)
+	use hppa && myconf="${myconf} --disable-o_direct"
+
+	if use clvm; then
+		myconf="${myconf} --with-cluster=${buildmode}"
+		# 4-state! Make sure we get it right, per bug 210879
+		# Valid options are: none, cman, gulm, all
+		#
+		# 2009/02:
+		# gulm is removed now, now dual-state:
+		# cman, none
+		# all still exists, but is not needed
+		#
+		# 2009/07:
+		# TODO: add corosync and re-enable ALL
+		local clvmd=""
+		use cman && clvmd="cman"
+		#clvmd="${clvmd/cmangulm/all}"
+		use corosync && clvmd="${clvmd:+$clvmd,}corosync"
+		use openais && clvmd="${clvmd:+$clvmd,}openais"
+		[ -z "${clvmd}" ] && clvmd="none"
+		myconf="${myconf} --with-clvmd=${clvmd}"
+		myconf="${myconf} --with-pool=${buildmode}"
+	else
+		myconf="${myconf} --with-clvmd=none --with-cluster=none"
+	fi
+
+	econf \
+		$(use_enable readline) \
+		$(use_enable selinux) \
+		--enable-pkgconfig \
+		--with-confdir="${EPREFIX}"/etc \
+		--exec-prefix="${EPREFIX}" \
+		--sbindir="${EPREFIX}/sbin" \
+		--with-staticdir="${EPREFIX}"/sbin \
+		--libdir="${EPREFIX}/$(get_libdir)" \
+		--with-usrlibdir="${EPREFIX}/usr/$(get_libdir)" \
+		--with-default-dm-run-dir=/run \
+		--with-default-run-dir=/run/lvm \
+		--with-default-locking-dir=/run/lock/lvm \
+		--with-default-pid-dir=/run \
+		$(use_enable udev udev_rules) \
+		$(use_enable udev udev_sync) \
+		$(use_with udev udevdir "$(get_udevdir)"/rules.d) \
+		$(use_enable systemd udev-systemd-background-jobs) \
+		"$(systemd_with_unitdir)" \
+		${myconf} \
+		CLDFLAGS="${LDFLAGS}"
+}
+
+src_compile() {
+	pushd include >/dev/null
+	emake
+	popd >/dev/null
+
+	if use device-mapper-only ; then
+		emake device-mapper
+	else
+		emake
+		emake CC="$(tc-getCC)" -C scripts lvm2_activation_generator_systemd_red_hat
+	fi
+}
+
+src_install() {
+	local inst
+	INSTALL_TARGETS="install install_tmpfiles_configuration"
+	# install systemd related files only when requested, bug #522430
+	use systemd && INSTALL_TARGETS="${INSTALL_TARGETS} install_systemd_units install_systemd_generators"
+	use device-mapper-only && INSTALL_TARGETS="install_device-mapper"
+	for inst in ${INSTALL_TARGETS}; do
+		emake DESTDIR="${D}" ${inst}
+	done
+
+	newinitd "${FILESDIR}"/device-mapper.rc-2.02.105-r2 device-mapper
+	newconfd "${FILESDIR}"/device-mapper.conf-1.02.22-r3 device-mapper
+
+	if use !device-mapper-only ; then
+		newinitd "${FILESDIR}"/dmeventd.initd-2.02.67-r1 dmeventd
+		newinitd "${FILESDIR}"/lvm.rc-2.02.105-r2 lvm
+		newconfd "${FILESDIR}"/lvm.confd-2.02.28-r2 lvm
+
+		newinitd "${FILESDIR}"/lvm-monitoring.initd-2.02.105-r2 lvm-monitoring
+		newinitd "${FILESDIR}"/lvmetad.initd-2.02.105-r2 lvmetad
+	fi
+
+	if use clvm; then
+		newinitd "${FILESDIR}"/clvmd.rc-2.02.39 clvmd
+		newconfd "${FILESDIR}"/clvmd.confd-2.02.39 clvmd
+	fi
+
+	if use static-libs; then
+		dolib.a libdm/ioctl/libdevmapper.a
+		dolib.a libdaemon/client/libdaemonclient.a #462908
+		#gen_usr_ldscript libdevmapper.so
+		dolib.a daemons/dmeventd/libdevmapper-event.a
+		#gen_usr_ldscript libdevmapper-event.so
+	else
+		rm -f "${ED}"usr/$(get_libdir)/{libdevmapper-event,liblvm2cmd,liblvm2app,libdevmapper}.a
+	fi
+
+	if use lvm2create_initrd; then
+		dosbin scripts/lvm2create_initrd/lvm2create_initrd
+		doman scripts/lvm2create_initrd/lvm2create_initrd.8
+		newdoc scripts/lvm2create_initrd/README README.lvm2create_initrd
+	fi
+
+	insinto /etc
+	doins "${FILESDIR}"/dmtab
+
+	dodoc README VERSION* WHATS_NEW WHATS_NEW_DM doc/*.{c,txt} conf/*.conf
+}
+
+pkg_postinst() {
+	ewarn "Make sure the \"lvm\" init script is in the runlevels:"
+	ewarn "# rc-update add lvm boot"
+	ewarn
+	ewarn "Make sure to enable lvmetad in /etc/lvm/lvm.conf if you want"
+	ewarn "to enable lvm autoactivation and metadata caching."
+}
+
+src_test() {
+	einfo "Tests are disabled because of device-node mucking, if you want to"
+	einfo "run tests, compile the package and see ${S}/tests"
+}

diff --git a/sys-fs/lvm2/lvm2-2.02.145.ebuild b/sys-fs/lvm2/lvm2-2.02.145.ebuild
new file mode 100644
index 0000000..1d68e30
--- /dev/null
+++ b/sys-fs/lvm2/lvm2-2.02.145.ebuild
@@ -0,0 +1,285 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit autotools eutils linux-info multilib systemd toolchain-funcs udev flag-o-matic
+
+DESCRIPTION="User-land utilities for LVM2 (device-mapper) software"
+HOMEPAGE="https://sources.redhat.com/lvm2/"
+SRC_URI="ftp://sources.redhat.com/pub/lvm2/${PN/lvm/LVM}.${PV}.tgz
+	ftp://sources.redhat.com/pub/lvm2/old/${PN/lvm/LVM}.${PV}.tgz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~x86-linux"
+IUSE="readline static static-libs systemd clvm cman corosync lvm1 lvm2create_initrd openais selinux +udev +thin device-mapper-only"
+REQUIRED_USE="device-mapper-only? ( !clvm !cman !corosync !lvm1 !lvm2create_initrd !openais !thin )
+	systemd? ( udev )
+	clvm? ( !systemd )"
+
+DEPEND_COMMON="
+	clvm? (
+		cman? ( =sys-cluster/cman-3* )
+		corosync? ( sys-cluster/corosync )
+		openais? ( sys-cluster/openais )
+		=sys-cluster/libdlm-3*
+	)
+
+	readline? ( sys-libs/readline:0= )
+	udev? ( >=virtual/libudev-208:=[static-libs?] )"
+# /run is now required for locking during early boot. /var cannot be assumed to
+# be available -- thus, pull in recent enough baselayout for /run.
+# This version of LVM is incompatible with cryptsetup <1.1.2.
+RDEPEND="${DEPEND_COMMON}
+	>=sys-apps/baselayout-2.2
+	!<sys-apps/openrc-0.11
+	!<sys-fs/cryptsetup-1.1.2
+	!!sys-fs/clvm
+	!!sys-fs/lvm-user
+	>=sys-apps/util-linux-2.16
+	lvm2create_initrd? ( sys-apps/makedev )
+	thin? ( >=sys-block/thin-provisioning-tools-0.3.0 )"
+# note: thin- 0.3.0 is required to avoid --disable-thin_check_needs_check
+# USE 'static' currently only works with eudev, bug 520450
+DEPEND="${DEPEND_COMMON}
+	virtual/pkgconfig
+	>=sys-devel/binutils-2.20.1-r1
+	sys-devel/autoconf-archive
+	static? (
+		selinux? ( sys-libs/libselinux[static-libs] )
+		udev? ( >=sys-fs/eudev-3.1.2[static-libs] )
+		>=sys-apps/util-linux-2.16[static-libs]
+	)"
+
+S=${WORKDIR}/${PN/lvm/LVM}.${PV}
+
+pkg_setup() {
+	local CONFIG_CHECK="~SYSVIPC"
+
+	if use udev; then
+		local WARNING_SYSVIPC="CONFIG_SYSVIPC:\tis not set (required for udev sync)\n"
+		if linux_config_exists; then
+			local uevent_helper_path=$(linux_chkconfig_string UEVENT_HELPER_PATH)
+			if [ -n "${uevent_helper_path}" ] && [ "${uevent_helper_path}" != '""' ]; then
+				ewarn "It's recommended to set an empty value to the following kernel config option:"
+				ewarn "CONFIG_UEVENT_HELPER_PATH=${uevent_helper_path}"
+			fi
+		fi
+	fi
+
+	check_extra_config
+
+	# 1. Genkernel no longer copies /sbin/lvm blindly.
+	if use static; then
+		elog "Warning, we no longer overwrite /sbin/lvm and /sbin/dmsetup with"
+		elog "their static versions. If you need the static binaries,"
+		elog "you must append .static to the filename!"
+	fi
+}
+
+src_prepare() {
+	# Gentoo specific modification(s):
+	epatch "${FILESDIR}"/${PN}-2.02.129-example.conf.in.patch
+
+	sed -i \
+		-e "1iAR = $(tc-getAR)" \
+		-e "s:CC ?= @CC@:CC = $(tc-getCC):" \
+		make.tmpl.in || die #444082
+
+	sed -i -e '/FLAG/s:-O2::' configure{.in,} || die #480212
+
+	if use udev && ! use device-mapper-only; then
+		sed -i -e '/use_lvmetad =/s:0:1:' conf/example.conf.in || die #514196
+		elog "Notice that \"use_lvmetad\" setting is enabled with USE=\"udev\" in"
+		elog "/etc/lvm/lvm.conf, which will require restart of udev, lvm, and lvmetad"
+		elog "if it was previously disabled."
+	fi
+
+	sed -i -e "s:/usr/bin/true:$(type -P true):" scripts/blk_availability_systemd_red_hat.service.in || die #517514
+
+	# For upstream -- review and forward:
+	epatch "${FILESDIR}"/${PN}-2.02.63-always-make-static-libdm.patch
+	epatch "${FILESDIR}"/${PN}-2.02.56-lvm2create_initrd.patch
+	epatch "${FILESDIR}"/${PN}-2.02.67-createinitrd.patch #301331
+	epatch "${FILESDIR}"/${PN}-2.02.99-locale-muck.patch #330373
+	epatch "${FILESDIR}"/${PN}-2.02.70-asneeded.patch # -Wl,--as-needed
+	epatch "${FILESDIR}"/${PN}-2.02.139-dynamic-static-ldflags.patch #332905
+	epatch "${FILESDIR}"/${PN}-2.02.129-static-pkgconfig-libs.patch #370217, #439414 + blkid
+	epatch "${FILESDIR}"/${PN}-2.02.130-pthread-pkgconfig.patch #492450
+
+	# Without thin-privision-tools, there is nothing to install for target install_man7:
+	use thin || { sed -i -e '/^install_lvm2/s:install_man7::' man/Makefile.in || die; }
+
+	eautoreconf
+}
+
+src_configure() {
+	filter-flags -flto
+	local myconf
+	local buildmode
+
+	myconf="${myconf} $(use_enable !device-mapper-only dmeventd)"
+	myconf="${myconf} $(use_enable !device-mapper-only cmdlib)"
+	myconf="${myconf} $(use_enable !device-mapper-only applib)"
+	myconf="${myconf} $(use_enable !device-mapper-only fsadm)"
+	myconf="${myconf} $(use_enable !device-mapper-only lvmetad)"
+	use device-mapper-only && myconf="${myconf} --disable-udev-systemd-background-jobs"
+
+	# Most of this package does weird stuff.
+	# The build options are tristate, and --without is NOT supported
+	# options: 'none', 'internal', 'shared'
+	if use static; then
+		buildmode="internal"
+		# This only causes the .static versions to become available
+		myconf="${myconf} --enable-static_link"
+	else
+		buildmode="shared"
+	fi
+	dmbuildmode=$(use !device-mapper-only && echo internal || echo none)
+
+	# dmeventd requires mirrors to be internal, and snapshot available
+	# so we cannot disable them
+	myconf="${myconf} --with-mirrors=${dmbuildmode}"
+	myconf="${myconf} --with-snapshots=${dmbuildmode}"
+	if use thin; then
+		myconf="${myconf} --with-thin=internal --with-cache=internal"
+		local texec
+		for texec in check dump repair restore; do
+			myconf="${myconf} --with-thin-${texec}=${EPREFIX}/sbin/thin_${texec}"
+			myconf="${myconf} --with-cache-${texec}=${EPREFIX}/sbin/cache_${texec}"
+		done
+	else
+		myconf="${myconf} --with-thin=none --with-cache=none"
+	fi
+
+	if use lvm1; then
+		myconf="${myconf} --with-lvm1=${buildmode}"
+	else
+		myconf="${myconf} --with-lvm1=none"
+	fi
+
+	# disable O_DIRECT support on hppa, breaks pv detection (#99532)
+	use hppa && myconf="${myconf} --disable-o_direct"
+
+	if use clvm; then
+		myconf="${myconf} --with-cluster=${buildmode}"
+		# 4-state! Make sure we get it right, per bug 210879
+		# Valid options are: none, cman, gulm, all
+		#
+		# 2009/02:
+		# gulm is removed now, now dual-state:
+		# cman, none
+		# all still exists, but is not needed
+		#
+		# 2009/07:
+		# TODO: add corosync and re-enable ALL
+		local clvmd=""
+		use cman && clvmd="cman"
+		#clvmd="${clvmd/cmangulm/all}"
+		use corosync && clvmd="${clvmd:+$clvmd,}corosync"
+		use openais && clvmd="${clvmd:+$clvmd,}openais"
+		[ -z "${clvmd}" ] && clvmd="none"
+		myconf="${myconf} --with-clvmd=${clvmd}"
+		myconf="${myconf} --with-pool=${buildmode}"
+	else
+		myconf="${myconf} --with-clvmd=none --with-cluster=none"
+	fi
+
+	econf \
+		$(use_enable readline) \
+		$(use_enable selinux) \
+		--enable-pkgconfig \
+		--with-confdir="${EPREFIX}"/etc \
+		--exec-prefix="${EPREFIX}" \
+		--sbindir="${EPREFIX}/sbin" \
+		--with-staticdir="${EPREFIX}"/sbin \
+		--libdir="${EPREFIX}/$(get_libdir)" \
+		--with-usrlibdir="${EPREFIX}/usr/$(get_libdir)" \
+		--with-default-dm-run-dir=/run \
+		--with-default-run-dir=/run/lvm \
+		--with-default-locking-dir=/run/lock/lvm \
+		--with-default-pid-dir=/run \
+		$(use_enable udev udev_rules) \
+		$(use_enable udev udev_sync) \
+		$(use_with udev udevdir "$(get_udevdir)"/rules.d) \
+		$(use_enable systemd udev-systemd-background-jobs) \
+		"$(systemd_with_unitdir)" \
+		${myconf} \
+		CLDFLAGS="${LDFLAGS}"
+}
+
+src_compile() {
+	pushd include >/dev/null
+	emake
+	popd >/dev/null
+
+	if use device-mapper-only ; then
+		emake device-mapper
+	else
+		emake
+		emake CC="$(tc-getCC)" -C scripts lvm2_activation_generator_systemd_red_hat
+	fi
+}
+
+src_install() {
+	local inst
+	INSTALL_TARGETS="install install_tmpfiles_configuration"
+	# install systemd related files only when requested, bug #522430
+	use systemd && INSTALL_TARGETS="${INSTALL_TARGETS} install_systemd_units install_systemd_generators"
+	use device-mapper-only && INSTALL_TARGETS="install_device-mapper"
+	for inst in ${INSTALL_TARGETS}; do
+		emake DESTDIR="${D}" ${inst}
+	done
+
+	newinitd "${FILESDIR}"/device-mapper.rc-2.02.105-r2 device-mapper
+	newconfd "${FILESDIR}"/device-mapper.conf-1.02.22-r3 device-mapper
+
+	if use !device-mapper-only ; then
+		newinitd "${FILESDIR}"/dmeventd.initd-2.02.67-r1 dmeventd
+		newinitd "${FILESDIR}"/lvm.rc-2.02.105-r2 lvm
+		newconfd "${FILESDIR}"/lvm.confd-2.02.28-r2 lvm
+
+		newinitd "${FILESDIR}"/lvm-monitoring.initd-2.02.105-r2 lvm-monitoring
+		newinitd "${FILESDIR}"/lvmetad.initd-2.02.105-r2 lvmetad
+	fi
+
+	if use clvm; then
+		newinitd "${FILESDIR}"/clvmd.rc-2.02.39 clvmd
+		newconfd "${FILESDIR}"/clvmd.confd-2.02.39 clvmd
+	fi
+
+	if use static-libs; then
+		dolib.a libdm/ioctl/libdevmapper.a
+		dolib.a libdaemon/client/libdaemonclient.a #462908
+		#gen_usr_ldscript libdevmapper.so
+		dolib.a daemons/dmeventd/libdevmapper-event.a
+		#gen_usr_ldscript libdevmapper-event.so
+	else
+		rm -f "${ED}"usr/$(get_libdir)/{libdevmapper-event,liblvm2cmd,liblvm2app,libdevmapper}.a
+	fi
+
+	if use lvm2create_initrd; then
+		dosbin scripts/lvm2create_initrd/lvm2create_initrd
+		doman scripts/lvm2create_initrd/lvm2create_initrd.8
+		newdoc scripts/lvm2create_initrd/README README.lvm2create_initrd
+	fi
+
+	insinto /etc
+	doins "${FILESDIR}"/dmtab
+
+	dodoc README VERSION* WHATS_NEW WHATS_NEW_DM doc/*.{c,txt} conf/*.conf
+}
+
+pkg_postinst() {
+	ewarn "Make sure the \"lvm\" init script is in the runlevels:"
+	ewarn "# rc-update add lvm boot"
+	ewarn
+	ewarn "Make sure to enable lvmetad in /etc/lvm/lvm.conf if you want"
+	ewarn "to enable lvm autoactivation and metadata caching."
+}
+
+src_test() {
+	einfo "Tests are disabled because of device-node mucking, if you want to"
+	einfo "run tests, compile the package and see ${S}/tests"
+}


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-fs/lvm2/, sys-fs/lvm2/files/
@ 2016-04-02  5:07 Mike Frysinger
  0 siblings, 0 replies; 29+ messages in thread
From: Mike Frysinger @ 2016-04-02  5:07 UTC (permalink / raw
  To: gentoo-commits

commit:     470db86bf35977a176324617aec54eb36b625921
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Sat Apr  2 05:06:37 2016 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Sat Apr  2 05:06:37 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=470db86b

sys-fs/lvm2: drop old <2.02.116 versions

 sys-fs/lvm2/Manifest                               |   3 -
 sys-fs/lvm2/files/device-mapper.rc-2.02.95-r2      | 111 ---------
 sys-fs/lvm2/files/lvm-monitoring.initd-2.02.67-r2  |  46 ----
 sys-fs/lvm2/files/lvm.rc-2.02.95-r2                |  96 --------
 .../lvm2-2.02.100-selinux_and_udev_static.patch    |  93 -------
 .../lvm2-2.02.107-static-pkgconfig-libs.patch      | 104 --------
 .../lvm2/files/lvm2-2.02.99-example.conf.in.patch  |  47 ----
 sys-fs/lvm2/lvm2-2.02.103.ebuild                   | 235 ------------------
 sys-fs/lvm2/lvm2-2.02.109-r1.ebuild                | 270 --------------------
 sys-fs/lvm2/lvm2-2.02.109.ebuild                   | 269 --------------------
 sys-fs/lvm2/lvm2-2.02.110.ebuild                   | 272 ---------------------
 11 files changed, 1546 deletions(-)

diff --git a/sys-fs/lvm2/Manifest b/sys-fs/lvm2/Manifest
index b448852..3ff8f23 100644
--- a/sys-fs/lvm2/Manifest
+++ b/sys-fs/lvm2/Manifest
@@ -1,6 +1,3 @@
-DIST LVM2.2.02.103.tgz 1343887 SHA256 71c5a2e8842ed2f13f52e02b44eb183110a3410dedd1e117348e4eecc29d3c2a SHA512 1a9920947312e3e248bff7ff5d5eb54dec3f3b05eb3388fa92f95369b26ae8e6838186f87d817b09e8c635ddc3cdf51bc1d07c2a9d65fd7eab33598998bb7afe WHIRLPOOL de96dd8b7fb46ec777f34169759852ee5ef03ccdc93e110bf63c92dddb9cf4f805635444ceeead6b581610d2a23217d3b4729c286f016623f73b99c0b35a42a0
-DIST LVM2.2.02.109.tgz 1482167 SHA256 7bc95ba5209c8aa5bd492167b2e2797f156852ed11cfc63fb783070ade8e65e7 SHA512 210645cccf297112ffdbc63e0336385c31b2d17d226ae10813ba8ffd4f01ce07af44a4134e60644283e4360e10e925113e867378502ae0166f3fc91258caea68 WHIRLPOOL 7f2d91446f502440b2ed73df0f2ce29069364bbb198e675223b61c17e5cc6e1c162ce60a977cb07b71e44d672c688bbbf0247380f1b9c5adf325cf324f4c4bb7
-DIST LVM2.2.02.110.tgz 1487448 SHA256 3dad1aa04a71b8420b15f44c53f041001436539d3f8073490c2d0c52f6fecd11 SHA512 5b4dfa5ed877d34efa5b109dc712e8fa9154b4954b267b0243f1925f9d2fa8c67f4ce8da36a85f3bba6c117f6153fdbf150e3753587ab90584a86d2654dc0812 WHIRLPOOL ea221ed3e9d3f79009d7c341a7a75b52eacc5be79e28f2498e7cdc0f4a97c2bebff405b032eb8086d3b5b5aaf79da2f281c5734562355bddbe6004058e114ced
 DIST LVM2.2.02.116.tgz 1538340 SHA256 2479d6ea61c405efcfcd8a78390d00c1d2e9c92c0262f3ed599f2c0fb6f0b767 SHA512 992541339637d597257850b4ff7f5348fb7cdcccf806ac8d986a3be1ad1edc5f6bfaedeed5128690c541d1a485cdc75742e90a766363c39867901003518fb84d WHIRLPOOL 1e89ec941882fddba62c9649be46eb5bc6c9cb899669d4bbe4a4a1023c8bf7d8264c4815ef88bb39dedcb9637815411feb826aa102e629d77b80e45e099e398d
 DIST LVM2.2.02.136.tgz 1891010 SHA256 c6af90097d8f7cd851d38c4f57bb3ad7039cfa123f1e336dba957814a298bd8c SHA512 ebda683e7dbeb2c4860a583d47e60756d18127e37a373ab2958af8e54b9bee0d2e3370b7803d88fa4b08564345c88af55bfbac317081160118ce4b3733b69f9d WHIRLPOOL 8020fdddac648e32084801ffaf9b00b8a683870c8dd8dd5969851fd081eb1efd578decd82cd4a7a24fb6150c55afafdd819a76eb7eb6926cdc057455cc1d1618
 DIST LVM2.2.02.139.tgz 1897293 SHA256 f423b1f2eee70efd671afc0982caa92e9413a582404057244021314172ec3a07 SHA512 f112207d7447606915026495b931bffc4c0d68d36b9a8792fe4b7abf8b743bc4559da5c79145cb4d457337118e60552f9df511e31f2799001d29d006f7946cc0 WHIRLPOOL 8a1ca0bb6946b1f6761223a4a9e7c5e3e5247ff4b85bc08734258f4616fbabb0ea7a3b22b4a245367997ad810b4b304b747d8da0bd128c241fbafe645855b7f9

diff --git a/sys-fs/lvm2/files/device-mapper.rc-2.02.95-r2 b/sys-fs/lvm2/files/device-mapper.rc-2.02.95-r2
deleted file mode 100644
index 4cd506a..0000000
--- a/sys-fs/lvm2/files/device-mapper.rc-2.02.95-r2
+++ /dev/null
@@ -1,111 +0,0 @@
-#!/sbin/runscript
-# Copyright 1999-2013 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-depend() {
-	# As of .67-r1, we call ALL lvm start/stop scripts with --sysinit, that
-	# means dmeventd is NOT notified, as it cannot be safely running
-	before dmeventd checkfs fsck
-	after modules
-}
-
-dm_in_proc() {
-	local retval=0
-	for x in devices misc ; do
-		grep -qs 'device-mapper' /proc/${x}
-		retval=$((${retval} + $?))
-	done
-	return ${retval}
-}
-
-# char **get_new_dm_volumes(void)
-#
-#   Return dmsetup commands to setup volumes
-get_new_dm_volumes() {
-	local volume params
-
-	# Filter comments and blank lines
-	grep -v -e '^[[:space:]]*\(#\|$\)' /etc/dmtab | \
-	while read volume params ; do
-		# If it exists, skip it
-		dmvolume_exists "${volume%:}" && continue
-		# Assemble the command to run to create volume
-		echo "echo ${params} | /sbin/dmsetup create ${volume%:}"
-	done
-
-	return 0
-}
-
-# int dmvolume_exists(volume)
-#
-#   Return true if volume exists in DM table
-dmvolume_exists() {
-	local x line volume=$1
-
-	[ -z "${volume}" ] && return 1
-
-	/sbin/dmsetup ls 2>/dev/null | \
-	while read line ; do
-		for x in ${line} ; do
-			# the following conditonal return only breaks out
-			# of the while loop, as it is running in a pipe.
-			[ "${x}" = "${volume}" ] && return 1
-			# We only want to check the volume name
-			break
-		done
-	done
-
-	# if 1 was returned from the above loop, then indicate that
-	# volume exists
-	[ $? = 1 ] && return 0
-
-	# otherwise the loop exited normally and the volume does not
-	# exist
-	return 1
-}
-
-# int is_empty_dm_volume(volume)
-#
-#   Return true if the volume exists in DM table, but is empty/non-valid
-is_empty_dm_volume() {
-	local table volume=$1
-
-	set -- $(/sbin/dmsetup table 2>/dev/null | grep -e "^${volume}:")
-	[ "${volume}" = "$1" -a -z "$2" ]
-}
-
-
-start() {
-	if [ -e /proc/modules ] && ! dm_in_proc ; then
-		modprobe dm-mod 2>/dev/null
-	fi
-	# Ensure the dirs exist for locking and running
-	checkpath -q -d -m 0700 -o root:root /run/lvm /run/lock/lvm
-
-	local x volume
-	
-	if [ -x /sbin/dmsetup -a -c /dev/mapper/control -a -f /etc/dmtab ] ; then
-		[ -n "$(get_new_dm_volumes)" ] && \
-			einfo " Setting up device-mapper volumes:"
-	
-		get_new_dm_volumes | \
-		while read x ; do
-			[ -n "${x}" ] || continue
-	
-			volume="${x##* }"
-	
-			ebegin "  Creating volume: ${volume}"
-			if ! eval "${x}" >/dev/null 2>/dev/null ; then
-				eend 1 "  Error creating volume: ${volume}"
-				# dmsetup still adds an empty volume in some cases,
-				#  so lets remove it
-				is_empty_dm_volume "${volume}" && \
-					/sbin/dmsetup remove "${volume}" 2>/dev/null
-			else
-				eend 0
-			fi
-		done
-	fi
-}
-

diff --git a/sys-fs/lvm2/files/lvm-monitoring.initd-2.02.67-r2 b/sys-fs/lvm2/files/lvm-monitoring.initd-2.02.67-r2
deleted file mode 100644
index 2a96706..0000000
--- a/sys-fs/lvm2/files/lvm-monitoring.initd-2.02.67-r2
+++ /dev/null
@@ -1,46 +0,0 @@
-#!/sbin/runscript
-# Copyright 1999-2013 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-# This script is based on upstream file
-# LVM2.2.02.67/scripts/lvm2_monitoring_init_red_hat.in
-
-depend() {
-	# As of .67-r1, we call ALL lvm start/stop scripts with --sysinit, that
-	# means dmeventd is NOT notified, as it cannot be safely running
-	need lvm dmeventd
-}
-
-VGCHANGE=/sbin/vgchange
-VGS=/sbin/vgs
-
-start() {
-	ret=0
-	# TODO do we want to separate out already active groups only?
-	VGSLIST=`$VGS --noheadings -o name 2> /dev/null`
-	for vg in $VGSLIST
-	do
-	    ebegin "Starting LVM monitoring for VG $vg:"
-		$VGCHANGE --monitor y --poll y $vg
-		ret2=$?
-		eend $ret2
-		[ $ret2 -ne 0 ] && ret=$ret2
-	done
-	return $ret
-}
-
-stop() {
-	ret=0
-	# TODO do we want to separate out already active groups only?
-	VGSLIST=`$VGS --noheadings -o name 2> /dev/null`
-	for vg in $VGSLIST
-	do
-	    ebegin "Stopping LVM monitoring for VG $vg:"
-		$VGCHANGE --monitor n $vg
-		ret2=$?
-		eend $ret2
-		[ $ret2 -ne 0 ] && ret=$ret2
-	done
-	return $ret
-}

diff --git a/sys-fs/lvm2/files/lvm.rc-2.02.95-r2 b/sys-fs/lvm2/files/lvm.rc-2.02.95-r2
deleted file mode 100644
index d0d9e31..0000000
--- a/sys-fs/lvm2/files/lvm.rc-2.02.95-r2
+++ /dev/null
@@ -1,96 +0,0 @@
-#!/sbin/runscript
-# Copyright 1999-2013 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-depend() {
-	use dmeventd
-	before checkfs fsck
-	after dmeventd modules device-mapper
-}
-
-config='global { locking_dir = "/run/lock/lvm" }'
-
-dm_in_proc() {
-	local retval=0
-	for x in devices misc ; do
-		grep -qs 'device-mapper' /proc/${x}
-		retval=$((${retval} + $?))
-	done
-	return ${retval}
-}
-
-start() {
-	# LVM support for /usr, /home, /opt ....
-	# This should be done *before* checking local
-	# volumes, or they never get checked.
-	
-	# NOTE: Add needed modules for LVM or RAID, etc
-	#       to /etc/modules.autoload if needed
-	for lvm_path in /bin/lvm /sbin/lvm ; do
-		[ -x "$lvm_path" ] && break
-	done
-	if [ ! -x "$lvm_path" ]; then
-		eerror "Cannot find lvm binary in /sbin or /bin!"
-		return 1
-	fi
-	if [ -z "${CDBOOT}" ] ; then
-		if [ -e /proc/modules ] && ! dm_in_proc ; then
-			modprobe dm-mod 2>/dev/null
-		fi
-		if [ -d /proc/lvm ] || dm_in_proc ; then
-			ebegin "Setting up the Logical Volume Manager"
-			#still echo stderr for debugging
-			lvm_commands="#! ${lvm_path} --config '${config}'\n"
-			# Extra PV find pass because some devices might not have been available until very recently
-			lvm_commands="${lvm_commands}pvscan\n"
-			# Now make the nodes
-			lvm_commands="${lvm_commands}vgscan --mknodes\n"
-			# And turn them on!
-			lvm_commands="${lvm_commands}vgchange --sysinit -a ly\n"
-			# Order of this is important, have to work around dash and LVM readline
-			printf "%b\n" "${lvm_commands}" | $lvm_path /proc/self/fd/0 --config "${config}" >/dev/null
-			eend $? "Failed to setup the LVM"
-		fi
-	fi
-}
-
-stop() {
-	for lvm_path in /bin/lvm /sbin/lvm ; do
-		[ -x "$lvm_path" ] && break
-	done
-	if [ ! -x "$lvm_path" ]; then
-		eerror "Cannot find lvm binary in /sbin or /bin!"
-		return 1
-	fi
-# Stop LVM2
-if [ -x /sbin/vgs ] && \
-   [ -x /sbin/vgchange ] && \
-   [ -x /sbin/lvchange ] && \
-   [ -f /etc/lvmtab -o -d /etc/lvm ] && \
-   [ -d /proc/lvm  -o "`grep device-mapper /proc/misc 2>/dev/null`" ]
-then
-	einfo "Shutting down the Logical Volume Manager"
-	
-
-        VGS=$($lvm_path vgs --config "${config}" -o vg_name --noheadings --nosuffix 2> /dev/null)
-
-        if [ "$VGS" ]
-        then
-            ebegin "  Shutting Down LVs & VGs"
-			#still echo stderr for debugging
-			lvm_commands="#! ${lvm_path} --config '${config}'\n"
-			# Extra PV find pass because some devices might not have been available until very recently
-			lvm_commands="${lvm_commands}lvchange --sysinit -a ln ${VGS}\n"
-			# Now make the nodes
-			lvm_commands="${lvm_commands}vgchange --sysinit -a ln\n"
-			# Order of this is important, have to work around dash and LVM readline
-			printf "%b\n" "${lvm_commands}" | $lvm_path /proc/self/fd/0 --config "${config}" >/dev/null
-			eend $? "Failed"
-        fi
-
-	einfo "Finished Shutting down the Logical Volume Manager"
-fi
-}
-
-# vim:ts=4

diff --git a/sys-fs/lvm2/files/lvm2-2.02.100-selinux_and_udev_static.patch b/sys-fs/lvm2/files/lvm2-2.02.100-selinux_and_udev_static.patch
deleted file mode 100644
index d6c8e5f..0000000
--- a/sys-fs/lvm2/files/lvm2-2.02.100-selinux_and_udev_static.patch
+++ /dev/null
@@ -1,93 +0,0 @@
-diff -ur LVM2.2.02.100.orig/configure.in LVM2.2.02.100/configure.in
---- LVM2.2.02.100.orig/configure.in	2013-08-13 13:44:43.000000000 +0300
-+++ LVM2.2.02.100/configure.in	2013-09-12 23:23:19.365329440 +0300
-@@ -954,6 +954,7 @@
- 		pkg_config_init
- 	fi
- 	PKG_CHECK_MODULES(UDEV, libudev >= 143, [UDEV_PC="libudev"])
-+	UDEV_STATIC_LIBS=`$PKG_CONFIG --static --libs libudev`
- 	AC_DEFINE([UDEV_SYNC_SUPPORT], 1, [Define to 1 to enable synchronisation with udev processing.])
- fi
- 
-@@ -1199,19 +1200,32 @@
- if test x$SELINUX = xyes; then
- 	AC_CHECK_LIB([sepol], [sepol_check_context], [
- 		AC_DEFINE([HAVE_SEPOL], 1, [Define to 1 if sepol_check_context is available.])
--		SELINUX_LIBS="-lsepol"])
-+		SEPOL_LIBS="-lsepol"])
- 
--	AC_CHECK_LIB([selinux], [is_selinux_enabled], [
--		AC_CHECK_HEADERS([selinux/selinux.h],, hard_bailout)
--		AC_CHECK_HEADERS([selinux/label.h])
--		AC_DEFINE([HAVE_SELINUX], 1, [Define to 1 to include support for selinux.])
--		SELINUX_LIBS="-lselinux $SELINUX_LIBS"
-+	dnl -- init pkgconfig if required
-+	if  test x$PKGCONFIG_INIT != x1; then
-+		pkg_config_init
-+	fi
-+	PKG_CHECK_MODULES(SELINUX, libselinux, [
- 		SELINUX_PC="libselinux"
--		HAVE_SELINUX=yes ], [
--		AC_MSG_WARN(Disabling selinux)
--		SELINUX_LIBS=
--		SELINUX_PC=
--		HAVE_SELINUX=no ])
-+		SELINUX_STATIC_LIBS=`$PKG_CONFIG --static --libs libselinux`
-+		SELINUX_LIBS="$SELINUX_LIBS $SEPOL_LIBS"
-+		AC_DEFINE([HAVE_SELINUX], 1, [Define to 1 to include support for selinux.])
-+	],[
-+		dnl -- old non-pkgconfig method, is buggy with static builds
-+		AC_CHECK_LIB([selinux], [is_selinux_enabled], [
-+			AC_CHECK_HEADERS([selinux/selinux.h],, hard_bailout)
-+			AC_CHECK_HEADERS([selinux/label.h])
-+			AC_DEFINE([HAVE_SELINUX], 1, [Define to 1 to include support for selinux.])
-+			SELINUX_LIBS="-lselinux $SEPOL_LIBS"
-+			SELINUX_STATIC_LIBS="$SELINUX_LIBS"
-+			SELINUX_PC="libselinux"
-+			HAVE_SELINUX=yes ], [
-+			AC_MSG_WARN(Disabling selinux)
-+			SELINUX_LIBS=
-+			SELINUX_PC=
-+			HAVE_SELINUX=no ])
-+	])
- fi
- 
- ################################################################################
-@@ -1615,6 +1629,7 @@
- AC_SUBST(SALCK_CFLAGS)
- AC_SUBST(SALCK_LIBS)
- AC_SUBST(SELINUX_LIBS)
-+AC_SUBST(SELINUX_STATIC_LIBS)
- AC_SUBST(SELINUX_PC)
- AC_SUBST(SNAPSHOTS)
- AC_SUBST(STATICDIR)
-@@ -1625,6 +1640,7 @@
- AC_SUBST(THIN_DUMP_CMD)
- AC_SUBST(THIN_REPAIR_CMD)
- AC_SUBST(UDEV_LIBS)
-+AC_SUBST(UDEV_STATIC_LIBS)
- AC_SUBST(UDEV_PC)
- AC_SUBST(UDEV_RULES)
- AC_SUBST(UDEV_SYNC)
-diff -ur LVM2.2.02.100.orig/make.tmpl.in LVM2.2.02.100/make.tmpl.in
---- LVM2.2.02.100.orig/make.tmpl.in	2013-08-13 13:44:43.000000000 +0300
-+++ LVM2.2.02.100/make.tmpl.in	2013-09-12 23:22:58.125328808 +0300
-@@ -32,7 +32,7 @@
- 
- LIBS = @LIBS@
- # Extra libraries always linked with static binaries
--STATIC_LIBS = $(SELINUX_LIBS) $(UDEV_LIBS)
-+STATIC_LIBS = $(SELINUX_STATIC_LIBS) $(UDEV_STATIC_LIBS)
- DEFS += @DEFS@
- # FIXME set this only where it's needed, not globally?
- CFLAGS += @CFLAGS@ @UDEV_CFLAGS@
-@@ -46,7 +46,9 @@
- PTHREAD_LIBS = @PTHREAD_LIBS@
- READLINE_LIBS = @READLINE_LIBS@
- SELINUX_LIBS = @SELINUX_LIBS@
-+SELINUX_STATIC_LIBS = @SELINUX_STATIC_LIBS@
- UDEV_LIBS = @UDEV_LIBS@
-+UDEV_STATIC_LIBS = @UDEV_STATIC_LIBS@
- TESTING = @TESTING@
- 
- # Setup directory variables

diff --git a/sys-fs/lvm2/files/lvm2-2.02.107-static-pkgconfig-libs.patch b/sys-fs/lvm2/files/lvm2-2.02.107-static-pkgconfig-libs.patch
deleted file mode 100644
index 723cd0e..0000000
--- a/sys-fs/lvm2/files/lvm2-2.02.107-static-pkgconfig-libs.patch
+++ /dev/null
@@ -1,104 +0,0 @@
-diff -Nuar --exclude '*.orig' --exclude '*.rej' LVM2.2.02.107.orig/configure.in LVM2.2.02.107/configure.in
---- LVM2.2.02.107.orig/configure.in	2014-07-15 12:57:55.867439868 -0700
-+++ LVM2.2.02.107/configure.in	2014-07-15 17:24:02.662666091 -0700
-@@ -997,6 +997,7 @@
- 			   fi])
- 	if test "$BLKID_WIPING" = yes; then
- 		BLKID_PC="blkid"
-+		BLKID_STATIC_LIBS=`$PKG_CONFIG --static --libs $BLKID_PC`
- 		AC_DEFINE([BLKID_WIPING_SUPPORT], 1, [Define to 1 to use libblkid detection of signatures when wiping.])
- 	fi
- fi
-@@ -1022,6 +1023,7 @@
- if test "$UDEV_SYNC" = yes; then
- 	pkg_config_init
- 	PKG_CHECK_MODULES(UDEV, libudev >= 143, [UDEV_PC="libudev"])
-+	UDEV_STATIC_LIBS=`$PKG_CONFIG --static --libs libudev`
- 	AC_DEFINE([UDEV_SYNC_SUPPORT], 1, [Define to 1 to enable synchronisation with udev processing.])
- fi
- 
-@@ -1242,19 +1244,32 @@
- if test "$SELINUX" = yes; then
- 	AC_CHECK_LIB([sepol], [sepol_check_context], [
- 		AC_DEFINE([HAVE_SEPOL], 1, [Define to 1 if sepol_check_context is available.])
--		SELINUX_LIBS="-lsepol"])
-+		SEPOL_LIBS="-lsepol"])
-+
-+	dnl -- init pkgconfig if required
-+	if  test x$PKGCONFIG_INIT != x1; then
-+		pkg_config_init
-+	fi
-+	PKG_CHECK_MODULES(SELINUX, libselinux, [
-+		SELINUX_PC="libselinux"
-+		SELINUX_STATIC_LIBS=`$PKG_CONFIG --static --libs libselinux`
-+		SELINUX_LIBS="$SELINUX_LIBS $SEPOL_LIBS"
-+		AC_DEFINE([HAVE_SELINUX], 1, [Define to 1 to include support for selinux.])
-+	],[
-+		dnl -- old non-pkgconfig method, is buggy with static builds
- 
- 	AC_CHECK_LIB([selinux], [is_selinux_enabled], [
- 		AC_CHECK_HEADERS([selinux/selinux.h],, hard_bailout)
- 		AC_CHECK_HEADERS([selinux/label.h])
- 		AC_DEFINE([HAVE_SELINUX], 1, [Define to 1 to include support for selinux.])
--		SELINUX_LIBS="-lselinux $SELINUX_LIBS"
-+		SELINUX_LIBS="-lselinux $SEPOL_LIBS"
- 		SELINUX_PC="libselinux"
- 		HAVE_SELINUX=yes ], [
- 		AC_MSG_WARN(Disabling selinux)
- 		SELINUX_LIBS=
- 		SELINUX_PC=
- 		HAVE_SELINUX=no ])
-+	])
- fi
- 
- ################################################################################
-@@ -1556,6 +1571,7 @@
- ################################################################################
- AC_SUBST(APPLIB)
- AC_SUBST(AWK)
-+AC_SUBST(BLKID_STATIC_LIBS)
- AC_SUBST(BLKID_PC)
- AC_SUBST(BLKID_WIPING)
- AC_SUBST(BUILD_CMIRRORD)
-@@ -1651,6 +1667,7 @@
- AC_SUBST(SALCK_CFLAGS)
- AC_SUBST(SALCK_LIBS)
- AC_SUBST(SELINUX_LIBS)
-+AC_SUBST(SELINUX_STATIC_LIBS)
- AC_SUBST(SELINUX_PC)
- AC_SUBST(SNAPSHOTS)
- AC_SUBST(STATICDIR)
-@@ -1662,6 +1679,7 @@
- AC_SUBST(THIN_DUMP_CMD)
- AC_SUBST(THIN_REPAIR_CMD)
- AC_SUBST(THIN_RESTORE_CMD)
-+AC_SUBST(UDEV_STATIC_LIBS)
- AC_SUBST(UDEV_PC)
- AC_SUBST(UDEV_RULES)
- AC_SUBST(UDEV_SYNC)
-diff -Nuar --exclude '*.orig' --exclude '*.rej' LVM2.2.02.107.orig/make.tmpl.in LVM2.2.02.107/make.tmpl.in
---- LVM2.2.02.107.orig/make.tmpl.in	2014-07-15 12:57:55.868439884 -0700
-+++ LVM2.2.02.107/make.tmpl.in	2014-07-15 17:23:24.060055838 -0700
-@@ -44,7 +44,7 @@
- 
- LIBS = @LIBS@
- # Extra libraries always linked with static binaries
--STATIC_LIBS = $(SELINUX_LIBS) $(UDEV_LIBS) $(BLKID_LIBS)
-+STATIC_LIBS = $(SELINUX_STATIC_LIBS) $(UDEV_STATIC_LIBS) $(BLKID_STATIC_LIBS)
- DEFS += @DEFS@
- # FIXME set this only where it's needed, not globally?
- CFLAGS += @CFLAGS@
-@@ -59,10 +59,13 @@
- PTHREAD_LIBS = @PTHREAD_LIBS@
- READLINE_LIBS = @READLINE_LIBS@
- SELINUX_LIBS = @SELINUX_LIBS@
-+SELINUX_STATIC_LIBS = @SELINUX_STATIC_LIBS@
- UDEV_CFLAGS = @UDEV_CFLAGS@
- UDEV_LIBS = @UDEV_LIBS@
-+UDEV_STATIC_LIBS = @UDEV_STATIC_LIBS@
- BLKID_CFLAGS = @BLKID_CFLAGS@
- BLKID_LIBS = @BLKID_LIBS@
-+BLKID_STATIC_LIBS = @BLKID_STATIC_LIBS@
- TESTING = @TESTING@
- 
- # Setup directory variables

diff --git a/sys-fs/lvm2/files/lvm2-2.02.99-example.conf.in.patch b/sys-fs/lvm2/files/lvm2-2.02.99-example.conf.in.patch
deleted file mode 100644
index 38be5df..0000000
--- a/sys-fs/lvm2/files/lvm2-2.02.99-example.conf.in.patch
+++ /dev/null
@@ -1,47 +0,0 @@
---- conf/example.conf.in
-+++ conf/example.conf.in
-@@ -50,7 +50,9 @@
- 
- 
-     # By default we accept every block device:
--    filter = [ "a/.*/" ]
-+    # Gentoo: we exclude /dev/nbd by default, because it makes a lot of kernel
-+    # noise when you probed while not available.
-+    filter = [ "r|/dev/nbd.*|", "a/.*/" ]
- 
-     # Exclude the cdrom drive
-     # filter = [ "r|/dev/cdrom|" ]
-@@ -259,6 +261,8 @@
-     # the new lvm2 on-disk metadata format.
-     # The default value is set when the tools are built.
-     # fallback_to_lvm1 = 0
-+    # Gentoo: the LVM tools are a seperate package.
-+    fallback_to_lvm1 = 0
- 
-     # The default metadata format that commands should use - "lvm1" or "lvm2".
-     # The command line override is -M1 or -M2.
-@@ -449,12 +453,12 @@
- 
- # Metadata settings
- #
--# metadata {
-+metadata {
-     # Default number of copies of metadata to hold on each PV.  0, 1 or 2.
-     # You might want to override it from the command line with 0 
-     # when running pvcreate on new PVs which are to be added to large VGs.
--
--    # pvmetadatacopies = 1
-+    # Gentoo: enable for data safety, but PV resize is then disabled.
-+    #pvmetadatacopies = 2
- 
-     # Approximate default size of on-disk metadata areas in sectors.
-     # You should increase this if you have large volume groups or
-@@ -476,7 +480,7 @@
-     # the supplied toolset to make changes (e.g. vgcfgrestore).
- 
-     # dirs = [ "/etc/lvm/metadata", "/mnt/disk2/lvm/metadata2" ]
--#}
-+}
- 
- # Event daemon
- #

diff --git a/sys-fs/lvm2/lvm2-2.02.103.ebuild b/sys-fs/lvm2/lvm2-2.02.103.ebuild
deleted file mode 100644
index a9e1ceb..0000000
--- a/sys-fs/lvm2/lvm2-2.02.103.ebuild
+++ /dev/null
@@ -1,235 +0,0 @@
-# Copyright 1999-2015 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-EAPI=5
-inherit autotools eutils linux-info multilib systemd toolchain-funcs udev
-
-DESCRIPTION="User-land utilities for LVM2 (device-mapper) software"
-HOMEPAGE="https://sources.redhat.com/lvm2/"
-SRC_URI="ftp://sources.redhat.com/pub/lvm2/${PN/lvm/LVM}.${PV}.tgz
-	ftp://sources.redhat.com/pub/lvm2/old/${PN/lvm/LVM}.${PV}.tgz"
-
-LICENSE="GPL-2"
-SLOT="0"
-KEYWORDS="alpha amd64 arm arm64 hppa ia64 ~mips ppc ppc64 s390 sh sparc x86 ~amd64-linux ~x86-linux"
-IUSE="readline static static-libs clvm cman +lvm1 lvm2create_initrd selinux +udev +thin"
-
-DEPEND_COMMON="clvm? ( cman? ( =sys-cluster/cman-3* ) =sys-cluster/libdlm-3* )
-	readline? ( sys-libs/readline:0= )
-	udev? ( >=virtual/libudev-208:=[static-libs?] )"
-# /run is now required for locking during early boot. /var cannot be assumed to
-# be available -- thus, pull in recent enough baselayout for /run.
-# This version of LVM is incompatible with cryptsetup <1.1.2.
-RDEPEND="${DEPEND_COMMON}
-	>=sys-apps/baselayout-2.2
-	!<sys-apps/openrc-0.11
-	!<sys-fs/cryptsetup-1.1.2
-	!!sys-fs/clvm
-	!!sys-fs/lvm-user
-	>=sys-apps/util-linux-2.16
-	lvm2create_initrd? ( sys-apps/makedev )
-	thin? ( >=sys-block/thin-provisioning-tools-0.2.1 )"
-DEPEND="${DEPEND_COMMON}
-	virtual/pkgconfig
-	>=sys-devel/binutils-2.20.1-r1
-	static? (
-		selinux? ( sys-libs/libselinux[static-libs] )
-		udev? ( >=virtual/libudev-208:=[static-libs] )
-	)"
-
-S=${WORKDIR}/${PN/lvm/LVM}.${PV}
-
-pkg_setup() {
-	local CONFIG_CHECK="~SYSVIPC"
-
-	if use udev; then
-		local WARNING_SYSVIPC="CONFIG_SYSVIPC:\tis not set (required for udev sync)\n"
-		if linux_config_exists; then
-			local uevent_helper_path=$(linux_chkconfig_string UEVENT_HELPER_PATH)
-			if [ -n "${uevent_helper_path}" ] && [ "${uevent_helper_path}" != '""' ]; then
-				ewarn "It's recommended to set an empty value to the following kernel config option:"
-				ewarn "CONFIG_UEVENT_HELPER_PATH=${uevent_helper_path}"
-			fi
-		fi
-	fi
-
-	check_extra_config
-
-	# 1. Genkernel no longer copies /sbin/lvm blindly.
-	if use static; then
-		elog "Warning, we no longer overwrite /sbin/lvm and /sbin/dmsetup with"
-		elog "their static versions. If you need the static binaries,"
-		elog "you must append .static to the filename!"
-	fi
-}
-
-src_prepare() {
-	# Gentoo specific modification(s):
-	epatch "${FILESDIR}"/${PN}-2.02.99-example.conf.in.patch
-
-	sed -i \
-		-e "1iAR = $(tc-getAR)" \
-		-e "s:CC ?= @CC@:CC = $(tc-getCC):" \
-		make.tmpl.in || die #444082
-
-	sed -i -e '/FLAG/s:-O2::' configure{,.in} || die #480212
-
-	# For upstream -- review and forward:
-	epatch "${FILESDIR}"/${PN}-2.02.63-always-make-static-libdm.patch
-	epatch "${FILESDIR}"/${PN}-2.02.56-lvm2create_initrd.patch
-	epatch "${FILESDIR}"/${PN}-2.02.67-createinitrd.patch #301331
-	epatch "${FILESDIR}"/${PN}-2.02.99-locale-muck.patch #330373
-	epatch "${FILESDIR}"/${PN}-2.02.70-asneeded.patch # -Wl,--as-needed
-	epatch "${FILESDIR}"/${PN}-2.02.92-dynamic-static-ldflags.patch #332905
-	epatch "${FILESDIR}"/${PN}-2.02.100-selinux_and_udev_static.patch #370217, #439414
-
-	eautoreconf
-}
-
-src_configure() {
-	local myconf
-	local buildmode
-
-	myconf="${myconf} --enable-dmeventd"
-	myconf="${myconf} --enable-cmdlib"
-	myconf="${myconf} --enable-applib"
-	myconf="${myconf} --enable-fsadm"
-	myconf="${myconf} --enable-lvmetad"
-
-	# Most of this package does weird stuff.
-	# The build options are tristate, and --without is NOT supported
-	# options: 'none', 'internal', 'shared'
-	if use static; then
-		buildmode="internal"
-		# This only causes the .static versions to become available
-		myconf="${myconf} --enable-static_link"
-	else
-		buildmode="shared"
-	fi
-
-	# dmeventd requires mirrors to be internal, and snapshot available
-	# so we cannot disable them
-	myconf="${myconf} --with-mirrors=internal"
-	myconf="${myconf} --with-snapshots=internal"
-	use thin \
-		&& myconf="${myconf} --with-thin=internal" \
-		|| myconf="${myconf} --with-thin=none"
-
-	if use lvm1; then
-		myconf="${myconf} --with-lvm1=${buildmode}"
-	else
-		myconf="${myconf} --with-lvm1=none"
-	fi
-
-	# disable O_DIRECT support on hppa, breaks pv detection (#99532)
-	use hppa && myconf="${myconf} --disable-o_direct"
-
-	if use clvm; then
-		myconf="${myconf} --with-cluster=${buildmode}"
-		# 4-state! Make sure we get it right, per bug 210879
-		# Valid options are: none, cman, gulm, all
-		#
-		# 2009/02:
-		# gulm is removed now, now dual-state:
-		# cman, none
-		# all still exists, but is not needed
-		#
-		# 2009/07:
-		# TODO: add corosync and re-enable ALL
-		local clvmd=""
-		use cman && clvmd="cman"
-		#clvmd="${clvmd/cmangulm/all}"
-		[ -z "${clvmd}" ] && clvmd="none"
-		myconf="${myconf} --with-clvmd=${clvmd}"
-		myconf="${myconf} --with-pool=${buildmode}"
-	else
-		myconf="${myconf} --with-clvmd=none --with-cluster=none"
-	fi
-
-	econf \
-		$(use_enable readline) \
-		$(use_enable selinux) \
-		--enable-pkgconfig \
-		--with-confdir="${EPREFIX}"/etc \
-		--exec-prefix="${EPREFIX}" \
-		--sbindir="${EPREFIX}/sbin" \
-		--with-staticdir="${EPREFIX}"/sbin \
-		--libdir="${EPREFIX}/$(get_libdir)" \
-		--with-usrlibdir="${EPREFIX}/usr/$(get_libdir)" \
-		--with-default-dm-run-dir=/run \
-		--with-default-run-dir=/run/lvm \
-		--with-default-locking-dir=/run/lock/lvm \
-		--with-default-pid-dir=/run \
-		$(use_enable udev udev_rules) \
-		$(use_enable udev udev_sync) \
-		$(use_with udev udevdir "$(get_udevdir)"/rules.d) \
-		"$(systemd_with_unitdir)" \
-		${myconf} \
-		CLDFLAGS="${LDFLAGS}"
-}
-
-src_compile() {
-	pushd include >/dev/null
-	emake
-	popd >/dev/null
-
-	emake
-	emake CC="$(tc-getCC)" -C scripts lvm2_activation_generator_systemd_red_hat
-}
-
-src_install() {
-	local inst
-	for inst in install install_systemd_units install_systemd_generators install_tmpfiles_configuration; do
-		emake DESTDIR="${D}" ${inst}
-	done
-
-	newinitd "${FILESDIR}"/lvm.rc-2.02.95-r2 lvm
-	newconfd "${FILESDIR}"/lvm.confd-2.02.28-r2 lvm
-
-	newinitd "${FILESDIR}"/lvm-monitoring.initd-2.02.67-r2 lvm-monitoring
-
-	newinitd "${FILESDIR}"/device-mapper.rc-2.02.95-r2 device-mapper
-	newconfd "${FILESDIR}"/device-mapper.conf-1.02.22-r3 device-mapper
-
-	newinitd "${FILESDIR}"/dmeventd.initd-2.02.67-r1 dmeventd
-
-	if use clvm; then
-		newinitd "${FILESDIR}"/clvmd.rc-2.02.39 clvmd
-		newconfd "${FILESDIR}"/clvmd.confd-2.02.39 clvmd
-	fi
-
-	if use static-libs; then
-		dolib.a libdm/ioctl/libdevmapper.a
-		dolib.a libdaemon/client/libdaemonclient.a #462908
-		#gen_usr_ldscript libdevmapper.so
-		dolib.a daemons/dmeventd/libdevmapper-event.a
-		#gen_usr_ldscript libdevmapper-event.so
-	else
-		rm -f "${ED}"usr/$(get_libdir)/{libdevmapper-event,liblvm2cmd,liblvm2app,libdevmapper}.a
-	fi
-
-	if use lvm2create_initrd; then
-		dosbin scripts/lvm2create_initrd/lvm2create_initrd
-		doman scripts/lvm2create_initrd/lvm2create_initrd.8
-		newdoc scripts/lvm2create_initrd/README README.lvm2create_initrd
-	fi
-
-	insinto /etc
-	doins "${FILESDIR}"/dmtab
-
-	dodoc README VERSION* WHATS_NEW WHATS_NEW_DM doc/*.{c,txt} conf/*.conf
-}
-
-pkg_postinst() {
-	ewarn "Make sure the \"lvm\" init script is in the runlevels:"
-	ewarn "# rc-update add lvm boot"
-	ewarn
-	ewarn "Make sure to enable lvmetad in /etc/lvm/lvm.conf if you want"
-	ewarn "to enable lvm autoactivation and metadata caching."
-}
-
-src_test() {
-	einfo "Tests are disabled because of device-node mucking, if you want to"
-	einfo "run tests, compile the package and see ${S}/tests"
-}

diff --git a/sys-fs/lvm2/lvm2-2.02.109-r1.ebuild b/sys-fs/lvm2/lvm2-2.02.109-r1.ebuild
deleted file mode 100644
index 51ab306..0000000
--- a/sys-fs/lvm2/lvm2-2.02.109-r1.ebuild
+++ /dev/null
@@ -1,270 +0,0 @@
-# Copyright 1999-2015 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-EAPI=5
-inherit autotools eutils linux-info multilib systemd toolchain-funcs udev flag-o-matic
-
-DESCRIPTION="User-land utilities for LVM2 (device-mapper) software"
-HOMEPAGE="https://sources.redhat.com/lvm2/"
-SRC_URI="ftp://sources.redhat.com/pub/lvm2/${PN/lvm/LVM}.${PV}.tgz
-	ftp://sources.redhat.com/pub/lvm2/old/${PN/lvm/LVM}.${PV}.tgz"
-
-LICENSE="GPL-2"
-SLOT="0"
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~x86-linux"
-IUSE="readline static static-libs systemd clvm cman lvm1 lvm2create_initrd selinux +udev +thin device-mapper-only"
-REQUIRED_USE="device-mapper-only? ( !clvm !cman !lvm1 !lvm2create_initrd !thin )
-	static? ( !udev )" #520450
-
-DEPEND_COMMON="clvm? ( cman? ( =sys-cluster/cman-3* ) =sys-cluster/libdlm-3* )
-	readline? ( sys-libs/readline:0= )
-	udev? ( >=virtual/libudev-208:=[static-libs?] )"
-# /run is now required for locking during early boot. /var cannot be assumed to
-# be available -- thus, pull in recent enough baselayout for /run.
-# This version of LVM is incompatible with cryptsetup <1.1.2.
-RDEPEND="${DEPEND_COMMON}
-	>=sys-apps/baselayout-2.2
-	!<sys-apps/openrc-0.11
-	!<sys-fs/cryptsetup-1.1.2
-	!!sys-fs/clvm
-	!!sys-fs/lvm-user
-	>=sys-apps/util-linux-2.16
-	lvm2create_initrd? ( sys-apps/makedev )
-	thin? ( >=sys-block/thin-provisioning-tools-0.3.0 )"
-# note: thin- 0.3.0 is required to avoid --disable-thin_check_needs_check
-DEPEND="${DEPEND_COMMON}
-	virtual/pkgconfig
-	>=sys-devel/binutils-2.20.1-r1
-	static? (
-		selinux? ( sys-libs/libselinux[static-libs] )
-		udev? ( >=virtual/libudev-208:=[static-libs] )
-		>=sys-apps/util-linux-2.16[static-libs]
-	)"
-
-S=${WORKDIR}/${PN/lvm/LVM}.${PV}
-
-pkg_setup() {
-	local CONFIG_CHECK="~SYSVIPC"
-
-	if use udev; then
-		local WARNING_SYSVIPC="CONFIG_SYSVIPC:\tis not set (required for udev sync)\n"
-		if linux_config_exists; then
-			local uevent_helper_path=$(linux_chkconfig_string UEVENT_HELPER_PATH)
-			if [ -n "${uevent_helper_path}" ] && [ "${uevent_helper_path}" != '""' ]; then
-				ewarn "It's recommended to set an empty value to the following kernel config option:"
-				ewarn "CONFIG_UEVENT_HELPER_PATH=${uevent_helper_path}"
-			fi
-		fi
-	fi
-
-	check_extra_config
-
-	# 1. Genkernel no longer copies /sbin/lvm blindly.
-	if use static; then
-		elog "Warning, we no longer overwrite /sbin/lvm and /sbin/dmsetup with"
-		elog "their static versions. If you need the static binaries,"
-		elog "you must append .static to the filename!"
-	fi
-}
-
-src_prepare() {
-	# Gentoo specific modification(s):
-	epatch "${FILESDIR}"/${PN}-2.02.108-example.conf.in.patch
-
-	sed -i \
-		-e "1iAR = $(tc-getAR)" \
-		-e "s:CC ?= @CC@:CC = $(tc-getCC):" \
-		make.tmpl.in || die #444082
-
-	sed -i -e '/FLAG/s:-O2::' configure{.in,} || die #480212
-
-	if use systemd && ! use device-mapper-only; then
-		sed -i -e '/use_lvmetad =/s:0:1:' conf/example.conf.in || die #514196
-	fi
-
-	sed -i -e "s:/usr/bin/true:$(type -P true):" scripts/blk_availability_systemd_red_hat.service.in || die #517514
-
-	# For upstream -- review and forward:
-	epatch "${FILESDIR}"/${PN}-2.02.63-always-make-static-libdm.patch
-	epatch "${FILESDIR}"/${PN}-2.02.56-lvm2create_initrd.patch
-	epatch "${FILESDIR}"/${PN}-2.02.67-createinitrd.patch #301331
-	epatch "${FILESDIR}"/${PN}-2.02.99-locale-muck.patch #330373
-	epatch "${FILESDIR}"/${PN}-2.02.70-asneeded.patch # -Wl,--as-needed
-	epatch "${FILESDIR}"/${PN}-2.02.92-dynamic-static-ldflags.patch #332905
-	epatch "${FILESDIR}"/${PN}-2.02.108-static-pkgconfig-libs.patch #370217, #439414 + blkid
-	epatch "${FILESDIR}"/${PN}-2.02.106-pthread-pkgconfig.patch #492450
-
-	# Without thin-privision-tools, there is nothing to install for target install_man7:
-	use thin || { sed -i -e '/^install_lvm2/s:install_man7::' man/Makefile.in || die; }
-
-	sed -i -e 's:|share):|shared):' configure.in || die #520640
-
-	eautoreconf
-}
-
-src_configure() {
-	filter-flags -flto
-	local myconf
-	local buildmode
-
-	myconf="${myconf} $(use_enable !device-mapper-only dmeventd)"
-	myconf="${myconf} $(use_enable !device-mapper-only cmdlib)"
-	myconf="${myconf} $(use_enable !device-mapper-only applib)"
-	myconf="${myconf} $(use_enable !device-mapper-only fsadm)"
-	myconf="${myconf} $(use_enable !device-mapper-only lvmetad)"
-	use device-mapper-only && myconf="${myconf} --disable-udev-systemd-background-jobs"
-
-	# Most of this package does weird stuff.
-	# The build options are tristate, and --without is NOT supported
-	# options: 'none', 'internal', 'shared'
-	if use static; then
-		buildmode="internal"
-		# This only causes the .static versions to become available
-		myconf="${myconf} --enable-static_link"
-	else
-		buildmode="shared"
-	fi
-	dmbuildmode=$(use !device-mapper-only && echo internal || echo none)
-
-	# dmeventd requires mirrors to be internal, and snapshot available
-	# so we cannot disable them
-	myconf="${myconf} --with-mirrors=${dmbuildmode}"
-	myconf="${myconf} --with-snapshots=${dmbuildmode}"
-	if use thin; then
-		myconf="${myconf} --with-thin=internal --with-cache=internal"
-		local texec
-		for texec in check dump repair restore; do
-			myconf="${myconf} --with-thin-${texec}=${EPREFIX}/sbin/thin_${texec}"
-			myconf="${myconf} --with-cache-${texec}=${EPREFIX}/sbin/cache_${texec}"
-		done
-	else
-		myconf="${myconf} --with-thin=none --with-cache=none"
-	fi
-
-	if use lvm1; then
-		myconf="${myconf} --with-lvm1=${buildmode}"
-	else
-		myconf="${myconf} --with-lvm1=none"
-	fi
-
-	# disable O_DIRECT support on hppa, breaks pv detection (#99532)
-	use hppa && myconf="${myconf} --disable-o_direct"
-
-	if use clvm; then
-		myconf="${myconf} --with-cluster=${buildmode}"
-		# 4-state! Make sure we get it right, per bug 210879
-		# Valid options are: none, cman, gulm, all
-		#
-		# 2009/02:
-		# gulm is removed now, now dual-state:
-		# cman, none
-		# all still exists, but is not needed
-		#
-		# 2009/07:
-		# TODO: add corosync and re-enable ALL
-		local clvmd=""
-		use cman && clvmd="cman"
-		#clvmd="${clvmd/cmangulm/all}"
-		[ -z "${clvmd}" ] && clvmd="none"
-		myconf="${myconf} --with-clvmd=${clvmd}"
-		myconf="${myconf} --with-pool=${buildmode}"
-	else
-		myconf="${myconf} --with-clvmd=none --with-cluster=none"
-	fi
-
-	econf \
-		$(use_enable readline) \
-		$(use_enable selinux) \
-		--enable-pkgconfig \
-		--with-confdir="${EPREFIX}"/etc \
-		--exec-prefix="${EPREFIX}" \
-		--sbindir="${EPREFIX}/sbin" \
-		--with-staticdir="${EPREFIX}"/sbin \
-		--libdir="${EPREFIX}/$(get_libdir)" \
-		--with-usrlibdir="${EPREFIX}/usr/$(get_libdir)" \
-		--with-default-dm-run-dir=/run \
-		--with-default-run-dir=/run/lvm \
-		--with-default-locking-dir=/run/lock/lvm \
-		--with-default-pid-dir=/run \
-		$(use_enable udev udev_rules) \
-		$(use_enable udev udev_sync) \
-		$(use_with udev udevdir "$(get_udevdir)"/rules.d) \
-		$(use_enable systemd udev-systemd-background-jobs) \
-		"$(systemd_with_unitdir)" \
-		${myconf} \
-		CLDFLAGS="${LDFLAGS}"
-}
-
-src_compile() {
-	pushd include >/dev/null
-	emake
-	popd >/dev/null
-
-	if use device-mapper-only ; then
-		emake device-mapper
-	else
-		emake
-		emake CC="$(tc-getCC)" -C scripts lvm2_activation_generator_systemd_red_hat
-	fi
-}
-
-src_install() {
-	local inst
-	INSTALL_TARGETS="install install_systemd_units install_systemd_generators install_tmpfiles_configuration"
-	use device-mapper-only && INSTALL_TARGETS="install_device-mapper"
-	for inst in ${INSTALL_TARGETS}; do
-		emake DESTDIR="${D}" ${inst}
-	done
-
-	newinitd "${FILESDIR}"/device-mapper.rc-2.02.105-r2 device-mapper
-	newconfd "${FILESDIR}"/device-mapper.conf-1.02.22-r3 device-mapper
-
-	if use !device-mapper-only ; then
-		newinitd "${FILESDIR}"/dmeventd.initd-2.02.67-r1 dmeventd
-		newinitd "${FILESDIR}"/lvm.rc-2.02.105-r2 lvm
-		newconfd "${FILESDIR}"/lvm.confd-2.02.28-r2 lvm
-
-		newinitd "${FILESDIR}"/lvm-monitoring.initd-2.02.105-r2 lvm-monitoring
-		newinitd "${FILESDIR}"/lvmetad.initd-2.02.105-r2 lvmetad
-	fi
-
-	if use clvm; then
-		newinitd "${FILESDIR}"/clvmd.rc-2.02.39 clvmd
-		newconfd "${FILESDIR}"/clvmd.confd-2.02.39 clvmd
-	fi
-
-	if use static-libs; then
-		dolib.a libdm/ioctl/libdevmapper.a
-		dolib.a libdaemon/client/libdaemonclient.a #462908
-		#gen_usr_ldscript libdevmapper.so
-		dolib.a daemons/dmeventd/libdevmapper-event.a
-		#gen_usr_ldscript libdevmapper-event.so
-	else
-		rm -f "${ED}"usr/$(get_libdir)/{libdevmapper-event,liblvm2cmd,liblvm2app,libdevmapper}.a
-	fi
-
-	if use lvm2create_initrd; then
-		dosbin scripts/lvm2create_initrd/lvm2create_initrd
-		doman scripts/lvm2create_initrd/lvm2create_initrd.8
-		newdoc scripts/lvm2create_initrd/README README.lvm2create_initrd
-	fi
-
-	insinto /etc
-	doins "${FILESDIR}"/dmtab
-
-	dodoc README VERSION* WHATS_NEW WHATS_NEW_DM doc/*.{c,txt} conf/*.conf
-}
-
-pkg_postinst() {
-	ewarn "Make sure the \"lvm\" init script is in the runlevels:"
-	ewarn "# rc-update add lvm boot"
-	ewarn
-	ewarn "Make sure to enable lvmetad in /etc/lvm/lvm.conf if you want"
-	ewarn "to enable lvm autoactivation and metadata caching."
-}
-
-src_test() {
-	einfo "Tests are disabled because of device-node mucking, if you want to"
-	einfo "run tests, compile the package and see ${S}/tests"
-}

diff --git a/sys-fs/lvm2/lvm2-2.02.109.ebuild b/sys-fs/lvm2/lvm2-2.02.109.ebuild
deleted file mode 100644
index 29c6ad3..0000000
--- a/sys-fs/lvm2/lvm2-2.02.109.ebuild
+++ /dev/null
@@ -1,269 +0,0 @@
-# Copyright 1999-2015 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-EAPI=5
-inherit autotools eutils linux-info multilib systemd toolchain-funcs udev flag-o-matic
-
-DESCRIPTION="User-land utilities for LVM2 (device-mapper) software"
-HOMEPAGE="https://sources.redhat.com/lvm2/"
-SRC_URI="ftp://sources.redhat.com/pub/lvm2/${PN/lvm/LVM}.${PV}.tgz
-	ftp://sources.redhat.com/pub/lvm2/old/${PN/lvm/LVM}.${PV}.tgz"
-
-LICENSE="GPL-2"
-SLOT="0"
-KEYWORDS="alpha amd64 arm arm64 hppa ia64 ~mips ppc ppc64 s390 sh sparc x86 ~amd64-linux ~x86-linux"
-IUSE="readline static static-libs systemd clvm cman lvm1 lvm2create_initrd selinux +udev +thin device-mapper-only"
-REQUIRED_USE="device-mapper-only? ( !clvm !cman !lvm1 !lvm2create_initrd !thin )"
-
-DEPEND_COMMON="clvm? ( cman? ( =sys-cluster/cman-3* ) =sys-cluster/libdlm-3* )
-	readline? ( sys-libs/readline:0= )
-	udev? ( >=virtual/libudev-208:=[static-libs?] )"
-# /run is now required for locking during early boot. /var cannot be assumed to
-# be available -- thus, pull in recent enough baselayout for /run.
-# This version of LVM is incompatible with cryptsetup <1.1.2.
-RDEPEND="${DEPEND_COMMON}
-	>=sys-apps/baselayout-2.2
-	!<sys-apps/openrc-0.11
-	!<sys-fs/cryptsetup-1.1.2
-	!!sys-fs/clvm
-	!!sys-fs/lvm-user
-	>=sys-apps/util-linux-2.16
-	lvm2create_initrd? ( sys-apps/makedev )
-	thin? ( >=sys-block/thin-provisioning-tools-0.3.0 )"
-# note: thin- 0.3.0 is required to avoid --disable-thin_check_needs_check
-DEPEND="${DEPEND_COMMON}
-	virtual/pkgconfig
-	>=sys-devel/binutils-2.20.1-r1
-	static? (
-		selinux? ( sys-libs/libselinux[static-libs] )
-		udev? ( >=virtual/libudev-208:=[static-libs] )
-		<sys-apps/util-linux-2.25[static-libs]
-	)"
-
-S=${WORKDIR}/${PN/lvm/LVM}.${PV}
-
-pkg_setup() {
-	local CONFIG_CHECK="~SYSVIPC"
-
-	if use udev; then
-		local WARNING_SYSVIPC="CONFIG_SYSVIPC:\tis not set (required for udev sync)\n"
-		if linux_config_exists; then
-			local uevent_helper_path=$(linux_chkconfig_string UEVENT_HELPER_PATH)
-			if [ -n "${uevent_helper_path}" ] && [ "${uevent_helper_path}" != '""' ]; then
-				ewarn "It's recommended to set an empty value to the following kernel config option:"
-				ewarn "CONFIG_UEVENT_HELPER_PATH=${uevent_helper_path}"
-			fi
-		fi
-	fi
-
-	check_extra_config
-
-	# 1. Genkernel no longer copies /sbin/lvm blindly.
-	if use static; then
-		elog "Warning, we no longer overwrite /sbin/lvm and /sbin/dmsetup with"
-		elog "their static versions. If you need the static binaries,"
-		elog "you must append .static to the filename!"
-	fi
-}
-
-src_prepare() {
-	# Gentoo specific modification(s):
-	epatch "${FILESDIR}"/${PN}-2.02.108-example.conf.in.patch
-
-	sed -i \
-		-e "1iAR = $(tc-getAR)" \
-		-e "s:CC ?= @CC@:CC = $(tc-getCC):" \
-		make.tmpl.in || die #444082
-
-	sed -i -e '/FLAG/s:-O2::' configure{.in,} || die #480212
-
-	if use systemd && ! use device-mapper-only; then
-		sed -i -e '/use_lvmetad =/s:0:1:' conf/example.conf.in || die #514196
-	fi
-
-	sed -i -e "s:/usr/bin/true:$(type -P true):" scripts/blk_availability_systemd_red_hat.service.in || die #517514
-
-	# For upstream -- review and forward:
-	epatch "${FILESDIR}"/${PN}-2.02.63-always-make-static-libdm.patch
-	epatch "${FILESDIR}"/${PN}-2.02.56-lvm2create_initrd.patch
-	epatch "${FILESDIR}"/${PN}-2.02.67-createinitrd.patch #301331
-	epatch "${FILESDIR}"/${PN}-2.02.99-locale-muck.patch #330373
-	epatch "${FILESDIR}"/${PN}-2.02.70-asneeded.patch # -Wl,--as-needed
-	epatch "${FILESDIR}"/${PN}-2.02.92-dynamic-static-ldflags.patch #332905
-	epatch "${FILESDIR}"/${PN}-2.02.108-static-pkgconfig-libs.patch #370217, #439414 + blkid
-	epatch "${FILESDIR}"/${PN}-2.02.106-pthread-pkgconfig.patch #492450
-
-	# Without thin-privision-tools, there is nothing to install for target install_man7:
-	use thin || { sed -i -e '/^install_lvm2/s:install_man7::' man/Makefile.in || die; }
-
-	sed -i -e 's:|share):|shared):' configure.in || die #520640
-
-	eautoreconf
-}
-
-src_configure() {
-	filter-flags -flto
-	local myconf
-	local buildmode
-
-	myconf="${myconf} $(use_enable !device-mapper-only dmeventd)"
-	myconf="${myconf} $(use_enable !device-mapper-only cmdlib)"
-	myconf="${myconf} $(use_enable !device-mapper-only applib)"
-	myconf="${myconf} $(use_enable !device-mapper-only fsadm)"
-	myconf="${myconf} $(use_enable !device-mapper-only lvmetad)"
-	use device-mapper-only && myconf="${myconf} --disable-udev-systemd-background-jobs"
-
-	# Most of this package does weird stuff.
-	# The build options are tristate, and --without is NOT supported
-	# options: 'none', 'internal', 'shared'
-	if use static; then
-		buildmode="internal"
-		# This only causes the .static versions to become available
-		myconf="${myconf} --enable-static_link"
-	else
-		buildmode="shared"
-	fi
-	dmbuildmode=$(use !device-mapper-only && echo internal || echo none)
-
-	# dmeventd requires mirrors to be internal, and snapshot available
-	# so we cannot disable them
-	myconf="${myconf} --with-mirrors=${dmbuildmode}"
-	myconf="${myconf} --with-snapshots=${dmbuildmode}"
-	if use thin; then
-		myconf="${myconf} --with-thin=internal --with-cache=internal"
-		local texec
-		for texec in check dump repair restore; do
-			myconf="${myconf} --with-thin-${texec}=${EPREFIX}/sbin/thin_${texec}"
-			myconf="${myconf} --with-cache-${texec}=${EPREFIX}/sbin/cache_${texec}"
-		done
-	else
-		myconf="${myconf} --with-thin=none --with-cache=none"
-	fi
-
-	if use lvm1; then
-		myconf="${myconf} --with-lvm1=${buildmode}"
-	else
-		myconf="${myconf} --with-lvm1=none"
-	fi
-
-	# disable O_DIRECT support on hppa, breaks pv detection (#99532)
-	use hppa && myconf="${myconf} --disable-o_direct"
-
-	if use clvm; then
-		myconf="${myconf} --with-cluster=${buildmode}"
-		# 4-state! Make sure we get it right, per bug 210879
-		# Valid options are: none, cman, gulm, all
-		#
-		# 2009/02:
-		# gulm is removed now, now dual-state:
-		# cman, none
-		# all still exists, but is not needed
-		#
-		# 2009/07:
-		# TODO: add corosync and re-enable ALL
-		local clvmd=""
-		use cman && clvmd="cman"
-		#clvmd="${clvmd/cmangulm/all}"
-		[ -z "${clvmd}" ] && clvmd="none"
-		myconf="${myconf} --with-clvmd=${clvmd}"
-		myconf="${myconf} --with-pool=${buildmode}"
-	else
-		myconf="${myconf} --with-clvmd=none --with-cluster=none"
-	fi
-
-	econf \
-		$(use_enable readline) \
-		$(use_enable selinux) \
-		--enable-pkgconfig \
-		--with-confdir="${EPREFIX}"/etc \
-		--exec-prefix="${EPREFIX}" \
-		--sbindir="${EPREFIX}/sbin" \
-		--with-staticdir="${EPREFIX}"/sbin \
-		--libdir="${EPREFIX}/$(get_libdir)" \
-		--with-usrlibdir="${EPREFIX}/usr/$(get_libdir)" \
-		--with-default-dm-run-dir=/run \
-		--with-default-run-dir=/run/lvm \
-		--with-default-locking-dir=/run/lock/lvm \
-		--with-default-pid-dir=/run \
-		$(use_enable udev udev_rules) \
-		$(use_enable udev udev_sync) \
-		$(use_with udev udevdir "$(get_udevdir)"/rules.d) \
-		$(use_enable systemd udev-systemd-background-jobs) \
-		"$(systemd_with_unitdir)" \
-		${myconf} \
-		CLDFLAGS="${LDFLAGS}"
-}
-
-src_compile() {
-	pushd include >/dev/null
-	emake
-	popd >/dev/null
-
-	if use device-mapper-only ; then
-		emake device-mapper
-	else
-		emake
-		emake CC="$(tc-getCC)" -C scripts lvm2_activation_generator_systemd_red_hat
-	fi
-}
-
-src_install() {
-	local inst
-	INSTALL_TARGETS="install install_systemd_units install_systemd_generators install_tmpfiles_configuration"
-	use device-mapper-only && INSTALL_TARGETS="install_device-mapper"
-	for inst in ${INSTALL_TARGETS}; do
-		emake DESTDIR="${D}" ${inst}
-	done
-
-	newinitd "${FILESDIR}"/device-mapper.rc-2.02.105-r2 device-mapper
-	newconfd "${FILESDIR}"/device-mapper.conf-1.02.22-r3 device-mapper
-
-	if use !device-mapper-only ; then
-		newinitd "${FILESDIR}"/dmeventd.initd-2.02.67-r1 dmeventd
-		newinitd "${FILESDIR}"/lvm.rc-2.02.105-r2 lvm
-		newconfd "${FILESDIR}"/lvm.confd-2.02.28-r2 lvm
-
-		newinitd "${FILESDIR}"/lvm-monitoring.initd-2.02.105-r2 lvm-monitoring
-		newinitd "${FILESDIR}"/lvmetad.initd-2.02.105-r2 lvmetad
-	fi
-
-	if use clvm; then
-		newinitd "${FILESDIR}"/clvmd.rc-2.02.39 clvmd
-		newconfd "${FILESDIR}"/clvmd.confd-2.02.39 clvmd
-	fi
-
-	if use static-libs; then
-		dolib.a libdm/ioctl/libdevmapper.a
-		dolib.a libdaemon/client/libdaemonclient.a #462908
-		#gen_usr_ldscript libdevmapper.so
-		dolib.a daemons/dmeventd/libdevmapper-event.a
-		#gen_usr_ldscript libdevmapper-event.so
-	else
-		rm -f "${ED}"usr/$(get_libdir)/{libdevmapper-event,liblvm2cmd,liblvm2app,libdevmapper}.a
-	fi
-
-	if use lvm2create_initrd; then
-		dosbin scripts/lvm2create_initrd/lvm2create_initrd
-		doman scripts/lvm2create_initrd/lvm2create_initrd.8
-		newdoc scripts/lvm2create_initrd/README README.lvm2create_initrd
-	fi
-
-	insinto /etc
-	doins "${FILESDIR}"/dmtab
-
-	dodoc README VERSION* WHATS_NEW WHATS_NEW_DM doc/*.{c,txt} conf/*.conf
-}
-
-pkg_postinst() {
-	ewarn "Make sure the \"lvm\" init script is in the runlevels:"
-	ewarn "# rc-update add lvm boot"
-	ewarn
-	ewarn "Make sure to enable lvmetad in /etc/lvm/lvm.conf if you want"
-	ewarn "to enable lvm autoactivation and metadata caching."
-}
-
-src_test() {
-	einfo "Tests are disabled because of device-node mucking, if you want to"
-	einfo "run tests, compile the package and see ${S}/tests"
-}

diff --git a/sys-fs/lvm2/lvm2-2.02.110.ebuild b/sys-fs/lvm2/lvm2-2.02.110.ebuild
deleted file mode 100644
index d90358a..0000000
--- a/sys-fs/lvm2/lvm2-2.02.110.ebuild
+++ /dev/null
@@ -1,272 +0,0 @@
-# Copyright 1999-2015 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-EAPI=5
-inherit autotools eutils linux-info multilib systemd toolchain-funcs udev flag-o-matic
-
-DESCRIPTION="User-land utilities for LVM2 (device-mapper) software"
-HOMEPAGE="https://sources.redhat.com/lvm2/"
-SRC_URI="ftp://sources.redhat.com/pub/lvm2/${PN/lvm/LVM}.${PV}.tgz
-	ftp://sources.redhat.com/pub/lvm2/old/${PN/lvm/LVM}.${PV}.tgz"
-
-LICENSE="GPL-2"
-SLOT="0"
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~x86-linux"
-IUSE="readline static static-libs systemd clvm cman lvm1 lvm2create_initrd selinux +udev +thin device-mapper-only"
-REQUIRED_USE="device-mapper-only? ( !clvm !cman !lvm1 !lvm2create_initrd !thin )
-	systemd? ( udev )
-	static? ( !udev )" #520450
-
-DEPEND_COMMON="clvm? ( cman? ( =sys-cluster/cman-3* ) =sys-cluster/libdlm-3* )
-	readline? ( sys-libs/readline:0= )
-	udev? ( >=virtual/libudev-208:=[static-libs?] )"
-# /run is now required for locking during early boot. /var cannot be assumed to
-# be available -- thus, pull in recent enough baselayout for /run.
-# This version of LVM is incompatible with cryptsetup <1.1.2.
-RDEPEND="${DEPEND_COMMON}
-	>=sys-apps/baselayout-2.2
-	!<sys-apps/openrc-0.11
-	!<sys-fs/cryptsetup-1.1.2
-	!!sys-fs/clvm
-	!!sys-fs/lvm-user
-	>=sys-apps/util-linux-2.16
-	lvm2create_initrd? ( sys-apps/makedev )
-	thin? ( >=sys-block/thin-provisioning-tools-0.3.0 )"
-# note: thin- 0.3.0 is required to avoid --disable-thin_check_needs_check
-DEPEND="${DEPEND_COMMON}
-	virtual/pkgconfig
-	>=sys-devel/binutils-2.20.1-r1
-	static? (
-		selinux? ( sys-libs/libselinux[static-libs] )
-		udev? ( >=virtual/libudev-208:=[static-libs] )
-		>=sys-apps/util-linux-2.16[static-libs]
-	)"
-
-S=${WORKDIR}/${PN/lvm/LVM}.${PV}
-
-pkg_setup() {
-	local CONFIG_CHECK="~SYSVIPC"
-
-	if use udev; then
-		local WARNING_SYSVIPC="CONFIG_SYSVIPC:\tis not set (required for udev sync)\n"
-		if linux_config_exists; then
-			local uevent_helper_path=$(linux_chkconfig_string UEVENT_HELPER_PATH)
-			if [ -n "${uevent_helper_path}" ] && [ "${uevent_helper_path}" != '""' ]; then
-				ewarn "It's recommended to set an empty value to the following kernel config option:"
-				ewarn "CONFIG_UEVENT_HELPER_PATH=${uevent_helper_path}"
-			fi
-		fi
-	fi
-
-	check_extra_config
-
-	# 1. Genkernel no longer copies /sbin/lvm blindly.
-	if use static; then
-		elog "Warning, we no longer overwrite /sbin/lvm and /sbin/dmsetup with"
-		elog "their static versions. If you need the static binaries,"
-		elog "you must append .static to the filename!"
-	fi
-}
-
-src_prepare() {
-	# Gentoo specific modification(s):
-	epatch "${FILESDIR}"/${PN}-2.02.108-example.conf.in.patch
-
-	sed -i \
-		-e "1iAR = $(tc-getAR)" \
-		-e "s:CC ?= @CC@:CC = $(tc-getCC):" \
-		make.tmpl.in || die #444082
-
-	sed -i -e '/FLAG/s:-O2::' configure{.in,} || die #480212
-
-	if use udev && ! use device-mapper-only; then
-		sed -i -e '/use_lvmetad =/s:0:1:' conf/example.conf.in || die #514196
-		elog "Notice that \"use_lvmetad\" setting is enabled with USE=\"udev\" in"
-		elog "/etc/lvm/lvm.conf, which will require restart of udev, lvm, and lvmetad"
-		elog "if it was previously disabled."
-	fi
-
-	sed -i -e "s:/usr/bin/true:$(type -P true):" scripts/blk_availability_systemd_red_hat.service.in || die #517514
-
-	# For upstream -- review and forward:
-	epatch "${FILESDIR}"/${PN}-2.02.63-always-make-static-libdm.patch
-	epatch "${FILESDIR}"/${PN}-2.02.56-lvm2create_initrd.patch
-	epatch "${FILESDIR}"/${PN}-2.02.67-createinitrd.patch #301331
-	epatch "${FILESDIR}"/${PN}-2.02.99-locale-muck.patch #330373
-	epatch "${FILESDIR}"/${PN}-2.02.70-asneeded.patch # -Wl,--as-needed
-	epatch "${FILESDIR}"/${PN}-2.02.92-dynamic-static-ldflags.patch #332905
-	epatch "${FILESDIR}"/${PN}-2.02.108-static-pkgconfig-libs.patch #370217, #439414 + blkid
-	epatch "${FILESDIR}"/${PN}-2.02.106-pthread-pkgconfig.patch #492450
-
-	# Without thin-privision-tools, there is nothing to install for target install_man7:
-	use thin || { sed -i -e '/^install_lvm2/s:install_man7::' man/Makefile.in || die; }
-
-	eautoreconf
-}
-
-src_configure() {
-	filter-flags -flto
-	local myconf
-	local buildmode
-
-	myconf="${myconf} $(use_enable !device-mapper-only dmeventd)"
-	myconf="${myconf} $(use_enable !device-mapper-only cmdlib)"
-	myconf="${myconf} $(use_enable !device-mapper-only applib)"
-	myconf="${myconf} $(use_enable !device-mapper-only fsadm)"
-	myconf="${myconf} $(use_enable !device-mapper-only lvmetad)"
-	use device-mapper-only && myconf="${myconf} --disable-udev-systemd-background-jobs"
-
-	# Most of this package does weird stuff.
-	# The build options are tristate, and --without is NOT supported
-	# options: 'none', 'internal', 'shared'
-	if use static; then
-		buildmode="internal"
-		# This only causes the .static versions to become available
-		myconf="${myconf} --enable-static_link"
-	else
-		buildmode="shared"
-	fi
-	dmbuildmode=$(use !device-mapper-only && echo internal || echo none)
-
-	# dmeventd requires mirrors to be internal, and snapshot available
-	# so we cannot disable them
-	myconf="${myconf} --with-mirrors=${dmbuildmode}"
-	myconf="${myconf} --with-snapshots=${dmbuildmode}"
-	if use thin; then
-		myconf="${myconf} --with-thin=internal --with-cache=internal"
-		local texec
-		for texec in check dump repair restore; do
-			myconf="${myconf} --with-thin-${texec}=${EPREFIX}/sbin/thin_${texec}"
-			myconf="${myconf} --with-cache-${texec}=${EPREFIX}/sbin/cache_${texec}"
-		done
-	else
-		myconf="${myconf} --with-thin=none --with-cache=none"
-	fi
-
-	if use lvm1; then
-		myconf="${myconf} --with-lvm1=${buildmode}"
-	else
-		myconf="${myconf} --with-lvm1=none"
-	fi
-
-	# disable O_DIRECT support on hppa, breaks pv detection (#99532)
-	use hppa && myconf="${myconf} --disable-o_direct"
-
-	if use clvm; then
-		myconf="${myconf} --with-cluster=${buildmode}"
-		# 4-state! Make sure we get it right, per bug 210879
-		# Valid options are: none, cman, gulm, all
-		#
-		# 2009/02:
-		# gulm is removed now, now dual-state:
-		# cman, none
-		# all still exists, but is not needed
-		#
-		# 2009/07:
-		# TODO: add corosync and re-enable ALL
-		local clvmd=""
-		use cman && clvmd="cman"
-		#clvmd="${clvmd/cmangulm/all}"
-		[ -z "${clvmd}" ] && clvmd="none"
-		myconf="${myconf} --with-clvmd=${clvmd}"
-		myconf="${myconf} --with-pool=${buildmode}"
-	else
-		myconf="${myconf} --with-clvmd=none --with-cluster=none"
-	fi
-
-	econf \
-		$(use_enable readline) \
-		$(use_enable selinux) \
-		--enable-pkgconfig \
-		--with-confdir="${EPREFIX}"/etc \
-		--exec-prefix="${EPREFIX}" \
-		--sbindir="${EPREFIX}/sbin" \
-		--with-staticdir="${EPREFIX}"/sbin \
-		--libdir="${EPREFIX}/$(get_libdir)" \
-		--with-usrlibdir="${EPREFIX}/usr/$(get_libdir)" \
-		--with-default-dm-run-dir=/run \
-		--with-default-run-dir=/run/lvm \
-		--with-default-locking-dir=/run/lock/lvm \
-		--with-default-pid-dir=/run \
-		$(use_enable udev udev_rules) \
-		$(use_enable udev udev_sync) \
-		$(use_with udev udevdir "$(get_udevdir)"/rules.d) \
-		$(use_enable systemd udev-systemd-background-jobs) \
-		"$(systemd_with_unitdir)" \
-		${myconf} \
-		CLDFLAGS="${LDFLAGS}"
-}
-
-src_compile() {
-	pushd include >/dev/null
-	emake
-	popd >/dev/null
-
-	if use device-mapper-only ; then
-		emake device-mapper
-	else
-		emake
-		emake CC="$(tc-getCC)" -C scripts lvm2_activation_generator_systemd_red_hat
-	fi
-}
-
-src_install() {
-	local inst
-	INSTALL_TARGETS="install install_systemd_units install_systemd_generators install_tmpfiles_configuration"
-	use device-mapper-only && INSTALL_TARGETS="install_device-mapper"
-	for inst in ${INSTALL_TARGETS}; do
-		emake DESTDIR="${D}" ${inst}
-	done
-
-	newinitd "${FILESDIR}"/device-mapper.rc-2.02.105-r2 device-mapper
-	newconfd "${FILESDIR}"/device-mapper.conf-1.02.22-r3 device-mapper
-
-	if use !device-mapper-only ; then
-		newinitd "${FILESDIR}"/dmeventd.initd-2.02.67-r1 dmeventd
-		newinitd "${FILESDIR}"/lvm.rc-2.02.105-r2 lvm
-		newconfd "${FILESDIR}"/lvm.confd-2.02.28-r2 lvm
-
-		newinitd "${FILESDIR}"/lvm-monitoring.initd-2.02.105-r2 lvm-monitoring
-		newinitd "${FILESDIR}"/lvmetad.initd-2.02.105-r2 lvmetad
-	fi
-
-	if use clvm; then
-		newinitd "${FILESDIR}"/clvmd.rc-2.02.39 clvmd
-		newconfd "${FILESDIR}"/clvmd.confd-2.02.39 clvmd
-	fi
-
-	if use static-libs; then
-		dolib.a libdm/ioctl/libdevmapper.a
-		dolib.a libdaemon/client/libdaemonclient.a #462908
-		#gen_usr_ldscript libdevmapper.so
-		dolib.a daemons/dmeventd/libdevmapper-event.a
-		#gen_usr_ldscript libdevmapper-event.so
-	else
-		rm -f "${ED}"usr/$(get_libdir)/{libdevmapper-event,liblvm2cmd,liblvm2app,libdevmapper}.a
-	fi
-
-	if use lvm2create_initrd; then
-		dosbin scripts/lvm2create_initrd/lvm2create_initrd
-		doman scripts/lvm2create_initrd/lvm2create_initrd.8
-		newdoc scripts/lvm2create_initrd/README README.lvm2create_initrd
-	fi
-
-	insinto /etc
-	doins "${FILESDIR}"/dmtab
-
-	dodoc README VERSION* WHATS_NEW WHATS_NEW_DM doc/*.{c,txt} conf/*.conf
-}
-
-pkg_postinst() {
-	ewarn "Make sure the \"lvm\" init script is in the runlevels:"
-	ewarn "# rc-update add lvm boot"
-	ewarn
-	ewarn "Make sure to enable lvmetad in /etc/lvm/lvm.conf if you want"
-	ewarn "to enable lvm autoactivation and metadata caching."
-}
-
-src_test() {
-	einfo "Tests are disabled because of device-node mucking, if you want to"
-	einfo "run tests, compile the package and see ${S}/tests"
-}


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-fs/lvm2/, sys-fs/lvm2/files/
@ 2016-04-20  3:58 Mike Frysinger
  0 siblings, 0 replies; 29+ messages in thread
From: Mike Frysinger @ 2016-04-20  3:58 UTC (permalink / raw
  To: gentoo-commits

commit:     a45d3e7432ae37620b99109ee771b6f6016280ef
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Wed Apr 20 03:55:14 2016 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Wed Apr 20 03:57:30 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a45d3e74

sys-fs/lvm2: fix build w/newer glibc #580062

 sys-fs/lvm2/files/lvm2-2.02.145-mkdev.patch | 127 ++++++++++++++++++++++++++++
 sys-fs/lvm2/lvm2-2.02.145-r2.ebuild         |   1 +
 2 files changed, 128 insertions(+)

diff --git a/sys-fs/lvm2/files/lvm2-2.02.145-mkdev.patch b/sys-fs/lvm2/files/lvm2-2.02.145-mkdev.patch
new file mode 100644
index 0000000..f91dccd
--- /dev/null
+++ b/sys-fs/lvm2/files/lvm2-2.02.145-mkdev.patch
@@ -0,0 +1,127 @@
+https://bugs.gentoo.org/580062
+
+From 2a1d0fa8ea765604cd8274aac5aa7876f1c145c9 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Tue, 19 Apr 2016 23:53:22 -0400
+Subject: [PATCH] convert major/minor/makedev handling
+
+Most of the files in here use MAJOR/MINOR/MKDEV macros, but a few
+missed it.  Update the defines in those files to match them.
+---
+ daemons/cmirrord/functions.c                          | 16 ++++++++++++----
+ daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c | 12 ++++++++++--
+ lib/filters/filter-sysfs.c                            |  6 ++++--
+ 3 files changed, 26 insertions(+), 8 deletions(-)
+
+diff --git a/daemons/cmirrord/functions.c b/daemons/cmirrord/functions.c
+index e9d3c09..5b3cb38 100644
+--- a/daemons/cmirrord/functions.c
++++ b/daemons/cmirrord/functions.c
+@@ -20,6 +20,14 @@
+ #include <time.h>
+ #include <unistd.h>
+ 
++#ifdef __linux__
++#  include "kdev_t.h"
++#else
++#  define MAJOR(x) major((x))
++#  define MINOR(x) minor((x))
++#  define MKDEV(x,y) makedev((x),(y))
++#endif
++
+ #define BYTE_SHIFT 3
+ 
+ /*
+@@ -333,8 +341,8 @@ static int find_disk_path(char *major_minor_str, char *path_rtn, int *unlink_pat
+ 			continue;
+ 		}
+ 		if (S_ISBLK(statbuf.st_mode) &&
+-		    (major(statbuf.st_rdev) == major) &&
+-		    (minor(statbuf.st_rdev) == minor)) {
++		    (MAJOR(statbuf.st_rdev) == major) &&
++		    (MINOR(statbuf.st_rdev) == minor)) {
+ 			LOG_DBG("  %s: YES", dep->d_name);
+ 			if (closedir(dp))
+ 				LOG_DBG("Unable to closedir /dev/mapper %s",
+@@ -1451,7 +1459,7 @@ static int disk_status_info(struct log_c *lc, struct dm_ulog_request *rq)
+ 	}
+ 
+ 	r = sprintf(data, "3 clustered-disk %d:%d %c",
+-		    major(statbuf.st_rdev), minor(statbuf.st_rdev),
++		    MAJOR(statbuf.st_rdev), MINOR(statbuf.st_rdev),
+ 		    (lc->log_dev_failed) ? 'D' : 'A');
+ 	if (r < 0)
+ 		return r;
+@@ -1514,7 +1522,7 @@ static int disk_status_table(struct log_c *lc, struct dm_ulog_request *rq)
+ 	}
+ 
+ 	r = sprintf(data, "clustered-disk %d:%d %u %s%s ",
+-		    major(statbuf.st_rdev), minor(statbuf.st_rdev),
++		    MAJOR(statbuf.st_rdev), MINOR(statbuf.st_rdev),
+ 		    lc->region_size,
+ 		    (lc->sync == DEFAULTSYNC) ? "" :
+ 		    (lc->sync == NOSYNC) ? "nosync " : "sync ",
+diff --git a/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c b/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c
+index 7b060ed..4098203 100644
+--- a/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c
++++ b/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c
+@@ -20,6 +20,14 @@
+ #include <stdarg.h>
+ #include <pthread.h>
+ 
++#ifdef __linux__
++#  include "kdev_t.h"
++#else
++#  define MAJOR(x) major((x))
++#  define MINOR(x) minor((x))
++#  define MKDEV(x,y) makedev((x),(y))
++#endif
++
+ /* First warning when snapshot is 80% full. */
+ #define WARNING_THRESH	(DM_PERCENT_1 * 80)
+ /* Run a check every 5%. */
+@@ -148,8 +156,8 @@ static void _umount(const char *device, int major, int minor)
+ 			continue; /* can't stat, skip this one */
+ 
+ 		if (S_ISBLK(st.st_mode) &&
+-		    major(st.st_rdev) == major &&
+-		    minor(st.st_rdev) == minor) {
++		    MAJOR(st.st_rdev) == major &&
++		    MINOR(st.st_rdev) == minor) {
+ 			log_error("Unmounting invalid snapshot %s from %s.", device, words[1]);
+ 			if (!_run(UMOUNT_COMMAND, "-fl", words[1], NULL))
+ 				log_error("Failed to umount snapshot %s from %s: %s.",
+diff --git a/lib/filters/filter-sysfs.c b/lib/filters/filter-sysfs.c
+index 3115f86..5f76e8b 100644
+--- a/lib/filters/filter-sysfs.c
++++ b/lib/filters/filter-sysfs.c
+@@ -19,6 +19,8 @@
+ 
+ #include <dirent.h>
+ 
++#include "kdev_t.h"
++
+ static int _locate_sysfs_blocks(const char *sysfs_dir, char *path, size_t len,
+ 				unsigned *sysfs_depth)
+ {
+@@ -120,7 +122,7 @@ static struct dev_set *_dev_set_create(struct dm_pool *mem,
+ 
+ static unsigned _hash_dev(dev_t dev)
+ {
+-	return (major(dev) ^ minor(dev)) & (SET_BUCKETS - 1);
++	return (MAJOR(dev) ^ MINOR(dev)) & (SET_BUCKETS - 1);
+ }
+ 
+ /*
+@@ -171,7 +173,7 @@ static int _parse_dev(const char *file, FILE *fp, dev_t *result)
+ 		return 0;
+ 	}
+ 
+-	*result = makedev(major, minor);
++	*result = MKDEV(major, minor);
+ 	return 1;
+ }
+ 
+-- 
+2.7.4
+

diff --git a/sys-fs/lvm2/lvm2-2.02.145-r2.ebuild b/sys-fs/lvm2/lvm2-2.02.145-r2.ebuild
index 4db87a2..0970c2f 100644
--- a/sys-fs/lvm2/lvm2-2.02.145-r2.ebuild
+++ b/sys-fs/lvm2/lvm2-2.02.145-r2.ebuild
@@ -68,6 +68,7 @@ PATCHES=(
 	"${FILESDIR}"/${PN}-2.02.139-dynamic-static-ldflags.patch #332905
 	"${FILESDIR}"/${PN}-2.02.129-static-pkgconfig-libs.patch #370217, #439414 + blkid
 	"${FILESDIR}"/${PN}-2.02.130-pthread-pkgconfig.patch #492450
+	"${FILESDIR}"/${PN}-2.02.145-mkdev.patch #580062
 )
 
 pkg_setup() {


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-fs/lvm2/, sys-fs/lvm2/files/
@ 2019-04-17  7:26 Robin H. Johnson
  0 siblings, 0 replies; 29+ messages in thread
From: Robin H. Johnson @ 2019-04-17  7:26 UTC (permalink / raw
  To: gentoo-commits

commit:     2c3d9335bfb904d55365b5a4f6470490021e3a91
Author:     Manuel Ullmann <labre <AT> posteo <DOT> de>
AuthorDate: Sat Apr 13 12:06:22 2019 +0000
Commit:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Wed Apr 17 07:25:37 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2c3d9335

sys-fs/lvm2: fix race condition with udev stopping in lvm rc service

Maintainer Edit: don't add lvm2-2.02.183-r1, just move straight forward to .184-r2.

Fixes: https://bugs.gentoo.org/683240
Fixes: https://github.com/gentoo/gentoo/pull/11670
Package-Manager: Portage-2.3.62, Repoman-2.3.11
Signed-off-by: Manuel Ullmann <labre <AT> posteo.de>
(cherry picked from commit 9af3439dabcf6efe6a2df4459e06366dc6a330af)
Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>

 sys-fs/lvm2/files/lvm.rc-2.02.183   | 149 ++++++++++++++++++++
 sys-fs/lvm2/lvm2-2.02.184-r2.ebuild | 262 ++++++++++++++++++++++++++++++++++++
 2 files changed, 411 insertions(+)

diff --git a/sys-fs/lvm2/files/lvm.rc-2.02.183 b/sys-fs/lvm2/files/lvm.rc-2.02.183
new file mode 100644
index 00000000000..d431fc72138
--- /dev/null
+++ b/sys-fs/lvm2/files/lvm.rc-2.02.183
@@ -0,0 +1,149 @@
+#!/sbin/openrc-run
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+_get_lvm_path() {
+	local lvm_path=
+	for lvm_path in /bin/lvm /sbin/lvm ; do
+		[ -x "$lvm_path" ] && break
+	done
+	echo "${lvm_path}"
+}
+
+_need_lvmetad()
+{
+	local lvm_path="$(_get_lvm_path)"
+	[ ! -x "${lvm_path}" ] && return 1
+	${lvm_path} dumpconfig global 2>/dev/null | grep -q 'use_lvmetad=1'
+}
+
+_need_lvmlockd()
+{
+	local lvm_path="$(_get_lvm_path)"
+	[ ! -x "${lvm_path}" ] && return 1
+	${lvm_path} dumpconfig global 2>/dev/null | grep -q 'use_lvmlockd=1'
+}
+
+depend() {
+	before checkfs fsck
+	after modules device-mapper
+	# We may use lvmetad based on the configuration. If we added lvmetad
+	# support while lvm2 is running then we aren't dependent on it. For the
+	# more common case, if its disabled in the config we aren't dependent
+	# on it.
+	config /etc/lvm/lvm.conf
+	local _need=
+	if service_started; then
+		_need=$(service_get_value need)
+	else
+		if _need_lvmetad; then
+			_need="${_need} lvmetad"
+		fi
+		if _need_lvmlockd; then
+			_need="${_need} lvmlockd"
+		fi
+	fi
+	need sysfs udev ${_need}
+}
+
+config='global { locking_dir = "/run/lock/lvm" }'
+
+dm_in_proc() {
+	local retval=0
+	for x in devices misc ; do
+		grep -qs 'device-mapper' /proc/${x}
+		retval=$((${retval} + $?))
+	done
+	return ${retval}
+}
+
+start() {
+	# LVM support for /usr, /home, /opt ....
+	# This should be done *before* checking local
+	# volumes, or they never get checked.
+
+	# NOTE: Add needed modules for LVM or RAID, etc
+	#       to /etc/modules.autoload if needed
+	lvm_path="$(_get_lvm_path)"
+	for lvm_path in /bin/lvm /sbin/lvm ; do
+		[ -x "$lvm_path" ] && break
+	done
+	if [ ! -x "$lvm_path" ]; then
+		eerror "Cannot find lvm binary in /sbin or /bin!"
+		return 1
+	fi
+	if [ -z "${CDBOOT}" ] ; then
+		if [ -e /proc/modules ] && ! dm_in_proc ; then
+			modprobe dm-mod 2>/dev/null
+		fi
+		if [ -d /proc/lvm ] || dm_in_proc ; then
+			ebegin "Setting up the Logical Volume Manager"
+			#still echo stderr for debugging
+			lvm_commands="#!${lvm_path}\n"
+			# Extra PV find pass because some devices might not have been available until very recently
+			lvm_commands="${lvm_commands}pvscan --config '${config}'\n"
+			# Now make the nodes
+			lvm_commands="${lvm_commands}vgscan --config '${config}' --mknodes\n"
+			# And turn them on!
+			lvm_commands="${lvm_commands}vgchange --config '${config}' --sysinit -a ly\n"
+			if _need_lvmlockd; then
+				# Start lockd VGs as required
+				lvm_commands="${lvm_commands}vgchange --config '${config}' --lock-start --lock-opt auto\n"
+			fi
+			# Order of this is important, have to work around dash and LVM readline
+			printf "%b\n" "${lvm_commands}" | $lvm_path /proc/self/fd/0 >/dev/null
+			eend $? "Failed to setup the LVM"
+		fi
+	fi
+}
+
+start_post()
+{
+	# Save if we needed lvmetad
+	if _need_lvmetad; then
+		service_set_value need lvmetad
+	fi
+}
+
+stop() {
+	for lvm_path in /bin/lvm /sbin/lvm ; do
+		[ -x "$lvm_path" ] && break
+	done
+	if [ ! -x "$lvm_path" ]; then
+		eerror "Cannot find lvm binary in /sbin or /bin!"
+		return 1
+	fi
+
+	# Stop LVM2
+	if [ -x /sbin/vgs ] && \
+		[ -x /sbin/vgchange ] && \
+		[ -x /sbin/lvchange ] && \
+		[ -f /etc/lvmtab -o -d /etc/lvm ] && \
+		[ -d /proc/lvm  -o "`grep device-mapper /proc/misc 2>/dev/null`" ]
+	then
+		einfo "Shutting down the Logical Volume Manager"
+
+		VGS=$($lvm_path vgs --config "${config}" -o vg_name --noheadings --nosuffix --rows 2> /dev/null)
+
+		if [ "$VGS" ]
+		then
+			local _ending="eend"
+			[ "$RC_RUNLEVEL" = shutdown ] && _ending="ewend"
+			ebegin "  Shutting Down LVs & VGs"
+				#still echo stderr for debugging
+				lvm_commands="#!${lvm_path}\n"
+				# Extra PV find pass because some devices might not have been available until very recently
+				lvm_commands="${lvm_commands}lvchange --config '${config}' --sysinit -a ln ${VGS}\n"
+				# Now make the nodes
+				lvm_commands="${lvm_commands}vgchange --config '${config}' --sysinit -a ln ${VGS}\n"
+				# Order of this is important, have to work around dash and LVM readline
+				printf "%b\n" "${lvm_commands}" | $lvm_path /proc/self/fd/0 --config "${config}" >/dev/null
+			${_ending} $? "Failed (possibly some LVs still needed for /usr or root)"
+		fi
+
+		einfo "Finished shutting down the Logical Volume Manager"
+		return 0
+	fi
+}
+
+# vim:ts=4

diff --git a/sys-fs/lvm2/lvm2-2.02.184-r2.ebuild b/sys-fs/lvm2/lvm2-2.02.184-r2.ebuild
new file mode 100644
index 00000000000..64a1656d31b
--- /dev/null
+++ b/sys-fs/lvm2/lvm2-2.02.184-r2.ebuild
@@ -0,0 +1,262 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit autotools linux-info multilib systemd toolchain-funcs udev flag-o-matic
+
+DESCRIPTION="User-land utilities for LVM2 (device-mapper) software"
+HOMEPAGE="https://sourceware.org/lvm2/"
+SRC_URI="ftp://sourceware.org/pub/lvm2/${PN/lvm/LVM}.${PV}.tgz
+	ftp://sourceware.org/pub/lvm2/old/${PN/lvm/LVM}.${PV}.tgz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~x86-linux"
+IUSE="readline static static-libs systemd lvm2create_initrd sanlock selinux +udev +thin device-mapper-only"
+REQUIRED_USE="device-mapper-only? ( !lvm2create_initrd !sanlock !thin )
+	systemd? ( udev )"
+
+DEPEND_COMMON="
+	dev-libs/libaio[static-libs?]
+	static? ( dev-libs/libaio[static-libs] )
+	!static? ( dev-libs/libaio[static-libs?] )
+	readline? ( sys-libs/readline:0= )
+	sanlock? ( sys-cluster/sanlock )
+	systemd? ( >=sys-apps/systemd-205:0= )
+	udev? ( >=virtual/libudev-208:=[static-libs?] )"
+# /run is now required for locking during early boot. /var cannot be assumed to
+# be available -- thus, pull in recent enough baselayout for /run.
+# This version of LVM is incompatible with cryptsetup <1.1.2.
+RDEPEND="${DEPEND_COMMON}
+	>=sys-apps/baselayout-2.2
+	!<sys-apps/openrc-0.11
+	!<sys-fs/cryptsetup-1.1.2
+	!!sys-fs/lvm-user
+	>=sys-apps/util-linux-2.16
+	lvm2create_initrd? ( sys-apps/makedev )
+	thin? ( >=sys-block/thin-provisioning-tools-0.3.0 )"
+# note: thin- 0.3.0 is required to avoid --disable-thin_check_needs_check
+# USE 'static' currently only works with eudev, bug 520450
+DEPEND="${DEPEND_COMMON}
+	virtual/pkgconfig
+	>=sys-devel/binutils-2.20.1-r1
+	sys-devel/autoconf-archive
+	static? (
+		selinux? ( sys-libs/libselinux[static-libs] )
+		udev? ( >=sys-fs/eudev-3.1.2[static-libs] )
+		>=sys-apps/util-linux-2.16[static-libs]
+	)"
+
+S=${WORKDIR}/${PN/lvm/LVM}.${PV}
+
+PATCHES=(
+	# Gentoo specific modification(s):
+	"${FILESDIR}"/${PN}-2.02.178-example.conf.in.patch
+
+	# For upstream -- review and forward:
+	"${FILESDIR}"/${PN}-2.02.63-always-make-static-libdm.patch
+	"${FILESDIR}"/${PN}-2.02.56-lvm2create_initrd.patch
+	"${FILESDIR}"/${PN}-2.02.67-createinitrd.patch #301331
+	"${FILESDIR}"/${PN}-2.02.99-locale-muck.patch #330373
+	"${FILESDIR}"/${PN}-2.02.178-asneeded.patch # -Wl,--as-needed
+	"${FILESDIR}"/${PN}-2.02.178-dynamic-static-ldflags.patch #332905
+	"${FILESDIR}"/${PN}-2.02.178-static-pkgconfig-libs.patch #370217, #439414 + blkid
+	"${FILESDIR}"/${PN}-2.02.176-pthread-pkgconfig.patch #492450
+	"${FILESDIR}"/${PN}-2.02.171-static-libm.patch #617756
+	"${FILESDIR}"/${PN}-2.02.166-HPPA-no-O_DIRECT.patch #657446
+	#"${FILESDIR}"/${PN}-2.02.145-mkdev.patch #580062 # Merged upstream
+)
+
+pkg_setup() {
+	local CONFIG_CHECK="~SYSVIPC"
+
+	if use udev; then
+		local WARNING_SYSVIPC="CONFIG_SYSVIPC:\tis not set (required for udev sync)\n"
+		if linux_config_exists; then
+			local uevent_helper_path=$(linux_chkconfig_string UEVENT_HELPER_PATH)
+			if [ -n "${uevent_helper_path}" ] && [ "${uevent_helper_path}" != '""' ]; then
+				ewarn "It's recommended to set an empty value to the following kernel config option:"
+				ewarn "CONFIG_UEVENT_HELPER_PATH=${uevent_helper_path}"
+			fi
+		fi
+	fi
+
+	check_extra_config
+
+	# 1. Genkernel no longer copies /sbin/lvm blindly.
+	if use static; then
+		elog "Warning, we no longer overwrite /sbin/lvm and /sbin/dmsetup with"
+		elog "their static versions. If you need the static binaries,"
+		elog "you must append .static to the filename!"
+	fi
+}
+
+src_prepare() {
+	default
+
+	sed -i \
+		-e "1iAR = $(tc-getAR)" \
+		-e "s:CC ?= @CC@:CC = $(tc-getCC):" \
+		make.tmpl.in || die #444082
+
+	sed -i -e '/FLAG/s:-O2::' configure{.ac,} || die #480212
+
+	if use udev && ! use device-mapper-only; then
+		sed -i -e '/use_lvmetad =/s:0:1:' conf/example.conf.in || die #514196
+		elog "Notice that \"use_lvmetad\" setting is enabled with USE=\"udev\" in"
+		elog "/etc/lvm/lvm.conf, which will require restart of udev, lvm, and lvmetad"
+		elog "if it was previously disabled."
+	fi
+
+	sed -i -e "s:/usr/bin/true:$(type -P true):" scripts/blk_availability_systemd_red_hat.service.in || die #517514
+
+	# Without thin-privision-tools, there is nothing to install for target install_man7:
+	if ! use thin ; then
+		sed -i -e '/^install_lvm2/s:install_man7::' man/Makefile.in || die
+	fi
+
+	eautoreconf
+}
+
+src_configure() {
+	filter-flags -flto
+	local myeconfargs=()
+
+	# Most of this package does weird stuff.
+	# The build options are tristate, and --without is NOT supported
+	# options: 'none', 'internal', 'shared'
+	myeconfargs+=(
+		$(use_enable !device-mapper-only dmfilemapd)
+		$(use_enable !device-mapper-only dmeventd)
+		$(use_enable !device-mapper-only cmdlib)
+		$(use_enable !device-mapper-only applib)
+		$(use_enable !device-mapper-only fsadm)
+		$(use_enable !device-mapper-only lvmetad)
+		$(use_enable !device-mapper-only lvmpolld)
+		$(usex device-mapper-only --disable-udev-systemd-background-jobs '')
+
+		# This only causes the .static versions to become available
+		$(usex static --enable-static_link '')
+
+		# dmeventd requires mirrors to be internal, and snapshot available
+		# so we cannot disable them
+		--with-mirrors="$(usex device-mapper-only none internal)"
+		--with-snapshots="$(usex device-mapper-only none internal)"
+
+		# disable O_DIRECT support on hppa, breaks pv detection (#99532)
+		$(usex hppa --disable-o_direct '')
+	)
+
+	if use thin; then
+		myeconfargs+=( --with-thin=internal --with-cache=internal )
+		local texec
+		for texec in check dump repair restore; do
+			myeconfargs+=( --with-thin-${texec}="${EPREFIX}"/sbin/thin_${texec} )
+			myeconfargs+=( --with-cache-${texec}="${EPREFIX}"/sbin/cache_${texec} )
+		done
+	else
+		myeconfargs+=( --with-thin=none --with-cache=none )
+	fi
+
+	myeconfargs+=( --with-clvmd=none --with-cluster=none )
+
+	myeconfargs+=(
+		$(use_enable readline)
+		$(use_enable selinux)
+		--enable-pkgconfig
+		--with-confdir="${EPREFIX}"/etc
+		--exec-prefix="${EPREFIX}"
+		--sbindir="${EPREFIX}/sbin"
+		--with-staticdir="${EPREFIX}"/sbin
+		--libdir="${EPREFIX}/$(get_libdir)"
+		--with-usrlibdir="${EPREFIX}/usr/$(get_libdir)"
+		--with-default-dm-run-dir=/run
+		--with-default-run-dir=/run/lvm
+		--with-default-locking-dir=/run/lock/lvm
+		--with-default-pid-dir=/run
+		$(use_enable udev udev_rules)
+		$(use_enable udev udev_sync)
+		$(use_with udev udevdir "$(get_udevdir)"/rules.d)
+		$(use_enable sanlock lvmlockd-sanlock)
+		$(use_enable systemd udev-systemd-background-jobs)
+		$(use_enable systemd notify-dbus)
+		--with-systemdsystemunitdir="$(systemd_get_systemunitdir)"
+		CLDFLAGS="${LDFLAGS}"
+	)
+	econf "${myeconfargs[@]}"
+}
+
+src_compile() {
+	pushd include >/dev/null
+	emake
+	popd >/dev/null
+
+	if use device-mapper-only ; then
+		emake device-mapper
+	else
+		emake
+		emake CC="$(tc-getCC)" -C scripts lvm2_activation_generator_systemd_red_hat
+	fi
+}
+
+src_install() {
+	local inst INSTALL_TARGETS
+	INSTALL_TARGETS=( install install_tmpfiles_configuration )
+	# install systemd related files only when requested, bug #522430
+	use systemd && INSTALL_TARGETS+=( install_systemd_units install_systemd_generators )
+	use device-mapper-only && INSTALL_TARGETS=( install_device-mapper )
+	for inst in ${INSTALL_TARGETS[@]}; do
+		emake DESTDIR="${D}" ${inst}
+	done
+
+	newinitd "${FILESDIR}"/device-mapper.rc-2.02.105-r2 device-mapper
+	newconfd "${FILESDIR}"/device-mapper.conf-1.02.22-r3 device-mapper
+
+	if use !device-mapper-only ; then
+		newinitd "${FILESDIR}"/dmeventd.initd-2.02.67-r1 dmeventd
+		newinitd "${FILESDIR}"/lvm.rc-2.02.183 lvm
+		newconfd "${FILESDIR}"/lvm.confd-2.02.28-r2 lvm
+
+		newinitd "${FILESDIR}"/lvm-monitoring.initd-2.02.105-r2 lvm-monitoring
+		newinitd "${FILESDIR}"/lvmetad.initd-2.02.116-r3 lvmetad
+		newinitd "${FILESDIR}"/lvmpolld.initd-2.02.183 lvmpolld
+	fi
+
+	if use sanlock; then
+		newinitd "${FILESDIR}"/lvmlockd.initd-2.02.166-r1 lvmlockd
+	fi
+
+	if use static-libs; then
+		dolib.a libdm/ioctl/libdevmapper.a
+		dolib.a libdaemon/client/libdaemonclient.a #462908
+		#gen_usr_ldscript libdevmapper.so
+		dolib.a daemons/dmeventd/libdevmapper-event.a
+		#gen_usr_ldscript libdevmapper-event.so
+	else
+		rm -f "${ED%/}"/usr/$(get_libdir)/{libdevmapper-event,liblvm2cmd,liblvm2app,libdevmapper}.a
+	fi
+
+	if use lvm2create_initrd; then
+		dosbin scripts/lvm2create_initrd/lvm2create_initrd
+		doman scripts/lvm2create_initrd/lvm2create_initrd.8
+		newdoc scripts/lvm2create_initrd/README README.lvm2create_initrd
+	fi
+
+	insinto /etc
+	doins "${FILESDIR}"/dmtab
+
+	dodoc README VERSION* WHATS_NEW WHATS_NEW_DM doc/*.{c,txt} conf/*.conf
+}
+
+pkg_postinst() {
+	ewarn "Make sure the \"lvm\" init script is in the runlevels:"
+	ewarn "# rc-update add lvm boot"
+	ewarn
+	ewarn "Make sure to enable lvmetad in /etc/lvm/lvm.conf if you want"
+	ewarn "to enable lvm autoactivation and metadata caching."
+}
+
+src_test() {
+	einfo "Tests are disabled because of device-node mucking, if you want to"
+	einfo "run tests, compile the package and see ${S}/tests"
+}


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-fs/lvm2/, sys-fs/lvm2/files/
@ 2019-05-07 19:16 Robin H. Johnson
  0 siblings, 0 replies; 29+ messages in thread
From: Robin H. Johnson @ 2019-05-07 19:16 UTC (permalink / raw
  To: gentoo-commits

commit:     26a0538c6aa1a45c47d3a8b38e55a11516184359
Author:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
AuthorDate: Tue May  7 19:16:10 2019 +0000
Commit:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Tue May  7 19:16:36 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=26a0538c

sys-fs/lvm2: better USE=-udev init support

Package-Manager: Portage-2.3.62, Repoman-2.3.12
Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>

 sys-fs/lvm2/files/lvm.confd-2.02.184-r3 |   9 ++
 sys-fs/lvm2/files/lvm.rc-2.02.184-r3    | 154 ++++++++++++++++++
 sys-fs/lvm2/lvm2-2.02.184-r3.ebuild     | 270 ++++++++++++++++++++++++++++++++
 3 files changed, 433 insertions(+)

diff --git a/sys-fs/lvm2/files/lvm.confd-2.02.184-r3 b/sys-fs/lvm2/files/lvm.confd-2.02.184-r3
new file mode 100644
index 00000000000..b29e1702b35
--- /dev/null
+++ b/sys-fs/lvm2/files/lvm.confd-2.02.184-r3
@@ -0,0 +1,9 @@
+# If LVM is built with udev, you must ensure udev is running first!
+# Otherwise it will hang
+rc_need="udev"
+
+# LVM should normally only be started after mdraid is available
+# this is because LVM physical volumes are very often MD devices.
+rc_after="mdraid"
+
+# vim: ft=gentoo-conf-d

diff --git a/sys-fs/lvm2/files/lvm.rc-2.02.184-r3 b/sys-fs/lvm2/files/lvm.rc-2.02.184-r3
new file mode 100644
index 00000000000..b48efb0c99a
--- /dev/null
+++ b/sys-fs/lvm2/files/lvm.rc-2.02.184-r3
@@ -0,0 +1,154 @@
+#!/sbin/openrc-run
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+_get_lvm_path() {
+	local lvm_path=
+	for lvm_path in /bin/lvm /sbin/lvm ; do
+		[ -x "$lvm_path" ] && break
+	done
+	echo "${lvm_path}"
+}
+
+_need_lvmetad()
+{
+	local lvm_path="$(_get_lvm_path)"
+	[ ! -x "${lvm_path}" ] && return 1
+	${lvm_path} dumpconfig global 2>/dev/null | grep -q 'use_lvmetad=1'
+}
+
+_need_lvmlockd()
+{
+	local lvm_path="$(_get_lvm_path)"
+	[ ! -x "${lvm_path}" ] && return 1
+	${lvm_path} dumpconfig global 2>/dev/null | grep -q 'use_lvmlockd=1'
+}
+
+depend() {
+	before checkfs fsck
+	after modules device-mapper
+	# We may use lvmetad based on the configuration. If we added lvmetad
+	# support while lvm2 is running then we aren't dependent on it. For the
+	# more common case, if its disabled in the config we aren't dependent
+	# on it.
+	config /etc/lvm/lvm.conf
+	local _need=
+	if service_started; then
+		_need=$(service_get_value need)
+	else
+		if _need_lvmetad; then
+			_need="${_need} lvmetad"
+		fi
+		if _need_lvmlockd; then
+			_need="${_need} lvmlockd"
+		fi
+	fi
+	# Make sure you review /etc/conf.d/lvm as well!
+	# Depending on your system, it might also introduce udev & mdraid
+	need sysfs ${_need}
+}
+
+config='global { locking_dir = "/run/lock/lvm" }'
+
+dm_in_proc() {
+	local retval=0
+	for x in devices misc ; do
+		grep -qs 'device-mapper' /proc/${x}
+		retval=$((${retval} + $?))
+	done
+	return ${retval}
+}
+
+start() {
+	# LVM support for /usr, /home, /opt ....
+	# This should be done *before* checking local
+	# volumes, or they never get checked.
+
+	# NOTE: Add needed modules for LVM or RAID, etc
+	#       to /etc/modules.autoload if needed
+	lvm_path="$(_get_lvm_path)"
+	for lvm_path in /bin/lvm /sbin/lvm ; do
+		[ -x "$lvm_path" ] && break
+	done
+	if [ ! -x "$lvm_path" ]; then
+		eerror "Cannot find lvm binary in /sbin or /bin!"
+		return 1
+	fi
+	if [ -z "${CDBOOT}" ] ; then
+		if [ -e /proc/modules ] && ! dm_in_proc ; then
+			modprobe dm-mod 2>/dev/null
+		fi
+		if [ -d /proc/lvm ] || dm_in_proc ; then
+			ebegin "Setting up the Logical Volume Manager"
+			#still echo stderr for debugging
+			lvm_commands="#!${lvm_path}\n"
+			# Extra PV find pass because some devices might not have been available until very recently
+			lvm_commands="${lvm_commands}pvscan --config '${config}'\n"
+			# Now make the nodes
+			lvm_commands="${lvm_commands}vgscan --config '${config}' --mknodes\n"
+			# And turn them on!
+			lvm_commands="${lvm_commands}vgchange --config '${config}' --sysinit -a ly\n"
+			if _need_lvmlockd; then
+				# Start lockd VGs as required
+				lvm_commands="${lvm_commands}vgchange --config '${config}' --lock-start --lock-opt auto\n"
+			fi
+			# Order of this is important, have to work around dash and LVM readline
+			printf "%b\n" "${lvm_commands}" | $lvm_path /proc/self/fd/0 >/dev/null
+			eend $? "Failed to setup the LVM"
+		fi
+	fi
+}
+
+start_post()
+{
+	# Save if we needed lvmetad
+	if _need_lvmetad; then
+		service_set_value need lvmetad
+	fi
+}
+
+stop() {
+	for lvm_path in /bin/lvm /sbin/lvm ; do
+		[ -x "$lvm_path" ] && break
+	done
+	if [ ! -x "$lvm_path" ]; then
+		eerror "Cannot find lvm binary in /sbin or /bin!"
+		return 1
+	fi
+
+	# Stop LVM2
+	if [ -x /sbin/vgs ] && \
+		[ -x /sbin/vgchange ] && \
+		[ -x /sbin/lvchange ] && \
+		[ -f /etc/lvmtab -o -d /etc/lvm ] && \
+		[ -d /proc/lvm  -o "`grep device-mapper /proc/misc 2>/dev/null`" ]
+	then
+		einfo "Shutting down the Logical Volume Manager"
+
+		VGS=$($lvm_path vgs --config "${config}" -o vg_name --noheadings --nosuffix --rows 2> /dev/null)
+
+		if [ "$VGS" ]
+		then
+			local _ending="eend"
+			[ "$RC_RUNLEVEL" = shutdown ] && _ending="ewend"
+			ebegin "  Shutting Down LVs & VGs"
+				#still echo stderr for debugging
+				lvm_commands="#!${lvm_path}\n"
+				# Extra PV find pass because some devices might not have been available until very recently
+				lvm_commands="${lvm_commands}lvchange --config '${config}' --sysinit -a ln ${VGS}\n"
+				# Now make the nodes
+				lvm_commands="${lvm_commands}vgchange --config '${config}' --sysinit -a ln ${VGS}\n"
+				# Order of this is important, have to work around dash and LVM readline
+				printf "%b\n" "${lvm_commands}" | $lvm_path /proc/self/fd/0 --config "${config}" >/dev/null
+			rc=$?
+			msg="Failed (possibly some LVs still needed for /usr or root)"
+			[ "$RC_RUNLEVEL" = shutdown ] && msg="${msg} [rc=$rc]" && rc=0
+			${_ending} $rc "${msg}"
+		fi
+
+		einfo "Finished shutting down the Logical Volume Manager"
+		return 0
+	fi
+}
+
+# vim:ts=4

diff --git a/sys-fs/lvm2/lvm2-2.02.184-r3.ebuild b/sys-fs/lvm2/lvm2-2.02.184-r3.ebuild
new file mode 100644
index 00000000000..0665b359447
--- /dev/null
+++ b/sys-fs/lvm2/lvm2-2.02.184-r3.ebuild
@@ -0,0 +1,270 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit autotools linux-info multilib systemd toolchain-funcs udev flag-o-matic
+
+DESCRIPTION="User-land utilities for LVM2 (device-mapper) software"
+HOMEPAGE="https://sourceware.org/lvm2/"
+SRC_URI="ftp://sourceware.org/pub/lvm2/${PN/lvm/LVM}.${PV}.tgz
+	ftp://sourceware.org/pub/lvm2/old/${PN/lvm/LVM}.${PV}.tgz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~x86-linux"
+IUSE="readline static static-libs systemd lvm2create_initrd sanlock selinux +udev +thin device-mapper-only"
+REQUIRED_USE="device-mapper-only? ( !lvm2create_initrd !sanlock !thin )
+	systemd? ( udev )"
+
+DEPEND_COMMON="
+	dev-libs/libaio[static-libs?]
+	static? ( dev-libs/libaio[static-libs] )
+	!static? ( dev-libs/libaio[static-libs?] )
+	readline? ( sys-libs/readline:0= )
+	sanlock? ( sys-cluster/sanlock )
+	systemd? ( >=sys-apps/systemd-205:0= )
+	udev? ( >=virtual/libudev-208:=[static-libs?] )"
+# /run is now required for locking during early boot. /var cannot be assumed to
+# be available -- thus, pull in recent enough baselayout for /run.
+# This version of LVM is incompatible with cryptsetup <1.1.2.
+RDEPEND="${DEPEND_COMMON}
+	>=sys-apps/baselayout-2.2
+	!<sys-apps/openrc-0.11
+	!<sys-fs/cryptsetup-1.1.2
+	!!sys-fs/lvm-user
+	>=sys-apps/util-linux-2.16
+	lvm2create_initrd? ( sys-apps/makedev )
+	thin? ( >=sys-block/thin-provisioning-tools-0.3.0 )"
+# note: thin- 0.3.0 is required to avoid --disable-thin_check_needs_check
+# USE 'static' currently only works with eudev, bug 520450
+DEPEND="${DEPEND_COMMON}
+	virtual/pkgconfig
+	>=sys-devel/binutils-2.20.1-r1
+	sys-devel/autoconf-archive
+	static? (
+		selinux? ( sys-libs/libselinux[static-libs] )
+		udev? ( >=sys-fs/eudev-3.1.2[static-libs] )
+		>=sys-apps/util-linux-2.16[static-libs]
+	)"
+
+S=${WORKDIR}/${PN/lvm/LVM}.${PV}
+
+PATCHES=(
+	# Gentoo specific modification(s):
+	"${FILESDIR}"/${PN}-2.02.178-example.conf.in.patch
+
+	# For upstream -- review and forward:
+	"${FILESDIR}"/${PN}-2.02.63-always-make-static-libdm.patch
+	"${FILESDIR}"/${PN}-2.02.56-lvm2create_initrd.patch
+	"${FILESDIR}"/${PN}-2.02.67-createinitrd.patch #301331
+	"${FILESDIR}"/${PN}-2.02.99-locale-muck.patch #330373
+	"${FILESDIR}"/${PN}-2.02.178-asneeded.patch # -Wl,--as-needed
+	"${FILESDIR}"/${PN}-2.02.178-dynamic-static-ldflags.patch #332905
+	"${FILESDIR}"/${PN}-2.02.178-static-pkgconfig-libs.patch #370217, #439414 + blkid
+	"${FILESDIR}"/${PN}-2.02.176-pthread-pkgconfig.patch #492450
+	"${FILESDIR}"/${PN}-2.02.171-static-libm.patch #617756
+	"${FILESDIR}"/${PN}-2.02.166-HPPA-no-O_DIRECT.patch #657446
+	#"${FILESDIR}"/${PN}-2.02.145-mkdev.patch #580062 # Merged upstream
+	"${FILESDIR}"/${PN}-2.02.184-dmeventd-no-idle-exit.patch
+)
+
+pkg_setup() {
+	local CONFIG_CHECK="~SYSVIPC"
+
+	if use udev; then
+		local WARNING_SYSVIPC="CONFIG_SYSVIPC:\tis not set (required for udev sync)\n"
+		if linux_config_exists; then
+			local uevent_helper_path=$(linux_chkconfig_string UEVENT_HELPER_PATH)
+			if [ -n "${uevent_helper_path}" ] && [ "${uevent_helper_path}" != '""' ]; then
+				ewarn "It's recommended to set an empty value to the following kernel config option:"
+				ewarn "CONFIG_UEVENT_HELPER_PATH=${uevent_helper_path}"
+			fi
+		fi
+	fi
+
+	check_extra_config
+
+	# 1. Genkernel no longer copies /sbin/lvm blindly.
+	if use static; then
+		elog "Warning, we no longer overwrite /sbin/lvm and /sbin/dmsetup with"
+		elog "their static versions. If you need the static binaries,"
+		elog "you must append .static to the filename!"
+	fi
+}
+
+src_prepare() {
+	default
+
+	sed -i \
+		-e "1iAR = $(tc-getAR)" \
+		-e "s:CC ?= @CC@:CC = $(tc-getCC):" \
+		make.tmpl.in || die #444082
+
+	sed -i -e '/FLAG/s:-O2::' configure{.ac,} || die #480212
+
+	if use udev && ! use device-mapper-only; then
+		sed -i -e '/use_lvmetad =/s:0:1:' conf/example.conf.in || die #514196
+		elog "Notice that \"use_lvmetad\" setting is enabled with USE=\"udev\" in"
+		elog "/etc/lvm/lvm.conf, which will require restart of udev, lvm, and lvmetad"
+		elog "if it was previously disabled."
+	fi
+
+	sed -i -e "s:/usr/bin/true:$(type -P true):" scripts/blk_availability_systemd_red_hat.service.in || die #517514
+
+	# Without thin-privision-tools, there is nothing to install for target install_man7:
+	if ! use thin ; then
+		sed -i -e '/^install_lvm2/s:install_man7::' man/Makefile.in || die
+	fi
+
+	eautoreconf
+}
+
+src_configure() {
+	filter-flags -flto
+	local myeconfargs=()
+
+	# Most of this package does weird stuff.
+	# The build options are tristate, and --without is NOT supported
+	# options: 'none', 'internal', 'shared'
+	myeconfargs+=(
+		$(use_enable !device-mapper-only dmfilemapd)
+		$(use_enable !device-mapper-only dmeventd)
+		$(use_enable !device-mapper-only cmdlib)
+		$(use_enable !device-mapper-only applib)
+		$(use_enable !device-mapper-only fsadm)
+		$(use_enable !device-mapper-only lvmetad)
+		$(use_enable !device-mapper-only lvmpolld)
+		$(usex device-mapper-only --disable-udev-systemd-background-jobs '')
+
+		# This only causes the .static versions to become available
+		$(usex static --enable-static_link '')
+
+		# dmeventd requires mirrors to be internal, and snapshot available
+		# so we cannot disable them
+		--with-mirrors="$(usex device-mapper-only none internal)"
+		--with-snapshots="$(usex device-mapper-only none internal)"
+
+		# disable O_DIRECT support on hppa, breaks pv detection (#99532)
+		$(usex hppa --disable-o_direct '')
+	)
+
+	if use thin; then
+		myeconfargs+=( --with-thin=internal --with-cache=internal )
+		local texec
+		for texec in check dump repair restore; do
+			myeconfargs+=( --with-thin-${texec}="${EPREFIX}"/sbin/thin_${texec} )
+			myeconfargs+=( --with-cache-${texec}="${EPREFIX}"/sbin/cache_${texec} )
+		done
+	else
+		myeconfargs+=( --with-thin=none --with-cache=none )
+	fi
+
+	myeconfargs+=( --with-clvmd=none --with-cluster=none )
+
+	myeconfargs+=(
+		$(use_enable readline)
+		$(use_enable selinux)
+		--enable-pkgconfig
+		--with-confdir="${EPREFIX}"/etc
+		--exec-prefix="${EPREFIX}"
+		--sbindir="${EPREFIX}/sbin"
+		--with-staticdir="${EPREFIX}"/sbin
+		--libdir="${EPREFIX}/$(get_libdir)"
+		--with-usrlibdir="${EPREFIX}/usr/$(get_libdir)"
+		--with-default-dm-run-dir=/run
+		--with-default-run-dir=/run/lvm
+		--with-default-locking-dir=/run/lock/lvm
+		--with-default-pid-dir=/run
+		$(use_enable udev udev_rules)
+		$(use_enable udev udev_sync)
+		$(use_with udev udevdir "$(get_udevdir)"/rules.d)
+		$(use_enable sanlock lvmlockd-sanlock)
+		$(use_enable systemd udev-systemd-background-jobs)
+		$(use_enable systemd notify-dbus)
+		--with-systemdsystemunitdir="$(systemd_get_systemunitdir)"
+		CLDFLAGS="${LDFLAGS}"
+	)
+	econf "${myeconfargs[@]}"
+}
+
+src_compile() {
+	pushd include >/dev/null
+	emake
+	popd >/dev/null
+
+	if use device-mapper-only ; then
+		emake device-mapper
+	else
+		emake
+		emake CC="$(tc-getCC)" -C scripts lvm2_activation_generator_systemd_red_hat
+	fi
+}
+
+src_install() {
+	local inst INSTALL_TARGETS
+	INSTALL_TARGETS=( install install_tmpfiles_configuration )
+	# install systemd related files only when requested, bug #522430
+	use systemd && INSTALL_TARGETS+=( install_systemd_units install_systemd_generators )
+	use device-mapper-only && INSTALL_TARGETS=( install_device-mapper )
+	for inst in ${INSTALL_TARGETS[@]}; do
+		emake DESTDIR="${D}" ${inst}
+	done
+
+	newinitd "${FILESDIR}"/device-mapper.rc-2.02.105-r2 device-mapper
+	newconfd "${FILESDIR}"/device-mapper.conf-1.02.22-r3 device-mapper
+
+	if use !device-mapper-only ; then
+		newinitd "${FILESDIR}"/dmeventd.initd-2.02.184-r2 dmeventd
+		newinitd "${FILESDIR}"/lvm.rc-2.02.184-r3 lvm
+		newconfd "${FILESDIR}"/lvm.confd-2.02.184-r3 lvm
+		if ! use udev ; then
+			# We keep the variable but remove udev from it.
+			sed -r -i \
+				-e '/^rc_need=/s/\<udev\>//g' \
+				"${ED}/etc/conf.d/lvm" || die "Could not drop udev from rc_need"
+		fi
+
+
+		newinitd "${FILESDIR}"/lvm-monitoring.initd-2.02.105-r2 lvm-monitoring
+		newinitd "${FILESDIR}"/lvmetad.initd-2.02.116-r3 lvmetad
+		newinitd "${FILESDIR}"/lvmpolld.initd-2.02.183 lvmpolld
+	fi
+
+	if use sanlock; then
+		newinitd "${FILESDIR}"/lvmlockd.initd-2.02.166-r1 lvmlockd
+	fi
+
+	if use static-libs; then
+		dolib.a libdm/ioctl/libdevmapper.a
+		dolib.a libdaemon/client/libdaemonclient.a #462908
+		#gen_usr_ldscript libdevmapper.so
+		dolib.a daemons/dmeventd/libdevmapper-event.a
+		#gen_usr_ldscript libdevmapper-event.so
+	else
+		rm -f "${ED%/}"/usr/$(get_libdir)/{libdevmapper-event,liblvm2cmd,liblvm2app,libdevmapper}.a
+	fi
+
+	if use lvm2create_initrd; then
+		dosbin scripts/lvm2create_initrd/lvm2create_initrd
+		doman scripts/lvm2create_initrd/lvm2create_initrd.8
+		newdoc scripts/lvm2create_initrd/README README.lvm2create_initrd
+	fi
+
+	insinto /etc
+	doins "${FILESDIR}"/dmtab
+
+	dodoc README VERSION* WHATS_NEW WHATS_NEW_DM doc/*.{c,txt} conf/*.conf
+}
+
+pkg_postinst() {
+	ewarn "Make sure the \"lvm\" init script is in the runlevels:"
+	ewarn "# rc-update add lvm boot"
+	ewarn
+	ewarn "Make sure to enable lvmetad in /etc/lvm/lvm.conf if you want"
+	ewarn "to enable lvm autoactivation and metadata caching."
+}
+
+src_test() {
+	einfo "Tests are disabled because of device-node mucking, if you want to"
+	einfo "run tests, compile the package and see ${S}/tests"
+}


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-fs/lvm2/, sys-fs/lvm2/files/
@ 2019-06-18  5:27 Robin H. Johnson
  0 siblings, 0 replies; 29+ messages in thread
From: Robin H. Johnson @ 2019-06-18  5:27 UTC (permalink / raw
  To: gentoo-commits

commit:     5a186b6d1089b239eb764c563d93c5d532152a20
Author:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
AuthorDate: Tue Jun 18 05:25:22 2019 +0000
Commit:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Tue Jun 18 05:27:16 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5a186b6d

sys-fs/lvm2: bump, bugfix release from upstream, stable candidate

Package-Manager: Portage-2.3.67, Repoman-2.3.12
Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>

 sys-fs/lvm2/Manifest                               |   1 +
 sys-fs/lvm2/files/device-mapper.rc-2.02.105-r2     |   2 +-
 sys-fs/lvm2/files/dmeventd.initd-2.02.67-r1        |   2 +-
 sys-fs/lvm2/files/lvm-monitoring.initd-2.02.105-r2 |   2 +-
 sys-fs/lvm2/files/lvm.rc-2.02.105-r2               |   2 +-
 sys-fs/lvm2/files/lvm.rc-2.02.116-r6               |   2 +-
 sys-fs/lvm2/files/lvm.rc-2.02.172                  |   2 +-
 sys-fs/lvm2/files/lvmetad.initd-2.02.105-r2        |   2 +-
 sys-fs/lvm2/files/lvmetad.initd-2.02.116-r3        |   2 +-
 sys-fs/lvm2/files/lvmlockd.initd-2.02.166-r1       |   2 +-
 sys-fs/lvm2/lvm2-2.02.145-r2.ebuild                |   2 +-
 ...vm2-2.02.145-r2.ebuild => lvm2-2.02.185.ebuild} | 180 +++++++++++----------
 12 files changed, 108 insertions(+), 93 deletions(-)

diff --git a/sys-fs/lvm2/Manifest b/sys-fs/lvm2/Manifest
index fa9cdc1b27e..bf3cba8c8b2 100644
--- a/sys-fs/lvm2/Manifest
+++ b/sys-fs/lvm2/Manifest
@@ -2,3 +2,4 @@ DIST LVM2.2.02.116.tgz 1538340 BLAKE2B 718261b60626f2eca5ba13011646bf551523ed8e5
 DIST LVM2.2.02.145.tgz 1986370 BLAKE2B 0c9e5efae17f26ff86152cecbf0b11a74e85007b2fa9491f44dec03ac8c11375bacf6685213b4be19037c8fbf70e13549516716ecf8fa262919a44625e6aab34 SHA512 84e28b3efc940837ea9da70fce620744aea0945ba29383b76ad7bcd4b5259b897c714162a8e8b7cfe26ae736a3ad2eca633a3e0df4d6280a32b28bd4cf472d27
 DIST LVM2.2.02.183.tgz 2380574 BLAKE2B b1fe71b6cdb8ee20dd53d0ad3399c553487baafa12657ec81a794c84ad161988afdb8693ac247877a2645d693a0740c74c8b991047ed2ba4adc9ec75f1c261a9 SHA512 3947523c6b0862ada40677ed171ed0cf95e070119e377296fc5ccb153e9c4212d34c0b16a887dbd68ccf265525345dabfed2aa59fb3604555429a7e2ecfff4d7
 DIST LVM2.2.02.184.tgz 2383698 BLAKE2B b6e308d76d541b9461dfcc6e82db256a175ccdabfae9c9d57d84eabd0d5ea50e3e09954b34741903e027412c2c26f72a5005fe934261576337a810738139deb8 SHA512 9db74f675e7c58f663a39afb79b6f33a33ad2cfbda63e9783ef5027f33977b4a1262a2e6754aa67c586eed083ee119a2e837c32a7746dcc53f13877c9d65c390
+DIST LVM2.2.02.185.tgz 2386328 BLAKE2B d2e31de3eedd7518ea2d239cb9b36b38e351d7fc070097a1fc4e7934e3636195da3247fba57d684bb0b31b7f3dbdfe29161bd121b2962b2c35c8c9d7914b4506 SHA512 f421505551aec2a09bc862f2fcc1ee825bc4d94c53a01d13265631e99308d60fbca40112be5bc7824cce3ef223c0775d2f6c345f6a3f227229a0566c903841bf

diff --git a/sys-fs/lvm2/files/device-mapper.rc-2.02.105-r2 b/sys-fs/lvm2/files/device-mapper.rc-2.02.105-r2
index 7dbacce0d94..79fdff246fb 100644
--- a/sys-fs/lvm2/files/device-mapper.rc-2.02.105-r2
+++ b/sys-fs/lvm2/files/device-mapper.rc-2.02.105-r2
@@ -1,5 +1,5 @@
 #!/sbin/openrc-run
-# Copyright 1999-2016 Gentoo Foundation
+# Copyright 1999-2019 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 depend() {

diff --git a/sys-fs/lvm2/files/dmeventd.initd-2.02.67-r1 b/sys-fs/lvm2/files/dmeventd.initd-2.02.67-r1
index 930e84baa86..f77996caa57 100644
--- a/sys-fs/lvm2/files/dmeventd.initd-2.02.67-r1
+++ b/sys-fs/lvm2/files/dmeventd.initd-2.02.67-r1
@@ -1,5 +1,5 @@
 #!/sbin/openrc-run
-# Copyright 1999-2016 Gentoo Foundation
+# Copyright 1999-2019 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 PIDFILE=/run/dmeventd.pid

diff --git a/sys-fs/lvm2/files/lvm-monitoring.initd-2.02.105-r2 b/sys-fs/lvm2/files/lvm-monitoring.initd-2.02.105-r2
index d603718cc22..914d6637c7a 100644
--- a/sys-fs/lvm2/files/lvm-monitoring.initd-2.02.105-r2
+++ b/sys-fs/lvm2/files/lvm-monitoring.initd-2.02.105-r2
@@ -1,5 +1,5 @@
 #!/sbin/openrc-run
-# Copyright 1999-2016 Gentoo Foundation
+# Copyright 1999-2019 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # This script is based on upstream file

diff --git a/sys-fs/lvm2/files/lvm.rc-2.02.105-r2 b/sys-fs/lvm2/files/lvm.rc-2.02.105-r2
index c59f9c3c878..937db047d19 100644
--- a/sys-fs/lvm2/files/lvm.rc-2.02.105-r2
+++ b/sys-fs/lvm2/files/lvm.rc-2.02.105-r2
@@ -1,5 +1,5 @@
 #!/sbin/openrc-run
-# Copyright 1999-2016 Gentoo Foundation
+# Copyright 1999-2019 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 depend() {

diff --git a/sys-fs/lvm2/files/lvm.rc-2.02.116-r6 b/sys-fs/lvm2/files/lvm.rc-2.02.116-r6
index 1bf075fae3e..cf430c6654d 100644
--- a/sys-fs/lvm2/files/lvm.rc-2.02.116-r6
+++ b/sys-fs/lvm2/files/lvm.rc-2.02.116-r6
@@ -1,5 +1,5 @@
 #!/sbin/openrc-run
-# Copyright 1999-2016 Gentoo Foundation
+# Copyright 1999-2019 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 _get_lvm_path() {

diff --git a/sys-fs/lvm2/files/lvm.rc-2.02.172 b/sys-fs/lvm2/files/lvm.rc-2.02.172
index c3f1f08f399..82037b28adf 100644
--- a/sys-fs/lvm2/files/lvm.rc-2.02.172
+++ b/sys-fs/lvm2/files/lvm.rc-2.02.172
@@ -1,5 +1,5 @@
 #!/sbin/openrc-run
-# Copyright 1999-2018 Gentoo Foundation
+# Copyright 1999-2019 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 _get_lvm_path() {

diff --git a/sys-fs/lvm2/files/lvmetad.initd-2.02.105-r2 b/sys-fs/lvm2/files/lvmetad.initd-2.02.105-r2
index c95a47d5be5..565f49c7c42 100644
--- a/sys-fs/lvm2/files/lvmetad.initd-2.02.105-r2
+++ b/sys-fs/lvm2/files/lvmetad.initd-2.02.105-r2
@@ -1,5 +1,5 @@
 #!/sbin/openrc-run
-# Copyright 1999-2016 Gentoo Foundation
+# Copyright 1999-2019 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 pidfile="/run/lvmetad.pid"

diff --git a/sys-fs/lvm2/files/lvmetad.initd-2.02.116-r3 b/sys-fs/lvm2/files/lvmetad.initd-2.02.116-r3
index 2efce4223e5..55bbf9c4b63 100644
--- a/sys-fs/lvm2/files/lvmetad.initd-2.02.116-r3
+++ b/sys-fs/lvm2/files/lvmetad.initd-2.02.116-r3
@@ -1,5 +1,5 @@
 #!/sbin/openrc-run
-# Copyright 1999-2016 Gentoo Foundation
+# Copyright 1999-2019 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 pidfile="/run/lvmetad.pid"

diff --git a/sys-fs/lvm2/files/lvmlockd.initd-2.02.166-r1 b/sys-fs/lvm2/files/lvmlockd.initd-2.02.166-r1
index 16e2cc3f12b..8b5986fae24 100644
--- a/sys-fs/lvm2/files/lvmlockd.initd-2.02.166-r1
+++ b/sys-fs/lvm2/files/lvmlockd.initd-2.02.166-r1
@@ -1,5 +1,5 @@
 #!/sbin/openrc-run
-# Copyright 1999-2017 Gentoo Foundation
+# Copyright 1999-2019 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 pidfile="/run/lvmlockd.pid"

diff --git a/sys-fs/lvm2/lvm2-2.02.145-r2.ebuild b/sys-fs/lvm2/lvm2-2.02.145-r2.ebuild
index 2890ca59239..31435ff9d05 100644
--- a/sys-fs/lvm2/lvm2-2.02.145-r2.ebuild
+++ b/sys-fs/lvm2/lvm2-2.02.145-r2.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2017 Gentoo Foundation
+# Copyright 1999-2019 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=6

diff --git a/sys-fs/lvm2/lvm2-2.02.145-r2.ebuild b/sys-fs/lvm2/lvm2-2.02.185.ebuild
similarity index 53%
copy from sys-fs/lvm2/lvm2-2.02.145-r2.ebuild
copy to sys-fs/lvm2/lvm2-2.02.185.ebuild
index 2890ca59239..f82f1a6846b 100644
--- a/sys-fs/lvm2/lvm2-2.02.145-r2.ebuild
+++ b/sys-fs/lvm2/lvm2-2.02.185.ebuild
@@ -1,8 +1,8 @@
-# Copyright 1999-2017 Gentoo Foundation
+# Copyright 1999-2019 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=6
-inherit autotools eutils linux-info multilib systemd toolchain-funcs udev flag-o-matic
+inherit autotools linux-info multilib systemd toolchain-funcs udev flag-o-matic
 
 DESCRIPTION="User-land utilities for LVM2 (device-mapper) software"
 HOMEPAGE="https://sourceware.org/lvm2/"
@@ -11,13 +11,17 @@ SRC_URI="ftp://sourceware.org/pub/lvm2/${PN/lvm/LVM}.${PV}.tgz
 
 LICENSE="GPL-2"
 SLOT="0"
-KEYWORDS="alpha amd64 arm arm64 hppa ia64 ~mips ppc ppc64 s390 ~sh sparc x86 ~amd64-linux ~x86-linux"
-IUSE="readline static static-libs systemd lvm1 lvm2create_initrd selinux +udev +thin device-mapper-only"
-REQUIRED_USE="device-mapper-only? ( !lvm1 !lvm2create_initrd !thin )
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~x86-linux"
+IUSE="readline static static-libs systemd lvm2create_initrd sanlock selinux +udev +thin device-mapper-only"
+REQUIRED_USE="device-mapper-only? ( !lvm2create_initrd !sanlock !thin )
 	systemd? ( udev )"
 
 DEPEND_COMMON="
+	dev-libs/libaio[static-libs?]
+	static? ( dev-libs/libaio[static-libs] )
+	!static? ( dev-libs/libaio[static-libs?] )
 	readline? ( sys-libs/readline:0= )
+	sanlock? ( sys-cluster/sanlock )
 	systemd? ( >=sys-apps/systemd-205:0= )
 	udev? ( >=virtual/libudev-208:=[static-libs?] )"
 # /run is now required for locking during early boot. /var cannot be assumed to
@@ -47,18 +51,22 @@ S=${WORKDIR}/${PN/lvm/LVM}.${PV}
 
 PATCHES=(
 	# Gentoo specific modification(s):
-	"${FILESDIR}"/${PN}-2.02.129-example.conf.in.patch
+	"${FILESDIR}"/${PN}-2.02.178-example.conf.in.patch
 
 	# For upstream -- review and forward:
 	"${FILESDIR}"/${PN}-2.02.63-always-make-static-libdm.patch
 	"${FILESDIR}"/${PN}-2.02.56-lvm2create_initrd.patch
 	"${FILESDIR}"/${PN}-2.02.67-createinitrd.patch #301331
 	"${FILESDIR}"/${PN}-2.02.99-locale-muck.patch #330373
-	"${FILESDIR}"/${PN}-2.02.70-asneeded.patch # -Wl,--as-needed
-	"${FILESDIR}"/${PN}-2.02.139-dynamic-static-ldflags.patch #332905
-	"${FILESDIR}"/${PN}-2.02.129-static-pkgconfig-libs.patch #370217, #439414 + blkid
-	"${FILESDIR}"/${PN}-2.02.130-pthread-pkgconfig.patch #492450
-	"${FILESDIR}"/${PN}-2.02.145-mkdev.patch #580062
+	"${FILESDIR}"/${PN}-2.02.178-asneeded.patch # -Wl,--as-needed
+	"${FILESDIR}"/${PN}-2.02.178-dynamic-static-ldflags.patch #332905
+	"${FILESDIR}"/${PN}-2.02.178-static-pkgconfig-libs.patch #370217, #439414 + blkid
+	"${FILESDIR}"/${PN}-2.02.176-pthread-pkgconfig.patch #492450
+	"${FILESDIR}"/${PN}-2.02.171-static-libm.patch #617756
+	"${FILESDIR}"/${PN}-2.02.166-HPPA-no-O_DIRECT.patch #657446
+	#"${FILESDIR}"/${PN}-2.02.145-mkdev.patch #580062 # Merged upstream
+	"${FILESDIR}"/${PN}-2.02.184-dmeventd-no-idle-exit.patch
+	#"${FILESDIR}"/${PN}-2.02.184-allow-reading-metadata-with-invalid-creation_time.patch #682380 # merged upstream
 )
 
 pkg_setup() {
@@ -93,7 +101,7 @@ src_prepare() {
 		-e "s:CC ?= @CC@:CC = $(tc-getCC):" \
 		make.tmpl.in || die #444082
 
-	sed -i -e '/FLAG/s:-O2::' configure{.in,} || die #480212
+	sed -i -e '/FLAG/s:-O2::' configure{.ac,} || die #480212
 
 	if use udev && ! use device-mapper-only; then
 		sed -i -e '/use_lvmetad =/s:0:1:' conf/example.conf.in || die #514196
@@ -105,82 +113,79 @@ src_prepare() {
 	sed -i -e "s:/usr/bin/true:$(type -P true):" scripts/blk_availability_systemd_red_hat.service.in || die #517514
 
 	# Without thin-privision-tools, there is nothing to install for target install_man7:
-	use thin || { sed -i -e '/^install_lvm2/s:install_man7::' man/Makefile.in || die; }
+	if ! use thin ; then
+		sed -i -e '/^install_lvm2/s:install_man7::' man/Makefile.in || die
+	fi
 
 	eautoreconf
 }
 
 src_configure() {
 	filter-flags -flto
-	local myconf=()
-	local buildmode
-
-	myconf+=( $(use_enable !device-mapper-only dmeventd) )
-	myconf+=( $(use_enable !device-mapper-only cmdlib) )
-	myconf+=( $(use_enable !device-mapper-only applib) )
-	myconf+=( $(use_enable !device-mapper-only fsadm) )
-	myconf+=( $(use_enable !device-mapper-only lvmetad) )
-	use device-mapper-only && myconf+=( --disable-udev-systemd-background-jobs )
+	local myeconfargs=()
 
 	# Most of this package does weird stuff.
 	# The build options are tristate, and --without is NOT supported
 	# options: 'none', 'internal', 'shared'
-	if use static; then
-		buildmode="internal"
+	myeconfargs+=(
+		$(use_enable !device-mapper-only dmfilemapd)
+		$(use_enable !device-mapper-only dmeventd)
+		$(use_enable !device-mapper-only cmdlib)
+		$(use_enable !device-mapper-only applib)
+		$(use_enable !device-mapper-only fsadm)
+		$(use_enable !device-mapper-only lvmetad)
+		$(use_enable !device-mapper-only lvmpolld)
+		$(usex device-mapper-only --disable-udev-systemd-background-jobs '')
+
 		# This only causes the .static versions to become available
-		myconf+=( --enable-static_link )
-	else
-		buildmode="shared"
-	fi
-	dmbuildmode=$(use !device-mapper-only && echo internal || echo none)
+		$(usex static --enable-static_link '')
+
+		# dmeventd requires mirrors to be internal, and snapshot available
+		# so we cannot disable them
+		--with-mirrors="$(usex device-mapper-only none internal)"
+		--with-snapshots="$(usex device-mapper-only none internal)"
+
+		# disable O_DIRECT support on hppa, breaks pv detection (#99532)
+		$(usex hppa --disable-o_direct '')
+	)
 
-	# dmeventd requires mirrors to be internal, and snapshot available
-	# so we cannot disable them
-	myconf+=( --with-mirrors=${dmbuildmode} )
-	myconf+=( --with-snapshots=${dmbuildmode} )
 	if use thin; then
-		myconf+=( --with-thin=internal --with-cache=internal )
+		myeconfargs+=( --with-thin=internal --with-cache=internal )
 		local texec
 		for texec in check dump repair restore; do
-			myconf+=( --with-thin-${texec}="${EPREFIX}"/sbin/thin_${texec} )
-			myconf+=( --with-cache-${texec}="${EPREFIX}"/sbin/cache_${texec} )
+			myeconfargs+=( --with-thin-${texec}="${EPREFIX}"/sbin/thin_${texec} )
+			myeconfargs+=( --with-cache-${texec}="${EPREFIX}"/sbin/cache_${texec} )
 		done
 	else
-		myconf+=( --with-thin=none --with-cache=none )
+		myeconfargs+=( --with-thin=none --with-cache=none )
 	fi
 
-	if use lvm1; then
-		myconf+=( --with-lvm1=${buildmode} )
-	else
-		myconf+=( --with-lvm1=none )
-	fi
-
-	# disable O_DIRECT support on hppa, breaks pv detection (#99532)
-	use hppa && myconf+=( --disable-o_direct )
-
-	myconf+=( --with-clvmd=none --with-cluster=none )
-
-	econf \
-		$(use_enable readline) \
-		$(use_enable selinux) \
-		--enable-pkgconfig \
-		--with-confdir="${EPREFIX}"/etc \
-		--exec-prefix="${EPREFIX}" \
-		--sbindir="${EPREFIX}/sbin" \
-		--with-staticdir="${EPREFIX}"/sbin \
-		--libdir="${EPREFIX}/$(get_libdir)" \
-		--with-usrlibdir="${EPREFIX}/usr/$(get_libdir)" \
-		--with-default-dm-run-dir=/run \
-		--with-default-run-dir=/run/lvm \
-		--with-default-locking-dir=/run/lock/lvm \
-		--with-default-pid-dir=/run \
-		$(use_enable udev udev_rules) \
-		$(use_enable udev udev_sync) \
-		$(use_with udev udevdir "$(get_udevdir)"/rules.d) \
-		$(use_enable systemd udev-systemd-background-jobs) \
-		--with-systemdsystemunitdir="$(systemd_get_systemunitdir)" \
-		${myconf[@]} \
+	myeconfargs+=( --with-clvmd=none --with-cluster=none )
+
+	myeconfargs+=(
+		$(use_enable readline)
+		$(use_enable selinux)
+		--enable-pkgconfig
+		--with-confdir="${EPREFIX}"/etc
+		--exec-prefix="${EPREFIX}"
+		--sbindir="${EPREFIX}/sbin"
+		--with-staticdir="${EPREFIX}"/sbin
+		--libdir="${EPREFIX}/$(get_libdir)"
+		--with-usrlibdir="${EPREFIX}/usr/$(get_libdir)"
+		--with-default-dm-run-dir=/run
+		--with-default-run-dir=/run/lvm
+		--with-default-locking-dir=/run/lock/lvm
+		--with-default-pid-dir=/run
+		$(use_enable udev udev_rules)
+		$(use_enable udev udev_sync)
+		$(use_with udev udevdir "$(get_udevdir)"/rules.d)
+		$(use_enable sanlock lvmlockd-sanlock)
+		$(use_enable systemd udev-systemd-background-jobs)
+		$(use_enable systemd notify-dbus)
+		--with-systemdsystemunitdir="$(systemd_get_systemunitdir)"
 		CLDFLAGS="${LDFLAGS}"
+	)
+	econf "${myeconfargs[@]}"
 }
 
 src_compile() {
@@ -197,12 +202,12 @@ src_compile() {
 }
 
 src_install() {
-	local inst
-	INSTALL_TARGETS="install install_tmpfiles_configuration"
+	local inst INSTALL_TARGETS
+	INSTALL_TARGETS=( install install_tmpfiles_configuration )
 	# install systemd related files only when requested, bug #522430
-	use systemd && INSTALL_TARGETS="${INSTALL_TARGETS} install_systemd_units install_systemd_generators"
-	use device-mapper-only && INSTALL_TARGETS="install_device-mapper"
-	for inst in ${INSTALL_TARGETS}; do
+	use systemd && INSTALL_TARGETS+=( install_systemd_units install_systemd_generators )
+	use device-mapper-only && INSTALL_TARGETS=( install_device-mapper )
+	for inst in ${INSTALL_TARGETS[@]}; do
 		emake DESTDIR="${D}" ${inst}
 	done
 
@@ -210,24 +215,33 @@ src_install() {
 	newconfd "${FILESDIR}"/device-mapper.conf-1.02.22-r3 device-mapper
 
 	if use !device-mapper-only ; then
-		newinitd "${FILESDIR}"/dmeventd.initd-2.02.67-r1 dmeventd
-		newinitd "${FILESDIR}"/lvm.rc-2.02.116-r6 lvm
-		newconfd "${FILESDIR}"/lvm.confd-2.02.28-r2 lvm
+		newinitd "${FILESDIR}"/dmeventd.initd-2.02.184-r2 dmeventd
+		newinitd "${FILESDIR}"/lvm.rc-2.02.184-r3 lvm
+		newconfd "${FILESDIR}"/lvm.confd-2.02.184-r3 lvm
+		if ! use udev ; then
+			# We keep the variable but remove udev from it.
+			sed -r -i \
+				-e '/^rc_need=/s/\<udev\>//g' \
+				"${ED}/etc/conf.d/lvm" || die "Could not drop udev from rc_need"
+		fi
 
 		newinitd "${FILESDIR}"/lvm-monitoring.initd-2.02.105-r2 lvm-monitoring
 		newinitd "${FILESDIR}"/lvmetad.initd-2.02.116-r3 lvmetad
+		newinitd "${FILESDIR}"/lvmpolld.initd-2.02.183 lvmpolld
+	fi
+
+	if use sanlock; then
+		newinitd "${FILESDIR}"/lvmlockd.initd-2.02.166-r1 lvmlockd
 	fi
 
 	if use static-libs; then
 		dolib.a libdm/ioctl/libdevmapper.a
-		if use !device-mapper-only ; then
-			dolib.a libdaemon/client/libdaemonclient.a #462908
-			#gen_usr_ldscript libdevmapper.so
-			dolib.a daemons/dmeventd/libdevmapper-event.a
-			#gen_usr_ldscript libdevmapper-event.so
-		fi
+		dolib.a libdaemon/client/libdaemonclient.a #462908
+		#gen_usr_ldscript libdevmapper.so
+		dolib.a daemons/dmeventd/libdevmapper-event.a
+		#gen_usr_ldscript libdevmapper-event.so
 	else
-		rm -f "${ED}"usr/$(get_libdir)/{libdevmapper-event,liblvm2cmd,liblvm2app,libdevmapper}.a
+		rm -f "${ED%/}"/usr/$(get_libdir)/{libdevmapper-event,liblvm2cmd,liblvm2app,libdevmapper}.a
 	fi
 
 	if use lvm2create_initrd; then


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-fs/lvm2/, sys-fs/lvm2/files/
@ 2019-06-18  9:03 Lars Wendler
  0 siblings, 0 replies; 29+ messages in thread
From: Lars Wendler @ 2019-06-18  9:03 UTC (permalink / raw
  To: gentoo-commits

commit:     708fc54cc41e78710557966a421eb734d07b3e64
Author:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
AuthorDate: Tue Jun 18 09:02:34 2019 +0000
Commit:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
CommitDate: Tue Jun 18 09:03:20 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=708fc54c

sys-fs/lvm2: Fixed build with app-shells/mksh

Thanks-to: Alexander Tsoy <alexander <AT> tsoy.me>
Closes: https://bugs.gentoo.org/686652
Package-Manager: Portage-2.3.67, Repoman-2.3.14
Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>

 sys-fs/lvm2/files/lvm2-2.02.184-mksh_build.patch | 13 +++++++++++++
 sys-fs/lvm2/lvm2-2.02.185.ebuild                 |  2 +-
 2 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/sys-fs/lvm2/files/lvm2-2.02.184-mksh_build.patch b/sys-fs/lvm2/files/lvm2-2.02.184-mksh_build.patch
new file mode 100644
index 00000000000..49c6853f23a
--- /dev/null
+++ b/sys-fs/lvm2/files/lvm2-2.02.184-mksh_build.patch
@@ -0,0 +1,13 @@
+https://bugs.gentoo.org/686652
+
+--- LVM2.2.02.184/tools/Makefile.in
++++ LVM2.2.02.184/tools/Makefile.in
+@@ -220,6 +220,6 @@
+ 	  echo "/* Do not edit. This file is generated by the Makefile. */" && \
+ 	  echo -en "const char _command_input[] =\n\n\"" && \
+ 	  $(EGREP) -v '^#|\-\-\-|^$$' $(srcdir)/command-lines.in | $(AWK) 'BEGIN {ORS = "\\n\"\n\""} //' && \
+-	  echo "\\n\";" \
++	  printf "%s\n" "\\n\";" \
+ 	) > $@
+ 
+ $(SOURCES:%.c=%.d) $(SOURCES2:%.c=%.d): command-lines-input.h command-count.h cmds.h

diff --git a/sys-fs/lvm2/lvm2-2.02.185.ebuild b/sys-fs/lvm2/lvm2-2.02.185.ebuild
index 49ad4a19d86..871a483ce9f 100644
--- a/sys-fs/lvm2/lvm2-2.02.185.ebuild
+++ b/sys-fs/lvm2/lvm2-2.02.185.ebuild
@@ -49,7 +49,6 @@ BDEPEND="
 	virtual/pkgconfig
 "
 
-
 S="${WORKDIR}/${PN/lvm/LVM}.${PV}"
 
 PATCHES=(
@@ -70,6 +69,7 @@ PATCHES=(
 	#"${FILESDIR}"/${PN}-2.02.145-mkdev.patch #580062 # Merged upstream
 	"${FILESDIR}"/${PN}-2.02.184-dmeventd-no-idle-exit.patch
 	#"${FILESDIR}"/${PN}-2.02.184-allow-reading-metadata-with-invalid-creation_time.patch #682380 # merged upstream
+	"${FILESDIR}"/${PN}-2.02.184-mksh_build.patch #686652
 )
 
 pkg_setup() {


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-fs/lvm2/, sys-fs/lvm2/files/
@ 2019-07-24  9:54 Lars Wendler
  0 siblings, 0 replies; 29+ messages in thread
From: Lars Wendler @ 2019-07-24  9:54 UTC (permalink / raw
  To: gentoo-commits

commit:     1ad73742ac898bddf1328bb91d8f02813cc6f35f
Author:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
AuthorDate: Wed Jul 24 09:51:33 2019 +0000
Commit:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
CommitDate: Wed Jul 24 09:51:33 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1ad73742

sys-fs/lvm2: Improvements for 2.03 series

- EAPI-7
- Forward-ported a couple of patches
- lvmetad has been removed
- Removed a couple of unused configure options

Package-Manager: Portage-2.3.69, Repoman-2.3.16
Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>

 sys-fs/lvm2/files/lvm.rc-2.03.05                   | 132 +++++++++++++++++++++
 .../files/lvm2-2.03.05-dmeventd-no-idle-exit.patch |  81 +++++++++++++
 .../lvm2-2.03.05-dynamic-static-ldflags.patch      |  75 ++++++++++++
 .../lvm2/files/lvm2-2.03.05-example.conf.in.patch  |  56 +++++++++
 .../files/lvm2-2.03.05-pthread-pkgconfig.patch     |  48 ++++++++
 sys-fs/lvm2/lvm2-2.03.05.ebuild                    |  56 ++++-----
 6 files changed, 414 insertions(+), 34 deletions(-)

diff --git a/sys-fs/lvm2/files/lvm.rc-2.03.05 b/sys-fs/lvm2/files/lvm.rc-2.03.05
new file mode 100644
index 00000000000..7b7d90b9826
--- /dev/null
+++ b/sys-fs/lvm2/files/lvm.rc-2.03.05
@@ -0,0 +1,132 @@
+#!/sbin/openrc-run
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+_get_lvm_path() {
+	local lvm_path=
+	for lvm_path in /bin/lvm /sbin/lvm ; do
+		[ -x "$lvm_path" ] && break
+	done
+	echo "${lvm_path}"
+}
+
+_need_lvmlockd()
+{
+	local lvm_path="$(_get_lvm_path)"
+	[ ! -x "${lvm_path}" ] && return 1
+	${lvm_path} dumpconfig global 2>/dev/null | grep -q 'use_lvmlockd=1'
+}
+
+depend() {
+	before checkfs fsck
+	after modules device-mapper
+	config /etc/lvm/lvm.conf
+	local _need=
+	if service_started; then
+		_need=$(service_get_value need)
+	else
+		if _need_lvmlockd; then
+			_need="${_need} lvmlockd"
+		fi
+	fi
+	# Make sure you review /etc/conf.d/lvm as well!
+	# Depending on your system, it might also introduce udev & mdraid
+	need sysfs ${_need}
+}
+
+config='global { locking_dir = "/run/lock/lvm" }'
+
+dm_in_proc() {
+	local retval=0
+	for x in devices misc ; do
+		grep -qs 'device-mapper' /proc/${x}
+		retval=$((${retval} + $?))
+	done
+	return ${retval}
+}
+
+start() {
+	# LVM support for /usr, /home, /opt ....
+	# This should be done *before* checking local
+	# volumes, or they never get checked.
+
+	# NOTE: Add needed modules for LVM or RAID, etc
+	#       to /etc/modules.autoload if needed
+	lvm_path="$(_get_lvm_path)"
+	for lvm_path in /bin/lvm /sbin/lvm ; do
+		[ -x "$lvm_path" ] && break
+	done
+	if [ ! -x "$lvm_path" ]; then
+		eerror "Cannot find lvm binary in /sbin or /bin!"
+		return 1
+	fi
+	if [ -z "${CDBOOT}" ] ; then
+		if [ -e /proc/modules ] && ! dm_in_proc ; then
+			modprobe dm-mod 2>/dev/null
+		fi
+		if [ -d /proc/lvm ] || dm_in_proc ; then
+			ebegin "Setting up the Logical Volume Manager"
+			#still echo stderr for debugging
+			lvm_commands="#!${lvm_path}\n"
+			# Extra PV find pass because some devices might not have been available until very recently
+			lvm_commands="${lvm_commands}pvscan --config '${config}'\n"
+			# Now make the nodes
+			lvm_commands="${lvm_commands}vgscan --config '${config}' --mknodes\n"
+			# And turn them on!
+			lvm_commands="${lvm_commands}vgchange --config '${config}' --sysinit -a ly\n"
+			if _need_lvmlockd; then
+				# Start lockd VGs as required
+				lvm_commands="${lvm_commands}vgchange --config '${config}' --lock-start --lock-opt auto\n"
+			fi
+			# Order of this is important, have to work around dash and LVM readline
+			printf "%b\n" "${lvm_commands}" | $lvm_path /proc/self/fd/0 >/dev/null
+			eend $? "Failed to setup the LVM"
+		fi
+	fi
+}
+
+stop() {
+	for lvm_path in /bin/lvm /sbin/lvm ; do
+		[ -x "$lvm_path" ] && break
+	done
+	if [ ! -x "$lvm_path" ]; then
+		eerror "Cannot find lvm binary in /sbin or /bin!"
+		return 1
+	fi
+
+	# Stop LVM2
+	if [ -x /sbin/vgs ] && \
+		[ -x /sbin/vgchange ] && \
+		[ -x /sbin/lvchange ] && \
+		[ -f /etc/lvmtab -o -d /etc/lvm ] && \
+		[ -d /proc/lvm  -o "`grep device-mapper /proc/misc 2>/dev/null`" ]
+	then
+		einfo "Shutting down the Logical Volume Manager"
+
+		VGS=$($lvm_path vgs --config "${config}" -o vg_name --noheadings --nosuffix --rows 2> /dev/null)
+
+		if [ "$VGS" ]
+		then
+			local _ending="eend"
+			[ "$RC_RUNLEVEL" = shutdown ] && _ending="ewend"
+			ebegin "  Shutting Down LVs & VGs"
+				#still echo stderr for debugging
+				lvm_commands="#!${lvm_path}\n"
+				# Extra PV find pass because some devices might not have been available until very recently
+				lvm_commands="${lvm_commands}lvchange --config '${config}' --sysinit -a ln ${VGS}\n"
+				# Now make the nodes
+				lvm_commands="${lvm_commands}vgchange --config '${config}' --sysinit -a ln ${VGS}\n"
+				# Order of this is important, have to work around dash and LVM readline
+				printf "%b\n" "${lvm_commands}" | $lvm_path /proc/self/fd/0 --config "${config}" >/dev/null
+			rc=$?
+			msg="Failed (possibly some LVs still needed for /usr or root)"
+			[ "$RC_RUNLEVEL" = shutdown ] && msg="${msg} [rc=$rc]" && rc=0
+			${_ending} $rc "${msg}"
+		fi
+
+		einfo "Finished shutting down the Logical Volume Manager"
+		return 0
+	fi
+}
+
+# vim:ts=4

diff --git a/sys-fs/lvm2/files/lvm2-2.03.05-dmeventd-no-idle-exit.patch b/sys-fs/lvm2/files/lvm2-2.03.05-dmeventd-no-idle-exit.patch
new file mode 100644
index 00000000000..ec37e5da1dc
--- /dev/null
+++ b/sys-fs/lvm2/files/lvm2-2.03.05-dmeventd-no-idle-exit.patch
@@ -0,0 +1,81 @@
+From ab3ae0a22dfbe20e2d17e7dc60e0f76184ec098c Mon Sep 17 00:00:00 2001
+From: "Robin H. Johnson" <robbat2@gentoo.org>
+Date: Wed, 24 Jul 2019 11:22:32 +0200
+Subject: [PATCH] dmeventd configurable idle exit time
+
+dmeventd nominally exits after 1 hour of idle time. There are use cases for
+this, esp. with socket activation, but also cases where users don't expect
+dmeventd to exit.
+
+Provide a tuning knob via environment variable, DMEVENTD_IDLE_EXIT_TIMEOUT,
+that can be -1 to not exit, or a configurable time for different idle exit.
+
+Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
+Fixes: https://bugs.gentoo.org/682556
+
+Forward-ported from 2.02.184 to 2.03.05
+Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>
+---
+ daemons/dmeventd/dmeventd.c | 16 ++++++++++++++--
+ man/dmeventd.8_main         |  4 ++++
+ 2 files changed, 18 insertions(+), 2 deletions(-)
+
+diff --git a/daemons/dmeventd/dmeventd.c b/daemons/dmeventd/dmeventd.c
+index 33859ef414..ac0b9743fc 100644
+--- a/daemons/dmeventd/dmeventd.c
++++ b/daemons/dmeventd/dmeventd.c
+@@ -2158,6 +2158,18 @@ int main(int argc, char *argv[])
+ 		.server_path = DM_EVENT_FIFO_SERVER
+ 	};
+ 	time_t now, idle_exit_timeout = DMEVENTD_IDLE_EXIT_TIMEOUT;
++
++	/* Provide a basic way to config the idle timeout */
++	char* idle_exit_timeout_env = getenv("DMEVENTD_IDLE_EXIT_TIMEOUT") ? : NULL;
++	if(NULL != idle_exit_timeout_env) {
++		char* endptr;
++		idle_exit_timeout = strtol(idle_exit_timeout_env, &endptr, 10);
++		if (errno == ERANGE || *endptr != '\0') {
++			fprintf(stderr, "DMEVENTD_IDLE_EXIT_TIMEOUT: bad time input\n");
++			exit(EXIT_FAILURE);
++		}
++	}
++
+ 	opterr = 0;
+ 	optind = 0;
+ 
+@@ -2253,7 +2265,7 @@ int main(int argc, char *argv[])
+ 		_process_initial_registrations();
+ 
+ 	for (;;) {
+-		if (_idle_since) {
++		if (_idle_since || _exit_now) {
+ 			if (_exit_now) {
+ 				if (_exit_now == DM_SCHEDULED_EXIT)
+ 					break; /* Only prints shutdown message */
+@@ -2262,7 +2274,7 @@ int main(int argc, char *argv[])
+ 					 (long) (time(NULL) - _idle_since));
+ 				break;
+ 			}
+-			if (idle_exit_timeout) {
++			if (idle_exit_timeout && idle_exit_timeout > 0) {
+ 				now = time(NULL);
+ 				if (now < _idle_since)
+ 					_idle_since = now; /* clock change? */
+diff --git a/man/dmeventd.8_main b/man/dmeventd.8_main
+index dc4abf627e..4b0e522041 100644
+--- a/man/dmeventd.8_main
++++ b/man/dmeventd.8_main
+@@ -178,6 +178,10 @@ is processed.
+ Variable is set by thin and vdo plugin to prohibit recursive interation
+ with dmeventd by any executed lvm2 command from
+ a thin_command, vdo_command environment.
++.TP
++.B DMEVENTD_IDLE_EXIT_TIMEOUT
++Configure the dmeventd idle exit timeout behavior, value in seconds. Default
++is 3600 (1 hour). -1 means do not exit.
+ .
+ .SH SEE ALSO
+ .
+-- 
+2.22.0
+

diff --git a/sys-fs/lvm2/files/lvm2-2.03.05-dynamic-static-ldflags.patch b/sys-fs/lvm2/files/lvm2-2.03.05-dynamic-static-ldflags.patch
new file mode 100644
index 00000000000..2b9a5dd945c
--- /dev/null
+++ b/sys-fs/lvm2/files/lvm2-2.03.05-dynamic-static-ldflags.patch
@@ -0,0 +1,75 @@
+From 93101699f5e1190184c00c99ab7b6e9717e5019a Mon Sep 17 00:00:00 2001
+From: "Robin H. Johnson" <robbat2@gentoo.org>
+Date: Wed, 24 Jul 2019 11:11:35 +0200
+Subject: [PATCH] Add dynamic static ldflags
+
+Forward-ported from 2.02.178 to 2.03.05
+Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>
+---
+ configure.ac                 | 2 ++
+ daemons/dmeventd/Makefile.in | 2 +-
+ make.tmpl.in                 | 1 +
+ tools/Makefile.in            | 2 +-
+ 4 files changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 1e45c0edcb..cc2625294a 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -33,6 +33,7 @@ case "$host_os" in
+ 		CLDFLAGS="${CLDFLAGS:"$LDFLAGS"} -Wl,--version-script,.export.sym"
+ 		# equivalent to -rdynamic
+ 		ELDFLAGS="-Wl,--export-dynamic"
++		STATIC_LDFLAGS="-Wl,--no-export-dynamic"
+ 		# FIXME Generate list and use --dynamic-list=.dlopen.sym
+ 		CLDWHOLEARCHIVE="-Wl,-whole-archive"
+ 		CLDNOWHOLEARCHIVE="-Wl,-no-whole-archive"
+@@ -1758,6 +1759,7 @@ AC_SUBST(SYSCONFDIR)
+ AC_SUBST(SYSTEMD_LIBS)
+ AC_SUBST(SNAPSHOTS)
+ AC_SUBST(STATICDIR)
++AC_SUBST(STATIC_LDFLAGS)
+ AC_SUBST(STATIC_LINK)
+ AC_SUBST(TESTSUITE_DATA)
+ AC_SUBST(THIN)
+diff --git a/daemons/dmeventd/Makefile.in b/daemons/dmeventd/Makefile.in
+index 6bd36d0325..a3c30ec1a0 100644
+--- a/daemons/dmeventd/Makefile.in
++++ b/daemons/dmeventd/Makefile.in
+@@ -66,7 +66,7 @@ dmeventd: $(LIB_SHARED) dmeventd.o
+ 
+ dmeventd.static: $(LIB_STATIC) dmeventd.o
+ 	@echo "    [CC] $@"
+-	$(Q) $(CC) $(CFLAGS) $(LDFLAGS) -static -L. -L$(interfacebuilddir) dmeventd.o \
++	$(Q) $(CC) $(CFLAGS) $(LDFLAGS) $(STATIC_LDFLAGS) -static -L. -L$(interfacebuilddir) dmeventd.o \
+ 		-o $@ $(DL_LIBS) $(DMEVENT_LIBS) $(LIBS) $(STATIC_LIBS)
+ 
+ ifeq ("@PKGCONFIG@", "yes")
+diff --git a/make.tmpl.in b/make.tmpl.in
+index f3332e91c1..1489c2afad 100644
+--- a/make.tmpl.in
++++ b/make.tmpl.in
+@@ -68,6 +68,7 @@ DEFS += @DEFS@
+ # FIXME set this only where it's needed, not globally?
+ CFLAGS ?= @COPTIMISE_FLAG@ @CFLAGS@
+ LDFLAGS ?= @LDFLAGS@
++STATIC_LDFLAGS += @STATIC_LDFLAGS@
+ CLDFLAGS += @CLDFLAGS@
+ ELDFLAGS += @ELDFLAGS@
+ LDDEPS += @LDDEPS@
+diff --git a/tools/Makefile.in b/tools/Makefile.in
+index 2620daa17c..e5fc9c4ae4 100644
+--- a/tools/Makefile.in
++++ b/tools/Makefile.in
+@@ -136,7 +136,7 @@ man-generator: man-generator.o
+ 
+ lvm.static: $(OBJECTS) lvm-static.o $(LVMINTERNAL_LIBS)
+ 	@echo "    [CC] $@"
+-	$(Q) $(CC) $(CFLAGS) $(LDFLAGS) -static -L$(interfacebuilddir) -o $@ $+ \
++	$(Q) $(CC) $(CFLAGS) $(LDFLAGS) $(STATIC_LDFLAGS) -static -L$(interfacebuilddir) -o $@ $+ \
+ 	      $(DMEVENT_LIBS) $(STATIC_LIBS) $(LVMLIBS)
+ 
+ liblvm2cmd.a: $(top_builddir)/lib/liblvm-internal.a $(OBJECTS) lvmcmdlib.o lvm2cmd.o
+-- 
+2.22.0
+

diff --git a/sys-fs/lvm2/files/lvm2-2.03.05-example.conf.in.patch b/sys-fs/lvm2/files/lvm2-2.03.05-example.conf.in.patch
new file mode 100644
index 00000000000..a79250b8b4f
--- /dev/null
+++ b/sys-fs/lvm2/files/lvm2-2.03.05-example.conf.in.patch
@@ -0,0 +1,56 @@
+From d5755288f23fdeaca4c6d317583f5f119ea8801c Mon Sep 17 00:00:00 2001
+From: "Robin H. Johnson" <robbat2@gentoo.org>
+Date: Wed, 24 Jul 2019 11:01:03 +0200
+Subject: [PATCH] Add Gentoo specific changes
+
+Forward-ported from 2.02.178 to 2.03.05
+Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>
+---
+ conf/example.conf.in | 10 +++++++---
+ 1 file changed, 7 insertions(+), 3 deletions(-)
+
+diff --git a/conf/example.conf.in b/conf/example.conf.in
+index 154f621bcf..83124ddea3 100644
+--- a/conf/example.conf.in
++++ b/conf/example.conf.in
+@@ -143,6 +143,9 @@ devices {
+ 	# Example
+ 	# Accept every block device:
+ 	# filter = [ "a|.*/|" ]
++	# Gentoo: we exclude /dev/nbd by default, because it makes a lot of kernel
++	# noise when you probed while not available.
++	filter = [ "r|/dev/nbd.*|", "a/.*/" ]
+ 	# Reject the cdrom drive:
+ 	# filter = [ "r|/dev/cdrom|" ]
+ 	# Work with just loopback devices, e.g. for testing:
+@@ -1677,7 +1680,7 @@ activation {
+ 
+ # Configuration section metadata.
+ # This configuration section has an automatic default value.
+-# metadata {
++metadata {
+ 
+ 	# Configuration option metadata/check_pv_device_sizes.
+ 	# Check device sizes are not smaller than corresponding PV sizes.
+@@ -1722,7 +1725,8 @@ activation {
+ 	# 
+ 	# This configuration option is advanced.
+ 	# This configuration option has an automatic default value.
+-	# pvmetadatacopies = 1
++	# Gentoo: enable for data safety, but PV resize is then disabled.
++	# pvmetadatacopies = 2
+ 
+ 	# Configuration option metadata/vgmetadatacopies.
+ 	# Number of copies of metadata to maintain for each VG.
+@@ -1766,7 +1770,7 @@ activation {
+ 	# This configuration option is advanced.
+ 	# This configuration option has an automatic default value.
+ 	# stripesize = 64
+-# }
++}
+ 
+ # Configuration section report.
+ # LVM report command output formatting.
+-- 
+2.22.0
+

diff --git a/sys-fs/lvm2/files/lvm2-2.03.05-pthread-pkgconfig.patch b/sys-fs/lvm2/files/lvm2-2.03.05-pthread-pkgconfig.patch
new file mode 100644
index 00000000000..56aa2a7b79f
--- /dev/null
+++ b/sys-fs/lvm2/files/lvm2-2.03.05-pthread-pkgconfig.patch
@@ -0,0 +1,48 @@
+From dbb68df8d02eff87f10df331e17bd0940e158f56 Mon Sep 17 00:00:00 2001
+From: "Robin H. Johnson" <robbat2@gentoo.org>
+Date: Wed, 24 Jul 2019 11:15:59 +0200
+Subject: [PATCH] Add pthread to libdevmapper pkgconfig file
+
+Forward-ported from 2.02.176 to 2.03.05
+Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>
+---
+ libdm/libdevmapper.pc.in | 2 +-
+ tools/Makefile.in        | 5 +++++
+ 2 files changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/libdm/libdevmapper.pc.in b/libdm/libdevmapper.pc.in
+index a325aeb9e0..aa0980378f 100644
+--- a/libdm/libdevmapper.pc.in
++++ b/libdm/libdevmapper.pc.in
+@@ -9,4 +9,4 @@ Version: @DM_LIB_PATCHLEVEL@
+ Cflags: -I${includedir} 
+ Libs: -L${libdir} -ldevmapper
+ Requires.private: @SELINUX_PC@ @UDEV_PC@
+-Libs.private: -lm @RT_LIBS@
++Libs.private: -lm @RT_LIBS@ @PTHREAD_LIBS@
+diff --git a/tools/Makefile.in b/tools/Makefile.in
+index e5fc9c4ae4..12e4de2c63 100644
+--- a/tools/Makefile.in
++++ b/tools/Makefile.in
+@@ -87,6 +87,7 @@ ifeq ("@STATIC_LINK@", "yes")
+   TARGETS += lvm.static
+   INSTALL_LVM_TARGETS += install_tools_static
+   INSTALL_CMDLIB_TARGETS += install_cmdlib_static
++  STATIC_LIBS += @PTHREAD_LIBS@
+ endif
+ 
+ LVMLIBS = $(SYSTEMD_LIBS) -L$(top_builddir)/libdm -ldevmapper $(LIBS) -laio
+@@ -113,6 +114,10 @@ CFLOW_TARGET = lvm
+ 
+ include $(top_builddir)/make.tmpl
+ 
++ifeq ("@STATIC_LINK@", "yes")
++    STATIC_LIBS += @PTHREAD_LIBS@
++endif
++
+ device-mapper:
+ 
+ all: device-mapper
+-- 
+2.22.0
+

diff --git a/sys-fs/lvm2/lvm2-2.03.05.ebuild b/sys-fs/lvm2/lvm2-2.03.05.ebuild
index c605404faf8..d4cb83b032c 100644
--- a/sys-fs/lvm2/lvm2-2.03.05.ebuild
+++ b/sys-fs/lvm2/lvm2-2.03.05.ebuild
@@ -1,7 +1,7 @@
 # Copyright 1999-2019 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=6
+EAPI=7
 inherit autotools linux-info multilib systemd toolchain-funcs udev flag-o-matic usr-ldscript
 
 DESCRIPTION="User-land utilities for LVM2 (device-mapper) software"
@@ -38,35 +38,38 @@ RDEPEND="${DEPEND_COMMON}
 # note: thin- 0.3.0 is required to avoid --disable-thin_check_needs_check
 # USE 'static' currently only works with eudev, bug 520450
 DEPEND="${DEPEND_COMMON}
-	virtual/pkgconfig
 	>=sys-devel/binutils-2.20.1-r1
-	sys-devel/autoconf-archive
 	static? (
 		selinux? ( sys-libs/libselinux[static-libs] )
 		udev? ( >=sys-fs/eudev-3.1.2[static-libs] )
 		>=sys-apps/util-linux-2.16[static-libs]
 	)"
+BDEPEND="
+	sys-devel/autoconf-archive
+	virtual/pkgconfig
+"
 
-S=${WORKDIR}/${PN/lvm/LVM}.${PV}
+S="${WORKDIR}/${PN/lvm/LVM}.${PV}"
 
 PATCHES=(
 	# Gentoo specific modification(s):
-	"${FILESDIR}"/${PN}-2.02.178-example.conf.in.patch
+	"${FILESDIR}"/${PN}-2.03.05-example.conf.in.patch
 
 	# For upstream -- review and forward:
-	"${FILESDIR}"/${PN}-2.02.63-always-make-static-libdm.patch
+	#"${FILESDIR}"/${PN}-2.02.63-always-make-static-libdm.patch # FIXME: breaks libdm/dm-tools build
 	"${FILESDIR}"/${PN}-2.02.56-lvm2create_initrd.patch
 	"${FILESDIR}"/${PN}-2.02.67-createinitrd.patch #301331
 	"${FILESDIR}"/${PN}-2.02.99-locale-muck.patch #330373
-	"${FILESDIR}"/${PN}-2.02.178-asneeded.patch # -Wl,--as-needed
-	"${FILESDIR}"/${PN}-2.02.178-dynamic-static-ldflags.patch #332905
+	#"${FILESDIR}"/${PN}-2.02.178-asneeded.patch # -Wl,--as-needed
+	"${FILESDIR}"/${PN}-2.03.05-dynamic-static-ldflags.patch #332905
 	"${FILESDIR}"/${PN}-2.02.178-static-pkgconfig-libs.patch #370217, #439414 + blkid
-	"${FILESDIR}"/${PN}-2.02.176-pthread-pkgconfig.patch #492450
+	"${FILESDIR}"/${PN}-2.03.05-pthread-pkgconfig.patch #492450
 	"${FILESDIR}"/${PN}-2.02.171-static-libm.patch #617756
 	"${FILESDIR}"/${PN}-2.02.166-HPPA-no-O_DIRECT.patch #657446
 	#"${FILESDIR}"/${PN}-2.02.145-mkdev.patch #580062 # Merged upstream
-	"${FILESDIR}"/${PN}-2.02.184-dmeventd-no-idle-exit.patch
+	"${FILESDIR}"/${PN}-2.03.05-dmeventd-no-idle-exit.patch
 	#"${FILESDIR}"/${PN}-2.02.184-allow-reading-metadata-with-invalid-creation_time.patch #682380 # merged upstream
+	"${FILESDIR}"/${PN}-2.02.184-mksh_build.patch #686652
 )
 
 pkg_setup() {
@@ -76,7 +79,7 @@ pkg_setup() {
 		local WARNING_SYSVIPC="CONFIG_SYSVIPC:\tis not set (required for udev sync)\n"
 		if linux_config_exists; then
 			local uevent_helper_path=$(linux_chkconfig_string UEVENT_HELPER_PATH)
-			if [ -n "${uevent_helper_path}" ] && [ "${uevent_helper_path}" != '""' ]; then
+			if [[ -n "${uevent_helper_path}" ]] && [[ "${uevent_helper_path}" != '""' ]]; then
 				ewarn "It's recommended to set an empty value to the following kernel config option:"
 				ewarn "CONFIG_UEVENT_HELPER_PATH=${uevent_helper_path}"
 			fi
@@ -103,13 +106,6 @@ src_prepare() {
 
 	sed -i -e '/FLAG/s:-O2::' configure{.ac,} || die #480212
 
-	if use udev && ! use device-mapper-only; then
-		sed -i -e '/use_lvmetad =/s:0:1:' conf/example.conf.in || die #514196
-		elog "Notice that \"use_lvmetad\" setting is enabled with USE=\"udev\" in"
-		elog "/etc/lvm/lvm.conf, which will require restart of udev, lvm, and lvmetad"
-		elog "if it was previously disabled."
-	fi
-
 	sed -i -e "s:/usr/bin/true:$(type -P true):" scripts/blk_availability_systemd_red_hat.service.in || die #517514
 
 	# Without thin-privision-tools, there is nothing to install for target install_man7:
@@ -131,9 +127,7 @@ src_configure() {
 		$(use_enable !device-mapper-only dmfilemapd)
 		$(use_enable !device-mapper-only dmeventd)
 		$(use_enable !device-mapper-only cmdlib)
-		$(use_enable !device-mapper-only applib)
 		$(use_enable !device-mapper-only fsadm)
-		$(use_enable !device-mapper-only lvmetad)
 		$(use_enable !device-mapper-only lvmpolld)
 		$(usex device-mapper-only --disable-udev-systemd-background-jobs '')
 
@@ -160,8 +154,6 @@ src_configure() {
 		myeconfargs+=( --with-thin=none --with-cache=none )
 	fi
 
-	myeconfargs+=( --with-clvmd=none --with-cluster=none )
-
 	myeconfargs+=(
 		$(use_enable readline)
 		$(use_enable selinux)
@@ -178,7 +170,7 @@ src_configure() {
 		--with-default-pid-dir=/run
 		$(use_enable udev udev_rules)
 		$(use_enable udev udev_sync)
-		$(use_with udev udevdir "$(get_udevdir)"/rules.d)
+		$(use_with udev udevdir "${EPREFIX}$(get_udevdir)"/rules.d)
 		$(use_enable sanlock lvmlockd-sanlock)
 		$(use_enable systemd udev-systemd-background-jobs)
 		$(use_enable systemd notify-dbus)
@@ -190,14 +182,14 @@ src_configure() {
 
 src_compile() {
 	pushd include >/dev/null
-	emake
+	emake V=1
 	popd >/dev/null
 
 	if use device-mapper-only ; then
-		emake device-mapper
+		emake V=1 device-mapper
 	else
-		emake
-		emake CC="$(tc-getCC)" -C scripts lvm2_activation_generator_systemd_red_hat
+		emake V=1
+		emake V=1 CC="$(tc-getCC)" -C scripts lvm2_activation_generator_systemd_red_hat
 	fi
 }
 
@@ -208,7 +200,7 @@ src_install() {
 	use systemd && INSTALL_TARGETS+=( install_systemd_units install_systemd_generators )
 	use device-mapper-only && INSTALL_TARGETS=( install_device-mapper )
 	for inst in ${INSTALL_TARGETS[@]}; do
-		emake DESTDIR="${D}" ${inst}
+		emake V=1 DESTDIR="${D}" ${inst}
 	done
 
 	newinitd "${FILESDIR}"/device-mapper.rc-2.02.105-r2 device-mapper
@@ -216,7 +208,7 @@ src_install() {
 
 	if use !device-mapper-only ; then
 		newinitd "${FILESDIR}"/dmeventd.initd-2.02.184-r2 dmeventd
-		newinitd "${FILESDIR}"/lvm.rc-2.02.184-r3 lvm
+		newinitd "${FILESDIR}"/lvm.rc-2.03.05 lvm
 		newconfd "${FILESDIR}"/lvm.confd-2.02.184-r3 lvm
 		if ! use udev ; then
 			# We keep the variable but remove udev from it.
@@ -226,7 +218,6 @@ src_install() {
 		fi
 
 		newinitd "${FILESDIR}"/lvm-monitoring.initd-2.02.105-r2 lvm-monitoring
-		newinitd "${FILESDIR}"/lvmetad.initd-2.02.116-r3 lvmetad
 		newinitd "${FILESDIR}"/lvmpolld.initd-2.02.183 lvmpolld
 	fi
 
@@ -241,7 +232,7 @@ src_install() {
 		dolib.a daemons/dmeventd/libdevmapper-event.a
 		#gen_usr_ldscript libdevmapper-event.so
 	else
-		rm -f "${ED%/}"/usr/$(get_libdir)/{libdevmapper-event,liblvm2cmd,liblvm2app,libdevmapper}.a
+		rm -f "${ED}"/usr/$(get_libdir)/{libdevmapper-event,liblvm2cmd,liblvm2app,libdevmapper}.a
 	fi
 
 	if use lvm2create_initrd; then
@@ -259,9 +250,6 @@ src_install() {
 pkg_postinst() {
 	ewarn "Make sure the \"lvm\" init script is in the runlevels:"
 	ewarn "# rc-update add lvm boot"
-	ewarn
-	ewarn "Make sure to enable lvmetad in /etc/lvm/lvm.conf if you want"
-	ewarn "to enable lvm autoactivation and metadata caching."
 }
 
 src_test() {


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-fs/lvm2/, sys-fs/lvm2/files/
@ 2019-11-27 16:16 Lars Wendler
  0 siblings, 0 replies; 29+ messages in thread
From: Lars Wendler @ 2019-11-27 16:16 UTC (permalink / raw
  To: gentoo-commits

commit:     2161b3a104c9a5664131b9297766db0538e7464e
Author:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
AuthorDate: Wed Nov 27 16:16:14 2019 +0000
Commit:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
CommitDate: Wed Nov 27 16:16:24 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2161b3a1

sys-fs/lvm2: Removed old

Package-Manager: Portage-2.3.80, Repoman-2.3.19
Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>

 sys-fs/lvm2/Manifest                               |   3 -
 sys-fs/lvm2/files/lvm.rc-2.02.116-r6               | 132 ----------
 sys-fs/lvm2/files/lvm.rc-2.02.172                  | 149 -----------
 sys-fs/lvm2/files/lvm.rc-2.02.183                  | 152 -----------
 .../lvm2-2.02.129-static-pkgconfig-libs.patch      | 102 --------
 .../files/lvm2-2.02.130-pthread-pkgconfig.patch    |  32 ---
 .../lvm2-2.02.139-dynamic-static-ldflags.patch     |  63 -----
 sys-fs/lvm2/files/lvm2-2.02.145-mkdev.patch        | 127 ----------
 sys-fs/lvm2/lvm2-2.02.145-r2.ebuild                | 254 -------------------
 sys-fs/lvm2/lvm2-2.02.183.ebuild                   | 259 -------------------
 sys-fs/lvm2/lvm2-2.02.185-r1.ebuild                | 278 ---------------------
 11 files changed, 1551 deletions(-)

diff --git a/sys-fs/lvm2/Manifest b/sys-fs/lvm2/Manifest
index 9b72fb0647e..701f9bc11eb 100644
--- a/sys-fs/lvm2/Manifest
+++ b/sys-fs/lvm2/Manifest
@@ -1,7 +1,4 @@
 DIST LVM2.2.02.116.tgz 1538340 BLAKE2B 718261b60626f2eca5ba13011646bf551523ed8e59aaceceb9097221c000268b7533ac43151ff1d9229911d87e764fbdb29ffa1d305f2aae99220a68e301559a SHA512 992541339637d597257850b4ff7f5348fb7cdcccf806ac8d986a3be1ad1edc5f6bfaedeed5128690c541d1a485cdc75742e90a766363c39867901003518fb84d
-DIST LVM2.2.02.145.tgz 1986370 BLAKE2B 0c9e5efae17f26ff86152cecbf0b11a74e85007b2fa9491f44dec03ac8c11375bacf6685213b4be19037c8fbf70e13549516716ecf8fa262919a44625e6aab34 SHA512 84e28b3efc940837ea9da70fce620744aea0945ba29383b76ad7bcd4b5259b897c714162a8e8b7cfe26ae736a3ad2eca633a3e0df4d6280a32b28bd4cf472d27
-DIST LVM2.2.02.183.tgz 2380574 BLAKE2B b1fe71b6cdb8ee20dd53d0ad3399c553487baafa12657ec81a794c84ad161988afdb8693ac247877a2645d693a0740c74c8b991047ed2ba4adc9ec75f1c261a9 SHA512 3947523c6b0862ada40677ed171ed0cf95e070119e377296fc5ccb153e9c4212d34c0b16a887dbd68ccf265525345dabfed2aa59fb3604555429a7e2ecfff4d7
 DIST LVM2.2.02.184.tgz 2383698 BLAKE2B b6e308d76d541b9461dfcc6e82db256a175ccdabfae9c9d57d84eabd0d5ea50e3e09954b34741903e027412c2c26f72a5005fe934261576337a810738139deb8 SHA512 9db74f675e7c58f663a39afb79b6f33a33ad2cfbda63e9783ef5027f33977b4a1262a2e6754aa67c586eed083ee119a2e837c32a7746dcc53f13877c9d65c390
-DIST LVM2.2.02.185.tgz 2386328 BLAKE2B d2e31de3eedd7518ea2d239cb9b36b38e351d7fc070097a1fc4e7934e3636195da3247fba57d684bb0b31b7f3dbdfe29161bd121b2962b2c35c8c9d7914b4506 SHA512 f421505551aec2a09bc862f2fcc1ee825bc4d94c53a01d13265631e99308d60fbca40112be5bc7824cce3ef223c0775d2f6c345f6a3f227229a0566c903841bf
 DIST LVM2.2.02.186.tgz 2389759 BLAKE2B e094c0135d455386ea5789208899d4dbdd5e78bebf52e49ab5587f881fbc2b94c6accecacf1b4ed182b0c87046402c00a47a1b724795a94fe3ec998b580a77ae SHA512 06a1c00142ee41d8a576a5e06a5beae70baced3020e753ce3b612355cc4d9e33be4acf58569d49436c4ee1118d288d884c7301b7d886074eaf9f2fa6b0248c03
 DIST LVM2.2.03.06.tgz 2453672 BLAKE2B 3d39bef4915ddb15c51011c131afcd2735723fc3e880e01fb863d82ccac0c34b7d71f6a3a126c6bb53fbf2dd923ccf0443e4e02a492fc0660ee1ef168dbb0e79 SHA512 2a01d34fa58348b0fac3d40a9ce736aa499af18c7e9bf96a3eeefc6a2de6a73460c83b6c67be20e9bd440998cbf847bc3e7a028385f38d715e221a5a857d391f

diff --git a/sys-fs/lvm2/files/lvm.rc-2.02.116-r6 b/sys-fs/lvm2/files/lvm.rc-2.02.116-r6
deleted file mode 100644
index cf430c6654d..00000000000
--- a/sys-fs/lvm2/files/lvm.rc-2.02.116-r6
+++ /dev/null
@@ -1,132 +0,0 @@
-#!/sbin/openrc-run
-# Copyright 1999-2019 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-_get_lvm_path() {
-	local lvm_path=
-	for lvm_path in /bin/lvm /sbin/lvm ; do
-		[ -x "$lvm_path" ] && break
-	done
-	echo "${lvm_path}"
-}
-
-_need_lvmetad()
-{
-	local lvm_path="$(_get_lvm_path)"
-	[ ! -x "${lvm_path}" ] && return 1
-	${lvm_path} dumpconfig global 2>/dev/null | grep -q 'use_lvmetad=1'
-}
-
-depend() {
-	before checkfs fsck
-	after modules device-mapper
-	# We may use lvmetad based on the configuration. If we added lvmetad
-	# support while lvm2 is running then we aren't dependent on it. For the
-	# more common case, if its disabled in the config we aren't dependent
-	# on it.
-	config /etc/lvm/lvm.conf
-	local _need=
-	if service_started; then
-		_need=$(service_get_value need)
-	else
-		if _need_lvmetad; then
-			_need="${_need} lvmetad"
-		fi
-	fi
-	need sysfs ${_need}
-}
-
-config='global { locking_dir = "/run/lock/lvm" }'
-
-dm_in_proc() {
-	local retval=0
-	for x in devices misc ; do
-		grep -qs 'device-mapper' /proc/${x}
-		retval=$((${retval} + $?))
-	done
-	return ${retval}
-}
-
-start() {
-	# LVM support for /usr, /home, /opt ....
-	# This should be done *before* checking local
-	# volumes, or they never get checked.
-
-	# NOTE: Add needed modules for LVM or RAID, etc
-	#       to /etc/modules.autoload if needed
-	lvm_path="$(_get_lvm_path)"
-	for lvm_path in /bin/lvm /sbin/lvm ; do
-		[ -x "$lvm_path" ] && break
-	done
-	if [ ! -x "$lvm_path" ]; then
-		eerror "Cannot find lvm binary in /sbin or /bin!"
-		return 1
-	fi
-	if [ -z "${CDBOOT}" ] ; then
-		if [ -e /proc/modules ] && ! dm_in_proc ; then
-			modprobe dm-mod 2>/dev/null
-		fi
-		if [ -d /proc/lvm ] || dm_in_proc ; then
-			ebegin "Setting up the Logical Volume Manager"
-			#still echo stderr for debugging
-			lvm_commands="#! ${lvm_path} --config '${config}'\n"
-			# Extra PV find pass because some devices might not have been available until very recently
-			lvm_commands="${lvm_commands}pvscan\n"
-			# Now make the nodes
-			lvm_commands="${lvm_commands}vgscan --mknodes\n"
-			# And turn them on!
-			lvm_commands="${lvm_commands}vgchange --sysinit -a ly\n"
-			# Order of this is important, have to work around dash and LVM readline
-			printf "%b\n" "${lvm_commands}" | $lvm_path /proc/self/fd/0 --config "${config}" >/dev/null
-			eend $? "Failed to setup the LVM"
-		fi
-	fi
-}
-
-start_post()
-{
-	# Save if we needed lvmetad
-	if _need_lvmetad; then
-		service_set_value need lvmetad
-	fi
-}
-
-stop() {
-	for lvm_path in /bin/lvm /sbin/lvm ; do
-		[ -x "$lvm_path" ] && break
-	done
-	if [ ! -x "$lvm_path" ]; then
-		eerror "Cannot find lvm binary in /sbin or /bin!"
-		return 1
-	fi
-# Stop LVM2
-if [ -x /sbin/vgs ] && \
-   [ -x /sbin/vgchange ] && \
-   [ -x /sbin/lvchange ] && \
-   [ -f /etc/lvmtab -o -d /etc/lvm ] && \
-   [ -d /proc/lvm  -o "`grep device-mapper /proc/misc 2>/dev/null`" ]
-then
-	einfo "Shutting down the Logical Volume Manager"
-
-        VGS=$($lvm_path vgs --config "${config}" -o vg_name --noheadings --nosuffix --rows 2> /dev/null)
-
-        if [ "$VGS" ]
-        then
-            ebegin "  Shutting Down LVs & VGs"
-			#still echo stderr for debugging
-			lvm_commands="#! ${lvm_path} --config '${config}'\n"
-			# Extra PV find pass because some devices might not have been available until very recently
-			lvm_commands="${lvm_commands}lvchange --sysinit -a ln ${VGS}\n"
-			# Now make the nodes
-			lvm_commands="${lvm_commands}vgchange --sysinit -a ln ${VGS}\n"
-			# Order of this is important, have to work around dash and LVM readline
-			printf "%b\n" "${lvm_commands}" | $lvm_path /proc/self/fd/0 --config "${config}" >/dev/null
-			eend $? "Failed (possibly some LVs still needed for /usr or root)"
-        fi
-
-	einfo "Finished shutting down the Logical Volume Manager"
-	return 0
-fi
-}
-
-# vim:ts=4

diff --git a/sys-fs/lvm2/files/lvm.rc-2.02.172 b/sys-fs/lvm2/files/lvm.rc-2.02.172
deleted file mode 100644
index 82037b28adf..00000000000
--- a/sys-fs/lvm2/files/lvm.rc-2.02.172
+++ /dev/null
@@ -1,149 +0,0 @@
-#!/sbin/openrc-run
-# Copyright 1999-2019 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-_get_lvm_path() {
-	local lvm_path=
-	for lvm_path in /bin/lvm /sbin/lvm ; do
-		[ -x "$lvm_path" ] && break
-	done
-	echo "${lvm_path}"
-}
-
-_need_lvmetad()
-{
-	local lvm_path="$(_get_lvm_path)"
-	[ ! -x "${lvm_path}" ] && return 1
-	${lvm_path} dumpconfig global 2>/dev/null | grep -q 'use_lvmetad=1'
-}
-
-_need_lvmlockd()
-{
-	local lvm_path="$(_get_lvm_path)"
-	[ ! -x "${lvm_path}" ] && return 1
-	${lvm_path} dumpconfig global 2>/dev/null | grep -q 'use_lvmlockd=1'
-}
-
-depend() {
-	before checkfs fsck
-	after modules device-mapper
-	# We may use lvmetad based on the configuration. If we added lvmetad
-	# support while lvm2 is running then we aren't dependent on it. For the
-	# more common case, if its disabled in the config we aren't dependent
-	# on it.
-	config /etc/lvm/lvm.conf
-	local _need=
-	if service_started; then
-		_need=$(service_get_value need)
-	else
-		if _need_lvmetad; then
-			_need="${_need} lvmetad"
-		fi
-		if _need_lvmlockd; then
-			_need="${_need} lvmlockd"
-		fi
-	fi
-	need sysfs ${_need}
-}
-
-config='global { locking_dir = "/run/lock/lvm" }'
-
-dm_in_proc() {
-	local retval=0
-	for x in devices misc ; do
-		grep -qs 'device-mapper' /proc/${x}
-		retval=$((${retval} + $?))
-	done
-	return ${retval}
-}
-
-start() {
-	# LVM support for /usr, /home, /opt ....
-	# This should be done *before* checking local
-	# volumes, or they never get checked.
-
-	# NOTE: Add needed modules for LVM or RAID, etc
-	#       to /etc/modules.autoload if needed
-	lvm_path="$(_get_lvm_path)"
-	for lvm_path in /bin/lvm /sbin/lvm ; do
-		[ -x "$lvm_path" ] && break
-	done
-	if [ ! -x "$lvm_path" ]; then
-		eerror "Cannot find lvm binary in /sbin or /bin!"
-		return 1
-	fi
-	if [ -z "${CDBOOT}" ] ; then
-		if [ -e /proc/modules ] && ! dm_in_proc ; then
-			modprobe dm-mod 2>/dev/null
-		fi
-		if [ -d /proc/lvm ] || dm_in_proc ; then
-			ebegin "Setting up the Logical Volume Manager"
-			#still echo stderr for debugging
-			lvm_commands="#!${lvm_path}\n"
-			# Extra PV find pass because some devices might not have been available until very recently
-			lvm_commands="${lvm_commands}pvscan --config '${config}'\n"
-			# Now make the nodes
-			lvm_commands="${lvm_commands}vgscan --config '${config}' --mknodes\n"
-			# And turn them on!
-			lvm_commands="${lvm_commands}vgchange --config '${config}' --sysinit -a ly\n"
-			if _need_lvmlockd; then
-				# Start lockd VGs as required
-				lvm_commands="${lvm_commands}vgchange --config '${config}' --lock-start --lock-opt auto\n"
-			fi
-			# Order of this is important, have to work around dash and LVM readline
-			printf "%b\n" "${lvm_commands}" | $lvm_path /proc/self/fd/0 >/dev/null
-			eend $? "Failed to setup the LVM"
-		fi
-	fi
-}
-
-start_post()
-{
-	# Save if we needed lvmetad
-	if _need_lvmetad; then
-		service_set_value need lvmetad
-	fi
-}
-
-stop() {
-	for lvm_path in /bin/lvm /sbin/lvm ; do
-		[ -x "$lvm_path" ] && break
-	done
-	if [ ! -x "$lvm_path" ]; then
-		eerror "Cannot find lvm binary in /sbin or /bin!"
-		return 1
-	fi
-
-	# Stop LVM2
-	if [ -x /sbin/vgs ] && \
-		[ -x /sbin/vgchange ] && \
-		[ -x /sbin/lvchange ] && \
-		[ -f /etc/lvmtab -o -d /etc/lvm ] && \
-		[ -d /proc/lvm  -o "`grep device-mapper /proc/misc 2>/dev/null`" ]
-	then
-		einfo "Shutting down the Logical Volume Manager"
-
-		VGS=$($lvm_path vgs --config "${config}" -o vg_name --noheadings --nosuffix --rows 2> /dev/null)
-
-		if [ "$VGS" ]
-		then
-			local _ending="eend"
-			[ "$RC_RUNLEVEL" = shutdown ] && _ending="ewend"
-			ebegin "  Shutting Down LVs & VGs"
-				#still echo stderr for debugging
-				lvm_commands="#!${lvm_path}\n"
-				# Extra PV find pass because some devices might not have been available until very recently
-				lvm_commands="${lvm_commands}lvchange --config '${config}' --sysinit -a ln ${VGS}\n"
-				# Now make the nodes
-				lvm_commands="${lvm_commands}vgchange --config '${config}' --sysinit -a ln ${VGS}\n"
-				# Order of this is important, have to work around dash and LVM readline
-				printf "%b\n" "${lvm_commands}" | $lvm_path /proc/self/fd/0 --config "${config}" >/dev/null
-			${_ending} $? "Failed (possibly some LVs still needed for /usr or root)"
-		fi
-
-		einfo "Finished shutting down the Logical Volume Manager"
-		return 0
-	fi
-}
-
-# vim:ts=4

diff --git a/sys-fs/lvm2/files/lvm.rc-2.02.183 b/sys-fs/lvm2/files/lvm.rc-2.02.183
deleted file mode 100644
index ce499a6dd21..00000000000
--- a/sys-fs/lvm2/files/lvm.rc-2.02.183
+++ /dev/null
@@ -1,152 +0,0 @@
-#!/sbin/openrc-run
-# Copyright 1999-2019 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-_get_lvm_path() {
-	local lvm_path=
-	for lvm_path in /bin/lvm /sbin/lvm ; do
-		[ -x "$lvm_path" ] && break
-	done
-	echo "${lvm_path}"
-}
-
-_need_lvmetad()
-{
-	local lvm_path="$(_get_lvm_path)"
-	[ ! -x "${lvm_path}" ] && return 1
-	${lvm_path} dumpconfig global 2>/dev/null | grep -q 'use_lvmetad=1'
-}
-
-_need_lvmlockd()
-{
-	local lvm_path="$(_get_lvm_path)"
-	[ ! -x "${lvm_path}" ] && return 1
-	${lvm_path} dumpconfig global 2>/dev/null | grep -q 'use_lvmlockd=1'
-}
-
-depend() {
-	before checkfs fsck
-	after modules device-mapper
-	# We may use lvmetad based on the configuration. If we added lvmetad
-	# support while lvm2 is running then we aren't dependent on it. For the
-	# more common case, if its disabled in the config we aren't dependent
-	# on it.
-	config /etc/lvm/lvm.conf
-	local _need=
-	if service_started; then
-		_need=$(service_get_value need)
-	else
-		if _need_lvmetad; then
-			_need="${_need} lvmetad"
-		fi
-		if _need_lvmlockd; then
-			_need="${_need} lvmlockd"
-		fi
-	fi
-	need sysfs udev ${_need}
-}
-
-config='global { locking_dir = "/run/lock/lvm" }'
-
-dm_in_proc() {
-	local retval=0
-	for x in devices misc ; do
-		grep -qs 'device-mapper' /proc/${x}
-		retval=$((${retval} + $?))
-	done
-	return ${retval}
-}
-
-start() {
-	# LVM support for /usr, /home, /opt ....
-	# This should be done *before* checking local
-	# volumes, or they never get checked.
-
-	# NOTE: Add needed modules for LVM or RAID, etc
-	#       to /etc/modules.autoload if needed
-	lvm_path="$(_get_lvm_path)"
-	for lvm_path in /bin/lvm /sbin/lvm ; do
-		[ -x "$lvm_path" ] && break
-	done
-	if [ ! -x "$lvm_path" ]; then
-		eerror "Cannot find lvm binary in /sbin or /bin!"
-		return 1
-	fi
-	if [ -z "${CDBOOT}" ] ; then
-		if [ -e /proc/modules ] && ! dm_in_proc ; then
-			modprobe dm-mod 2>/dev/null
-		fi
-		if [ -d /proc/lvm ] || dm_in_proc ; then
-			ebegin "Setting up the Logical Volume Manager"
-			#still echo stderr for debugging
-			lvm_commands="#!${lvm_path}\n"
-			# Extra PV find pass because some devices might not have been available until very recently
-			lvm_commands="${lvm_commands}pvscan --config '${config}'\n"
-			# Now make the nodes
-			lvm_commands="${lvm_commands}vgscan --config '${config}' --mknodes\n"
-			# And turn them on!
-			lvm_commands="${lvm_commands}vgchange --config '${config}' --sysinit -a ly\n"
-			if _need_lvmlockd; then
-				# Start lockd VGs as required
-				lvm_commands="${lvm_commands}vgchange --config '${config}' --lock-start --lock-opt auto\n"
-			fi
-			# Order of this is important, have to work around dash and LVM readline
-			printf "%b\n" "${lvm_commands}" | $lvm_path /proc/self/fd/0 >/dev/null
-			eend $? "Failed to setup the LVM"
-		fi
-	fi
-}
-
-start_post()
-{
-	# Save if we needed lvmetad
-	if _need_lvmetad; then
-		service_set_value need lvmetad
-	fi
-}
-
-stop() {
-	for lvm_path in /bin/lvm /sbin/lvm ; do
-		[ -x "$lvm_path" ] && break
-	done
-	if [ ! -x "$lvm_path" ]; then
-		eerror "Cannot find lvm binary in /sbin or /bin!"
-		return 1
-	fi
-
-	# Stop LVM2
-	if [ -x /sbin/vgs ] && \
-		[ -x /sbin/vgchange ] && \
-		[ -x /sbin/lvchange ] && \
-		[ -f /etc/lvmtab -o -d /etc/lvm ] && \
-		[ -d /proc/lvm  -o "`grep device-mapper /proc/misc 2>/dev/null`" ]
-	then
-		einfo "Shutting down the Logical Volume Manager"
-
-		VGS=$($lvm_path vgs --config "${config}" -o vg_name --noheadings --nosuffix --rows 2> /dev/null)
-
-		if [ "$VGS" ]
-		then
-			local _ending="eend"
-			[ "$RC_RUNLEVEL" = shutdown ] && _ending="ewend"
-			ebegin "  Shutting Down LVs & VGs"
-				#still echo stderr for debugging
-				lvm_commands="#!${lvm_path}\n"
-				# Extra PV find pass because some devices might not have been available until very recently
-				lvm_commands="${lvm_commands}lvchange --config '${config}' --sysinit -a ln ${VGS}\n"
-				# Now make the nodes
-				lvm_commands="${lvm_commands}vgchange --config '${config}' --sysinit -a ln ${VGS}\n"
-				# Order of this is important, have to work around dash and LVM readline
-				printf "%b\n" "${lvm_commands}" | $lvm_path /proc/self/fd/0 --config "${config}" >/dev/null
-			rc=$?
-			msg="Failed (possibly some LVs still needed for /usr or root)"
-			[ "$RC_RUNLEVEL" = shutdown ] && msg="${msg} [rc=$rc]" && rc=0
-			${_ending} $rc "${msg}"
-		fi
-
-		einfo "Finished shutting down the Logical Volume Manager"
-		return 0
-	fi
-}
-
-# vim:ts=4

diff --git a/sys-fs/lvm2/files/lvm2-2.02.129-static-pkgconfig-libs.patch b/sys-fs/lvm2/files/lvm2-2.02.129-static-pkgconfig-libs.patch
deleted file mode 100644
index 239694523b3..00000000000
--- a/sys-fs/lvm2/files/lvm2-2.02.129-static-pkgconfig-libs.patch
+++ /dev/null
@@ -1,102 +0,0 @@
---- LVM2.2.02.129/configure.in
-+++ LVM2.2.02.129/configure.in
-@@ -1287,6 +1287,7 @@
- 			   fi])
- 	if test "$BLKID_WIPING" = yes; then
- 		BLKID_PC="blkid"
-+		BLKID_STATIC_LIBS=`$PKG_CONFIG --static --libs $BLKID_PC`
- 		DEFAULT_USE_BLKID_WIPING=1
- 		AC_DEFINE([BLKID_WIPING_SUPPORT], 1, [Define to 1 to use libblkid detection of signatures when wiping.])
- 	else
-@@ -1332,6 +1333,7 @@
- if test "$UDEV_SYNC" = yes; then
- 	pkg_config_init
- 	PKG_CHECK_MODULES(UDEV, libudev >= 143, [UDEV_PC="libudev"])
-+	UDEV_STATIC_LIBS=`$PKG_CONFIG --static --libs libudev`
- 	AC_DEFINE([UDEV_SYNC_SUPPORT], 1, [Define to 1 to enable synchronisation with udev processing.])
- fi
- 
-@@ -1558,19 +1560,32 @@
- if test "$SELINUX" = yes; then
- 	AC_CHECK_LIB([sepol], [sepol_check_context], [
- 		AC_DEFINE([HAVE_SEPOL], 1, [Define to 1 if sepol_check_context is available.])
--		SELINUX_LIBS="-lsepol"])
-+		SEPOL_LIBS="-lsepol"])
-+
-+	dnl -- init pkgconfig if required
-+	if  test x$PKGCONFIG_INIT != x1; then
-+		pkg_config_init
-+	fi
-+	PKG_CHECK_MODULES(SELINUX, libselinux, [
-+		SELINUX_PC="libselinux"
-+		SELINUX_STATIC_LIBS=`$PKG_CONFIG --static --libs libselinux`
-+		SELINUX_LIBS="$SELINUX_LIBS $SEPOL_LIBS"
-+		AC_DEFINE([HAVE_SELINUX], 1, [Define to 1 to include support for selinux.])
-+	],[
-+		dnl -- old non-pkgconfig method, is buggy with static builds
- 
- 	AC_CHECK_LIB([selinux], [is_selinux_enabled], [
- 		AC_CHECK_HEADERS([selinux/selinux.h],, hard_bailout)
- 		AC_CHECK_HEADERS([selinux/label.h])
- 		AC_DEFINE([HAVE_SELINUX], 1, [Define to 1 to include support for selinux.])
--		SELINUX_LIBS="-lselinux $SELINUX_LIBS"
-+		SELINUX_LIBS="-lselinux $SEPOL_LIBS"
- 		SELINUX_PC="libselinux"
- 		HAVE_SELINUX=yes ], [
- 		AC_MSG_WARN(Disabling selinux)
- 		SELINUX_LIBS=
- 		SELINUX_PC=
- 		HAVE_SELINUX=no ])
-+	])
- fi
- 
- ################################################################################
-@@ -1902,6 +1917,7 @@
- ################################################################################
- AC_SUBST(APPLIB)
- AC_SUBST(AWK)
-+AC_SUBST(BLKID_STATIC_LIBS)
- AC_SUBST(BLKID_PC)
- AC_SUBST(BUILD_CMIRRORD)
- AC_SUBST(BUILD_DMEVENTD)
-@@ -2005,6 +2021,7 @@
- AC_SUBST(SALCK_CFLAGS)
- AC_SUBST(SALCK_LIBS)
- AC_SUBST(SELINUX_LIBS)
-+AC_SUBST(SELINUX_STATIC_LIBS)
- AC_SUBST(SELINUX_PC)
- AC_SUBST(SNAPSHOTS)
- AC_SUBST(STATICDIR)
-@@ -2020,6 +2037,7 @@
- AC_SUBST(CACHE_DUMP_CMD)
- AC_SUBST(CACHE_REPAIR_CMD)
- AC_SUBST(CACHE_RESTORE_CMD)
-+AC_SUBST(UDEV_STATIC_LIBS)
- AC_SUBST(UDEV_PC)
- AC_SUBST(UDEV_RULES)
- AC_SUBST(UDEV_SYNC)
---- LVM2.2.02.129/make.tmpl.in
-+++ LVM2.2.02.129/make.tmpl.in
-@@ -43,7 +43,7 @@
- 
- LIBS = @LIBS@
- # Extra libraries always linked with static binaries
--STATIC_LIBS = $(SELINUX_LIBS) $(UDEV_LIBS) $(BLKID_LIBS)
-+STATIC_LIBS = $(SELINUX_STATIC_LIBS) $(UDEV_STATIC_LIBS) $(BLKID_STATIC_LIBS)
- DEFS += @DEFS@
- # FIXME set this only where it's needed, not globally?
- CFLAGS ?= @COPTIMISE_FLAG@ @CFLAGS@
-@@ -58,10 +58,13 @@
- PTHREAD_LIBS = @PTHREAD_LIBS@
- READLINE_LIBS = @READLINE_LIBS@
- SELINUX_LIBS = @SELINUX_LIBS@
-+SELINUX_STATIC_LIBS = @SELINUX_STATIC_LIBS@
- UDEV_CFLAGS = @UDEV_CFLAGS@
- UDEV_LIBS = @UDEV_LIBS@
-+UDEV_STATIC_LIBS = @UDEV_STATIC_LIBS@
- BLKID_CFLAGS = @BLKID_CFLAGS@
- BLKID_LIBS = @BLKID_LIBS@
-+BLKID_STATIC_LIBS = @BLKID_STATIC_LIBS@
- VALGRIND_CFLAGS = @VALGRIND_CFLAGS@
- TESTING = @TESTING@
- 

diff --git a/sys-fs/lvm2/files/lvm2-2.02.130-pthread-pkgconfig.patch b/sys-fs/lvm2/files/lvm2-2.02.130-pthread-pkgconfig.patch
deleted file mode 100644
index 11db632e2e7..00000000000
--- a/sys-fs/lvm2/files/lvm2-2.02.130-pthread-pkgconfig.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-Make sure that libdm usage always brings in pthread libraries, both in
-pkgconfig and during manual build.
-
---- LVM2.2.02.130/libdm/libdevmapper.pc.in
-+++ LVM2.2.02.130/libdm/libdevmapper.pc.in
-@@ -9,4 +9,4 @@
- Cflags: -I${includedir} 
- Libs: -L${libdir} -ldevmapper
- Requires.private: @SELINUX_PC@ @UDEV_PC@
--Libs.private: -lm @RT_LIB@
-+Libs.private: -lm @RT_LIB@ @PTHREAD_LIBS@
---- LVM2.2.02.130/tools/Makefile.in
-+++ LVM2.2.02.130/tools/Makefile.in
-@@ -90,6 +90,7 @@
-   INSTALL_LVM_TARGETS += install_tools_static
-   INSTALL_DMSETUP_TARGETS += install_dmsetup_static
-   INSTALL_CMDLIB_TARGETS += install_cmdlib_static
-+  STATIC_LIBS += @PTHREAD_LIBS@
- endif
- 
- LVMLIBS = $(LVMINTERNAL_LIBS)
-@@ -120,6 +121,10 @@
- 
- include $(top_builddir)/make.tmpl
- 
-+ifeq ("@STATIC_LINK@", "yes")
-+  STATIC_LIBS += @PTHREAD_LIBS@
-+endif
-+
- device-mapper: $(TARGETS_DM)
- 
- CFLAGS_dmsetup.o += $(UDEV_CFLAGS) $(EXTRA_EXEC_CFLAGS)

diff --git a/sys-fs/lvm2/files/lvm2-2.02.139-dynamic-static-ldflags.patch b/sys-fs/lvm2/files/lvm2-2.02.139-dynamic-static-ldflags.patch
deleted file mode 100644
index 312e546e240..00000000000
--- a/sys-fs/lvm2/files/lvm2-2.02.139-dynamic-static-ldflags.patch
+++ /dev/null
@@ -1,63 +0,0 @@
-diff -ur LVM2.2.02.139_O/configure.in LVM2.2.02.139/configure.in
---- LVM2.2.02.139_O/configure.in	2016-01-19 12:54:33.155187005 +0000
-+++ LVM2.2.02.139/configure.in	2016-01-19 12:56:39.487181372 +0000
-@@ -31,6 +31,7 @@
- 	linux*)
- 		CLDFLAGS="$CLDFLAGS -Wl,--version-script,.export.sym"
- 		ELDFLAGS="-Wl,--export-dynamic"
-+		STATIC_LDFLAGS="-Wl,--no-export-dynamic"
- 		# FIXME Generate list and use --dynamic-list=.dlopen.sym
- 		CLDWHOLEARCHIVE="-Wl,-whole-archive"
- 		CLDNOWHOLEARCHIVE="-Wl,-no-whole-archive"
-@@ -2009,6 +2010,7 @@
- AC_SUBST(SELINUX_PC)
- AC_SUBST(SNAPSHOTS)
- AC_SUBST(STATICDIR)
-+AC_SUBST(STATIC_LDFLAGS)
- AC_SUBST(STATIC_LINK)
- AC_SUBST(TESTING)
- AC_SUBST(TESTSUITE_DATA)
-diff -ur LVM2.2.02.139_O/daemons/dmeventd/Makefile.in LVM2.2.02.139/daemons/dmeventd/Makefile.in
---- LVM2.2.02.139_O/daemons/dmeventd/Makefile.in	2016-01-19 12:54:33.278186999 +0000
-+++ LVM2.2.02.139/daemons/dmeventd/Makefile.in	2016-01-19 12:57:44.277178484 +0000
-@@ -67,7 +67,7 @@
- 	$(DL_LIBS) $(LVMLIBS) $(LIBS) -rdynamic
- 
- dmeventd.static: $(LIB_STATIC) dmeventd.o $(interfacebuilddir)/libdevmapper.a
--	$(CC) $(CFLAGS) $(LDFLAGS) $(ELDFLAGS) -static -L. -L$(interfacebuilddir) -o $@ \
-+	$(CC) $(CFLAGS) $(LDFLAGS) $(ELDFLAGS) $(STATIC_LDFLAGS) -static -L. -L$(interfacebuilddir) -o $@ \
- 	dmeventd.o $(DL_LIBS) $(LVMLIBS) $(LIBS) $(STATIC_LIBS)
- 
- ifeq ("@PKGCONFIG@", "yes")
-diff -ur LVM2.2.02.139_O/make.tmpl.in LVM2.2.02.139/make.tmpl.in
---- LVM2.2.02.139_O/make.tmpl.in	2016-01-19 12:54:33.529186988 +0000
-+++ LVM2.2.02.139/make.tmpl.in	2016-01-19 12:58:31.514176378 +0000
-@@ -49,6 +49,7 @@
- # FIXME set this only where it's needed, not globally?
- CFLAGS ?= @COPTIMISE_FLAG@ @CFLAGS@
- LDFLAGS ?= @COPTIMISE_FLAG@ @LDFLAGS@
-+STATIC_LDFLAGS += @STATIC_LDFLAGS@
- CLDFLAGS += @CLDFLAGS@
- ELDFLAGS += @ELDFLAGS@
- LDDEPS += @LDDEPS@
-diff -ur LVM2.2.02.139_O/tools/Makefile.in LVM2.2.02.139/tools/Makefile.in
---- LVM2.2.02.139_O/tools/Makefile.in	2016-01-08 18:51:21.000000000 +0000
-+++ LVM2.2.02.139/tools/Makefile.in	2016-01-19 13:00:08.349172060 +0000
-@@ -129,7 +129,7 @@
- 	      -o $@ dmsetup.o -ldevmapper $(LIBS)
- 
- dmsetup.static: dmsetup.o $(interfacebuilddir)/libdevmapper.a
--	$(CC) $(CFLAGS) $(LDFLAGS) -static -L$(interfacebuilddir) \
-+	$(CC) $(CFLAGS) $(LDFLAGS) $(STATIC_LDFLAGS) -static -L$(interfacebuilddir) \
- 	      -o $@ dmsetup.o -ldevmapper $(M_LIBS) $(PTHREAD_LIBS) $(STATIC_LIBS) $(LIBS)
- 
- all: device-mapper
-@@ -146,7 +146,7 @@
- endif
- 
- lvm.static: $(OBJECTS) lvm-static.o $(top_builddir)/lib/liblvm-internal.a  $(interfacebuilddir)/libdevmapper.a
--	$(CC) $(CFLAGS) $(LDFLAGS) -static -L$(interfacebuilddir) -o $@ \
-+	$(CC) $(CFLAGS) $(LDFLAGS) $(STATIC_LDFLAGS) -static -L$(interfacebuilddir) -o $@ \
- 	      $(OBJECTS) lvm-static.o $(LVMLIBS) $(STATIC_LIBS) $(LIBS)
- 
- liblvm2cmd.a: $(top_builddir)/lib/liblvm-internal.a $(OBJECTS) lvmcmdlib.o lvm2cmd.o

diff --git a/sys-fs/lvm2/files/lvm2-2.02.145-mkdev.patch b/sys-fs/lvm2/files/lvm2-2.02.145-mkdev.patch
deleted file mode 100644
index f91dccd5c18..00000000000
--- a/sys-fs/lvm2/files/lvm2-2.02.145-mkdev.patch
+++ /dev/null
@@ -1,127 +0,0 @@
-https://bugs.gentoo.org/580062
-
-From 2a1d0fa8ea765604cd8274aac5aa7876f1c145c9 Mon Sep 17 00:00:00 2001
-From: Mike Frysinger <vapier@gentoo.org>
-Date: Tue, 19 Apr 2016 23:53:22 -0400
-Subject: [PATCH] convert major/minor/makedev handling
-
-Most of the files in here use MAJOR/MINOR/MKDEV macros, but a few
-missed it.  Update the defines in those files to match them.
----
- daemons/cmirrord/functions.c                          | 16 ++++++++++++----
- daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c | 12 ++++++++++--
- lib/filters/filter-sysfs.c                            |  6 ++++--
- 3 files changed, 26 insertions(+), 8 deletions(-)
-
-diff --git a/daemons/cmirrord/functions.c b/daemons/cmirrord/functions.c
-index e9d3c09..5b3cb38 100644
---- a/daemons/cmirrord/functions.c
-+++ b/daemons/cmirrord/functions.c
-@@ -20,6 +20,14 @@
- #include <time.h>
- #include <unistd.h>
- 
-+#ifdef __linux__
-+#  include "kdev_t.h"
-+#else
-+#  define MAJOR(x) major((x))
-+#  define MINOR(x) minor((x))
-+#  define MKDEV(x,y) makedev((x),(y))
-+#endif
-+
- #define BYTE_SHIFT 3
- 
- /*
-@@ -333,8 +341,8 @@ static int find_disk_path(char *major_minor_str, char *path_rtn, int *unlink_pat
- 			continue;
- 		}
- 		if (S_ISBLK(statbuf.st_mode) &&
--		    (major(statbuf.st_rdev) == major) &&
--		    (minor(statbuf.st_rdev) == minor)) {
-+		    (MAJOR(statbuf.st_rdev) == major) &&
-+		    (MINOR(statbuf.st_rdev) == minor)) {
- 			LOG_DBG("  %s: YES", dep->d_name);
- 			if (closedir(dp))
- 				LOG_DBG("Unable to closedir /dev/mapper %s",
-@@ -1451,7 +1459,7 @@ static int disk_status_info(struct log_c *lc, struct dm_ulog_request *rq)
- 	}
- 
- 	r = sprintf(data, "3 clustered-disk %d:%d %c",
--		    major(statbuf.st_rdev), minor(statbuf.st_rdev),
-+		    MAJOR(statbuf.st_rdev), MINOR(statbuf.st_rdev),
- 		    (lc->log_dev_failed) ? 'D' : 'A');
- 	if (r < 0)
- 		return r;
-@@ -1514,7 +1522,7 @@ static int disk_status_table(struct log_c *lc, struct dm_ulog_request *rq)
- 	}
- 
- 	r = sprintf(data, "clustered-disk %d:%d %u %s%s ",
--		    major(statbuf.st_rdev), minor(statbuf.st_rdev),
-+		    MAJOR(statbuf.st_rdev), MINOR(statbuf.st_rdev),
- 		    lc->region_size,
- 		    (lc->sync == DEFAULTSYNC) ? "" :
- 		    (lc->sync == NOSYNC) ? "nosync " : "sync ",
-diff --git a/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c b/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c
-index 7b060ed..4098203 100644
---- a/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c
-+++ b/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c
-@@ -20,6 +20,14 @@
- #include <stdarg.h>
- #include <pthread.h>
- 
-+#ifdef __linux__
-+#  include "kdev_t.h"
-+#else
-+#  define MAJOR(x) major((x))
-+#  define MINOR(x) minor((x))
-+#  define MKDEV(x,y) makedev((x),(y))
-+#endif
-+
- /* First warning when snapshot is 80% full. */
- #define WARNING_THRESH	(DM_PERCENT_1 * 80)
- /* Run a check every 5%. */
-@@ -148,8 +156,8 @@ static void _umount(const char *device, int major, int minor)
- 			continue; /* can't stat, skip this one */
- 
- 		if (S_ISBLK(st.st_mode) &&
--		    major(st.st_rdev) == major &&
--		    minor(st.st_rdev) == minor) {
-+		    MAJOR(st.st_rdev) == major &&
-+		    MINOR(st.st_rdev) == minor) {
- 			log_error("Unmounting invalid snapshot %s from %s.", device, words[1]);
- 			if (!_run(UMOUNT_COMMAND, "-fl", words[1], NULL))
- 				log_error("Failed to umount snapshot %s from %s: %s.",
-diff --git a/lib/filters/filter-sysfs.c b/lib/filters/filter-sysfs.c
-index 3115f86..5f76e8b 100644
---- a/lib/filters/filter-sysfs.c
-+++ b/lib/filters/filter-sysfs.c
-@@ -19,6 +19,8 @@
- 
- #include <dirent.h>
- 
-+#include "kdev_t.h"
-+
- static int _locate_sysfs_blocks(const char *sysfs_dir, char *path, size_t len,
- 				unsigned *sysfs_depth)
- {
-@@ -120,7 +122,7 @@ static struct dev_set *_dev_set_create(struct dm_pool *mem,
- 
- static unsigned _hash_dev(dev_t dev)
- {
--	return (major(dev) ^ minor(dev)) & (SET_BUCKETS - 1);
-+	return (MAJOR(dev) ^ MINOR(dev)) & (SET_BUCKETS - 1);
- }
- 
- /*
-@@ -171,7 +173,7 @@ static int _parse_dev(const char *file, FILE *fp, dev_t *result)
- 		return 0;
- 	}
- 
--	*result = makedev(major, minor);
-+	*result = MKDEV(major, minor);
- 	return 1;
- }
- 
--- 
-2.7.4
-

diff --git a/sys-fs/lvm2/lvm2-2.02.145-r2.ebuild b/sys-fs/lvm2/lvm2-2.02.145-r2.ebuild
deleted file mode 100644
index 70a95fcb0f7..00000000000
--- a/sys-fs/lvm2/lvm2-2.02.145-r2.ebuild
+++ /dev/null
@@ -1,254 +0,0 @@
-# Copyright 1999-2019 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-inherit autotools eutils linux-info multilib systemd toolchain-funcs udev flag-o-matic
-
-DESCRIPTION="User-land utilities for LVM2 (device-mapper) software"
-HOMEPAGE="https://sourceware.org/lvm2/"
-SRC_URI="ftp://sourceware.org/pub/lvm2/${PN/lvm/LVM}.${PV}.tgz
-	ftp://sourceware.org/pub/lvm2/old/${PN/lvm/LVM}.${PV}.tgz"
-
-LICENSE="GPL-2"
-SLOT="0"
-KEYWORDS="alpha amd64 arm arm64 hppa ia64 ~mips ppc ppc64 s390 ~sh sparc x86 ~amd64-linux ~x86-linux"
-IUSE="readline static static-libs systemd lvm1 lvm2create_initrd selinux +udev +thin device-mapper-only"
-REQUIRED_USE="device-mapper-only? ( !lvm1 !lvm2create_initrd !thin )
-	systemd? ( udev )"
-
-DEPEND_COMMON="
-	readline? ( sys-libs/readline:0= )
-	systemd? ( >=sys-apps/systemd-205:0= )
-	udev? ( >=virtual/libudev-208:=[static-libs(-)?] )"
-# /run is now required for locking during early boot. /var cannot be assumed to
-# be available -- thus, pull in recent enough baselayout for /run.
-# This version of LVM is incompatible with cryptsetup <1.1.2.
-RDEPEND="${DEPEND_COMMON}
-	>=sys-apps/baselayout-2.2
-	!<sys-apps/openrc-0.11
-	!<sys-fs/cryptsetup-1.1.2
-	!!sys-fs/lvm-user
-	>=sys-apps/util-linux-2.16
-	lvm2create_initrd? ( sys-apps/makedev )
-	thin? ( >=sys-block/thin-provisioning-tools-0.3.0 )"
-# note: thin- 0.3.0 is required to avoid --disable-thin_check_needs_check
-# USE 'static' currently only works with eudev, bug 520450
-DEPEND="${DEPEND_COMMON}
-	virtual/pkgconfig
-	>=sys-devel/binutils-2.20.1-r1
-	sys-devel/autoconf-archive
-	static? (
-		selinux? ( sys-libs/libselinux[static-libs] )
-		udev? ( >=sys-fs/eudev-3.1.2[static-libs] )
-		>=sys-apps/util-linux-2.16[static-libs]
-	)"
-
-S=${WORKDIR}/${PN/lvm/LVM}.${PV}
-
-PATCHES=(
-	# Gentoo specific modification(s):
-	"${FILESDIR}"/${PN}-2.02.129-example.conf.in.patch
-
-	# For upstream -- review and forward:
-	"${FILESDIR}"/${PN}-2.02.63-always-make-static-libdm.patch
-	"${FILESDIR}"/${PN}-2.02.56-lvm2create_initrd.patch
-	"${FILESDIR}"/${PN}-2.02.67-createinitrd.patch #301331
-	"${FILESDIR}"/${PN}-2.02.99-locale-muck.patch #330373
-	"${FILESDIR}"/${PN}-2.02.70-asneeded.patch # -Wl,--as-needed
-	"${FILESDIR}"/${PN}-2.02.139-dynamic-static-ldflags.patch #332905
-	"${FILESDIR}"/${PN}-2.02.129-static-pkgconfig-libs.patch #370217, #439414 + blkid
-	"${FILESDIR}"/${PN}-2.02.130-pthread-pkgconfig.patch #492450
-	"${FILESDIR}"/${PN}-2.02.145-mkdev.patch #580062
-)
-
-pkg_setup() {
-	local CONFIG_CHECK="~SYSVIPC"
-
-	if use udev; then
-		local WARNING_SYSVIPC="CONFIG_SYSVIPC:\tis not set (required for udev sync)\n"
-		if linux_config_exists; then
-			local uevent_helper_path=$(linux_chkconfig_string UEVENT_HELPER_PATH)
-			if [ -n "${uevent_helper_path}" ] && [ "${uevent_helper_path}" != '""' ]; then
-				ewarn "It's recommended to set an empty value to the following kernel config option:"
-				ewarn "CONFIG_UEVENT_HELPER_PATH=${uevent_helper_path}"
-			fi
-		fi
-	fi
-
-	check_extra_config
-
-	# 1. Genkernel no longer copies /sbin/lvm blindly.
-	if use static; then
-		elog "Warning, we no longer overwrite /sbin/lvm and /sbin/dmsetup with"
-		elog "their static versions. If you need the static binaries,"
-		elog "you must append .static to the filename!"
-	fi
-}
-
-src_prepare() {
-	default
-
-	sed -i \
-		-e "1iAR = $(tc-getAR)" \
-		-e "s:CC ?= @CC@:CC = $(tc-getCC):" \
-		make.tmpl.in || die #444082
-
-	sed -i -e '/FLAG/s:-O2::' configure{.in,} || die #480212
-
-	if use udev && ! use device-mapper-only; then
-		sed -i -e '/use_lvmetad =/s:0:1:' conf/example.conf.in || die #514196
-		elog "Notice that \"use_lvmetad\" setting is enabled with USE=\"udev\" in"
-		elog "/etc/lvm/lvm.conf, which will require restart of udev, lvm, and lvmetad"
-		elog "if it was previously disabled."
-	fi
-
-	sed -i -e "s:/usr/bin/true:$(type -P true):" scripts/blk_availability_systemd_red_hat.service.in || die #517514
-
-	# Without thin-privision-tools, there is nothing to install for target install_man7:
-	use thin || { sed -i -e '/^install_lvm2/s:install_man7::' man/Makefile.in || die; }
-
-	eautoreconf
-}
-
-src_configure() {
-	filter-flags -flto
-	local myconf=()
-	local buildmode
-
-	myconf+=( $(use_enable !device-mapper-only dmeventd) )
-	myconf+=( $(use_enable !device-mapper-only cmdlib) )
-	myconf+=( $(use_enable !device-mapper-only applib) )
-	myconf+=( $(use_enable !device-mapper-only fsadm) )
-	myconf+=( $(use_enable !device-mapper-only lvmetad) )
-	use device-mapper-only && myconf+=( --disable-udev-systemd-background-jobs )
-
-	# Most of this package does weird stuff.
-	# The build options are tristate, and --without is NOT supported
-	# options: 'none', 'internal', 'shared'
-	if use static; then
-		buildmode="internal"
-		# This only causes the .static versions to become available
-		myconf+=( --enable-static_link )
-	else
-		buildmode="shared"
-	fi
-	dmbuildmode=$(use !device-mapper-only && echo internal || echo none)
-
-	# dmeventd requires mirrors to be internal, and snapshot available
-	# so we cannot disable them
-	myconf+=( --with-mirrors=${dmbuildmode} )
-	myconf+=( --with-snapshots=${dmbuildmode} )
-	if use thin; then
-		myconf+=( --with-thin=internal --with-cache=internal )
-		local texec
-		for texec in check dump repair restore; do
-			myconf+=( --with-thin-${texec}="${EPREFIX}"/sbin/thin_${texec} )
-			myconf+=( --with-cache-${texec}="${EPREFIX}"/sbin/cache_${texec} )
-		done
-	else
-		myconf+=( --with-thin=none --with-cache=none )
-	fi
-
-	if use lvm1; then
-		myconf+=( --with-lvm1=${buildmode} )
-	else
-		myconf+=( --with-lvm1=none )
-	fi
-
-	# disable O_DIRECT support on hppa, breaks pv detection (#99532)
-	use hppa && myconf+=( --disable-o_direct )
-
-	myconf+=( --with-clvmd=none --with-cluster=none )
-
-	econf \
-		$(use_enable readline) \
-		$(use_enable selinux) \
-		--enable-pkgconfig \
-		--with-confdir="${EPREFIX}"/etc \
-		--exec-prefix="${EPREFIX}" \
-		--sbindir="${EPREFIX}/sbin" \
-		--with-staticdir="${EPREFIX}"/sbin \
-		--libdir="${EPREFIX}/$(get_libdir)" \
-		--with-usrlibdir="${EPREFIX}/usr/$(get_libdir)" \
-		--with-default-dm-run-dir=/run \
-		--with-default-run-dir=/run/lvm \
-		--with-default-locking-dir=/run/lock/lvm \
-		--with-default-pid-dir=/run \
-		$(use_enable udev udev_rules) \
-		$(use_enable udev udev_sync) \
-		$(use_with udev udevdir "$(get_udevdir)"/rules.d) \
-		$(use_enable systemd udev-systemd-background-jobs) \
-		--with-systemdsystemunitdir="$(systemd_get_systemunitdir)" \
-		${myconf[@]} \
-		CLDFLAGS="${LDFLAGS}"
-}
-
-src_compile() {
-	pushd include >/dev/null
-	emake
-	popd >/dev/null
-
-	if use device-mapper-only ; then
-		emake device-mapper
-	else
-		emake
-		emake CC="$(tc-getCC)" -C scripts lvm2_activation_generator_systemd_red_hat
-	fi
-}
-
-src_install() {
-	local inst
-	INSTALL_TARGETS="install install_tmpfiles_configuration"
-	# install systemd related files only when requested, bug #522430
-	use systemd && INSTALL_TARGETS="${INSTALL_TARGETS} install_systemd_units install_systemd_generators"
-	use device-mapper-only && INSTALL_TARGETS="install_device-mapper"
-	for inst in ${INSTALL_TARGETS}; do
-		emake DESTDIR="${D}" ${inst}
-	done
-
-	newinitd "${FILESDIR}"/device-mapper.rc-2.02.105-r2 device-mapper
-	newconfd "${FILESDIR}"/device-mapper.conf-1.02.22-r3 device-mapper
-
-	if use !device-mapper-only ; then
-		newinitd "${FILESDIR}"/dmeventd.initd-2.02.67-r1 dmeventd
-		newinitd "${FILESDIR}"/lvm.rc-2.02.116-r6 lvm
-		newconfd "${FILESDIR}"/lvm.confd-2.02.28-r2 lvm
-
-		newinitd "${FILESDIR}"/lvm-monitoring.initd-2.02.105-r2 lvm-monitoring
-		newinitd "${FILESDIR}"/lvmetad.initd-2.02.116-r3 lvmetad
-	fi
-
-	if use static-libs; then
-		dolib.a libdm/ioctl/libdevmapper.a
-		if use !device-mapper-only ; then
-			dolib.a libdaemon/client/libdaemonclient.a #462908
-			dolib.a daemons/dmeventd/libdevmapper-event.a
-		fi
-	else
-		rm -f "${ED}"usr/$(get_libdir)/{libdevmapper-event,liblvm2cmd,liblvm2app,libdevmapper}.a
-	fi
-
-	if use lvm2create_initrd; then
-		dosbin scripts/lvm2create_initrd/lvm2create_initrd
-		doman scripts/lvm2create_initrd/lvm2create_initrd.8
-		newdoc scripts/lvm2create_initrd/README README.lvm2create_initrd
-	fi
-
-	insinto /etc
-	doins "${FILESDIR}"/dmtab
-
-	dodoc README VERSION* WHATS_NEW WHATS_NEW_DM doc/*.{c,txt} conf/*.conf
-}
-
-pkg_postinst() {
-	ewarn "Make sure the \"lvm\" init script is in the runlevels:"
-	ewarn "# rc-update add lvm boot"
-	ewarn
-	ewarn "Make sure to enable lvmetad in /etc/lvm/lvm.conf if you want"
-	ewarn "to enable lvm autoactivation and metadata caching."
-}
-
-src_test() {
-	einfo "Tests are disabled because of device-node mucking, if you want to"
-	einfo "run tests, compile the package and see ${S}/tests"
-}

diff --git a/sys-fs/lvm2/lvm2-2.02.183.ebuild b/sys-fs/lvm2/lvm2-2.02.183.ebuild
deleted file mode 100644
index 24737eaf33f..00000000000
--- a/sys-fs/lvm2/lvm2-2.02.183.ebuild
+++ /dev/null
@@ -1,259 +0,0 @@
-# Copyright 1999-2019 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-inherit autotools linux-info multilib systemd toolchain-funcs udev flag-o-matic
-
-DESCRIPTION="User-land utilities for LVM2 (device-mapper) software"
-HOMEPAGE="https://sourceware.org/lvm2/"
-SRC_URI="ftp://sourceware.org/pub/lvm2/${PN/lvm/LVM}.${PV}.tgz
-	ftp://sourceware.org/pub/lvm2/old/${PN/lvm/LVM}.${PV}.tgz"
-
-LICENSE="GPL-2"
-SLOT="0"
-KEYWORDS="alpha amd64 arm arm64 ~hppa ~ia64 ~mips ppc ppc64 s390 ~sh ~sparc x86 ~amd64-linux ~x86-linux"
-IUSE="readline static static-libs systemd lvm2create_initrd sanlock selinux +udev +thin device-mapper-only"
-REQUIRED_USE="device-mapper-only? ( !lvm2create_initrd !sanlock !thin )
-	systemd? ( udev )"
-
-DEPEND_COMMON="
-	dev-libs/libaio[static-libs?]
-	static? ( dev-libs/libaio[static-libs] )
-	!static? ( dev-libs/libaio[static-libs?] )
-	readline? ( sys-libs/readline:0= )
-	sanlock? ( sys-cluster/sanlock )
-	systemd? ( >=sys-apps/systemd-205:0= )
-	udev? ( >=virtual/libudev-208:=[static-libs(-)?] )"
-# /run is now required for locking during early boot. /var cannot be assumed to
-# be available -- thus, pull in recent enough baselayout for /run.
-# This version of LVM is incompatible with cryptsetup <1.1.2.
-RDEPEND="${DEPEND_COMMON}
-	>=sys-apps/baselayout-2.2
-	!<sys-apps/openrc-0.11
-	!<sys-fs/cryptsetup-1.1.2
-	!!sys-fs/lvm-user
-	>=sys-apps/util-linux-2.16
-	lvm2create_initrd? ( sys-apps/makedev )
-	thin? ( >=sys-block/thin-provisioning-tools-0.3.0 )"
-# note: thin- 0.3.0 is required to avoid --disable-thin_check_needs_check
-# USE 'static' currently only works with eudev, bug 520450
-DEPEND="${DEPEND_COMMON}
-	virtual/pkgconfig
-	>=sys-devel/binutils-2.20.1-r1
-	sys-devel/autoconf-archive
-	static? (
-		selinux? ( sys-libs/libselinux[static-libs] )
-		udev? ( >=sys-fs/eudev-3.1.2[static-libs] )
-		>=sys-apps/util-linux-2.16[static-libs]
-	)"
-
-S=${WORKDIR}/${PN/lvm/LVM}.${PV}
-
-PATCHES=(
-	# Gentoo specific modification(s):
-	"${FILESDIR}"/${PN}-2.02.178-example.conf.in.patch
-
-	# For upstream -- review and forward:
-	"${FILESDIR}"/${PN}-2.02.63-always-make-static-libdm.patch
-	"${FILESDIR}"/${PN}-2.02.56-lvm2create_initrd.patch
-	"${FILESDIR}"/${PN}-2.02.67-createinitrd.patch #301331
-	"${FILESDIR}"/${PN}-2.02.99-locale-muck.patch #330373
-	"${FILESDIR}"/${PN}-2.02.178-asneeded.patch # -Wl,--as-needed
-	"${FILESDIR}"/${PN}-2.02.178-dynamic-static-ldflags.patch #332905
-	"${FILESDIR}"/${PN}-2.02.178-static-pkgconfig-libs.patch #370217, #439414 + blkid
-	"${FILESDIR}"/${PN}-2.02.176-pthread-pkgconfig.patch #492450
-	"${FILESDIR}"/${PN}-2.02.171-static-libm.patch #617756
-	"${FILESDIR}"/${PN}-2.02.166-HPPA-no-O_DIRECT.patch #657446
-	#"${FILESDIR}"/${PN}-2.02.145-mkdev.patch #580062 # Merged upstream
-)
-
-pkg_setup() {
-	local CONFIG_CHECK="~SYSVIPC"
-
-	if use udev; then
-		local WARNING_SYSVIPC="CONFIG_SYSVIPC:\tis not set (required for udev sync)\n"
-		if linux_config_exists; then
-			local uevent_helper_path=$(linux_chkconfig_string UEVENT_HELPER_PATH)
-			if [ -n "${uevent_helper_path}" ] && [ "${uevent_helper_path}" != '""' ]; then
-				ewarn "It's recommended to set an empty value to the following kernel config option:"
-				ewarn "CONFIG_UEVENT_HELPER_PATH=${uevent_helper_path}"
-			fi
-		fi
-	fi
-
-	check_extra_config
-
-	# 1. Genkernel no longer copies /sbin/lvm blindly.
-	if use static; then
-		elog "Warning, we no longer overwrite /sbin/lvm and /sbin/dmsetup with"
-		elog "their static versions. If you need the static binaries,"
-		elog "you must append .static to the filename!"
-	fi
-}
-
-src_prepare() {
-	default
-
-	sed -i \
-		-e "1iAR = $(tc-getAR)" \
-		-e "s:CC ?= @CC@:CC = $(tc-getCC):" \
-		make.tmpl.in || die #444082
-
-	sed -i -e '/FLAG/s:-O2::' configure{.ac,} || die #480212
-
-	if use udev && ! use device-mapper-only; then
-		sed -i -e '/use_lvmetad =/s:0:1:' conf/example.conf.in || die #514196
-		elog "Notice that \"use_lvmetad\" setting is enabled with USE=\"udev\" in"
-		elog "/etc/lvm/lvm.conf, which will require restart of udev, lvm, and lvmetad"
-		elog "if it was previously disabled."
-	fi
-
-	sed -i -e "s:/usr/bin/true:$(type -P true):" scripts/blk_availability_systemd_red_hat.service.in || die #517514
-
-	# Without thin-privision-tools, there is nothing to install for target install_man7:
-	if ! use thin ; then
-		sed -i -e '/^install_lvm2/s:install_man7::' man/Makefile.in || die
-	fi
-
-	eautoreconf
-}
-
-src_configure() {
-	filter-flags -flto
-	local myeconfargs=()
-
-	# Most of this package does weird stuff.
-	# The build options are tristate, and --without is NOT supported
-	# options: 'none', 'internal', 'shared'
-	myeconfargs+=(
-		$(use_enable !device-mapper-only dmeventd)
-		$(use_enable !device-mapper-only cmdlib)
-		$(use_enable !device-mapper-only applib)
-		$(use_enable !device-mapper-only fsadm)
-		$(use_enable !device-mapper-only lvmetad)
-		$(usex device-mapper-only --disable-udev-systemd-background-jobs '')
-
-		# This only causes the .static versions to become available
-		$(usex static --enable-static_link '')
-
-		# dmeventd requires mirrors to be internal, and snapshot available
-		# so we cannot disable them
-		--with-mirrors="$(usex device-mapper-only none internal)"
-		--with-snapshots="$(usex device-mapper-only none internal)"
-
-		# disable O_DIRECT support on hppa, breaks pv detection (#99532)
-		$(usex hppa --disable-o_direct '')
-	)
-
-	if use thin; then
-		myeconfargs+=( --with-thin=internal --with-cache=internal )
-		local texec
-		for texec in check dump repair restore; do
-			myeconfargs+=( --with-thin-${texec}="${EPREFIX}"/sbin/thin_${texec} )
-			myeconfargs+=( --with-cache-${texec}="${EPREFIX}"/sbin/cache_${texec} )
-		done
-	else
-		myeconfargs+=( --with-thin=none --with-cache=none )
-	fi
-
-	myeconfargs+=( --with-clvmd=none --with-cluster=none )
-
-	myeconfargs+=(
-		$(use_enable readline)
-		$(use_enable selinux)
-		--enable-pkgconfig
-		--with-confdir="${EPREFIX}"/etc
-		--exec-prefix="${EPREFIX}"
-		--sbindir="${EPREFIX}/sbin"
-		--with-staticdir="${EPREFIX}"/sbin
-		--libdir="${EPREFIX}/$(get_libdir)"
-		--with-usrlibdir="${EPREFIX}/usr/$(get_libdir)"
-		--with-default-dm-run-dir=/run
-		--with-default-run-dir=/run/lvm
-		--with-default-locking-dir=/run/lock/lvm
-		--with-default-pid-dir=/run
-		$(use_enable udev udev_rules)
-		$(use_enable udev udev_sync)
-		$(use_with udev udevdir "$(get_udevdir)"/rules.d)
-		$(use_enable sanlock lvmlockd-sanlock)
-		$(use_enable systemd udev-systemd-background-jobs)
-		--with-systemdsystemunitdir="$(systemd_get_systemunitdir)"
-		CLDFLAGS="${LDFLAGS}"
-	)
-	# Hard-wire this to bash as some shells (dash) don't know
-	# "-o pipefail" #682404
-	CONFIG_SHELL="/bin/bash" \
-	econf "${myeconfargs[@]}"
-}
-
-src_compile() {
-	pushd include >/dev/null
-	emake
-	popd >/dev/null
-
-	if use device-mapper-only ; then
-		emake device-mapper
-	else
-		emake
-		emake CC="$(tc-getCC)" -C scripts lvm2_activation_generator_systemd_red_hat
-	fi
-}
-
-src_install() {
-	local inst INSTALL_TARGETS
-	INSTALL_TARGETS=( install install_tmpfiles_configuration )
-	# install systemd related files only when requested, bug #522430
-	use systemd && INSTALL_TARGETS+=( install_systemd_units install_systemd_generators )
-	use device-mapper-only && INSTALL_TARGETS=( install_device-mapper )
-	for inst in ${INSTALL_TARGETS[@]}; do
-		emake DESTDIR="${D}" ${inst}
-	done
-
-	newinitd "${FILESDIR}"/device-mapper.rc-2.02.105-r2 device-mapper
-	newconfd "${FILESDIR}"/device-mapper.conf-1.02.22-r3 device-mapper
-
-	if use !device-mapper-only ; then
-		newinitd "${FILESDIR}"/dmeventd.initd-2.02.67-r1 dmeventd
-		newinitd "${FILESDIR}"/lvm.rc-2.02.172 lvm
-		newconfd "${FILESDIR}"/lvm.confd-2.02.28-r2 lvm
-
-		newinitd "${FILESDIR}"/lvm-monitoring.initd-2.02.105-r2 lvm-monitoring
-		newinitd "${FILESDIR}"/lvmetad.initd-2.02.116-r3 lvmetad
-	fi
-
-	if use sanlock; then
-		newinitd "${FILESDIR}"/lvmlockd.initd-2.02.166-r1 lvmlockd
-	fi
-
-	if use static-libs; then
-		dolib.a libdm/ioctl/libdevmapper.a
-		dolib.a libdaemon/client/libdaemonclient.a #462908
-		dolib.a daemons/dmeventd/libdevmapper-event.a
-	else
-		rm -f "${ED%/}"/usr/$(get_libdir)/{libdevmapper-event,liblvm2cmd,liblvm2app,libdevmapper}.a
-	fi
-
-	if use lvm2create_initrd; then
-		dosbin scripts/lvm2create_initrd/lvm2create_initrd
-		doman scripts/lvm2create_initrd/lvm2create_initrd.8
-		newdoc scripts/lvm2create_initrd/README README.lvm2create_initrd
-	fi
-
-	insinto /etc
-	doins "${FILESDIR}"/dmtab
-
-	dodoc README VERSION* WHATS_NEW WHATS_NEW_DM doc/*.{c,txt} conf/*.conf
-}
-
-pkg_postinst() {
-	ewarn "Make sure the \"lvm\" init script is in the runlevels:"
-	ewarn "# rc-update add lvm boot"
-	ewarn
-	ewarn "Make sure to enable lvmetad in /etc/lvm/lvm.conf if you want"
-	ewarn "to enable lvm autoactivation and metadata caching."
-}
-
-src_test() {
-	einfo "Tests are disabled because of device-node mucking, if you want to"
-	einfo "run tests, compile the package and see ${S}/tests"
-}

diff --git a/sys-fs/lvm2/lvm2-2.02.185-r1.ebuild b/sys-fs/lvm2/lvm2-2.02.185-r1.ebuild
deleted file mode 100644
index ec678f7044b..00000000000
--- a/sys-fs/lvm2/lvm2-2.02.185-r1.ebuild
+++ /dev/null
@@ -1,278 +0,0 @@
-# Copyright 1999-2019 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-inherit autotools linux-info multilib systemd toolchain-funcs udev flag-o-matic
-
-DESCRIPTION="User-land utilities for LVM2 (device-mapper) software"
-HOMEPAGE="https://sourceware.org/lvm2/"
-SRC_URI="ftp://sourceware.org/pub/lvm2/${PN/lvm/LVM}.${PV}.tgz
-	ftp://sourceware.org/pub/lvm2/old/${PN/lvm/LVM}.${PV}.tgz"
-
-LICENSE="GPL-2"
-SLOT="0"
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~x86-linux"
-IUSE="readline static static-libs systemd lvm2create_initrd sanlock selinux +udev +thin device-mapper-only"
-REQUIRED_USE="device-mapper-only? ( !lvm2create_initrd !sanlock !thin )
-	systemd? ( udev )"
-
-DEPEND_COMMON="
-	dev-libs/libaio[static-libs?]
-	static? ( dev-libs/libaio[static-libs] )
-	!static? ( dev-libs/libaio[static-libs?] )
-	readline? ( sys-libs/readline:0= )
-	sanlock? ( sys-cluster/sanlock )
-	systemd? ( >=sys-apps/systemd-205:0= )
-	udev? ( >=virtual/libudev-208:=[static-libs(-)?] )"
-# /run is now required for locking during early boot. /var cannot be assumed to
-# be available -- thus, pull in recent enough baselayout for /run.
-# This version of LVM is incompatible with cryptsetup <1.1.2.
-RDEPEND="${DEPEND_COMMON}
-	>=sys-apps/baselayout-2.2
-	!<sys-apps/openrc-0.11
-	!<sys-fs/cryptsetup-1.1.2
-	!!sys-fs/lvm-user
-	>=sys-apps/util-linux-2.16
-	lvm2create_initrd? ( sys-apps/makedev )
-	thin? ( >=sys-block/thin-provisioning-tools-0.3.0 )"
-# note: thin- 0.3.0 is required to avoid --disable-thin_check_needs_check
-# USE 'static' currently only works with eudev, bug 520450
-DEPEND="${DEPEND_COMMON}
-	>=sys-devel/binutils-2.20.1-r1
-	static? (
-		selinux? ( sys-libs/libselinux[static-libs] )
-		udev? ( >=sys-fs/eudev-3.1.2[static-libs] )
-		>=sys-apps/util-linux-2.16[static-libs]
-	)"
-BDEPEND="
-	sys-devel/autoconf-archive
-	virtual/pkgconfig
-"
-
-S="${WORKDIR}/${PN/lvm/LVM}.${PV}"
-
-PATCHES=(
-	# Gentoo specific modification(s):
-	"${FILESDIR}"/${PN}-2.02.178-example.conf.in.patch
-
-	# For upstream -- review and forward:
-	"${FILESDIR}"/${PN}-2.02.63-always-make-static-libdm.patch
-	"${FILESDIR}"/${PN}-2.02.56-lvm2create_initrd.patch
-	"${FILESDIR}"/${PN}-2.02.67-createinitrd.patch #301331
-	"${FILESDIR}"/${PN}-2.02.99-locale-muck.patch #330373
-	"${FILESDIR}"/${PN}-2.02.178-asneeded.patch # -Wl,--as-needed
-	"${FILESDIR}"/${PN}-2.02.178-dynamic-static-ldflags.patch #332905
-	"${FILESDIR}"/${PN}-2.02.178-static-pkgconfig-libs.patch #370217, #439414 + blkid
-	"${FILESDIR}"/${PN}-2.02.176-pthread-pkgconfig.patch #492450
-	"${FILESDIR}"/${PN}-2.02.171-static-libm.patch #617756
-	"${FILESDIR}"/${PN}-2.02.166-HPPA-no-O_DIRECT.patch #657446
-	#"${FILESDIR}"/${PN}-2.02.145-mkdev.patch #580062 # Merged upstream
-	"${FILESDIR}"/${PN}-2.02.184-dmeventd-no-idle-exit.patch
-	#"${FILESDIR}"/${PN}-2.02.184-allow-reading-metadata-with-invalid-creation_time.patch #682380 # merged upstream
-	"${FILESDIR}"/${PN}-2.02.184-mksh_build.patch #686652
-)
-
-pkg_setup() {
-	local CONFIG_CHECK="~SYSVIPC"
-
-	if use udev; then
-		local WARNING_SYSVIPC="CONFIG_SYSVIPC:\tis not set (required for udev sync)\n"
-		if linux_config_exists; then
-			local uevent_helper_path=$(linux_chkconfig_string UEVENT_HELPER_PATH)
-			if [[ -n "${uevent_helper_path}" ]] && [[ "${uevent_helper_path}" != '""' ]]; then
-				ewarn "It's recommended to set an empty value to the following kernel config option:"
-				ewarn "CONFIG_UEVENT_HELPER_PATH=${uevent_helper_path}"
-			fi
-		fi
-	fi
-
-	check_extra_config
-
-	# 1. Genkernel no longer copies /sbin/lvm blindly.
-	if use static; then
-		elog "Warning, we no longer overwrite /sbin/lvm and /sbin/dmsetup with"
-		elog "their static versions. If you need the static binaries,"
-		elog "you must append .static to the filename!"
-	fi
-}
-
-src_prepare() {
-	default
-
-	sed -i \
-		-e "1iAR = $(tc-getAR)" \
-		-e "s:CC ?= @CC@:CC = $(tc-getCC):" \
-		make.tmpl.in || die #444082
-
-	sed -i -e '/FLAG/s:-O2::' configure{.ac,} || die #480212
-
-	if use udev && ! use device-mapper-only; then
-		sed -i -e '/use_lvmetad =/s:0:1:' conf/example.conf.in || die #514196
-		elog "Notice that \"use_lvmetad\" setting is enabled with USE=\"udev\" in"
-		elog "/etc/lvm/lvm.conf, which will require restart of udev, lvm, and lvmetad"
-		elog "if it was previously disabled."
-	fi
-
-	sed -i -e "s:/usr/bin/true:$(type -P true):" scripts/blk_availability_systemd_red_hat.service.in || die #517514
-
-	# Don't install thin man page when not requested
-	if ! use thin ; then
-		sed -i -e 's/^\(MAN7+=.*\) $(LVMTHINMAN) \(.*\)$/\1 \2/' man/Makefile.in || die
-	fi
-
-	eautoreconf
-}
-
-src_configure() {
-	filter-flags -flto
-	local myeconfargs=()
-
-	# Most of this package does weird stuff.
-	# The build options are tristate, and --without is NOT supported
-	# options: 'none', 'internal', 'shared'
-	myeconfargs+=(
-		$(use_enable !device-mapper-only dmfilemapd)
-		$(use_enable !device-mapper-only dmeventd)
-		$(use_enable !device-mapper-only cmdlib)
-		$(use_enable !device-mapper-only applib)
-		$(use_enable !device-mapper-only fsadm)
-		$(use_enable !device-mapper-only lvmetad)
-		$(use_enable !device-mapper-only lvmpolld)
-		$(usex device-mapper-only --disable-udev-systemd-background-jobs '')
-
-		# This only causes the .static versions to become available
-		$(usex static --enable-static_link '')
-
-		# dmeventd requires mirrors to be internal, and snapshot available
-		# so we cannot disable them
-		--with-mirrors="$(usex device-mapper-only none internal)"
-		--with-snapshots="$(usex device-mapper-only none internal)"
-
-		# disable O_DIRECT support on hppa, breaks pv detection (#99532)
-		$(usex hppa --disable-o_direct '')
-	)
-
-	if use thin; then
-		myeconfargs+=( --with-thin=internal --with-cache=internal )
-		local texec
-		for texec in check dump repair restore; do
-			myeconfargs+=( --with-thin-${texec}="${EPREFIX}"/sbin/thin_${texec} )
-			myeconfargs+=( --with-cache-${texec}="${EPREFIX}"/sbin/cache_${texec} )
-		done
-	else
-		myeconfargs+=( --with-thin=none --with-cache=none )
-	fi
-
-	myeconfargs+=( --with-clvmd=none --with-cluster=none )
-
-	myeconfargs+=(
-		$(use_enable readline)
-		$(use_enable selinux)
-		--enable-pkgconfig
-		--with-confdir="${EPREFIX}"/etc
-		--exec-prefix="${EPREFIX}"
-		--sbindir="${EPREFIX}/sbin"
-		--with-staticdir="${EPREFIX}"/sbin
-		--libdir="${EPREFIX}/$(get_libdir)"
-		--with-usrlibdir="${EPREFIX}/usr/$(get_libdir)"
-		--with-default-dm-run-dir=/run
-		--with-default-run-dir=/run/lvm
-		--with-default-locking-dir=/run/lock/lvm
-		--with-default-pid-dir=/run
-		$(use_enable udev udev_rules)
-		$(use_enable udev udev_sync)
-		$(use_with udev udevdir "$(get_udevdir)"/rules.d)
-		$(use_enable sanlock lvmlockd-sanlock)
-		$(use_enable systemd udev-systemd-background-jobs)
-		$(use_enable systemd notify-dbus)
-		--with-systemdsystemunitdir="$(systemd_get_systemunitdir)"
-		CLDFLAGS="${LDFLAGS}"
-	)
-	# Hard-wire this to bash as some shells (dash) don't know
-	# "-o pipefail" #682404
-	CONFIG_SHELL="/bin/bash" \
-	econf "${myeconfargs[@]}"
-}
-
-src_compile() {
-	pushd include >/dev/null
-	emake V=1
-	popd >/dev/null
-
-	if use device-mapper-only ; then
-		emake V=1 device-mapper
-	else
-		emake V=1
-		emake V=1 CC="$(tc-getCC)" -C scripts lvm2_activation_generator_systemd_red_hat
-	fi
-}
-
-src_install() {
-	local inst INSTALL_TARGETS
-	INSTALL_TARGETS=( install install_tmpfiles_configuration )
-	# install systemd related files only when requested, bug #522430
-	use systemd && INSTALL_TARGETS+=( install_systemd_units install_systemd_generators )
-	use device-mapper-only && INSTALL_TARGETS=( install_device-mapper )
-	for inst in ${INSTALL_TARGETS[@]}; do
-		emake V=1 DESTDIR="${D}" ${inst}
-	done
-
-	newinitd "${FILESDIR}"/device-mapper.rc-2.02.105-r2 device-mapper
-	newconfd "${FILESDIR}"/device-mapper.conf-1.02.22-r3 device-mapper
-
-	if use !device-mapper-only ; then
-		newinitd "${FILESDIR}"/dmeventd.initd-2.02.184-r2 dmeventd
-		newinitd "${FILESDIR}"/lvm.rc-2.02.184-r3 lvm
-		newconfd "${FILESDIR}"/lvm.confd-2.02.184-r3 lvm
-		if ! use udev ; then
-			# We keep the variable but remove udev from it.
-			sed -r -i \
-				-e '/^rc_need=/s/\<udev\>//g' \
-				"${ED}/etc/conf.d/lvm" || die "Could not drop udev from rc_need"
-		fi
-
-		newinitd "${FILESDIR}"/lvm-monitoring.initd-2.02.105-r2 lvm-monitoring
-		newinitd "${FILESDIR}"/lvmetad.initd-2.02.116-r3 lvmetad
-		newinitd "${FILESDIR}"/lvmpolld.initd-2.02.183 lvmpolld
-	fi
-
-	if use sanlock; then
-		newinitd "${FILESDIR}"/lvmlockd.initd-2.02.166-r1 lvmlockd
-	fi
-
-	if use static-libs; then
-		dolib.a libdm/ioctl/libdevmapper.a
-		if use !device-mapper-only; then
-			# depends on lvmetad
-			dolib.a libdaemon/client/libdaemonclient.a #462908
-			# depends on dmeventd
-			dolib.a daemons/dmeventd/libdevmapper-event.a
-		fi
-	else
-		rm -f "${ED}"/usr/$(get_libdir)/{libdevmapper-event,liblvm2cmd,liblvm2app,libdevmapper}.a
-	fi
-
-	if use lvm2create_initrd; then
-		dosbin scripts/lvm2create_initrd/lvm2create_initrd
-		doman scripts/lvm2create_initrd/lvm2create_initrd.8
-		newdoc scripts/lvm2create_initrd/README README.lvm2create_initrd
-	fi
-
-	insinto /etc
-	doins "${FILESDIR}"/dmtab
-
-	dodoc README VERSION* WHATS_NEW WHATS_NEW_DM doc/*.{c,txt} conf/*.conf
-}
-
-pkg_postinst() {
-	ewarn "Make sure the \"lvm\" init script is in the runlevels:"
-	ewarn "# rc-update add lvm boot"
-	ewarn
-	ewarn "Make sure to enable lvmetad in /etc/lvm/lvm.conf if you want"
-	ewarn "to enable lvm autoactivation and metadata caching."
-}
-
-src_test() {
-	einfo "Tests are disabled because of device-node mucking, if you want to"
-	einfo "run tests, compile the package and see ${S}/tests"
-}


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-fs/lvm2/, sys-fs/lvm2/files/
@ 2019-11-28 22:45 Robin H. Johnson
  0 siblings, 0 replies; 29+ messages in thread
From: Robin H. Johnson @ 2019-11-28 22:45 UTC (permalink / raw
  To: gentoo-commits

commit:     0a7dcaff7c920619ffce4c0195223cbd9db02411
Author:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
AuthorDate: Thu Nov 28 22:43:05 2019 +0000
Commit:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Thu Nov 28 22:44:35 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0a7dcaff

sys-fs/lvm2: partial revert of 2161b3a104c9a5664131b9297766db0538e7464e

Bug 690494 shows that the regression is still not fixed in 2.02.186-r2,
so 2.02.145-r2 is still required for some users.

Bug: https://bugs.gentoo.org/show_bug.cgi?id=690494
Package-Manager: Portage-2.3.79, Repoman-2.3.18
Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>

 sys-fs/lvm2/Manifest                               |   3 +
 .../lvm2-2.02.129-static-pkgconfig-libs.patch      | 102 +++++++++
 .../files/lvm2-2.02.130-pthread-pkgconfig.patch    |  32 +++
 .../lvm2-2.02.139-dynamic-static-ldflags.patch     |  63 +++++
 sys-fs/lvm2/files/lvm2-2.02.145-mkdev.patch        | 127 +++++++++++
 sys-fs/lvm2/lvm2-2.02.145-r2.ebuild                | 254 +++++++++++++++++++++
 6 files changed, 581 insertions(+)

diff --git a/sys-fs/lvm2/Manifest b/sys-fs/lvm2/Manifest
index 701f9bc11eb..9b72fb0647e 100644
--- a/sys-fs/lvm2/Manifest
+++ b/sys-fs/lvm2/Manifest
@@ -1,4 +1,7 @@
 DIST LVM2.2.02.116.tgz 1538340 BLAKE2B 718261b60626f2eca5ba13011646bf551523ed8e59aaceceb9097221c000268b7533ac43151ff1d9229911d87e764fbdb29ffa1d305f2aae99220a68e301559a SHA512 992541339637d597257850b4ff7f5348fb7cdcccf806ac8d986a3be1ad1edc5f6bfaedeed5128690c541d1a485cdc75742e90a766363c39867901003518fb84d
+DIST LVM2.2.02.145.tgz 1986370 BLAKE2B 0c9e5efae17f26ff86152cecbf0b11a74e85007b2fa9491f44dec03ac8c11375bacf6685213b4be19037c8fbf70e13549516716ecf8fa262919a44625e6aab34 SHA512 84e28b3efc940837ea9da70fce620744aea0945ba29383b76ad7bcd4b5259b897c714162a8e8b7cfe26ae736a3ad2eca633a3e0df4d6280a32b28bd4cf472d27
+DIST LVM2.2.02.183.tgz 2380574 BLAKE2B b1fe71b6cdb8ee20dd53d0ad3399c553487baafa12657ec81a794c84ad161988afdb8693ac247877a2645d693a0740c74c8b991047ed2ba4adc9ec75f1c261a9 SHA512 3947523c6b0862ada40677ed171ed0cf95e070119e377296fc5ccb153e9c4212d34c0b16a887dbd68ccf265525345dabfed2aa59fb3604555429a7e2ecfff4d7
 DIST LVM2.2.02.184.tgz 2383698 BLAKE2B b6e308d76d541b9461dfcc6e82db256a175ccdabfae9c9d57d84eabd0d5ea50e3e09954b34741903e027412c2c26f72a5005fe934261576337a810738139deb8 SHA512 9db74f675e7c58f663a39afb79b6f33a33ad2cfbda63e9783ef5027f33977b4a1262a2e6754aa67c586eed083ee119a2e837c32a7746dcc53f13877c9d65c390
+DIST LVM2.2.02.185.tgz 2386328 BLAKE2B d2e31de3eedd7518ea2d239cb9b36b38e351d7fc070097a1fc4e7934e3636195da3247fba57d684bb0b31b7f3dbdfe29161bd121b2962b2c35c8c9d7914b4506 SHA512 f421505551aec2a09bc862f2fcc1ee825bc4d94c53a01d13265631e99308d60fbca40112be5bc7824cce3ef223c0775d2f6c345f6a3f227229a0566c903841bf
 DIST LVM2.2.02.186.tgz 2389759 BLAKE2B e094c0135d455386ea5789208899d4dbdd5e78bebf52e49ab5587f881fbc2b94c6accecacf1b4ed182b0c87046402c00a47a1b724795a94fe3ec998b580a77ae SHA512 06a1c00142ee41d8a576a5e06a5beae70baced3020e753ce3b612355cc4d9e33be4acf58569d49436c4ee1118d288d884c7301b7d886074eaf9f2fa6b0248c03
 DIST LVM2.2.03.06.tgz 2453672 BLAKE2B 3d39bef4915ddb15c51011c131afcd2735723fc3e880e01fb863d82ccac0c34b7d71f6a3a126c6bb53fbf2dd923ccf0443e4e02a492fc0660ee1ef168dbb0e79 SHA512 2a01d34fa58348b0fac3d40a9ce736aa499af18c7e9bf96a3eeefc6a2de6a73460c83b6c67be20e9bd440998cbf847bc3e7a028385f38d715e221a5a857d391f

diff --git a/sys-fs/lvm2/files/lvm2-2.02.129-static-pkgconfig-libs.patch b/sys-fs/lvm2/files/lvm2-2.02.129-static-pkgconfig-libs.patch
new file mode 100644
index 00000000000..239694523b3
--- /dev/null
+++ b/sys-fs/lvm2/files/lvm2-2.02.129-static-pkgconfig-libs.patch
@@ -0,0 +1,102 @@
+--- LVM2.2.02.129/configure.in
++++ LVM2.2.02.129/configure.in
+@@ -1287,6 +1287,7 @@
+ 			   fi])
+ 	if test "$BLKID_WIPING" = yes; then
+ 		BLKID_PC="blkid"
++		BLKID_STATIC_LIBS=`$PKG_CONFIG --static --libs $BLKID_PC`
+ 		DEFAULT_USE_BLKID_WIPING=1
+ 		AC_DEFINE([BLKID_WIPING_SUPPORT], 1, [Define to 1 to use libblkid detection of signatures when wiping.])
+ 	else
+@@ -1332,6 +1333,7 @@
+ if test "$UDEV_SYNC" = yes; then
+ 	pkg_config_init
+ 	PKG_CHECK_MODULES(UDEV, libudev >= 143, [UDEV_PC="libudev"])
++	UDEV_STATIC_LIBS=`$PKG_CONFIG --static --libs libudev`
+ 	AC_DEFINE([UDEV_SYNC_SUPPORT], 1, [Define to 1 to enable synchronisation with udev processing.])
+ fi
+ 
+@@ -1558,19 +1560,32 @@
+ if test "$SELINUX" = yes; then
+ 	AC_CHECK_LIB([sepol], [sepol_check_context], [
+ 		AC_DEFINE([HAVE_SEPOL], 1, [Define to 1 if sepol_check_context is available.])
+-		SELINUX_LIBS="-lsepol"])
++		SEPOL_LIBS="-lsepol"])
++
++	dnl -- init pkgconfig if required
++	if  test x$PKGCONFIG_INIT != x1; then
++		pkg_config_init
++	fi
++	PKG_CHECK_MODULES(SELINUX, libselinux, [
++		SELINUX_PC="libselinux"
++		SELINUX_STATIC_LIBS=`$PKG_CONFIG --static --libs libselinux`
++		SELINUX_LIBS="$SELINUX_LIBS $SEPOL_LIBS"
++		AC_DEFINE([HAVE_SELINUX], 1, [Define to 1 to include support for selinux.])
++	],[
++		dnl -- old non-pkgconfig method, is buggy with static builds
+ 
+ 	AC_CHECK_LIB([selinux], [is_selinux_enabled], [
+ 		AC_CHECK_HEADERS([selinux/selinux.h],, hard_bailout)
+ 		AC_CHECK_HEADERS([selinux/label.h])
+ 		AC_DEFINE([HAVE_SELINUX], 1, [Define to 1 to include support for selinux.])
+-		SELINUX_LIBS="-lselinux $SELINUX_LIBS"
++		SELINUX_LIBS="-lselinux $SEPOL_LIBS"
+ 		SELINUX_PC="libselinux"
+ 		HAVE_SELINUX=yes ], [
+ 		AC_MSG_WARN(Disabling selinux)
+ 		SELINUX_LIBS=
+ 		SELINUX_PC=
+ 		HAVE_SELINUX=no ])
++	])
+ fi
+ 
+ ################################################################################
+@@ -1902,6 +1917,7 @@
+ ################################################################################
+ AC_SUBST(APPLIB)
+ AC_SUBST(AWK)
++AC_SUBST(BLKID_STATIC_LIBS)
+ AC_SUBST(BLKID_PC)
+ AC_SUBST(BUILD_CMIRRORD)
+ AC_SUBST(BUILD_DMEVENTD)
+@@ -2005,6 +2021,7 @@
+ AC_SUBST(SALCK_CFLAGS)
+ AC_SUBST(SALCK_LIBS)
+ AC_SUBST(SELINUX_LIBS)
++AC_SUBST(SELINUX_STATIC_LIBS)
+ AC_SUBST(SELINUX_PC)
+ AC_SUBST(SNAPSHOTS)
+ AC_SUBST(STATICDIR)
+@@ -2020,6 +2037,7 @@
+ AC_SUBST(CACHE_DUMP_CMD)
+ AC_SUBST(CACHE_REPAIR_CMD)
+ AC_SUBST(CACHE_RESTORE_CMD)
++AC_SUBST(UDEV_STATIC_LIBS)
+ AC_SUBST(UDEV_PC)
+ AC_SUBST(UDEV_RULES)
+ AC_SUBST(UDEV_SYNC)
+--- LVM2.2.02.129/make.tmpl.in
++++ LVM2.2.02.129/make.tmpl.in
+@@ -43,7 +43,7 @@
+ 
+ LIBS = @LIBS@
+ # Extra libraries always linked with static binaries
+-STATIC_LIBS = $(SELINUX_LIBS) $(UDEV_LIBS) $(BLKID_LIBS)
++STATIC_LIBS = $(SELINUX_STATIC_LIBS) $(UDEV_STATIC_LIBS) $(BLKID_STATIC_LIBS)
+ DEFS += @DEFS@
+ # FIXME set this only where it's needed, not globally?
+ CFLAGS ?= @COPTIMISE_FLAG@ @CFLAGS@
+@@ -58,10 +58,13 @@
+ PTHREAD_LIBS = @PTHREAD_LIBS@
+ READLINE_LIBS = @READLINE_LIBS@
+ SELINUX_LIBS = @SELINUX_LIBS@
++SELINUX_STATIC_LIBS = @SELINUX_STATIC_LIBS@
+ UDEV_CFLAGS = @UDEV_CFLAGS@
+ UDEV_LIBS = @UDEV_LIBS@
++UDEV_STATIC_LIBS = @UDEV_STATIC_LIBS@
+ BLKID_CFLAGS = @BLKID_CFLAGS@
+ BLKID_LIBS = @BLKID_LIBS@
++BLKID_STATIC_LIBS = @BLKID_STATIC_LIBS@
+ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@
+ TESTING = @TESTING@
+ 

diff --git a/sys-fs/lvm2/files/lvm2-2.02.130-pthread-pkgconfig.patch b/sys-fs/lvm2/files/lvm2-2.02.130-pthread-pkgconfig.patch
new file mode 100644
index 00000000000..11db632e2e7
--- /dev/null
+++ b/sys-fs/lvm2/files/lvm2-2.02.130-pthread-pkgconfig.patch
@@ -0,0 +1,32 @@
+Make sure that libdm usage always brings in pthread libraries, both in
+pkgconfig and during manual build.
+
+--- LVM2.2.02.130/libdm/libdevmapper.pc.in
++++ LVM2.2.02.130/libdm/libdevmapper.pc.in
+@@ -9,4 +9,4 @@
+ Cflags: -I${includedir} 
+ Libs: -L${libdir} -ldevmapper
+ Requires.private: @SELINUX_PC@ @UDEV_PC@
+-Libs.private: -lm @RT_LIB@
++Libs.private: -lm @RT_LIB@ @PTHREAD_LIBS@
+--- LVM2.2.02.130/tools/Makefile.in
++++ LVM2.2.02.130/tools/Makefile.in
+@@ -90,6 +90,7 @@
+   INSTALL_LVM_TARGETS += install_tools_static
+   INSTALL_DMSETUP_TARGETS += install_dmsetup_static
+   INSTALL_CMDLIB_TARGETS += install_cmdlib_static
++  STATIC_LIBS += @PTHREAD_LIBS@
+ endif
+ 
+ LVMLIBS = $(LVMINTERNAL_LIBS)
+@@ -120,6 +121,10 @@
+ 
+ include $(top_builddir)/make.tmpl
+ 
++ifeq ("@STATIC_LINK@", "yes")
++  STATIC_LIBS += @PTHREAD_LIBS@
++endif
++
+ device-mapper: $(TARGETS_DM)
+ 
+ CFLAGS_dmsetup.o += $(UDEV_CFLAGS) $(EXTRA_EXEC_CFLAGS)

diff --git a/sys-fs/lvm2/files/lvm2-2.02.139-dynamic-static-ldflags.patch b/sys-fs/lvm2/files/lvm2-2.02.139-dynamic-static-ldflags.patch
new file mode 100644
index 00000000000..312e546e240
--- /dev/null
+++ b/sys-fs/lvm2/files/lvm2-2.02.139-dynamic-static-ldflags.patch
@@ -0,0 +1,63 @@
+diff -ur LVM2.2.02.139_O/configure.in LVM2.2.02.139/configure.in
+--- LVM2.2.02.139_O/configure.in	2016-01-19 12:54:33.155187005 +0000
++++ LVM2.2.02.139/configure.in	2016-01-19 12:56:39.487181372 +0000
+@@ -31,6 +31,7 @@
+ 	linux*)
+ 		CLDFLAGS="$CLDFLAGS -Wl,--version-script,.export.sym"
+ 		ELDFLAGS="-Wl,--export-dynamic"
++		STATIC_LDFLAGS="-Wl,--no-export-dynamic"
+ 		# FIXME Generate list and use --dynamic-list=.dlopen.sym
+ 		CLDWHOLEARCHIVE="-Wl,-whole-archive"
+ 		CLDNOWHOLEARCHIVE="-Wl,-no-whole-archive"
+@@ -2009,6 +2010,7 @@
+ AC_SUBST(SELINUX_PC)
+ AC_SUBST(SNAPSHOTS)
+ AC_SUBST(STATICDIR)
++AC_SUBST(STATIC_LDFLAGS)
+ AC_SUBST(STATIC_LINK)
+ AC_SUBST(TESTING)
+ AC_SUBST(TESTSUITE_DATA)
+diff -ur LVM2.2.02.139_O/daemons/dmeventd/Makefile.in LVM2.2.02.139/daemons/dmeventd/Makefile.in
+--- LVM2.2.02.139_O/daemons/dmeventd/Makefile.in	2016-01-19 12:54:33.278186999 +0000
++++ LVM2.2.02.139/daemons/dmeventd/Makefile.in	2016-01-19 12:57:44.277178484 +0000
+@@ -67,7 +67,7 @@
+ 	$(DL_LIBS) $(LVMLIBS) $(LIBS) -rdynamic
+ 
+ dmeventd.static: $(LIB_STATIC) dmeventd.o $(interfacebuilddir)/libdevmapper.a
+-	$(CC) $(CFLAGS) $(LDFLAGS) $(ELDFLAGS) -static -L. -L$(interfacebuilddir) -o $@ \
++	$(CC) $(CFLAGS) $(LDFLAGS) $(ELDFLAGS) $(STATIC_LDFLAGS) -static -L. -L$(interfacebuilddir) -o $@ \
+ 	dmeventd.o $(DL_LIBS) $(LVMLIBS) $(LIBS) $(STATIC_LIBS)
+ 
+ ifeq ("@PKGCONFIG@", "yes")
+diff -ur LVM2.2.02.139_O/make.tmpl.in LVM2.2.02.139/make.tmpl.in
+--- LVM2.2.02.139_O/make.tmpl.in	2016-01-19 12:54:33.529186988 +0000
++++ LVM2.2.02.139/make.tmpl.in	2016-01-19 12:58:31.514176378 +0000
+@@ -49,6 +49,7 @@
+ # FIXME set this only where it's needed, not globally?
+ CFLAGS ?= @COPTIMISE_FLAG@ @CFLAGS@
+ LDFLAGS ?= @COPTIMISE_FLAG@ @LDFLAGS@
++STATIC_LDFLAGS += @STATIC_LDFLAGS@
+ CLDFLAGS += @CLDFLAGS@
+ ELDFLAGS += @ELDFLAGS@
+ LDDEPS += @LDDEPS@
+diff -ur LVM2.2.02.139_O/tools/Makefile.in LVM2.2.02.139/tools/Makefile.in
+--- LVM2.2.02.139_O/tools/Makefile.in	2016-01-08 18:51:21.000000000 +0000
++++ LVM2.2.02.139/tools/Makefile.in	2016-01-19 13:00:08.349172060 +0000
+@@ -129,7 +129,7 @@
+ 	      -o $@ dmsetup.o -ldevmapper $(LIBS)
+ 
+ dmsetup.static: dmsetup.o $(interfacebuilddir)/libdevmapper.a
+-	$(CC) $(CFLAGS) $(LDFLAGS) -static -L$(interfacebuilddir) \
++	$(CC) $(CFLAGS) $(LDFLAGS) $(STATIC_LDFLAGS) -static -L$(interfacebuilddir) \
+ 	      -o $@ dmsetup.o -ldevmapper $(M_LIBS) $(PTHREAD_LIBS) $(STATIC_LIBS) $(LIBS)
+ 
+ all: device-mapper
+@@ -146,7 +146,7 @@
+ endif
+ 
+ lvm.static: $(OBJECTS) lvm-static.o $(top_builddir)/lib/liblvm-internal.a  $(interfacebuilddir)/libdevmapper.a
+-	$(CC) $(CFLAGS) $(LDFLAGS) -static -L$(interfacebuilddir) -o $@ \
++	$(CC) $(CFLAGS) $(LDFLAGS) $(STATIC_LDFLAGS) -static -L$(interfacebuilddir) -o $@ \
+ 	      $(OBJECTS) lvm-static.o $(LVMLIBS) $(STATIC_LIBS) $(LIBS)
+ 
+ liblvm2cmd.a: $(top_builddir)/lib/liblvm-internal.a $(OBJECTS) lvmcmdlib.o lvm2cmd.o

diff --git a/sys-fs/lvm2/files/lvm2-2.02.145-mkdev.patch b/sys-fs/lvm2/files/lvm2-2.02.145-mkdev.patch
new file mode 100644
index 00000000000..f91dccd5c18
--- /dev/null
+++ b/sys-fs/lvm2/files/lvm2-2.02.145-mkdev.patch
@@ -0,0 +1,127 @@
+https://bugs.gentoo.org/580062
+
+From 2a1d0fa8ea765604cd8274aac5aa7876f1c145c9 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Tue, 19 Apr 2016 23:53:22 -0400
+Subject: [PATCH] convert major/minor/makedev handling
+
+Most of the files in here use MAJOR/MINOR/MKDEV macros, but a few
+missed it.  Update the defines in those files to match them.
+---
+ daemons/cmirrord/functions.c                          | 16 ++++++++++++----
+ daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c | 12 ++++++++++--
+ lib/filters/filter-sysfs.c                            |  6 ++++--
+ 3 files changed, 26 insertions(+), 8 deletions(-)
+
+diff --git a/daemons/cmirrord/functions.c b/daemons/cmirrord/functions.c
+index e9d3c09..5b3cb38 100644
+--- a/daemons/cmirrord/functions.c
++++ b/daemons/cmirrord/functions.c
+@@ -20,6 +20,14 @@
+ #include <time.h>
+ #include <unistd.h>
+ 
++#ifdef __linux__
++#  include "kdev_t.h"
++#else
++#  define MAJOR(x) major((x))
++#  define MINOR(x) minor((x))
++#  define MKDEV(x,y) makedev((x),(y))
++#endif
++
+ #define BYTE_SHIFT 3
+ 
+ /*
+@@ -333,8 +341,8 @@ static int find_disk_path(char *major_minor_str, char *path_rtn, int *unlink_pat
+ 			continue;
+ 		}
+ 		if (S_ISBLK(statbuf.st_mode) &&
+-		    (major(statbuf.st_rdev) == major) &&
+-		    (minor(statbuf.st_rdev) == minor)) {
++		    (MAJOR(statbuf.st_rdev) == major) &&
++		    (MINOR(statbuf.st_rdev) == minor)) {
+ 			LOG_DBG("  %s: YES", dep->d_name);
+ 			if (closedir(dp))
+ 				LOG_DBG("Unable to closedir /dev/mapper %s",
+@@ -1451,7 +1459,7 @@ static int disk_status_info(struct log_c *lc, struct dm_ulog_request *rq)
+ 	}
+ 
+ 	r = sprintf(data, "3 clustered-disk %d:%d %c",
+-		    major(statbuf.st_rdev), minor(statbuf.st_rdev),
++		    MAJOR(statbuf.st_rdev), MINOR(statbuf.st_rdev),
+ 		    (lc->log_dev_failed) ? 'D' : 'A');
+ 	if (r < 0)
+ 		return r;
+@@ -1514,7 +1522,7 @@ static int disk_status_table(struct log_c *lc, struct dm_ulog_request *rq)
+ 	}
+ 
+ 	r = sprintf(data, "clustered-disk %d:%d %u %s%s ",
+-		    major(statbuf.st_rdev), minor(statbuf.st_rdev),
++		    MAJOR(statbuf.st_rdev), MINOR(statbuf.st_rdev),
+ 		    lc->region_size,
+ 		    (lc->sync == DEFAULTSYNC) ? "" :
+ 		    (lc->sync == NOSYNC) ? "nosync " : "sync ",
+diff --git a/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c b/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c
+index 7b060ed..4098203 100644
+--- a/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c
++++ b/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c
+@@ -20,6 +20,14 @@
+ #include <stdarg.h>
+ #include <pthread.h>
+ 
++#ifdef __linux__
++#  include "kdev_t.h"
++#else
++#  define MAJOR(x) major((x))
++#  define MINOR(x) minor((x))
++#  define MKDEV(x,y) makedev((x),(y))
++#endif
++
+ /* First warning when snapshot is 80% full. */
+ #define WARNING_THRESH	(DM_PERCENT_1 * 80)
+ /* Run a check every 5%. */
+@@ -148,8 +156,8 @@ static void _umount(const char *device, int major, int minor)
+ 			continue; /* can't stat, skip this one */
+ 
+ 		if (S_ISBLK(st.st_mode) &&
+-		    major(st.st_rdev) == major &&
+-		    minor(st.st_rdev) == minor) {
++		    MAJOR(st.st_rdev) == major &&
++		    MINOR(st.st_rdev) == minor) {
+ 			log_error("Unmounting invalid snapshot %s from %s.", device, words[1]);
+ 			if (!_run(UMOUNT_COMMAND, "-fl", words[1], NULL))
+ 				log_error("Failed to umount snapshot %s from %s: %s.",
+diff --git a/lib/filters/filter-sysfs.c b/lib/filters/filter-sysfs.c
+index 3115f86..5f76e8b 100644
+--- a/lib/filters/filter-sysfs.c
++++ b/lib/filters/filter-sysfs.c
+@@ -19,6 +19,8 @@
+ 
+ #include <dirent.h>
+ 
++#include "kdev_t.h"
++
+ static int _locate_sysfs_blocks(const char *sysfs_dir, char *path, size_t len,
+ 				unsigned *sysfs_depth)
+ {
+@@ -120,7 +122,7 @@ static struct dev_set *_dev_set_create(struct dm_pool *mem,
+ 
+ static unsigned _hash_dev(dev_t dev)
+ {
+-	return (major(dev) ^ minor(dev)) & (SET_BUCKETS - 1);
++	return (MAJOR(dev) ^ MINOR(dev)) & (SET_BUCKETS - 1);
+ }
+ 
+ /*
+@@ -171,7 +173,7 @@ static int _parse_dev(const char *file, FILE *fp, dev_t *result)
+ 		return 0;
+ 	}
+ 
+-	*result = makedev(major, minor);
++	*result = MKDEV(major, minor);
+ 	return 1;
+ }
+ 
+-- 
+2.7.4
+

diff --git a/sys-fs/lvm2/lvm2-2.02.145-r2.ebuild b/sys-fs/lvm2/lvm2-2.02.145-r2.ebuild
new file mode 100644
index 00000000000..70a95fcb0f7
--- /dev/null
+++ b/sys-fs/lvm2/lvm2-2.02.145-r2.ebuild
@@ -0,0 +1,254 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit autotools eutils linux-info multilib systemd toolchain-funcs udev flag-o-matic
+
+DESCRIPTION="User-land utilities for LVM2 (device-mapper) software"
+HOMEPAGE="https://sourceware.org/lvm2/"
+SRC_URI="ftp://sourceware.org/pub/lvm2/${PN/lvm/LVM}.${PV}.tgz
+	ftp://sourceware.org/pub/lvm2/old/${PN/lvm/LVM}.${PV}.tgz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 ~mips ppc ppc64 s390 ~sh sparc x86 ~amd64-linux ~x86-linux"
+IUSE="readline static static-libs systemd lvm1 lvm2create_initrd selinux +udev +thin device-mapper-only"
+REQUIRED_USE="device-mapper-only? ( !lvm1 !lvm2create_initrd !thin )
+	systemd? ( udev )"
+
+DEPEND_COMMON="
+	readline? ( sys-libs/readline:0= )
+	systemd? ( >=sys-apps/systemd-205:0= )
+	udev? ( >=virtual/libudev-208:=[static-libs(-)?] )"
+# /run is now required for locking during early boot. /var cannot be assumed to
+# be available -- thus, pull in recent enough baselayout for /run.
+# This version of LVM is incompatible with cryptsetup <1.1.2.
+RDEPEND="${DEPEND_COMMON}
+	>=sys-apps/baselayout-2.2
+	!<sys-apps/openrc-0.11
+	!<sys-fs/cryptsetup-1.1.2
+	!!sys-fs/lvm-user
+	>=sys-apps/util-linux-2.16
+	lvm2create_initrd? ( sys-apps/makedev )
+	thin? ( >=sys-block/thin-provisioning-tools-0.3.0 )"
+# note: thin- 0.3.0 is required to avoid --disable-thin_check_needs_check
+# USE 'static' currently only works with eudev, bug 520450
+DEPEND="${DEPEND_COMMON}
+	virtual/pkgconfig
+	>=sys-devel/binutils-2.20.1-r1
+	sys-devel/autoconf-archive
+	static? (
+		selinux? ( sys-libs/libselinux[static-libs] )
+		udev? ( >=sys-fs/eudev-3.1.2[static-libs] )
+		>=sys-apps/util-linux-2.16[static-libs]
+	)"
+
+S=${WORKDIR}/${PN/lvm/LVM}.${PV}
+
+PATCHES=(
+	# Gentoo specific modification(s):
+	"${FILESDIR}"/${PN}-2.02.129-example.conf.in.patch
+
+	# For upstream -- review and forward:
+	"${FILESDIR}"/${PN}-2.02.63-always-make-static-libdm.patch
+	"${FILESDIR}"/${PN}-2.02.56-lvm2create_initrd.patch
+	"${FILESDIR}"/${PN}-2.02.67-createinitrd.patch #301331
+	"${FILESDIR}"/${PN}-2.02.99-locale-muck.patch #330373
+	"${FILESDIR}"/${PN}-2.02.70-asneeded.patch # -Wl,--as-needed
+	"${FILESDIR}"/${PN}-2.02.139-dynamic-static-ldflags.patch #332905
+	"${FILESDIR}"/${PN}-2.02.129-static-pkgconfig-libs.patch #370217, #439414 + blkid
+	"${FILESDIR}"/${PN}-2.02.130-pthread-pkgconfig.patch #492450
+	"${FILESDIR}"/${PN}-2.02.145-mkdev.patch #580062
+)
+
+pkg_setup() {
+	local CONFIG_CHECK="~SYSVIPC"
+
+	if use udev; then
+		local WARNING_SYSVIPC="CONFIG_SYSVIPC:\tis not set (required for udev sync)\n"
+		if linux_config_exists; then
+			local uevent_helper_path=$(linux_chkconfig_string UEVENT_HELPER_PATH)
+			if [ -n "${uevent_helper_path}" ] && [ "${uevent_helper_path}" != '""' ]; then
+				ewarn "It's recommended to set an empty value to the following kernel config option:"
+				ewarn "CONFIG_UEVENT_HELPER_PATH=${uevent_helper_path}"
+			fi
+		fi
+	fi
+
+	check_extra_config
+
+	# 1. Genkernel no longer copies /sbin/lvm blindly.
+	if use static; then
+		elog "Warning, we no longer overwrite /sbin/lvm and /sbin/dmsetup with"
+		elog "their static versions. If you need the static binaries,"
+		elog "you must append .static to the filename!"
+	fi
+}
+
+src_prepare() {
+	default
+
+	sed -i \
+		-e "1iAR = $(tc-getAR)" \
+		-e "s:CC ?= @CC@:CC = $(tc-getCC):" \
+		make.tmpl.in || die #444082
+
+	sed -i -e '/FLAG/s:-O2::' configure{.in,} || die #480212
+
+	if use udev && ! use device-mapper-only; then
+		sed -i -e '/use_lvmetad =/s:0:1:' conf/example.conf.in || die #514196
+		elog "Notice that \"use_lvmetad\" setting is enabled with USE=\"udev\" in"
+		elog "/etc/lvm/lvm.conf, which will require restart of udev, lvm, and lvmetad"
+		elog "if it was previously disabled."
+	fi
+
+	sed -i -e "s:/usr/bin/true:$(type -P true):" scripts/blk_availability_systemd_red_hat.service.in || die #517514
+
+	# Without thin-privision-tools, there is nothing to install for target install_man7:
+	use thin || { sed -i -e '/^install_lvm2/s:install_man7::' man/Makefile.in || die; }
+
+	eautoreconf
+}
+
+src_configure() {
+	filter-flags -flto
+	local myconf=()
+	local buildmode
+
+	myconf+=( $(use_enable !device-mapper-only dmeventd) )
+	myconf+=( $(use_enable !device-mapper-only cmdlib) )
+	myconf+=( $(use_enable !device-mapper-only applib) )
+	myconf+=( $(use_enable !device-mapper-only fsadm) )
+	myconf+=( $(use_enable !device-mapper-only lvmetad) )
+	use device-mapper-only && myconf+=( --disable-udev-systemd-background-jobs )
+
+	# Most of this package does weird stuff.
+	# The build options are tristate, and --without is NOT supported
+	# options: 'none', 'internal', 'shared'
+	if use static; then
+		buildmode="internal"
+		# This only causes the .static versions to become available
+		myconf+=( --enable-static_link )
+	else
+		buildmode="shared"
+	fi
+	dmbuildmode=$(use !device-mapper-only && echo internal || echo none)
+
+	# dmeventd requires mirrors to be internal, and snapshot available
+	# so we cannot disable them
+	myconf+=( --with-mirrors=${dmbuildmode} )
+	myconf+=( --with-snapshots=${dmbuildmode} )
+	if use thin; then
+		myconf+=( --with-thin=internal --with-cache=internal )
+		local texec
+		for texec in check dump repair restore; do
+			myconf+=( --with-thin-${texec}="${EPREFIX}"/sbin/thin_${texec} )
+			myconf+=( --with-cache-${texec}="${EPREFIX}"/sbin/cache_${texec} )
+		done
+	else
+		myconf+=( --with-thin=none --with-cache=none )
+	fi
+
+	if use lvm1; then
+		myconf+=( --with-lvm1=${buildmode} )
+	else
+		myconf+=( --with-lvm1=none )
+	fi
+
+	# disable O_DIRECT support on hppa, breaks pv detection (#99532)
+	use hppa && myconf+=( --disable-o_direct )
+
+	myconf+=( --with-clvmd=none --with-cluster=none )
+
+	econf \
+		$(use_enable readline) \
+		$(use_enable selinux) \
+		--enable-pkgconfig \
+		--with-confdir="${EPREFIX}"/etc \
+		--exec-prefix="${EPREFIX}" \
+		--sbindir="${EPREFIX}/sbin" \
+		--with-staticdir="${EPREFIX}"/sbin \
+		--libdir="${EPREFIX}/$(get_libdir)" \
+		--with-usrlibdir="${EPREFIX}/usr/$(get_libdir)" \
+		--with-default-dm-run-dir=/run \
+		--with-default-run-dir=/run/lvm \
+		--with-default-locking-dir=/run/lock/lvm \
+		--with-default-pid-dir=/run \
+		$(use_enable udev udev_rules) \
+		$(use_enable udev udev_sync) \
+		$(use_with udev udevdir "$(get_udevdir)"/rules.d) \
+		$(use_enable systemd udev-systemd-background-jobs) \
+		--with-systemdsystemunitdir="$(systemd_get_systemunitdir)" \
+		${myconf[@]} \
+		CLDFLAGS="${LDFLAGS}"
+}
+
+src_compile() {
+	pushd include >/dev/null
+	emake
+	popd >/dev/null
+
+	if use device-mapper-only ; then
+		emake device-mapper
+	else
+		emake
+		emake CC="$(tc-getCC)" -C scripts lvm2_activation_generator_systemd_red_hat
+	fi
+}
+
+src_install() {
+	local inst
+	INSTALL_TARGETS="install install_tmpfiles_configuration"
+	# install systemd related files only when requested, bug #522430
+	use systemd && INSTALL_TARGETS="${INSTALL_TARGETS} install_systemd_units install_systemd_generators"
+	use device-mapper-only && INSTALL_TARGETS="install_device-mapper"
+	for inst in ${INSTALL_TARGETS}; do
+		emake DESTDIR="${D}" ${inst}
+	done
+
+	newinitd "${FILESDIR}"/device-mapper.rc-2.02.105-r2 device-mapper
+	newconfd "${FILESDIR}"/device-mapper.conf-1.02.22-r3 device-mapper
+
+	if use !device-mapper-only ; then
+		newinitd "${FILESDIR}"/dmeventd.initd-2.02.67-r1 dmeventd
+		newinitd "${FILESDIR}"/lvm.rc-2.02.116-r6 lvm
+		newconfd "${FILESDIR}"/lvm.confd-2.02.28-r2 lvm
+
+		newinitd "${FILESDIR}"/lvm-monitoring.initd-2.02.105-r2 lvm-monitoring
+		newinitd "${FILESDIR}"/lvmetad.initd-2.02.116-r3 lvmetad
+	fi
+
+	if use static-libs; then
+		dolib.a libdm/ioctl/libdevmapper.a
+		if use !device-mapper-only ; then
+			dolib.a libdaemon/client/libdaemonclient.a #462908
+			dolib.a daemons/dmeventd/libdevmapper-event.a
+		fi
+	else
+		rm -f "${ED}"usr/$(get_libdir)/{libdevmapper-event,liblvm2cmd,liblvm2app,libdevmapper}.a
+	fi
+
+	if use lvm2create_initrd; then
+		dosbin scripts/lvm2create_initrd/lvm2create_initrd
+		doman scripts/lvm2create_initrd/lvm2create_initrd.8
+		newdoc scripts/lvm2create_initrd/README README.lvm2create_initrd
+	fi
+
+	insinto /etc
+	doins "${FILESDIR}"/dmtab
+
+	dodoc README VERSION* WHATS_NEW WHATS_NEW_DM doc/*.{c,txt} conf/*.conf
+}
+
+pkg_postinst() {
+	ewarn "Make sure the \"lvm\" init script is in the runlevels:"
+	ewarn "# rc-update add lvm boot"
+	ewarn
+	ewarn "Make sure to enable lvmetad in /etc/lvm/lvm.conf if you want"
+	ewarn "to enable lvm autoactivation and metadata caching."
+}
+
+src_test() {
+	einfo "Tests are disabled because of device-node mucking, if you want to"
+	einfo "run tests, compile the package and see ${S}/tests"
+}


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-fs/lvm2/, sys-fs/lvm2/files/
@ 2020-03-26 20:24 Lars Wendler
  0 siblings, 0 replies; 29+ messages in thread
From: Lars Wendler @ 2020-03-26 20:24 UTC (permalink / raw
  To: gentoo-commits

commit:     9dc859090c6d45ef63d059138984aca4295f06b6
Author:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
AuthorDate: Thu Mar 26 20:23:50 2020 +0000
Commit:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
CommitDate: Thu Mar 26 20:24:02 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9dc85909

sys-fs/lvm2: Removed old

Package-Manager: Portage-2.3.96, Repoman-2.3.22
Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>

 sys-fs/lvm2/Manifest                               |   2 -
 sys-fs/lvm2/files/dmeventd.initd-2.02.67-r1        |  25 --
 sys-fs/lvm2/files/lvm.confd-2.02.28-r2             |   5 -
 sys-fs/lvm2/files/lvm.rc-2.02.105-r2               |  96 --------
 .../files/lvm2-2.02.106-pthread-pkgconfig.patch    |  32 ---
 .../lvm2/files/lvm2-2.02.108-example.conf.in.patch |  50 ----
 .../lvm2-2.02.108-static-pkgconfig-libs.patch      | 104 ---------
 .../lvm2/files/lvm2-2.02.129-example.conf.in.patch |  52 -----
 .../lvm2-2.02.129-static-pkgconfig-libs.patch      | 102 ---------
 .../files/lvm2-2.02.130-pthread-pkgconfig.patch    |  32 ---
 .../lvm2-2.02.139-dynamic-static-ldflags.patch     |  63 -----
 sys-fs/lvm2/files/lvm2-2.02.145-mkdev.patch        | 127 -----------
 sys-fs/lvm2/files/lvm2-2.02.70-asneeded.patch      |  15 --
 sys-fs/lvm2/files/lvmetad.initd-2.02.105-r2        |  12 -
 sys-fs/lvm2/lvm2-2.02.116.ebuild                   | 243 --------------------
 sys-fs/lvm2/lvm2-2.02.145-r2.ebuild                | 254 ---------------------
 sys-fs/lvm2/metadata.xml                           |   1 -
 17 files changed, 1215 deletions(-)

diff --git a/sys-fs/lvm2/Manifest b/sys-fs/lvm2/Manifest
index d3185d0649c..70cf42f7af5 100644
--- a/sys-fs/lvm2/Manifest
+++ b/sys-fs/lvm2/Manifest
@@ -1,5 +1,3 @@
-DIST LVM2.2.02.116.tgz 1538340 BLAKE2B 718261b60626f2eca5ba13011646bf551523ed8e59aaceceb9097221c000268b7533ac43151ff1d9229911d87e764fbdb29ffa1d305f2aae99220a68e301559a SHA512 992541339637d597257850b4ff7f5348fb7cdcccf806ac8d986a3be1ad1edc5f6bfaedeed5128690c541d1a485cdc75742e90a766363c39867901003518fb84d
-DIST LVM2.2.02.145.tgz 1986370 BLAKE2B 0c9e5efae17f26ff86152cecbf0b11a74e85007b2fa9491f44dec03ac8c11375bacf6685213b4be19037c8fbf70e13549516716ecf8fa262919a44625e6aab34 SHA512 84e28b3efc940837ea9da70fce620744aea0945ba29383b76ad7bcd4b5259b897c714162a8e8b7cfe26ae736a3ad2eca633a3e0df4d6280a32b28bd4cf472d27
 DIST LVM2.2.02.184.tgz 2383698 BLAKE2B b6e308d76d541b9461dfcc6e82db256a175ccdabfae9c9d57d84eabd0d5ea50e3e09954b34741903e027412c2c26f72a5005fe934261576337a810738139deb8 SHA512 9db74f675e7c58f663a39afb79b6f33a33ad2cfbda63e9783ef5027f33977b4a1262a2e6754aa67c586eed083ee119a2e837c32a7746dcc53f13877c9d65c390
 DIST LVM2.2.02.186.tgz 2389759 BLAKE2B e094c0135d455386ea5789208899d4dbdd5e78bebf52e49ab5587f881fbc2b94c6accecacf1b4ed182b0c87046402c00a47a1b724795a94fe3ec998b580a77ae SHA512 06a1c00142ee41d8a576a5e06a5beae70baced3020e753ce3b612355cc4d9e33be4acf58569d49436c4ee1118d288d884c7301b7d886074eaf9f2fa6b0248c03
 DIST LVM2.2.02.187.tgz 2405544 BLAKE2B be804be3c64927a8848e8ea8de228fb563b6f8c22628b785aabb33fc993629e5370788216bd814246aeb3a5546fd5446383ce24342e716579887556edf2bbed2 SHA512 3ce56f0c0d2e7dbcdae5be263199f73ee5c4c052599d53cde9b16500a326d0340893344f4671839be06b5b4225d592175d01c9974db14f2dc220d6e9a1d47e91

diff --git a/sys-fs/lvm2/files/dmeventd.initd-2.02.67-r1 b/sys-fs/lvm2/files/dmeventd.initd-2.02.67-r1
deleted file mode 100644
index f77996caa57..00000000000
--- a/sys-fs/lvm2/files/dmeventd.initd-2.02.67-r1
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/sbin/openrc-run
-# Copyright 1999-2019 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-PIDFILE=/run/dmeventd.pid
-BIN=/sbin/dmeventd
-
-depend() {
-	# As of .67-r1, we call ALL lvm start/stop scripts with --sysinit, that
-	# means dmeventd is NOT notified, as it cannot be safely running
-	after lvm device-mapper
-}
-
-start() {
-	ebegin "Starting dmeventd"
-	start-stop-daemon --start --exec $BIN --pidfile $PIDFILE
-	eend $?
-}
-
-stop() {
-	ebegin "Stopping dmeventd"
-	start-stop-daemon --stop --exec $BIN --pidfile $PIDFILE
-	eend $?
-}
-

diff --git a/sys-fs/lvm2/files/lvm.confd-2.02.28-r2 b/sys-fs/lvm2/files/lvm.confd-2.02.28-r2
deleted file mode 100644
index 2fbd8668c37..00000000000
--- a/sys-fs/lvm2/files/lvm.confd-2.02.28-r2
+++ /dev/null
@@ -1,5 +0,0 @@
-# LVM should normally only be started after mdraid is available
-# this is because LVM physical volumes are very often MD devices.
-RC_AFTER="mdraid"
-
-# vim: ft=gentoo-conf-d

diff --git a/sys-fs/lvm2/files/lvm.rc-2.02.105-r2 b/sys-fs/lvm2/files/lvm.rc-2.02.105-r2
deleted file mode 100644
index 937db047d19..00000000000
--- a/sys-fs/lvm2/files/lvm.rc-2.02.105-r2
+++ /dev/null
@@ -1,96 +0,0 @@
-#!/sbin/openrc-run
-# Copyright 1999-2019 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-depend() {
-	before checkfs fsck
-	after modules device-mapper
-	need lvmetad sysfs
-}
-
-config='global { locking_dir = "/run/lock/lvm" }'
-
-dm_in_proc() {
-	local retval=0
-	for x in devices misc ; do
-		grep -qs 'device-mapper' /proc/${x}
-		retval=$((${retval} + $?))
-	done
-	return ${retval}
-}
-
-start() {
-	# LVM support for /usr, /home, /opt ....
-	# This should be done *before* checking local
-	# volumes, or they never get checked.
-	
-	# NOTE: Add needed modules for LVM or RAID, etc
-	#       to /etc/modules.autoload if needed
-	for lvm_path in /bin/lvm /sbin/lvm ; do
-		[ -x "$lvm_path" ] && break
-	done
-	if [ ! -x "$lvm_path" ]; then
-		eerror "Cannot find lvm binary in /sbin or /bin!"
-		return 1
-	fi
-	if [ -z "${CDBOOT}" ] ; then
-		if [ -e /proc/modules ] && ! dm_in_proc ; then
-			modprobe dm-mod 2>/dev/null
-		fi
-		if [ -d /proc/lvm ] || dm_in_proc ; then
-			ebegin "Setting up the Logical Volume Manager"
-			#still echo stderr for debugging
-			lvm_commands="#! ${lvm_path} --config '${config}'\n"
-			# Extra PV find pass because some devices might not have been available until very recently
-			lvm_commands="${lvm_commands}pvscan\n"
-			# Now make the nodes
-			lvm_commands="${lvm_commands}vgscan --mknodes\n"
-			# And turn them on!
-			lvm_commands="${lvm_commands}vgchange --sysinit -a ly\n"
-			# Order of this is important, have to work around dash and LVM readline
-			printf "%b\n" "${lvm_commands}" | $lvm_path /proc/self/fd/0 --config "${config}" >/dev/null
-			eend $? "Failed to setup the LVM"
-		fi
-	fi
-}
-
-stop() {
-	for lvm_path in /bin/lvm /sbin/lvm ; do
-		[ -x "$lvm_path" ] && break
-	done
-	if [ ! -x "$lvm_path" ]; then
-		eerror "Cannot find lvm binary in /sbin or /bin!"
-		return 1
-	fi
-# Stop LVM2
-if [ -x /sbin/vgs ] && \
-   [ -x /sbin/vgchange ] && \
-   [ -x /sbin/lvchange ] && \
-   [ -f /etc/lvmtab -o -d /etc/lvm ] && \
-   [ -d /proc/lvm  -o "`grep device-mapper /proc/misc 2>/dev/null`" ]
-then
-	einfo "Shutting down the Logical Volume Manager"
-	
-
-        VGS=$($lvm_path vgs --config "${config}" -o vg_name --noheadings --nosuffix --rows 2> /dev/null)
-
-        if [ "$VGS" ]
-        then
-            ebegin "  Shutting Down LVs & VGs"
-			#still echo stderr for debugging
-			lvm_commands="#! ${lvm_path} --config '${config}'\n"
-			# Extra PV find pass because some devices might not have been available until very recently
-			lvm_commands="${lvm_commands}lvchange --sysinit -a ln ${VGS}\n"
-			# Now make the nodes
-			lvm_commands="${lvm_commands}vgchange --sysinit -a ln ${VGS}\n"
-			# Order of this is important, have to work around dash and LVM readline
-			printf "%b\n" "${lvm_commands}" | $lvm_path /proc/self/fd/0 --config "${config}" >/dev/null
-			eend $? "Failed (possibly some LVs still needed for /usr or root)"
-        fi
-
-	einfo "Finished shutting down the Logical Volume Manager"
-	return 0
-fi
-}
-
-# vim:ts=4

diff --git a/sys-fs/lvm2/files/lvm2-2.02.106-pthread-pkgconfig.patch b/sys-fs/lvm2/files/lvm2-2.02.106-pthread-pkgconfig.patch
deleted file mode 100644
index 594d6061725..00000000000
--- a/sys-fs/lvm2/files/lvm2-2.02.106-pthread-pkgconfig.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-Make sure that libdm usage always brings in pthread libraries, both in
-pkgconfig and during manual build.
-
---- tools/Makefile.in
-+++ tools/Makefile.in
-@@ -87,6 +87,7 @@
-   INSTALL_LVM_TARGETS += install_tools_static
-   INSTALL_DMSETUP_TARGETS += install_dmsetup_static
-   INSTALL_CMDLIB_TARGETS += install_cmdlib_static
-+  STATIC_LIBS += @PTHREAD_LIBS@
- endif
- 
- LVMLIBS = $(LVMINTERNAL_LIBS)
-@@ -118,6 +119,10 @@
- 
- include $(top_builddir)/make.tmpl
- 
-+ifeq ("@STATIC_LINK@", "yes")
-+  STATIC_LIBS += @PTHREAD_LIBS@
-+endif
-+
- device-mapper: $(TARGETS_DM)
- 
- CFLAGS_dmsetup.o += $(UDEV_CFLAGS) $(EXTRA_EXEC_CFLAGS)
---- libdm/libdevmapper.pc.in
-+++ libdm/libdevmapper.pc.in
-@@ -8,4 +8,5 @@
- Version: @DM_LIB_PATCHLEVEL@
- Cflags: -I${includedir} 
- Libs: -L${libdir} -ldevmapper
-+Libs.private: -L${libdir} @PTHREAD_LIBS@
- Requires.private: @SELINUX_PC@ @UDEV_PC@

diff --git a/sys-fs/lvm2/files/lvm2-2.02.108-example.conf.in.patch b/sys-fs/lvm2/files/lvm2-2.02.108-example.conf.in.patch
deleted file mode 100644
index af5a5afe258..00000000000
--- a/sys-fs/lvm2/files/lvm2-2.02.108-example.conf.in.patch
+++ /dev/null
@@ -1,50 +0,0 @@
-Maintainer note: Forward ported without editing from lvm2-2.02.99-example.conf.in.patch to apply cleanly.
-
---- conf/example.conf.in
-+++ conf/example.conf.in
-@@ -105,6 +105,10 @@
-     # By default we accept every block device:
-     # filter = [ "a/.*/" ]
- 
-+    # Gentoo: we exclude /dev/nbd by default, because it makes a lot of kernel
-+    # noise when you probed while not available.
-+    filter = [ "r|/dev/nbd.*|", "a/.*/" ]
-+
-     # Exclude the cdrom drive
-     # filter = [ "r|/dev/cdrom|" ]
- 
-@@ -522,7 +526,8 @@
-     # e.g. vgscan.lvm1 and they will stop working after you start using
-     # the new lvm2 on-disk metadata format.
-     # The default value is set when the tools are built.
--    # fallback_to_lvm1 = 0
-+    # Gentoo: the LVM tools are a seperate package.
-+    fallback_to_lvm1 = 0
- 
-     # The default metadata format that commands should use - "lvm1" or "lvm2".
-     # The command line override is -M1 or -M2.
-@@ -1182,12 +1187,13 @@
- 
- # Metadata settings
- #
--# metadata {
-+metadata {
-     # Default number of copies of metadata to hold on each PV.  0, 1 or 2.
-     # You might want to override it from the command line with 0 
-     # when running pvcreate on new PVs which are to be added to large VGs.
- 
--    # pvmetadatacopies = 1
-+    # Gentoo: enable for data safety, but PV resize is then disabled.
-+    # pvmetadatacopies = 2
- 
-     # Default number of copies of metadata to maintain for each VG.
-     # If set to a non-zero value, LVM automatically chooses which of
-@@ -1222,7 +1228,7 @@
-     # the supplied toolset to make changes (e.g. vgcfgrestore).
- 
-     # dirs = [ "/etc/lvm/metadata", "/mnt/disk2/lvm/metadata2" ]
--#}
-+}
- 
- # Event daemon
- #

diff --git a/sys-fs/lvm2/files/lvm2-2.02.108-static-pkgconfig-libs.patch b/sys-fs/lvm2/files/lvm2-2.02.108-static-pkgconfig-libs.patch
deleted file mode 100644
index 3ab699868a5..00000000000
--- a/sys-fs/lvm2/files/lvm2-2.02.108-static-pkgconfig-libs.patch
+++ /dev/null
@@ -1,104 +0,0 @@
-Maintainer note: Forward ported without editing from lvm2-2.02.107-static-pkgconfig-libs.patch to apply cleanly.
-
---- configure.in
-+++ configure.in
-@@ -1067,6 +1067,7 @@
- 			   fi])
- 	if test "$BLKID_WIPING" = yes; then
- 		BLKID_PC="blkid"
-+		BLKID_STATIC_LIBS=`$PKG_CONFIG --static --libs $BLKID_PC`
- 		AC_DEFINE([BLKID_WIPING_SUPPORT], 1, [Define to 1 to use libblkid detection of signatures when wiping.])
- 	fi
- fi
-@@ -1092,6 +1093,7 @@
- if test "$UDEV_SYNC" = yes; then
- 	pkg_config_init
- 	PKG_CHECK_MODULES(UDEV, libudev >= 143, [UDEV_PC="libudev"])
-+	UDEV_STATIC_LIBS=`$PKG_CONFIG --static --libs libudev`
- 	AC_DEFINE([UDEV_SYNC_SUPPORT], 1, [Define to 1 to enable synchronisation with udev processing.])
- fi
- 
-@@ -1312,19 +1314,32 @@
- if test "$SELINUX" = yes; then
- 	AC_CHECK_LIB([sepol], [sepol_check_context], [
- 		AC_DEFINE([HAVE_SEPOL], 1, [Define to 1 if sepol_check_context is available.])
--		SELINUX_LIBS="-lsepol"])
-+		SEPOL_LIBS="-lsepol"])
-+
-+	dnl -- init pkgconfig if required
-+	if  test x$PKGCONFIG_INIT != x1; then
-+		pkg_config_init
-+	fi
-+	PKG_CHECK_MODULES(SELINUX, libselinux, [
-+		SELINUX_PC="libselinux"
-+		SELINUX_STATIC_LIBS=`$PKG_CONFIG --static --libs libselinux`
-+		SELINUX_LIBS="$SELINUX_LIBS $SEPOL_LIBS"
-+		AC_DEFINE([HAVE_SELINUX], 1, [Define to 1 to include support for selinux.])
-+	],[
-+		dnl -- old non-pkgconfig method, is buggy with static builds
- 
- 	AC_CHECK_LIB([selinux], [is_selinux_enabled], [
- 		AC_CHECK_HEADERS([selinux/selinux.h],, hard_bailout)
- 		AC_CHECK_HEADERS([selinux/label.h])
- 		AC_DEFINE([HAVE_SELINUX], 1, [Define to 1 to include support for selinux.])
--		SELINUX_LIBS="-lselinux $SELINUX_LIBS"
-+		SELINUX_LIBS="-lselinux $SEPOL_LIBS"
- 		SELINUX_PC="libselinux"
- 		HAVE_SELINUX=yes ], [
- 		AC_MSG_WARN(Disabling selinux)
- 		SELINUX_LIBS=
- 		SELINUX_PC=
- 		HAVE_SELINUX=no ])
-+	])
- fi
- 
- ################################################################################
-@@ -1626,6 +1641,7 @@
- ################################################################################
- AC_SUBST(APPLIB)
- AC_SUBST(AWK)
-+AC_SUBST(BLKID_STATIC_LIBS)
- AC_SUBST(BLKID_PC)
- AC_SUBST(BLKID_WIPING)
- AC_SUBST(BUILD_CMIRRORD)
-@@ -1721,6 +1737,7 @@
- AC_SUBST(SALCK_CFLAGS)
- AC_SUBST(SALCK_LIBS)
- AC_SUBST(SELINUX_LIBS)
-+AC_SUBST(SELINUX_STATIC_LIBS)
- AC_SUBST(SELINUX_PC)
- AC_SUBST(SNAPSHOTS)
- AC_SUBST(STATICDIR)
-@@ -1735,6 +1752,7 @@
- AC_SUBST(CACHE_DUMP_CMD)
- AC_SUBST(CACHE_REPAIR_CMD)
- AC_SUBST(CACHE_RESTORE_CMD)
-+AC_SUBST(UDEV_STATIC_LIBS)
- AC_SUBST(UDEV_PC)
- AC_SUBST(UDEV_RULES)
- AC_SUBST(UDEV_SYNC)
---- make.tmpl.in
-+++ make.tmpl.in
-@@ -43,7 +43,7 @@
- 
- LIBS = @LIBS@
- # Extra libraries always linked with static binaries
--STATIC_LIBS = $(SELINUX_LIBS) $(UDEV_LIBS) $(BLKID_LIBS)
-+STATIC_LIBS = $(SELINUX_STATIC_LIBS) $(UDEV_STATIC_LIBS) $(BLKID_STATIC_LIBS)
- DEFS += @DEFS@
- # FIXME set this only where it's needed, not globally?
- CFLAGS += @CFLAGS@
-@@ -57,10 +57,13 @@
- PTHREAD_LIBS = @PTHREAD_LIBS@
- READLINE_LIBS = @READLINE_LIBS@
- SELINUX_LIBS = @SELINUX_LIBS@
-+SELINUX_STATIC_LIBS = @SELINUX_STATIC_LIBS@
- UDEV_CFLAGS = @UDEV_CFLAGS@
- UDEV_LIBS = @UDEV_LIBS@
-+UDEV_STATIC_LIBS = @UDEV_STATIC_LIBS@
- BLKID_CFLAGS = @BLKID_CFLAGS@
- BLKID_LIBS = @BLKID_LIBS@
-+BLKID_STATIC_LIBS = @BLKID_STATIC_LIBS@
- TESTING = @TESTING@
- 
- # Setup directory variables

diff --git a/sys-fs/lvm2/files/lvm2-2.02.129-example.conf.in.patch b/sys-fs/lvm2/files/lvm2-2.02.129-example.conf.in.patch
deleted file mode 100644
index 076e06080ca..00000000000
--- a/sys-fs/lvm2/files/lvm2-2.02.129-example.conf.in.patch
+++ /dev/null
@@ -1,52 +0,0 @@
-Maintainer note: Forward ported without editing from lvm2-2.02.108-example.conf.in.patch to apply cleanly.
-
---- LVM2.2.02.129/conf/example.conf.in
-+++ LVM2.2.02.129/conf/example.conf.in
-@@ -128,6 +128,9 @@
- 	# Example
- 	# Accept every block device:
- 	# filter = [ "a|.*/|" ]
-+	# Gentoo: we exclude /dev/nbd by default, because it makes a lot of kernel
-+	# noise when you probed while not available.
-+	filter = [ "r|/dev/nbd.*|", "a/.*/" ]
- 	# Reject the cdrom drive:
- 	# filter = [ "r|/dev/cdrom|" ]
- 	# Work with just loopback devices, e.g. for testing:
-@@ -620,7 +623,8 @@
- 	# tools need to be installed with .lvm1 suffices, e.g. vgscan.lvm1.
- 	# They will stop working once the lvm2 on-disk metadata format is used.
- 	# This configuration option has an automatic default value.
--	# fallback_to_lvm1 = @DEFAULT_FALLBACK_TO_LVM1@
-+	# Gentoo: the LVM tools are a seperate package.
-+	fallback_to_lvm1 = 0
- 
- 	# Configuration option global/format.
- 	# The default metadata format that commands should use.
-@@ -1413,7 +1417,7 @@
- 
- # Configuration section metadata.
- # This configuration section has an automatic default value.
--# metadata {
-+metadata {
- 
- 	# Configuration option metadata/pvmetadatacopies.
- 	# Number of copies of metadata to store on each PV.
-@@ -1431,7 +1435,8 @@
- 	# 
- 	# This configuration option is advanced.
- 	# This configuration option has an automatic default value.
--	# pvmetadatacopies = 1
-+	# Gentoo: enable for data safety, but PV resize is then disabled.
-+	# pvmetadatacopies = 2
- 
- 	# Configuration option metadata/vgmetadatacopies.
- 	# Number of copies of metadata to maintain for each VG.
-@@ -1486,7 +1491,7 @@
- 	# 
- 	# This configuration option is advanced.
- 	# This configuration option does not have a default value defined.
--# }
-+}
- 
- # Configuration section report.
- # LVM report command output formatting.

diff --git a/sys-fs/lvm2/files/lvm2-2.02.129-static-pkgconfig-libs.patch b/sys-fs/lvm2/files/lvm2-2.02.129-static-pkgconfig-libs.patch
deleted file mode 100644
index 239694523b3..00000000000
--- a/sys-fs/lvm2/files/lvm2-2.02.129-static-pkgconfig-libs.patch
+++ /dev/null
@@ -1,102 +0,0 @@
---- LVM2.2.02.129/configure.in
-+++ LVM2.2.02.129/configure.in
-@@ -1287,6 +1287,7 @@
- 			   fi])
- 	if test "$BLKID_WIPING" = yes; then
- 		BLKID_PC="blkid"
-+		BLKID_STATIC_LIBS=`$PKG_CONFIG --static --libs $BLKID_PC`
- 		DEFAULT_USE_BLKID_WIPING=1
- 		AC_DEFINE([BLKID_WIPING_SUPPORT], 1, [Define to 1 to use libblkid detection of signatures when wiping.])
- 	else
-@@ -1332,6 +1333,7 @@
- if test "$UDEV_SYNC" = yes; then
- 	pkg_config_init
- 	PKG_CHECK_MODULES(UDEV, libudev >= 143, [UDEV_PC="libudev"])
-+	UDEV_STATIC_LIBS=`$PKG_CONFIG --static --libs libudev`
- 	AC_DEFINE([UDEV_SYNC_SUPPORT], 1, [Define to 1 to enable synchronisation with udev processing.])
- fi
- 
-@@ -1558,19 +1560,32 @@
- if test "$SELINUX" = yes; then
- 	AC_CHECK_LIB([sepol], [sepol_check_context], [
- 		AC_DEFINE([HAVE_SEPOL], 1, [Define to 1 if sepol_check_context is available.])
--		SELINUX_LIBS="-lsepol"])
-+		SEPOL_LIBS="-lsepol"])
-+
-+	dnl -- init pkgconfig if required
-+	if  test x$PKGCONFIG_INIT != x1; then
-+		pkg_config_init
-+	fi
-+	PKG_CHECK_MODULES(SELINUX, libselinux, [
-+		SELINUX_PC="libselinux"
-+		SELINUX_STATIC_LIBS=`$PKG_CONFIG --static --libs libselinux`
-+		SELINUX_LIBS="$SELINUX_LIBS $SEPOL_LIBS"
-+		AC_DEFINE([HAVE_SELINUX], 1, [Define to 1 to include support for selinux.])
-+	],[
-+		dnl -- old non-pkgconfig method, is buggy with static builds
- 
- 	AC_CHECK_LIB([selinux], [is_selinux_enabled], [
- 		AC_CHECK_HEADERS([selinux/selinux.h],, hard_bailout)
- 		AC_CHECK_HEADERS([selinux/label.h])
- 		AC_DEFINE([HAVE_SELINUX], 1, [Define to 1 to include support for selinux.])
--		SELINUX_LIBS="-lselinux $SELINUX_LIBS"
-+		SELINUX_LIBS="-lselinux $SEPOL_LIBS"
- 		SELINUX_PC="libselinux"
- 		HAVE_SELINUX=yes ], [
- 		AC_MSG_WARN(Disabling selinux)
- 		SELINUX_LIBS=
- 		SELINUX_PC=
- 		HAVE_SELINUX=no ])
-+	])
- fi
- 
- ################################################################################
-@@ -1902,6 +1917,7 @@
- ################################################################################
- AC_SUBST(APPLIB)
- AC_SUBST(AWK)
-+AC_SUBST(BLKID_STATIC_LIBS)
- AC_SUBST(BLKID_PC)
- AC_SUBST(BUILD_CMIRRORD)
- AC_SUBST(BUILD_DMEVENTD)
-@@ -2005,6 +2021,7 @@
- AC_SUBST(SALCK_CFLAGS)
- AC_SUBST(SALCK_LIBS)
- AC_SUBST(SELINUX_LIBS)
-+AC_SUBST(SELINUX_STATIC_LIBS)
- AC_SUBST(SELINUX_PC)
- AC_SUBST(SNAPSHOTS)
- AC_SUBST(STATICDIR)
-@@ -2020,6 +2037,7 @@
- AC_SUBST(CACHE_DUMP_CMD)
- AC_SUBST(CACHE_REPAIR_CMD)
- AC_SUBST(CACHE_RESTORE_CMD)
-+AC_SUBST(UDEV_STATIC_LIBS)
- AC_SUBST(UDEV_PC)
- AC_SUBST(UDEV_RULES)
- AC_SUBST(UDEV_SYNC)
---- LVM2.2.02.129/make.tmpl.in
-+++ LVM2.2.02.129/make.tmpl.in
-@@ -43,7 +43,7 @@
- 
- LIBS = @LIBS@
- # Extra libraries always linked with static binaries
--STATIC_LIBS = $(SELINUX_LIBS) $(UDEV_LIBS) $(BLKID_LIBS)
-+STATIC_LIBS = $(SELINUX_STATIC_LIBS) $(UDEV_STATIC_LIBS) $(BLKID_STATIC_LIBS)
- DEFS += @DEFS@
- # FIXME set this only where it's needed, not globally?
- CFLAGS ?= @COPTIMISE_FLAG@ @CFLAGS@
-@@ -58,10 +58,13 @@
- PTHREAD_LIBS = @PTHREAD_LIBS@
- READLINE_LIBS = @READLINE_LIBS@
- SELINUX_LIBS = @SELINUX_LIBS@
-+SELINUX_STATIC_LIBS = @SELINUX_STATIC_LIBS@
- UDEV_CFLAGS = @UDEV_CFLAGS@
- UDEV_LIBS = @UDEV_LIBS@
-+UDEV_STATIC_LIBS = @UDEV_STATIC_LIBS@
- BLKID_CFLAGS = @BLKID_CFLAGS@
- BLKID_LIBS = @BLKID_LIBS@
-+BLKID_STATIC_LIBS = @BLKID_STATIC_LIBS@
- VALGRIND_CFLAGS = @VALGRIND_CFLAGS@
- TESTING = @TESTING@
- 

diff --git a/sys-fs/lvm2/files/lvm2-2.02.130-pthread-pkgconfig.patch b/sys-fs/lvm2/files/lvm2-2.02.130-pthread-pkgconfig.patch
deleted file mode 100644
index 11db632e2e7..00000000000
--- a/sys-fs/lvm2/files/lvm2-2.02.130-pthread-pkgconfig.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-Make sure that libdm usage always brings in pthread libraries, both in
-pkgconfig and during manual build.
-
---- LVM2.2.02.130/libdm/libdevmapper.pc.in
-+++ LVM2.2.02.130/libdm/libdevmapper.pc.in
-@@ -9,4 +9,4 @@
- Cflags: -I${includedir} 
- Libs: -L${libdir} -ldevmapper
- Requires.private: @SELINUX_PC@ @UDEV_PC@
--Libs.private: -lm @RT_LIB@
-+Libs.private: -lm @RT_LIB@ @PTHREAD_LIBS@
---- LVM2.2.02.130/tools/Makefile.in
-+++ LVM2.2.02.130/tools/Makefile.in
-@@ -90,6 +90,7 @@
-   INSTALL_LVM_TARGETS += install_tools_static
-   INSTALL_DMSETUP_TARGETS += install_dmsetup_static
-   INSTALL_CMDLIB_TARGETS += install_cmdlib_static
-+  STATIC_LIBS += @PTHREAD_LIBS@
- endif
- 
- LVMLIBS = $(LVMINTERNAL_LIBS)
-@@ -120,6 +121,10 @@
- 
- include $(top_builddir)/make.tmpl
- 
-+ifeq ("@STATIC_LINK@", "yes")
-+  STATIC_LIBS += @PTHREAD_LIBS@
-+endif
-+
- device-mapper: $(TARGETS_DM)
- 
- CFLAGS_dmsetup.o += $(UDEV_CFLAGS) $(EXTRA_EXEC_CFLAGS)

diff --git a/sys-fs/lvm2/files/lvm2-2.02.139-dynamic-static-ldflags.patch b/sys-fs/lvm2/files/lvm2-2.02.139-dynamic-static-ldflags.patch
deleted file mode 100644
index 312e546e240..00000000000
--- a/sys-fs/lvm2/files/lvm2-2.02.139-dynamic-static-ldflags.patch
+++ /dev/null
@@ -1,63 +0,0 @@
-diff -ur LVM2.2.02.139_O/configure.in LVM2.2.02.139/configure.in
---- LVM2.2.02.139_O/configure.in	2016-01-19 12:54:33.155187005 +0000
-+++ LVM2.2.02.139/configure.in	2016-01-19 12:56:39.487181372 +0000
-@@ -31,6 +31,7 @@
- 	linux*)
- 		CLDFLAGS="$CLDFLAGS -Wl,--version-script,.export.sym"
- 		ELDFLAGS="-Wl,--export-dynamic"
-+		STATIC_LDFLAGS="-Wl,--no-export-dynamic"
- 		# FIXME Generate list and use --dynamic-list=.dlopen.sym
- 		CLDWHOLEARCHIVE="-Wl,-whole-archive"
- 		CLDNOWHOLEARCHIVE="-Wl,-no-whole-archive"
-@@ -2009,6 +2010,7 @@
- AC_SUBST(SELINUX_PC)
- AC_SUBST(SNAPSHOTS)
- AC_SUBST(STATICDIR)
-+AC_SUBST(STATIC_LDFLAGS)
- AC_SUBST(STATIC_LINK)
- AC_SUBST(TESTING)
- AC_SUBST(TESTSUITE_DATA)
-diff -ur LVM2.2.02.139_O/daemons/dmeventd/Makefile.in LVM2.2.02.139/daemons/dmeventd/Makefile.in
---- LVM2.2.02.139_O/daemons/dmeventd/Makefile.in	2016-01-19 12:54:33.278186999 +0000
-+++ LVM2.2.02.139/daemons/dmeventd/Makefile.in	2016-01-19 12:57:44.277178484 +0000
-@@ -67,7 +67,7 @@
- 	$(DL_LIBS) $(LVMLIBS) $(LIBS) -rdynamic
- 
- dmeventd.static: $(LIB_STATIC) dmeventd.o $(interfacebuilddir)/libdevmapper.a
--	$(CC) $(CFLAGS) $(LDFLAGS) $(ELDFLAGS) -static -L. -L$(interfacebuilddir) -o $@ \
-+	$(CC) $(CFLAGS) $(LDFLAGS) $(ELDFLAGS) $(STATIC_LDFLAGS) -static -L. -L$(interfacebuilddir) -o $@ \
- 	dmeventd.o $(DL_LIBS) $(LVMLIBS) $(LIBS) $(STATIC_LIBS)
- 
- ifeq ("@PKGCONFIG@", "yes")
-diff -ur LVM2.2.02.139_O/make.tmpl.in LVM2.2.02.139/make.tmpl.in
---- LVM2.2.02.139_O/make.tmpl.in	2016-01-19 12:54:33.529186988 +0000
-+++ LVM2.2.02.139/make.tmpl.in	2016-01-19 12:58:31.514176378 +0000
-@@ -49,6 +49,7 @@
- # FIXME set this only where it's needed, not globally?
- CFLAGS ?= @COPTIMISE_FLAG@ @CFLAGS@
- LDFLAGS ?= @COPTIMISE_FLAG@ @LDFLAGS@
-+STATIC_LDFLAGS += @STATIC_LDFLAGS@
- CLDFLAGS += @CLDFLAGS@
- ELDFLAGS += @ELDFLAGS@
- LDDEPS += @LDDEPS@
-diff -ur LVM2.2.02.139_O/tools/Makefile.in LVM2.2.02.139/tools/Makefile.in
---- LVM2.2.02.139_O/tools/Makefile.in	2016-01-08 18:51:21.000000000 +0000
-+++ LVM2.2.02.139/tools/Makefile.in	2016-01-19 13:00:08.349172060 +0000
-@@ -129,7 +129,7 @@
- 	      -o $@ dmsetup.o -ldevmapper $(LIBS)
- 
- dmsetup.static: dmsetup.o $(interfacebuilddir)/libdevmapper.a
--	$(CC) $(CFLAGS) $(LDFLAGS) -static -L$(interfacebuilddir) \
-+	$(CC) $(CFLAGS) $(LDFLAGS) $(STATIC_LDFLAGS) -static -L$(interfacebuilddir) \
- 	      -o $@ dmsetup.o -ldevmapper $(M_LIBS) $(PTHREAD_LIBS) $(STATIC_LIBS) $(LIBS)
- 
- all: device-mapper
-@@ -146,7 +146,7 @@
- endif
- 
- lvm.static: $(OBJECTS) lvm-static.o $(top_builddir)/lib/liblvm-internal.a  $(interfacebuilddir)/libdevmapper.a
--	$(CC) $(CFLAGS) $(LDFLAGS) -static -L$(interfacebuilddir) -o $@ \
-+	$(CC) $(CFLAGS) $(LDFLAGS) $(STATIC_LDFLAGS) -static -L$(interfacebuilddir) -o $@ \
- 	      $(OBJECTS) lvm-static.o $(LVMLIBS) $(STATIC_LIBS) $(LIBS)
- 
- liblvm2cmd.a: $(top_builddir)/lib/liblvm-internal.a $(OBJECTS) lvmcmdlib.o lvm2cmd.o

diff --git a/sys-fs/lvm2/files/lvm2-2.02.145-mkdev.patch b/sys-fs/lvm2/files/lvm2-2.02.145-mkdev.patch
deleted file mode 100644
index f91dccd5c18..00000000000
--- a/sys-fs/lvm2/files/lvm2-2.02.145-mkdev.patch
+++ /dev/null
@@ -1,127 +0,0 @@
-https://bugs.gentoo.org/580062
-
-From 2a1d0fa8ea765604cd8274aac5aa7876f1c145c9 Mon Sep 17 00:00:00 2001
-From: Mike Frysinger <vapier@gentoo.org>
-Date: Tue, 19 Apr 2016 23:53:22 -0400
-Subject: [PATCH] convert major/minor/makedev handling
-
-Most of the files in here use MAJOR/MINOR/MKDEV macros, but a few
-missed it.  Update the defines in those files to match them.
----
- daemons/cmirrord/functions.c                          | 16 ++++++++++++----
- daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c | 12 ++++++++++--
- lib/filters/filter-sysfs.c                            |  6 ++++--
- 3 files changed, 26 insertions(+), 8 deletions(-)
-
-diff --git a/daemons/cmirrord/functions.c b/daemons/cmirrord/functions.c
-index e9d3c09..5b3cb38 100644
---- a/daemons/cmirrord/functions.c
-+++ b/daemons/cmirrord/functions.c
-@@ -20,6 +20,14 @@
- #include <time.h>
- #include <unistd.h>
- 
-+#ifdef __linux__
-+#  include "kdev_t.h"
-+#else
-+#  define MAJOR(x) major((x))
-+#  define MINOR(x) minor((x))
-+#  define MKDEV(x,y) makedev((x),(y))
-+#endif
-+
- #define BYTE_SHIFT 3
- 
- /*
-@@ -333,8 +341,8 @@ static int find_disk_path(char *major_minor_str, char *path_rtn, int *unlink_pat
- 			continue;
- 		}
- 		if (S_ISBLK(statbuf.st_mode) &&
--		    (major(statbuf.st_rdev) == major) &&
--		    (minor(statbuf.st_rdev) == minor)) {
-+		    (MAJOR(statbuf.st_rdev) == major) &&
-+		    (MINOR(statbuf.st_rdev) == minor)) {
- 			LOG_DBG("  %s: YES", dep->d_name);
- 			if (closedir(dp))
- 				LOG_DBG("Unable to closedir /dev/mapper %s",
-@@ -1451,7 +1459,7 @@ static int disk_status_info(struct log_c *lc, struct dm_ulog_request *rq)
- 	}
- 
- 	r = sprintf(data, "3 clustered-disk %d:%d %c",
--		    major(statbuf.st_rdev), minor(statbuf.st_rdev),
-+		    MAJOR(statbuf.st_rdev), MINOR(statbuf.st_rdev),
- 		    (lc->log_dev_failed) ? 'D' : 'A');
- 	if (r < 0)
- 		return r;
-@@ -1514,7 +1522,7 @@ static int disk_status_table(struct log_c *lc, struct dm_ulog_request *rq)
- 	}
- 
- 	r = sprintf(data, "clustered-disk %d:%d %u %s%s ",
--		    major(statbuf.st_rdev), minor(statbuf.st_rdev),
-+		    MAJOR(statbuf.st_rdev), MINOR(statbuf.st_rdev),
- 		    lc->region_size,
- 		    (lc->sync == DEFAULTSYNC) ? "" :
- 		    (lc->sync == NOSYNC) ? "nosync " : "sync ",
-diff --git a/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c b/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c
-index 7b060ed..4098203 100644
---- a/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c
-+++ b/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c
-@@ -20,6 +20,14 @@
- #include <stdarg.h>
- #include <pthread.h>
- 
-+#ifdef __linux__
-+#  include "kdev_t.h"
-+#else
-+#  define MAJOR(x) major((x))
-+#  define MINOR(x) minor((x))
-+#  define MKDEV(x,y) makedev((x),(y))
-+#endif
-+
- /* First warning when snapshot is 80% full. */
- #define WARNING_THRESH	(DM_PERCENT_1 * 80)
- /* Run a check every 5%. */
-@@ -148,8 +156,8 @@ static void _umount(const char *device, int major, int minor)
- 			continue; /* can't stat, skip this one */
- 
- 		if (S_ISBLK(st.st_mode) &&
--		    major(st.st_rdev) == major &&
--		    minor(st.st_rdev) == minor) {
-+		    MAJOR(st.st_rdev) == major &&
-+		    MINOR(st.st_rdev) == minor) {
- 			log_error("Unmounting invalid snapshot %s from %s.", device, words[1]);
- 			if (!_run(UMOUNT_COMMAND, "-fl", words[1], NULL))
- 				log_error("Failed to umount snapshot %s from %s: %s.",
-diff --git a/lib/filters/filter-sysfs.c b/lib/filters/filter-sysfs.c
-index 3115f86..5f76e8b 100644
---- a/lib/filters/filter-sysfs.c
-+++ b/lib/filters/filter-sysfs.c
-@@ -19,6 +19,8 @@
- 
- #include <dirent.h>
- 
-+#include "kdev_t.h"
-+
- static int _locate_sysfs_blocks(const char *sysfs_dir, char *path, size_t len,
- 				unsigned *sysfs_depth)
- {
-@@ -120,7 +122,7 @@ static struct dev_set *_dev_set_create(struct dm_pool *mem,
- 
- static unsigned _hash_dev(dev_t dev)
- {
--	return (major(dev) ^ minor(dev)) & (SET_BUCKETS - 1);
-+	return (MAJOR(dev) ^ MINOR(dev)) & (SET_BUCKETS - 1);
- }
- 
- /*
-@@ -171,7 +173,7 @@ static int _parse_dev(const char *file, FILE *fp, dev_t *result)
- 		return 0;
- 	}
- 
--	*result = makedev(major, minor);
-+	*result = MKDEV(major, minor);
- 	return 1;
- }
- 
--- 
-2.7.4
-

diff --git a/sys-fs/lvm2/files/lvm2-2.02.70-asneeded.patch b/sys-fs/lvm2/files/lvm2-2.02.70-asneeded.patch
deleted file mode 100644
index 1bae0db10c1..00000000000
--- a/sys-fs/lvm2/files/lvm2-2.02.70-asneeded.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-http://bugs.gentoo.org/330255
-
-liblvm2app.so: undefined reference to `floor'
-
---- LVM2/liblvm/Makefile.in
-+++ LVM2/liblvm/Makefile.in
-@@ -39,7 +39,7 @@
- 
- include $(top_builddir)/make.tmpl
- 
--LIBS += $(LVMINTERNAL_LIBS) -ldevmapper
-+LIBS += $(LVMINTERNAL_LIBS) -ldevmapper -lm
- 
- ifeq ("@DMEVENTD@", "yes")
-   LIBS += -ldevmapper-event

diff --git a/sys-fs/lvm2/files/lvmetad.initd-2.02.105-r2 b/sys-fs/lvm2/files/lvmetad.initd-2.02.105-r2
deleted file mode 100644
index 565f49c7c42..00000000000
--- a/sys-fs/lvm2/files/lvmetad.initd-2.02.105-r2
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/sbin/openrc-run
-# Copyright 1999-2019 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-pidfile="/run/lvmetad.pid"
-command="/sbin/lvmetad"
-command_args="${LVMETAD_OPTS:=-p ${pidfile}}"
-start_stop_daemon_args="--pidfile ${pidfile}"
-
-depend() {
-	:
-}

diff --git a/sys-fs/lvm2/lvm2-2.02.116.ebuild b/sys-fs/lvm2/lvm2-2.02.116.ebuild
deleted file mode 100644
index 725a5c7c841..00000000000
--- a/sys-fs/lvm2/lvm2-2.02.116.ebuild
+++ /dev/null
@@ -1,243 +0,0 @@
-# Copyright 1999-2020 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=5
-inherit autotools eutils linux-info multilib systemd toolchain-funcs udev flag-o-matic
-
-DESCRIPTION="User-land utilities for LVM2 (device-mapper) software"
-HOMEPAGE="https://sourceware.org/lvm2/"
-SRC_URI="ftp://sourceware.org/pub/lvm2/${PN/lvm/LVM}.${PV}.tgz
-	ftp://sourceware.org/pub/lvm2/old/${PN/lvm/LVM}.${PV}.tgz"
-
-LICENSE="GPL-2"
-SLOT="0"
-KEYWORDS="~alpha amd64 arm arm64 hppa ia64 ~mips ppc ppc64 s390 sparc x86 ~amd64-linux ~x86-linux"
-IUSE="readline static static-libs systemd lvm1 lvm2create_initrd selinux +udev +thin device-mapper-only"
-REQUIRED_USE="device-mapper-only? ( !lvm1 !lvm2create_initrd !thin )
-	systemd? ( udev )
-	static? ( !udev !systemd )" #520450
-
-DEPEND_COMMON="
-	readline? ( sys-libs/readline:0= )
-	udev? ( >=virtual/libudev-208:=[static-libs(-)?] )"
-# /run is now required for locking during early boot. /var cannot be assumed to
-# be available -- thus, pull in recent enough baselayout for /run.
-# This version of LVM is incompatible with cryptsetup <1.1.2.
-RDEPEND="${DEPEND_COMMON}
-	>=sys-apps/baselayout-2.2
-	!<sys-apps/openrc-0.11
-	!<sys-fs/cryptsetup-1.1.2
-	!!sys-fs/lvm-user
-	>=sys-apps/util-linux-2.16
-	lvm2create_initrd? ( sys-apps/makedev )
-	thin? ( >=sys-block/thin-provisioning-tools-0.3.0 )"
-# note: thin- 0.3.0 is required to avoid --disable-thin_check_needs_check
-DEPEND="${DEPEND_COMMON}
-	virtual/pkgconfig
-	>=sys-devel/binutils-2.20.1-r1
-	static? (
-		selinux? ( sys-libs/libselinux[static-libs] )
-		udev? ( >=virtual/libudev-208:=[static-libs] )
-		>=sys-apps/util-linux-2.16[static-libs]
-	)"
-
-S=${WORKDIR}/${PN/lvm/LVM}.${PV}
-
-pkg_setup() {
-	local CONFIG_CHECK="~SYSVIPC"
-
-	if use udev; then
-		local WARNING_SYSVIPC="CONFIG_SYSVIPC:\tis not set (required for udev sync)\n"
-		if linux_config_exists; then
-			local uevent_helper_path=$(linux_chkconfig_string UEVENT_HELPER_PATH)
-			if [ -n "${uevent_helper_path}" ] && [ "${uevent_helper_path}" != '""' ]; then
-				ewarn "It's recommended to set an empty value to the following kernel config option:"
-				ewarn "CONFIG_UEVENT_HELPER_PATH=${uevent_helper_path}"
-			fi
-		fi
-	fi
-
-	check_extra_config
-
-	# 1. Genkernel no longer copies /sbin/lvm blindly.
-	if use static; then
-		elog "Warning, we no longer overwrite /sbin/lvm and /sbin/dmsetup with"
-		elog "their static versions. If you need the static binaries,"
-		elog "you must append .static to the filename!"
-	fi
-}
-
-src_prepare() {
-	# Gentoo specific modification(s):
-	epatch "${FILESDIR}"/${PN}-2.02.108-example.conf.in.patch
-
-	sed -i \
-		-e "1iAR = $(tc-getAR)" \
-		-e "s:CC ?= @CC@:CC = $(tc-getCC):" \
-		make.tmpl.in || die #444082
-
-	sed -i -e '/FLAG/s:-O2::' configure{.in,} || die #480212
-
-	if use udev && ! use device-mapper-only; then
-		sed -i -e '/use_lvmetad =/s:0:1:' conf/example.conf.in || die #514196
-		elog "Notice that \"use_lvmetad\" setting is enabled with USE=\"udev\" in"
-		elog "/etc/lvm/lvm.conf, which will require restart of udev, lvm, and lvmetad"
-		elog "if it was previously disabled."
-	fi
-
-	sed -i -e "s:/usr/bin/true:$(type -P true):" scripts/blk_availability_systemd_red_hat.service.in || die #517514
-
-	# For upstream -- review and forward:
-	epatch "${FILESDIR}"/${PN}-2.02.63-always-make-static-libdm.patch
-	epatch "${FILESDIR}"/${PN}-2.02.56-lvm2create_initrd.patch
-	epatch "${FILESDIR}"/${PN}-2.02.67-createinitrd.patch #301331
-	epatch "${FILESDIR}"/${PN}-2.02.99-locale-muck.patch #330373
-	epatch "${FILESDIR}"/${PN}-2.02.70-asneeded.patch # -Wl,--as-needed
-	epatch "${FILESDIR}"/${PN}-2.02.92-dynamic-static-ldflags.patch #332905
-	epatch "${FILESDIR}"/${PN}-2.02.108-static-pkgconfig-libs.patch #370217, #439414 + blkid
-	epatch "${FILESDIR}"/${PN}-2.02.106-pthread-pkgconfig.patch #492450
-
-	# Without thin-privision-tools, there is nothing to install for target install_man7:
-	use thin || { sed -i -e '/^install_lvm2/s:install_man7::' man/Makefile.in || die; }
-
-	eautoreconf
-}
-
-src_configure() {
-	filter-flags -flto
-	local myconf
-	local buildmode
-
-	myconf="${myconf} $(use_enable !device-mapper-only dmeventd)"
-	myconf="${myconf} $(use_enable !device-mapper-only cmdlib)"
-	myconf="${myconf} $(use_enable !device-mapper-only applib)"
-	myconf="${myconf} $(use_enable !device-mapper-only fsadm)"
-	myconf="${myconf} $(use_enable !device-mapper-only lvmetad)"
-	use device-mapper-only && myconf="${myconf} --disable-udev-systemd-background-jobs"
-
-	# Most of this package does weird stuff.
-	# The build options are tristate, and --without is NOT supported
-	# options: 'none', 'internal', 'shared'
-	if use static; then
-		buildmode="internal"
-		# This only causes the .static versions to become available
-		myconf="${myconf} --enable-static_link"
-	else
-		buildmode="shared"
-	fi
-	dmbuildmode=$(use !device-mapper-only && echo internal || echo none)
-
-	# dmeventd requires mirrors to be internal, and snapshot available
-	# so we cannot disable them
-	myconf="${myconf} --with-mirrors=${dmbuildmode}"
-	myconf="${myconf} --with-snapshots=${dmbuildmode}"
-	if use thin; then
-		myconf="${myconf} --with-thin=internal --with-cache=internal"
-		local texec
-		for texec in check dump repair restore; do
-			myconf="${myconf} --with-thin-${texec}=${EPREFIX}/sbin/thin_${texec}"
-			myconf="${myconf} --with-cache-${texec}=${EPREFIX}/sbin/cache_${texec}"
-		done
-	else
-		myconf="${myconf} --with-thin=none --with-cache=none"
-	fi
-
-	if use lvm1; then
-		myconf="${myconf} --with-lvm1=${buildmode}"
-	else
-		myconf="${myconf} --with-lvm1=none"
-	fi
-
-	# disable O_DIRECT support on hppa, breaks pv detection (#99532)
-	use hppa && myconf="${myconf} --disable-o_direct"
-
-	myconf="${myconf} --with-clvmd=none --with-cluster=none"
-
-	econf \
-		$(use_enable readline) \
-		$(use_enable selinux) \
-		--enable-pkgconfig \
-		--with-confdir="${EPREFIX}"/etc \
-		--exec-prefix="${EPREFIX}" \
-		--sbindir="${EPREFIX}/sbin" \
-		--with-staticdir="${EPREFIX}"/sbin \
-		--libdir="${EPREFIX}/$(get_libdir)" \
-		--with-usrlibdir="${EPREFIX}/usr/$(get_libdir)" \
-		--with-default-dm-run-dir=/run \
-		--with-default-run-dir=/run/lvm \
-		--with-default-locking-dir=/run/lock/lvm \
-		--with-default-pid-dir=/run \
-		$(use_enable udev udev_rules) \
-		$(use_enable udev udev_sync) \
-		$(use_with udev udevdir "$(get_udevdir)"/rules.d) \
-		$(use_enable systemd udev-systemd-background-jobs) \
-		"$(systemd_with_unitdir)" \
-		${myconf} \
-		CLDFLAGS="${LDFLAGS}"
-}
-
-src_compile() {
-	pushd include >/dev/null
-	emake
-	popd >/dev/null
-
-	if use device-mapper-only ; then
-		emake device-mapper
-	else
-		emake
-		emake CC="$(tc-getCC)" -C scripts lvm2_activation_generator_systemd_red_hat
-	fi
-}
-
-src_install() {
-	local inst
-	INSTALL_TARGETS="install install_systemd_units install_systemd_generators install_tmpfiles_configuration"
-	use device-mapper-only && INSTALL_TARGETS="install_device-mapper"
-	for inst in ${INSTALL_TARGETS}; do
-		emake DESTDIR="${D}" ${inst}
-	done
-
-	newinitd "${FILESDIR}"/device-mapper.rc-2.02.105-r2 device-mapper
-	newconfd "${FILESDIR}"/device-mapper.conf-1.02.22-r3 device-mapper
-
-	if use !device-mapper-only ; then
-		newinitd "${FILESDIR}"/dmeventd.initd-2.02.67-r1 dmeventd
-		newinitd "${FILESDIR}"/lvm.rc-2.02.105-r2 lvm
-		newconfd "${FILESDIR}"/lvm.confd-2.02.28-r2 lvm
-
-		newinitd "${FILESDIR}"/lvm-monitoring.initd-2.02.105-r2 lvm-monitoring
-		newinitd "${FILESDIR}"/lvmetad.initd-2.02.105-r2 lvmetad
-	fi
-
-	if use static-libs; then
-		dolib.a libdm/ioctl/libdevmapper.a
-		dolib.a libdaemon/client/libdaemonclient.a #462908
-		dolib.a daemons/dmeventd/libdevmapper-event.a
-	else
-		rm -f "${ED}"usr/$(get_libdir)/{libdevmapper-event,liblvm2cmd,liblvm2app,libdevmapper}.a
-	fi
-
-	if use lvm2create_initrd; then
-		dosbin scripts/lvm2create_initrd/lvm2create_initrd
-		doman scripts/lvm2create_initrd/lvm2create_initrd.8
-		newdoc scripts/lvm2create_initrd/README README.lvm2create_initrd
-	fi
-
-	insinto /etc
-	doins "${FILESDIR}"/dmtab
-
-	dodoc README VERSION* WHATS_NEW WHATS_NEW_DM doc/*.{c,txt} conf/*.conf
-}
-
-pkg_postinst() {
-	ewarn "Make sure the \"lvm\" init script is in the runlevels:"
-	ewarn "# rc-update add lvm boot"
-	ewarn
-	ewarn "Make sure to enable lvmetad in /etc/lvm/lvm.conf if you want"
-	ewarn "to enable lvm autoactivation and metadata caching."
-}
-
-src_test() {
-	einfo "Tests are disabled because of device-node mucking, if you want to"
-	einfo "run tests, compile the package and see ${S}/tests"
-}

diff --git a/sys-fs/lvm2/lvm2-2.02.145-r2.ebuild b/sys-fs/lvm2/lvm2-2.02.145-r2.ebuild
deleted file mode 100644
index 10963e70c3d..00000000000
--- a/sys-fs/lvm2/lvm2-2.02.145-r2.ebuild
+++ /dev/null
@@ -1,254 +0,0 @@
-# Copyright 1999-2020 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-inherit autotools eutils linux-info multilib systemd toolchain-funcs udev flag-o-matic
-
-DESCRIPTION="User-land utilities for LVM2 (device-mapper) software"
-HOMEPAGE="https://sourceware.org/lvm2/"
-SRC_URI="ftp://sourceware.org/pub/lvm2/${PN/lvm/LVM}.${PV}.tgz
-	ftp://sourceware.org/pub/lvm2/old/${PN/lvm/LVM}.${PV}.tgz"
-
-LICENSE="GPL-2"
-SLOT="0"
-KEYWORDS="~alpha amd64 arm arm64 hppa ia64 ~mips ppc ppc64 s390 sparc x86 ~amd64-linux ~x86-linux"
-IUSE="readline static static-libs systemd lvm1 lvm2create_initrd selinux +udev +thin device-mapper-only"
-REQUIRED_USE="device-mapper-only? ( !lvm1 !lvm2create_initrd !thin )
-	systemd? ( udev )"
-
-DEPEND_COMMON="
-	readline? ( sys-libs/readline:0= )
-	systemd? ( >=sys-apps/systemd-205:0= )
-	udev? ( >=virtual/libudev-208:=[static-libs(-)?] )"
-# /run is now required for locking during early boot. /var cannot be assumed to
-# be available -- thus, pull in recent enough baselayout for /run.
-# This version of LVM is incompatible with cryptsetup <1.1.2.
-RDEPEND="${DEPEND_COMMON}
-	>=sys-apps/baselayout-2.2
-	!<sys-apps/openrc-0.11
-	!<sys-fs/cryptsetup-1.1.2
-	!!sys-fs/lvm-user
-	>=sys-apps/util-linux-2.16
-	lvm2create_initrd? ( sys-apps/makedev )
-	thin? ( >=sys-block/thin-provisioning-tools-0.3.0 )"
-# note: thin- 0.3.0 is required to avoid --disable-thin_check_needs_check
-# USE 'static' currently only works with eudev, bug 520450
-DEPEND="${DEPEND_COMMON}
-	virtual/pkgconfig
-	>=sys-devel/binutils-2.20.1-r1
-	sys-devel/autoconf-archive
-	static? (
-		selinux? ( sys-libs/libselinux[static-libs] )
-		udev? ( >=sys-fs/eudev-3.1.2[static-libs] )
-		>=sys-apps/util-linux-2.16[static-libs]
-	)"
-
-S=${WORKDIR}/${PN/lvm/LVM}.${PV}
-
-PATCHES=(
-	# Gentoo specific modification(s):
-	"${FILESDIR}"/${PN}-2.02.129-example.conf.in.patch
-
-	# For upstream -- review and forward:
-	"${FILESDIR}"/${PN}-2.02.63-always-make-static-libdm.patch
-	"${FILESDIR}"/${PN}-2.02.56-lvm2create_initrd.patch
-	"${FILESDIR}"/${PN}-2.02.67-createinitrd.patch #301331
-	"${FILESDIR}"/${PN}-2.02.99-locale-muck.patch #330373
-	"${FILESDIR}"/${PN}-2.02.70-asneeded.patch # -Wl,--as-needed
-	"${FILESDIR}"/${PN}-2.02.139-dynamic-static-ldflags.patch #332905
-	"${FILESDIR}"/${PN}-2.02.129-static-pkgconfig-libs.patch #370217, #439414 + blkid
-	"${FILESDIR}"/${PN}-2.02.130-pthread-pkgconfig.patch #492450
-	"${FILESDIR}"/${PN}-2.02.145-mkdev.patch #580062
-)
-
-pkg_setup() {
-	local CONFIG_CHECK="~SYSVIPC"
-
-	if use udev; then
-		local WARNING_SYSVIPC="CONFIG_SYSVIPC:\tis not set (required for udev sync)\n"
-		if linux_config_exists; then
-			local uevent_helper_path=$(linux_chkconfig_string UEVENT_HELPER_PATH)
-			if [ -n "${uevent_helper_path}" ] && [ "${uevent_helper_path}" != '""' ]; then
-				ewarn "It's recommended to set an empty value to the following kernel config option:"
-				ewarn "CONFIG_UEVENT_HELPER_PATH=${uevent_helper_path}"
-			fi
-		fi
-	fi
-
-	check_extra_config
-
-	# 1. Genkernel no longer copies /sbin/lvm blindly.
-	if use static; then
-		elog "Warning, we no longer overwrite /sbin/lvm and /sbin/dmsetup with"
-		elog "their static versions. If you need the static binaries,"
-		elog "you must append .static to the filename!"
-	fi
-}
-
-src_prepare() {
-	default
-
-	sed -i \
-		-e "1iAR = $(tc-getAR)" \
-		-e "s:CC ?= @CC@:CC = $(tc-getCC):" \
-		make.tmpl.in || die #444082
-
-	sed -i -e '/FLAG/s:-O2::' configure{.in,} || die #480212
-
-	if use udev && ! use device-mapper-only; then
-		sed -i -e '/use_lvmetad =/s:0:1:' conf/example.conf.in || die #514196
-		elog "Notice that \"use_lvmetad\" setting is enabled with USE=\"udev\" in"
-		elog "/etc/lvm/lvm.conf, which will require restart of udev, lvm, and lvmetad"
-		elog "if it was previously disabled."
-	fi
-
-	sed -i -e "s:/usr/bin/true:$(type -P true):" scripts/blk_availability_systemd_red_hat.service.in || die #517514
-
-	# Without thin-privision-tools, there is nothing to install for target install_man7:
-	use thin || { sed -i -e '/^install_lvm2/s:install_man7::' man/Makefile.in || die; }
-
-	eautoreconf
-}
-
-src_configure() {
-	filter-flags -flto
-	local myconf=()
-	local buildmode
-
-	myconf+=( $(use_enable !device-mapper-only dmeventd) )
-	myconf+=( $(use_enable !device-mapper-only cmdlib) )
-	myconf+=( $(use_enable !device-mapper-only applib) )
-	myconf+=( $(use_enable !device-mapper-only fsadm) )
-	myconf+=( $(use_enable !device-mapper-only lvmetad) )
-	use device-mapper-only && myconf+=( --disable-udev-systemd-background-jobs )
-
-	# Most of this package does weird stuff.
-	# The build options are tristate, and --without is NOT supported
-	# options: 'none', 'internal', 'shared'
-	if use static; then
-		buildmode="internal"
-		# This only causes the .static versions to become available
-		myconf+=( --enable-static_link )
-	else
-		buildmode="shared"
-	fi
-	dmbuildmode=$(use !device-mapper-only && echo internal || echo none)
-
-	# dmeventd requires mirrors to be internal, and snapshot available
-	# so we cannot disable them
-	myconf+=( --with-mirrors=${dmbuildmode} )
-	myconf+=( --with-snapshots=${dmbuildmode} )
-	if use thin; then
-		myconf+=( --with-thin=internal --with-cache=internal )
-		local texec
-		for texec in check dump repair restore; do
-			myconf+=( --with-thin-${texec}="${EPREFIX}"/sbin/thin_${texec} )
-			myconf+=( --with-cache-${texec}="${EPREFIX}"/sbin/cache_${texec} )
-		done
-	else
-		myconf+=( --with-thin=none --with-cache=none )
-	fi
-
-	if use lvm1; then
-		myconf+=( --with-lvm1=${buildmode} )
-	else
-		myconf+=( --with-lvm1=none )
-	fi
-
-	# disable O_DIRECT support on hppa, breaks pv detection (#99532)
-	use hppa && myconf+=( --disable-o_direct )
-
-	myconf+=( --with-clvmd=none --with-cluster=none )
-
-	econf \
-		$(use_enable readline) \
-		$(use_enable selinux) \
-		--enable-pkgconfig \
-		--with-confdir="${EPREFIX}"/etc \
-		--exec-prefix="${EPREFIX}" \
-		--sbindir="${EPREFIX}/sbin" \
-		--with-staticdir="${EPREFIX}"/sbin \
-		--libdir="${EPREFIX}/$(get_libdir)" \
-		--with-usrlibdir="${EPREFIX}/usr/$(get_libdir)" \
-		--with-default-dm-run-dir=/run \
-		--with-default-run-dir=/run/lvm \
-		--with-default-locking-dir=/run/lock/lvm \
-		--with-default-pid-dir=/run \
-		$(use_enable udev udev_rules) \
-		$(use_enable udev udev_sync) \
-		$(use_with udev udevdir "$(get_udevdir)"/rules.d) \
-		$(use_enable systemd udev-systemd-background-jobs) \
-		--with-systemdsystemunitdir="$(systemd_get_systemunitdir)" \
-		${myconf[@]} \
-		CLDFLAGS="${LDFLAGS}"
-}
-
-src_compile() {
-	pushd include >/dev/null
-	emake
-	popd >/dev/null
-
-	if use device-mapper-only ; then
-		emake device-mapper
-	else
-		emake
-		emake CC="$(tc-getCC)" -C scripts lvm2_activation_generator_systemd_red_hat
-	fi
-}
-
-src_install() {
-	local inst
-	INSTALL_TARGETS="install install_tmpfiles_configuration"
-	# install systemd related files only when requested, bug #522430
-	use systemd && INSTALL_TARGETS="${INSTALL_TARGETS} install_systemd_units install_systemd_generators"
-	use device-mapper-only && INSTALL_TARGETS="install_device-mapper"
-	for inst in ${INSTALL_TARGETS}; do
-		emake DESTDIR="${D}" ${inst}
-	done
-
-	newinitd "${FILESDIR}"/device-mapper.rc-2.02.105-r2 device-mapper
-	newconfd "${FILESDIR}"/device-mapper.conf-1.02.22-r3 device-mapper
-
-	if use !device-mapper-only ; then
-		newinitd "${FILESDIR}"/dmeventd.initd-2.02.67-r1 dmeventd
-		newinitd "${FILESDIR}"/lvm.rc-2.02.116-r6 lvm
-		newconfd "${FILESDIR}"/lvm.confd-2.02.28-r2 lvm
-
-		newinitd "${FILESDIR}"/lvm-monitoring.initd-2.02.105-r2 lvm-monitoring
-		newinitd "${FILESDIR}"/lvmetad.initd-2.02.116-r3 lvmetad
-	fi
-
-	if use static-libs; then
-		dolib.a libdm/ioctl/libdevmapper.a
-		if use !device-mapper-only ; then
-			dolib.a libdaemon/client/libdaemonclient.a #462908
-			dolib.a daemons/dmeventd/libdevmapper-event.a
-		fi
-	else
-		rm -f "${ED}"usr/$(get_libdir)/{libdevmapper-event,liblvm2cmd,liblvm2app,libdevmapper}.a
-	fi
-
-	if use lvm2create_initrd; then
-		dosbin scripts/lvm2create_initrd/lvm2create_initrd
-		doman scripts/lvm2create_initrd/lvm2create_initrd.8
-		newdoc scripts/lvm2create_initrd/README README.lvm2create_initrd
-	fi
-
-	insinto /etc
-	doins "${FILESDIR}"/dmtab
-
-	dodoc README VERSION* WHATS_NEW WHATS_NEW_DM doc/*.{c,txt} conf/*.conf
-}
-
-pkg_postinst() {
-	ewarn "Make sure the \"lvm\" init script is in the runlevels:"
-	ewarn "# rc-update add lvm boot"
-	ewarn
-	ewarn "Make sure to enable lvmetad in /etc/lvm/lvm.conf if you want"
-	ewarn "to enable lvm autoactivation and metadata caching."
-}
-
-src_test() {
-	einfo "Tests are disabled because of device-node mucking, if you want to"
-	einfo "run tests, compile the package and see ${S}/tests"
-}

diff --git a/sys-fs/lvm2/metadata.xml b/sys-fs/lvm2/metadata.xml
index 019c533da75..0761d9dca00 100644
--- a/sys-fs/lvm2/metadata.xml
+++ b/sys-fs/lvm2/metadata.xml
@@ -16,7 +16,6 @@
 		<description>Upstream Maintainer (please CC on bugs)</description>
 	</maintainer>
 	<use>
-		<flag name="lvm1">Allow users to build lvm2 with lvm1 support</flag>
 		<flag name="lvm2create_initrd">Install lvm2create_initrd script and pull in <pkg>sys-apps/makedev</pkg> for the /sbin/MAKEDEV command</flag>
 		<flag name="thin">Support for thin volumes</flag>
 		<flag name="device-mapper-only">Build only device-mapper and not the rest of LVM2 (UNSUPPORTED)</flag>


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-fs/lvm2/, sys-fs/lvm2/files/
@ 2021-05-09  9:05 Lars Wendler
  0 siblings, 0 replies; 29+ messages in thread
From: Lars Wendler @ 2021-05-09  9:05 UTC (permalink / raw
  To: gentoo-commits

commit:     a7ac92c1680fc9f4c22ec486751d39503c8fe404
Author:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
AuthorDate: Sun May  9 09:04:55 2021 +0000
Commit:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
CommitDate: Sun May  9 09:04:55 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a7ac92c1

sys-fs/lvm2: Bump to version 2.03.12. Removed old

Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>

 sys-fs/lvm2/Manifest                               |   2 +-
 ...h => lvm2-2.03.12-dynamic-static-ldflags.patch} |  35 +++---
 sys-fs/lvm2/files/lvm2-2.03.12-static-libm.patch   |  25 +++++
 .../files/lvm2-2.03.12-static-pkgconfig-libs.patch | 117 +++++++++++++++++++++
 .../{lvm2-2.03.11.ebuild => lvm2-2.03.12.ebuild}   |   6 +-
 5 files changed, 164 insertions(+), 21 deletions(-)

diff --git a/sys-fs/lvm2/Manifest b/sys-fs/lvm2/Manifest
index eacbc2c1aad..03bce3f05e0 100644
--- a/sys-fs/lvm2/Manifest
+++ b/sys-fs/lvm2/Manifest
@@ -1,3 +1,3 @@
 DIST LVM2.2.02.187.tgz 2405544 BLAKE2B be804be3c64927a8848e8ea8de228fb563b6f8c22628b785aabb33fc993629e5370788216bd814246aeb3a5546fd5446383ce24342e716579887556edf2bbed2 SHA512 3ce56f0c0d2e7dbcdae5be263199f73ee5c4c052599d53cde9b16500a326d0340893344f4671839be06b5b4225d592175d01c9974db14f2dc220d6e9a1d47e91
 DIST LVM2.2.02.188.tgz 2421550 BLAKE2B bed90c8454cd4b20fdeec6dcbf5a9f97c9310671aea3b2252f8069cfa439fcb050f5ad95f928a7125a1734a4dc5ac985da99a4a570538e377a7205191a505476 SHA512 8c9db17c49dc8ebcab6c7f246ab85870a80658be811cf7f4d8f36abbebafa355b030bfc1e3bcbad73ccccb7fcd06d4a95ac547ca15d18d33715126da92703dca
-DIST LVM2.2.03.11.tgz 2528527 BLAKE2B 4c02e630e033f9bfed44468b5b8dff4af52c943cb9d6385bfe568ba50463dfc97cd968d79c34eb2528d66930d6c2895de17fe546a34d80fd17a5892560bcb670 SHA512 50f21337e397fc5b4692bb08e5d48409b907b96b39168343bab2d40bb74fd84ff466e15f3d664305bc044f3f6be4369fa7378399d5a838793632e74706f17653
+DIST LVM2.2.03.12.tgz 2594040 BLAKE2B 4e5630f27c818b79a1241b96a9d58d7078ece4a061b9bb4f26fddf77036fa2a319cc4f23835a6c784b025b3ddd07a18ce0a7ad3038fc90e90c2990d309a5d64a SHA512 e4d3bfb38b346251a2ea2cee7b79f2e12ed407652b659b35b65f58c8bb252943cee1c511713aeec8ff3400790e0e99ea6b83e8740050defe5cbb118f18bf7700

diff --git a/sys-fs/lvm2/files/lvm2-2.03.05-dynamic-static-ldflags.patch b/sys-fs/lvm2/files/lvm2-2.03.12-dynamic-static-ldflags.patch
similarity index 71%
rename from sys-fs/lvm2/files/lvm2-2.03.05-dynamic-static-ldflags.patch
rename to sys-fs/lvm2/files/lvm2-2.03.12-dynamic-static-ldflags.patch
index 2b9a5dd945c..80b6bc7a023 100644
--- a/sys-fs/lvm2/files/lvm2-2.03.05-dynamic-static-ldflags.patch
+++ b/sys-fs/lvm2/files/lvm2-2.03.12-dynamic-static-ldflags.patch
@@ -1,9 +1,10 @@
-From 93101699f5e1190184c00c99ab7b6e9717e5019a Mon Sep 17 00:00:00 2001
+From 4bdd215fd84e83a8119d0b971904221743a87a23 Mon Sep 17 00:00:00 2001
 From: "Robin H. Johnson" <robbat2@gentoo.org>
 Date: Wed, 24 Jul 2019 11:11:35 +0200
 Subject: [PATCH] Add dynamic static ldflags
 
 Forward-ported from 2.02.178 to 2.03.05
+Forward-ported from 2.03.05 to 2.03.12
 Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>
 ---
  configure.ac                 | 2 ++
@@ -13,18 +14,18 @@ Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>
  4 files changed, 5 insertions(+), 2 deletions(-)
 
 diff --git a/configure.ac b/configure.ac
-index 1e45c0edcb..cc2625294a 100644
+index 1a49e7fe7e..354b53b5ec 100644
 --- a/configure.ac
 +++ b/configure.ac
-@@ -33,6 +33,7 @@ case "$host_os" in
- 		CLDFLAGS="${CLDFLAGS:"$LDFLAGS"} -Wl,--version-script,.export.sym"
+@@ -32,6 +32,7 @@ case "$host_os" in
+ 	linux*)
  		# equivalent to -rdynamic
  		ELDFLAGS="-Wl,--export-dynamic"
 +		STATIC_LDFLAGS="-Wl,--no-export-dynamic"
  		# FIXME Generate list and use --dynamic-list=.dlopen.sym
  		CLDWHOLEARCHIVE="-Wl,-whole-archive"
  		CLDNOWHOLEARCHIVE="-Wl,-no-whole-archive"
-@@ -1758,6 +1759,7 @@ AC_SUBST(SYSCONFDIR)
+@@ -1860,6 +1861,7 @@ AC_SUBST(SYSCONFDIR)
  AC_SUBST(SYSTEMD_LIBS)
  AC_SUBST(SNAPSHOTS)
  AC_SUBST(STATICDIR)
@@ -33,23 +34,23 @@ index 1e45c0edcb..cc2625294a 100644
  AC_SUBST(TESTSUITE_DATA)
  AC_SUBST(THIN)
 diff --git a/daemons/dmeventd/Makefile.in b/daemons/dmeventd/Makefile.in
-index 6bd36d0325..a3c30ec1a0 100644
+index af51198aae..f7896e581e 100644
 --- a/daemons/dmeventd/Makefile.in
 +++ b/daemons/dmeventd/Makefile.in
-@@ -66,7 +66,7 @@ dmeventd: $(LIB_SHARED) dmeventd.o
+@@ -76,7 +76,7 @@ dmeventd: $(LIB_SHARED) dmeventd.o
  
  dmeventd.static: $(LIB_STATIC) dmeventd.o
  	@echo "    [CC] $@"
--	$(Q) $(CC) $(CFLAGS) $(LDFLAGS) -static -L. -L$(interfacebuilddir) dmeventd.o \
-+	$(Q) $(CC) $(CFLAGS) $(LDFLAGS) $(STATIC_LDFLAGS) -static -L. -L$(interfacebuilddir) dmeventd.o \
+-	$(Q) $(CC) $(CFLAGS) $(LDFLAGS) -static dmeventd.o \
++	$(Q) $(CC) $(CFLAGS) $(LDFLAGS) $(STATIC_LDFLAGS) -static dmeventd.o \
  		-o $@ $(DL_LIBS) $(DMEVENT_LIBS) $(LIBS) $(STATIC_LIBS)
  
  ifeq ("@PKGCONFIG@", "yes")
 diff --git a/make.tmpl.in b/make.tmpl.in
-index f3332e91c1..1489c2afad 100644
+index 200ea2e05f..99f02e8b77 100644
 --- a/make.tmpl.in
 +++ b/make.tmpl.in
-@@ -68,6 +68,7 @@ DEFS += @DEFS@
+@@ -69,6 +69,7 @@ DEFS += @DEFS@
  # FIXME set this only where it's needed, not globally?
  CFLAGS ?= @COPTIMISE_FLAG@ @CFLAGS@
  LDFLAGS ?= @LDFLAGS@
@@ -58,18 +59,18 @@ index f3332e91c1..1489c2afad 100644
  ELDFLAGS += @ELDFLAGS@
  LDDEPS += @LDDEPS@
 diff --git a/tools/Makefile.in b/tools/Makefile.in
-index 2620daa17c..e5fc9c4ae4 100644
+index ec546ca632..cdede2a058 100644
 --- a/tools/Makefile.in
 +++ b/tools/Makefile.in
-@@ -136,7 +136,7 @@ man-generator: man-generator.o
+@@ -137,7 +137,7 @@ man-generator: man-generator.o
  
  lvm.static: $(OBJECTS) lvm-static.o $(LVMINTERNAL_LIBS)
  	@echo "    [CC] $@"
--	$(Q) $(CC) $(CFLAGS) $(LDFLAGS) -static -L$(interfacebuilddir) -o $@ $+ \
-+	$(Q) $(CC) $(CFLAGS) $(LDFLAGS) $(STATIC_LDFLAGS) -static -L$(interfacebuilddir) -o $@ $+ \
- 	      $(DMEVENT_LIBS) $(STATIC_LIBS) $(LVMLIBS)
+-	$(Q) $(CC) $(CFLAGS) $(LDFLAGS) -static -L$(interfacebuilddir) \
++	$(Q) $(CC) $(CFLAGS) $(LDFLAGS) $(STATIC_LDFLAGS) -static -L$(interfacebuilddir) \
+ 		-o $@ $+ $(LVMLIBS) $(STATIC_LIBS)
  
  liblvm2cmd.a: $(top_builddir)/lib/liblvm-internal.a $(OBJECTS) lvmcmdlib.o lvm2cmd.o
 -- 
-2.22.0
+2.31.1
 

diff --git a/sys-fs/lvm2/files/lvm2-2.03.12-static-libm.patch b/sys-fs/lvm2/files/lvm2-2.03.12-static-libm.patch
new file mode 100644
index 00000000000..5bb776c9b5e
--- /dev/null
+++ b/sys-fs/lvm2/files/lvm2-2.03.12-static-libm.patch
@@ -0,0 +1,25 @@
+From 4917d9c8b6227256a4a83ff937119d6aa53d654e Mon Sep 17 00:00:00 2001
+From: "Robin H. Johnson" <robbat2@gentoo.org>
+Date: Sun, 9 May 2021 11:02:54 +0200
+Subject: [PATCH] Add libm to static libs
+
+---
+ make.tmpl.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/make.tmpl.in b/make.tmpl.in
+index ae189546d0..8ee00bd9e8 100644
+--- a/make.tmpl.in
++++ b/make.tmpl.in
+@@ -64,7 +64,7 @@ PYCOMPILE = $(top_srcdir)/autoconf/py-compile
+ LIBS += @LIBS@ $(SELINUX_LIBS) $(UDEV_LIBS) $(RT_LIBS) $(M_LIBS)
+ LVMLIBS = $(DMEVENT_LIBS) $(READLINE_LIBS) $(EDITLINE_LIBS) $(SYSTEMD_LIBS) $(BLKID_LIBS) $(AIO_LIBS) $(LIBS)
+ # Extra libraries always linked with static binaries
+-STATIC_LIBS = $(PTHREAD_LIBS) $(SELINUX_STATIC_LIBS) $(UDEV_STATIC_LIBS) $(BLKID_STATIC_LIBS)
++STATIC_LIBS = $(PTHREAD_LIBS) $(SELINUX_STATIC_LIBS) $(UDEV_STATIC_LIBS) $(BLKID_STATIC_LIBS) $(M_LIBS)
+ DEFS += @DEFS@
+ # FIXME set this only where it's needed, not globally?
+ CFLAGS ?= @COPTIMISE_FLAG@ @CFLAGS@
+-- 
+2.31.1
+

diff --git a/sys-fs/lvm2/files/lvm2-2.03.12-static-pkgconfig-libs.patch b/sys-fs/lvm2/files/lvm2-2.03.12-static-pkgconfig-libs.patch
new file mode 100644
index 00000000000..083a7327c6a
--- /dev/null
+++ b/sys-fs/lvm2/files/lvm2-2.03.12-static-pkgconfig-libs.patch
@@ -0,0 +1,117 @@
+From 88aeb306dfd1e0174bf02cc208d46f0d722204dc Mon Sep 17 00:00:00 2001
+From: "Robin H. Johnson" <robbat2@gentoo.org>
+Date: Sun, 9 May 2021 11:00:22 +0200
+Subject: [PATCH] Use pkgconfig to detect static libs
+
+---
+ configure.ac | 20 ++++++++++++++++++--
+ make.tmpl.in |  5 ++++-
+ 2 files changed, 22 insertions(+), 3 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 354b53b5ec..e872d70256 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -1097,6 +1097,7 @@ if test "$BLKID_WIPING" != no; then
+ 	PKG_CHECK_MODULES(BLKID, blkid >= 2.24,
+ 			  [ BLKID_WIPING=yes
+ 			    BLKID_PC="blkid"
++			    BLKID_STATIC_LIBS=`$PKG_CONFIG --static --libs $BLKID_PC`
+ 			    DEFAULT_USE_BLKID_WIPING=1
+ 			    AC_DEFINE([BLKID_WIPING_SUPPORT], 1, [Define to 1 to use libblkid detection of signatures when wiping.])
+ 			  ], [if test "$BLKID_WIPING" = maybe; then
+@@ -1145,6 +1146,7 @@ AC_MSG_RESULT($UDEV_SYNC)
+ if test "$UDEV_SYNC" = yes; then
+ 	pkg_config_init
+ 	PKG_CHECK_MODULES(UDEV, libudev >= 143, [UDEV_PC="libudev"])
++	UDEV_STATIC_LIBS=`$PKG_CONFIG --static --libs libudev`
+ 	AC_DEFINE([UDEV_SYNC_SUPPORT], 1, [Define to 1 to enable synchronisation with udev processing.])
+ 
+ 	AC_CHECK_LIB(udev, udev_device_get_is_initialized, AC_DEFINE([HAVE_LIBUDEV_UDEV_DEVICE_GET_IS_INITIALIZED], 1,
+@@ -1369,19 +1371,30 @@ dnl -- Check for selinux
+ if test "$SELINUX" = yes; then
+ 	AC_CHECK_LIB([sepol], [sepol_check_context], [
+ 		AC_DEFINE([HAVE_SEPOL], 1, [Define to 1 if sepol_check_context is available.])
+-		SELINUX_LIBS="-lsepol"])
++		SEPOL_LIBS="-lsepol"])
++
++	dnl -- init pkgconfig if required
++	AS_IF([test x$PKGCONFIG_INIT != x1], [pkg_config_init])
++	PKG_CHECK_MODULES(SELINUX, libselinux, [
++		SELINUX_PC="libselinux"
++		SELINUX_STATIC_LIBS=`$PKG_CONFIG --static --libs libselinux`
++		SELINUX_LIBS="$SELINUX_LIBS $SEPOL_LIBS"
++		AC_DEFINE([HAVE_SELINUX], 1, [Define to 1 to include support for selinux.])
++	], [
++		dnl -- old non-pkgconfig method, is buggy with static builds
+ 
+ 	AC_CHECK_LIB([selinux], [is_selinux_enabled], [
+ 		AC_CHECK_HEADERS([selinux/selinux.h],, hard_bailout)
+ 		AC_CHECK_HEADERS([selinux/label.h])
+ 		AC_DEFINE([HAVE_SELINUX], 1, [Define to 1 to include support for selinux.])
+-		SELINUX_LIBS="-lselinux $SELINUX_LIBS"
++		SELINUX_LIBS="-lselinux $SEPOL_LIBS"
+ 		SELINUX_PC="libselinux"
+ 		HAVE_SELINUX=yes ], [
+ 		AC_MSG_WARN(Disabling selinux)
+ 		SELINUX_LIBS=
+ 		SELINUX_PC=
+ 		HAVE_SELINUX=no ])
++	])
+ fi
+ 
+ ################################################################################
+@@ -1755,6 +1768,7 @@ AC_DEFINE_UNQUOTED(LVM_CONFIGURE_LINE, "$CONFIGURE_LINE", [configure command lin
+ ################################################################################
+ AC_SUBST(AWK)
+ AC_SUBST(BLKID_PC)
++AC_SUBST(BLKID_STATIC_LIBS)
+ AC_SUBST(BUILD_CMIRRORD)
+ AC_SUBST(BUILD_DMEVENTD)
+ AC_SUBST(BUILD_LVMDBUSD)
+@@ -1857,6 +1871,7 @@ AC_SUBST(SALCK_LIBS)
+ AC_SUBST(SBINDIR)
+ AC_SUBST(SELINUX_LIBS)
+ AC_SUBST(SELINUX_PC)
++AC_SUBST(SELINUX_STATIC_LIBS)
+ AC_SUBST(SYSCONFDIR)
+ AC_SUBST(SYSTEMD_LIBS)
+ AC_SUBST(SNAPSHOTS)
+@@ -1875,6 +1890,7 @@ AC_SUBST(CACHE_REPAIR_CMD)
+ AC_SUBST(CACHE_RESTORE_CMD)
+ AC_SUBST(UDEV_PC)
+ AC_SUBST(UDEV_RULES)
++AC_SUBST(UDEV_STATIC_LIBS)
+ AC_SUBST(UDEV_SYNC)
+ AC_SUBST(UDEV_SYSTEMD_BACKGROUND_JOBS)
+ AC_SUBST(UDEV_RULE_EXEC_DETECTION)
+diff --git a/make.tmpl.in b/make.tmpl.in
+index 99f02e8b77..ae189546d0 100644
+--- a/make.tmpl.in
++++ b/make.tmpl.in
+@@ -64,7 +64,7 @@ PYCOMPILE = $(top_srcdir)/autoconf/py-compile
+ LIBS += @LIBS@ $(SELINUX_LIBS) $(UDEV_LIBS) $(RT_LIBS) $(M_LIBS)
+ LVMLIBS = $(DMEVENT_LIBS) $(READLINE_LIBS) $(EDITLINE_LIBS) $(SYSTEMD_LIBS) $(BLKID_LIBS) $(AIO_LIBS) $(LIBS)
+ # Extra libraries always linked with static binaries
+-STATIC_LIBS = $(PTHREAD_LIBS)
++STATIC_LIBS = $(PTHREAD_LIBS) $(SELINUX_STATIC_LIBS) $(UDEV_STATIC_LIBS) $(BLKID_STATIC_LIBS)
+ DEFS += @DEFS@
+ # FIXME set this only where it's needed, not globally?
+ CFLAGS ?= @COPTIMISE_FLAG@ @CFLAGS@
+@@ -83,10 +83,13 @@ PTHREAD_LIBS = @PTHREAD_LIBS@
+ READLINE_LIBS = @READLINE_LIBS@
+ EDITLINE_LIBS = @EDITLINE_LIBS@
+ SELINUX_LIBS = @SELINUX_LIBS@
++SELINUX_STATIC_LIBS = @SELINUX_STATIC_LIBS@
+ UDEV_CFLAGS = @UDEV_CFLAGS@
+ UDEV_LIBS = @UDEV_LIBS@
++UDEV_STATIC_LIBS = @UDEV_STATIC_LIBS@
+ BLKID_CFLAGS = @BLKID_CFLAGS@
+ BLKID_LIBS = @BLKID_LIBS@
++BLKID_STATIC_LIBS = @BLKID_STATIC_LIBS@
+ SYSTEMD_LIBS = @SYSTEMD_LIBS@
+ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@
+ USE_TRACKING = @USE_TRACKING@
+-- 
+2.31.1
+

diff --git a/sys-fs/lvm2/lvm2-2.03.11.ebuild b/sys-fs/lvm2/lvm2-2.03.12.ebuild
similarity index 97%
rename from sys-fs/lvm2/lvm2-2.03.11.ebuild
rename to sys-fs/lvm2/lvm2-2.03.12.ebuild
index d8d945f5a7d..5a5bd509c37 100644
--- a/sys-fs/lvm2/lvm2-2.03.11.ebuild
+++ b/sys-fs/lvm2/lvm2-2.03.12.ebuild
@@ -58,10 +58,10 @@ PATCHES=(
 	"${FILESDIR}"/${PN}-2.02.67-createinitrd.patch #301331
 	"${FILESDIR}"/${PN}-2.02.99-locale-muck.patch #330373
 	#"${FILESDIR}"/${PN}-2.02.178-asneeded.patch # -Wl,--as-needed
-	"${FILESDIR}"/${PN}-2.03.05-dynamic-static-ldflags.patch #332905
-	"${FILESDIR}"/${PN}-2.02.178-static-pkgconfig-libs.patch #370217, #439414 + blkid
+	"${FILESDIR}"/${PN}-2.03.12-dynamic-static-ldflags.patch #332905
+	"${FILESDIR}"/${PN}-2.03.12-static-pkgconfig-libs.patch #370217, #439414 + blkid
 	"${FILESDIR}"/${PN}-2.03.05-pthread-pkgconfig.patch #492450
-	"${FILESDIR}"/${PN}-2.02.171-static-libm.patch #617756
+	"${FILESDIR}"/${PN}-2.03.12-static-libm.patch #617756
 	"${FILESDIR}"/${PN}-2.02.166-HPPA-no-O_DIRECT.patch #657446
 	#"${FILESDIR}"/${PN}-2.02.145-mkdev.patch #580062 # Merged upstream
 	"${FILESDIR}"/${PN}-2.03.05-dmeventd-no-idle-exit.patch


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-fs/lvm2/, sys-fs/lvm2/files/
@ 2022-06-16 22:10 Sam James
  0 siblings, 0 replies; 29+ messages in thread
From: Sam James @ 2022-06-16 22:10 UTC (permalink / raw
  To: gentoo-commits

commit:     515ec4557c56cf0e82b95873056c40d8c6269694
Author:     Alfred Persson Forsberg <cat <AT> catcream <DOT> org>
AuthorDate: Thu Jun 16 22:03:41 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Jun 16 22:10:26 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=515ec455

sys-fs/lvm2: fix building on musl

A few changes to make lvm2 build on musl. Each patch file is commented
in more detail, see those. The mallinfo patch should be looked back to.

Closes: https://bugs.gentoo.org/712336
Closes: https://bugs.gentoo.org/549506
Signed-off-by: Alfred Persson Forsberg <cat <AT> catcream.org>
Closes: https://github.com/gentoo/gentoo/pull/25883
Signed-off-by: Sam James <sam <AT> gentoo.org>

 sys-fs/lvm2/files/lvm2-2.03.14-r1-add-fcntl.patch  | 24 ++++++++++++
 .../files/lvm2-2.03.14-r1-fopen-to-freopen.patch   | 43 ++++++++++++++++++++++
 sys-fs/lvm2/files/lvm2-2.03.14-r1-mallinfo.patch   | 18 +++++++++
 sys-fs/lvm2/lvm2-2.03.14-r1.ebuild                 |  3 ++
 4 files changed, 88 insertions(+)

diff --git a/sys-fs/lvm2/files/lvm2-2.03.14-r1-add-fcntl.patch b/sys-fs/lvm2/files/lvm2-2.03.14-r1-add-fcntl.patch
new file mode 100644
index 000000000000..1b5524a61405
--- /dev/null
+++ b/sys-fs/lvm2/files/lvm2-2.03.14-r1-add-fcntl.patch
@@ -0,0 +1,24 @@
+https://bugs.gentoo.org/712336
+https://bugs.gentoo.org/549506
+
+Adds fcntl.h into daemon-server.c to define fcntl and some constants.
+
+---
+ libdaemon/server/daemon-server.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/libdaemon/server/daemon-server.c b/libdaemon/server/daemon-server.c
+index 88905a7..771b021 100644
+--- a/libdaemon/server/daemon-server.c
++++ b/libdaemon/server/daemon-server.c
+@@ -28,6 +28,7 @@
+ #include <sys/un.h>
+ #include <unistd.h>
+ #include <signal.h>
++#include <fcntl.h>
+ 
+ #include <syslog.h> /* FIXME. For the global closelog(). */
+ 
+-- 
+2.35.1
+

diff --git a/sys-fs/lvm2/files/lvm2-2.03.14-r1-fopen-to-freopen.patch b/sys-fs/lvm2/files/lvm2-2.03.14-r1-fopen-to-freopen.patch
new file mode 100644
index 000000000000..56248e10e5d6
--- /dev/null
+++ b/sys-fs/lvm2/files/lvm2-2.03.14-r1-fopen-to-freopen.patch
@@ -0,0 +1,43 @@
+In musl stdout, stdin and stderr are read-only unlike in glibc.
+This patch changes std* = fopen(...) to freopen(..., std*).
+
+See: https://www.gnu.org/software/libc/manual/html_node/Standard-Streams.html and https://wiki.gentoo.org/wiki/User:Sam/Musl_porting_notes
+
+---
+ tools/lvmcmdline.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/tools/lvmcmdline.c b/tools/lvmcmdline.c
+index 1e12bed..19da1e5 100644
+--- a/tools/lvmcmdline.c
++++ b/tools/lvmcmdline.c
+@@ -3384,7 +3384,7 @@ static int _check_standard_fds(void)
+ 	int err = is_valid_fd(STDERR_FILENO);
+ 
+ 	if (!is_valid_fd(STDIN_FILENO) &&
+-	    !(stdin = fopen(_PATH_DEVNULL, "r"))) {
++		!freopen(_PATH_DEVNULL, "r", stdin)) {
+ 		if (err)
+ 			perror("stdin stream open");
+ 		else
+@@ -3394,7 +3394,7 @@ static int _check_standard_fds(void)
+ 	}
+ 
+ 	if (!is_valid_fd(STDOUT_FILENO) &&
+-	    !(stdout = fopen(_PATH_DEVNULL, "w"))) {
++		!freopen(_PATH_DEVNULL, "w", stdout)) {
+ 		if (err)
+ 			perror("stdout stream open");
+ 		/* else no stdout */
+@@ -3402,7 +3402,7 @@ static int _check_standard_fds(void)
+ 	}
+ 
+ 	if (!is_valid_fd(STDERR_FILENO) &&
+-	    !(stderr = fopen(_PATH_DEVNULL, "w"))) {
++		!freopen(_PATH_DEVNULL, "w", stderr)) {
+ 		printf("stderr stream open: %s\n",
+ 		       strerror(errno));
+ 		return 0;
+-- 
+2.35.1
+

diff --git a/sys-fs/lvm2/files/lvm2-2.03.14-r1-mallinfo.patch b/sys-fs/lvm2/files/lvm2-2.03.14-r1-mallinfo.patch
new file mode 100644
index 000000000000..af4cbc0d5aab
--- /dev/null
+++ b/sys-fs/lvm2/files/lvm2-2.03.14-r1-mallinfo.patch
@@ -0,0 +1,18 @@
+https://git.alpinelinux.org/aports/tree/main/lvm2/mallinfo.patch
+
+Patch from Alpine, disables _allocate_memory since mallinfo isn't defined in musl.
+19:17 <@sam_> your caution is well-advised, but it should be safe enough given it's only affecting the non-glibc path
+
+Should be looked back to!
+
+--- ./lib/mm/memlock.c.orig	2015-03-09 11:18:41.560028850 -0100
++++ ./lib/mm/memlock.c	2015-03-09 11:19:54.504373309 -0100
+@@ -137,7 +137,7 @@
+ 
+ static void _allocate_memory(void)
+ {
+-#ifndef VALGRIND_POOL
++#if !defined(VALGRIND_POOL) && defined(__GLIBC__)
+ 	void *stack_mem;
+ 	struct rlimit limit;
+ 	int i, area = 0, missing = _size_malloc_tmp, max_areas = 32, hblks;

diff --git a/sys-fs/lvm2/lvm2-2.03.14-r1.ebuild b/sys-fs/lvm2/lvm2-2.03.14-r1.ebuild
index f3bc54eebc36..66b2184868ed 100644
--- a/sys-fs/lvm2/lvm2-2.03.14-r1.ebuild
+++ b/sys-fs/lvm2/lvm2-2.03.14-r1.ebuild
@@ -70,6 +70,9 @@ PATCHES=(
 	"${FILESDIR}"/${PN}-2.03.05-dmeventd-no-idle-exit.patch
 	#"${FILESDIR}"/${PN}-2.02.184-allow-reading-metadata-with-invalid-creation_time.patch #682380 # merged upstream
 	"${FILESDIR}"/${PN}-2.02.184-mksh_build.patch #686652
+	"${FILESDIR}"/${PN}-2.03.14-r1-add-fcntl.patch
+	"${FILESDIR}"/${PN}-2.03.14-r1-fopen-to-freopen.patch
+	"${FILESDIR}"/${PN}-2.03.14-r1-mallinfo.patch
 )
 
 pkg_setup() {


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-fs/lvm2/, sys-fs/lvm2/files/
@ 2022-07-07 15:10 Mike Gilbert
  0 siblings, 0 replies; 29+ messages in thread
From: Mike Gilbert @ 2022-07-07 15:10 UTC (permalink / raw
  To: gentoo-commits

commit:     b48169ca772187d66007a3fd051df57a5d152303
Author:     Alfred Persson Forsberg <cat <AT> catcream <DOT> org>
AuthorDate: Wed Jun 29 17:45:36 2022 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Thu Jul  7 15:08:48 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b48169ca

sys-fs/lvm2: fix segfault on musl

The default streams in musl are const and we can't modify them directly.
Use freopen instead.

https://listman.redhat.com/archives/lvm-devel/2022-June/024203.html

See also:
https://wiki.gentoo.org/wiki/User:Sam/Musl_porting_notes#error:_assignment_of_read-only_variable_.27.5Bstdout.7Cstdin.7Cstderr.5D.27
https://www.gnu.org/software/libc/manual/html_node/Standard-Streams.html

Signed-off-by: Alfred Persson Forsberg <cat <AT> catcream.org>
Closes: https://github.com/gentoo/gentoo/pull/26024
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>

 sys-fs/lvm2/files/lvm2-2.03.14-freopen_n2.patch    | 34 ++++++++++++++++++++++
 ...m2-2.03.14-r2.ebuild => lvm2-2.03.14-r3.ebuild} |  1 +
 2 files changed, 35 insertions(+)

diff --git a/sys-fs/lvm2/files/lvm2-2.03.14-freopen_n2.patch b/sys-fs/lvm2/files/lvm2-2.03.14-freopen_n2.patch
new file mode 100644
index 000000000000..5ca32f19fc54
--- /dev/null
+++ b/sys-fs/lvm2/files/lvm2-2.03.14-freopen_n2.patch
@@ -0,0 +1,34 @@
+In musl, the standard streams are read-only. To modify them we need to
+use freopen. This patch does the same as lvm2-2.03.14-r1-fopen-to-freopen.patch
+
+https://listman.redhat.com/archives/lvm-devel/2022-June/024203.html
+
+See also:
+https://wiki.gentoo.org/wiki/User:Sam/Musl_porting_notes#error:_assignment_of_read-only_variable_.27.5Bstdout.7Cstdin.7Cstderr.5D.27
+https://www.gnu.org/software/libc/manual/html_node/Standard-Streams.html
+
+---
+ lib/log/log.c | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/lib/log/log.c b/lib/log/log.c
+index 7b4d537..897c183 100644
+--- a/lib/log/log.c
++++ b/lib/log/log.c
+@@ -207,8 +207,12 @@ int reopen_standard_stream(FILE **stream, const char *mode)
+ 	}
+ 
+ 	_check_and_replace_standard_log_streams(old_stream, new_stream);
+-
++	
++#ifdef __GLIBC__
+ 	*stream = new_stream;
++#else
++	freopen(NULL, mode, *stream);
++#endif
+ 	return 1;
+ }
+ 
+-- 
+2.35.1
+

diff --git a/sys-fs/lvm2/lvm2-2.03.14-r2.ebuild b/sys-fs/lvm2/lvm2-2.03.14-r3.ebuild
similarity index 99%
rename from sys-fs/lvm2/lvm2-2.03.14-r2.ebuild
rename to sys-fs/lvm2/lvm2-2.03.14-r3.ebuild
index 2da81764efe4..281599b2fdf0 100644
--- a/sys-fs/lvm2/lvm2-2.03.14-r2.ebuild
+++ b/sys-fs/lvm2/lvm2-2.03.14-r3.ebuild
@@ -73,6 +73,7 @@ PATCHES=(
 	"${FILESDIR}"/${PN}-2.03.14-r1-add-fcntl.patch
 	"${FILESDIR}"/${PN}-2.03.14-r1-fopen-to-freopen.patch
 	"${FILESDIR}"/${PN}-2.03.14-r1-mallinfo.patch
+	"${FILESDIR}"/${PN}-2.03.14-freopen_n2.patch
 )
 
 pkg_setup() {


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-fs/lvm2/, sys-fs/lvm2/files/
@ 2022-10-26 19:17 Mike Gilbert
  0 siblings, 0 replies; 29+ messages in thread
From: Mike Gilbert @ 2022-10-26 19:17 UTC (permalink / raw
  To: gentoo-commits

commit:     7b5252991ea9d0d5f16d33ea8d07faae8722f3b1
Author:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Wed Oct 26 18:27:18 2022 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Wed Oct 26 19:17:00 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7b525299

sys-fs/lvm2: drop 2.02.188-r3

Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>

 sys-fs/lvm2/Manifest                               |   1 -
 sys-fs/lvm2/files/lvm2-2.02.171-static-libm.patch  |  13 -
 .../files/lvm2-2.02.176-pthread-pkgconfig.patch    |  29 --
 sys-fs/lvm2/files/lvm2-2.02.178-asneeded.patch     |  15 -
 .../lvm2-2.02.178-dynamic-static-ldflags.patch     |  59 ----
 .../lvm2/files/lvm2-2.02.178-example.conf.in.patch |  50 ----
 .../lvm2-2.02.178-static-pkgconfig-libs.patch      | 102 -------
 ...ading-metadata-with-invalid-creation_time.patch |  72 -----
 .../lvm2-2.02.184-dmeventd-no-idle-exit.patch      |  68 -----
 ...2-2.02.186-udev_remove_unsupported_option.patch |  34 ---
 .../lvm2-2.02.63-always-make-static-libdm.patch    |  42 ---
 sys-fs/lvm2/lvm2-2.02.188-r3.ebuild                | 308 ---------------------
 12 files changed, 793 deletions(-)

diff --git a/sys-fs/lvm2/Manifest b/sys-fs/lvm2/Manifest
index f62db729f464..040ecbb191f0 100644
--- a/sys-fs/lvm2/Manifest
+++ b/sys-fs/lvm2/Manifest
@@ -1,2 +1 @@
-DIST LVM2.2.02.188.tgz 2421550 BLAKE2B bed90c8454cd4b20fdeec6dcbf5a9f97c9310671aea3b2252f8069cfa439fcb050f5ad95f928a7125a1734a4dc5ac985da99a4a570538e377a7205191a505476 SHA512 8c9db17c49dc8ebcab6c7f246ab85870a80658be811cf7f4d8f36abbebafa355b030bfc1e3bcbad73ccccb7fcd06d4a95ac547ca15d18d33715126da92703dca
 DIST LVM2.2.03.14.tgz 2639538 BLAKE2B 806f5e9cb76a05febef6f8ce8cfc42c92927b9538f62a21029c5ffc426a4fd7c3f32709be08dbd8028b53891b1075d1d13cb3b0d7b1815071ee8eb927d8f3ed3 SHA512 6a93bed1d5cf36f0f48d4d413d028b0e480cd4fc20e25d173770a892f265d2a0cc68d01a720b1513469953649e989532cd0c45f9538f92a4190eb3dc4555857d

diff --git a/sys-fs/lvm2/files/lvm2-2.02.171-static-libm.patch b/sys-fs/lvm2/files/lvm2-2.02.171-static-libm.patch
deleted file mode 100644
index 1cbf956db258..000000000000
--- a/sys-fs/lvm2/files/lvm2-2.02.171-static-libm.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff --git a/make.tmpl.in b/make.tmpl.in
-index a40eaaa15..7eea943aa 100644
---- a/make.tmpl.in
-+++ b/make.tmpl.in
-@@ -53,7 +53,7 @@ PYCOMPILE = $(top_srcdir)/autoconf/py-compile
- 
- LIBS = @LIBS@
- # Extra libraries always linked with static binaries
--STATIC_LIBS = $(SELINUX_STATIC_LIBS) $(UDEV_STATIC_LIBS) $(BLKID_STATIC_LIBS)
-+STATIC_LIBS = $(SELINUX_STATIC_LIBS) $(UDEV_STATIC_LIBS) $(BLKID_STATIC_LIBS) $(M_LIBS)
- DEFS += @DEFS@
- # FIXME set this only where it's needed, not globally?
- CFLAGS ?= @COPTIMISE_FLAG@ @CFLAGS@

diff --git a/sys-fs/lvm2/files/lvm2-2.02.176-pthread-pkgconfig.patch b/sys-fs/lvm2/files/lvm2-2.02.176-pthread-pkgconfig.patch
deleted file mode 100644
index c0265e81268a..000000000000
--- a/sys-fs/lvm2/files/lvm2-2.02.176-pthread-pkgconfig.patch
+++ /dev/null
@@ -1,29 +0,0 @@
---- LVM2.2.02.176/libdm/libdevmapper.pc.in
-+++ LVM2.2.02.176/libdm/libdevmapper.pc.in
-@@ -9,4 +9,4 @@
- Cflags: -I${includedir} 
- Libs: -L${libdir} -ldevmapper
- Requires.private: @SELINUX_PC@ @UDEV_PC@
--Libs.private: -lm @RT_LIBS@
-+Libs.private: -lm @RT_LIBS@ @PTHREAD_LIBS@
---- LVM2.2.02.176/tools/Makefile.in
-+++ LVM2.2.02.176/tools/Makefile.in
-@@ -93,6 +93,7 @@
-   INSTALL_LVM_TARGETS += install_tools_static
-   INSTALL_DMSETUP_TARGETS += install_dmsetup_static
-   INSTALL_CMDLIB_TARGETS += install_cmdlib_static
-+  STATIC_LIBS += @PTHREAD_LIBS@
- endif
- 
- LVMLIBS = $(LVMINTERNAL_LIBS) -ldevmapper
-@@ -118,6 +119,10 @@
- 
- include $(top_builddir)/make.tmpl
- 
-+ifeq ("@STATIC_LINK@", "yes")
-+  STATIC_LIBS += @PTHREAD_LIBS@
-+endif
-+
- device-mapper: $(TARGETS_DM)
- 
- CFLAGS_dmsetup.o += $(UDEV_CFLAGS) $(EXTRA_EXEC_CFLAGS)

diff --git a/sys-fs/lvm2/files/lvm2-2.02.178-asneeded.patch b/sys-fs/lvm2/files/lvm2-2.02.178-asneeded.patch
deleted file mode 100644
index c831c6d6e60c..000000000000
--- a/sys-fs/lvm2/files/lvm2-2.02.178-asneeded.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-http://bugs.gentoo.org/330255
-
-liblvm2app.so: undefined reference to `floor'
-
---- LVM2.2.02.178/liblvm/Makefile.in
-+++ LVM2.2.02.178/liblvm/Makefile.in
-@@ -43,7 +43,7 @@
- include $(top_builddir)/make.tmpl
- 
- LDFLAGS += -L$(top_builddir)/lib -L$(top_builddir)/daemons/dmeventd
--LIBS += $(LVMINTERNAL_LIBS) -ldevmapper -laio
-+LIBS += $(LVMINTERNAL_LIBS) -ldevmapper -laio -lm
- 
- .PHONY: install_dynamic install_static install_include install_pkgconfig
- 

diff --git a/sys-fs/lvm2/files/lvm2-2.02.178-dynamic-static-ldflags.patch b/sys-fs/lvm2/files/lvm2-2.02.178-dynamic-static-ldflags.patch
deleted file mode 100644
index 0a0e73209062..000000000000
--- a/sys-fs/lvm2/files/lvm2-2.02.178-dynamic-static-ldflags.patch
+++ /dev/null
@@ -1,59 +0,0 @@
---- LVM2.2.02.178/configure.ac
-+++ LVM2.2.02.178/configure.ac
-@@ -33,6 +33,7 @@
- 		CLDFLAGS="$CLDFLAGS -Wl,--version-script,.export.sym"
- 		# equivalent to -rdynamic
- 		ELDFLAGS="-Wl,--export-dynamic"
-+		STATIC_LDFLAGS="-Wl,--no-export-dynamic"
- 		# FIXME Generate list and use --dynamic-list=.dlopen.sym
- 		CLDWHOLEARCHIVE="-Wl,-whole-archive"
- 		CLDNOWHOLEARCHIVE="-Wl,-no-whole-archive"
-@@ -2042,6 +2043,7 @@
- AC_SUBST(SYSTEMD_LIBS)
- AC_SUBST(SNAPSHOTS)
- AC_SUBST(STATICDIR)
-+AC_SUBST(STATIC_LDFLAGS)
- AC_SUBST(STATIC_LINK)
- AC_SUBST(TESTSUITE_DATA)
- AC_SUBST(THIN)
---- LVM2.2.02.178/daemons/dmeventd/Makefile.in
-+++ LVM2.2.02.178/daemons/dmeventd/Makefile.in
-@@ -64,7 +64,7 @@
- 		-o $@ $(DL_LIBS) $(DMEVENT_LIBS) $(LIBS)
- 
- dmeventd.static: $(LIB_STATIC) dmeventd.o $(interfacebuilddir)/libdevmapper.a
--	$(CC) $(CFLAGS) $(LDFLAGS) -static -L. -L$(interfacebuilddir) dmeventd.o \
-+	$(CC) $(CFLAGS) $(LDFLAGS) $(STATIC_LDFLAGS) -static -L. -L$(interfacebuilddir) dmeventd.o \
- 		-o $@ $(DL_LIBS) $(DMEVENT_LIBS) $(LIBS) $(STATIC_LIBS)
- 
- ifeq ("@PKGCONFIG@", "yes")
---- LVM2.2.02.178/make.tmpl.in
-+++ LVM2.2.02.178/make.tmpl.in
-@@ -64,6 +64,7 @@
- # FIXME set this only where it's needed, not globally?
- CFLAGS ?= @COPTIMISE_FLAG@ @CFLAGS@
- LDFLAGS ?= @LDFLAGS@
-+STATIC_LDFLAGS += @STATIC_LDFLAGS@
- CLDFLAGS += @CLDFLAGS@
- ELDFLAGS += @ELDFLAGS@
- LDDEPS += @LDDEPS@
---- LVM2.2.02.178/tools/Makefile.in
-+++ LVM2.2.02.178/tools/Makefile.in
-@@ -129,7 +129,7 @@
- 
- dmsetup.static: dmsetup.o $(interfacebuilddir)/libdevmapper.a
- 	@echo "    [CC] $@"
--	$(Q) $(CC) $(CFLAGS) $(LDFLAGS) -static -L$(interfacebuilddir) \
-+	$(Q) $(CC) $(CFLAGS) $(LDFLAGS) $(STATIC_LDFLAGS) -static -L$(interfacebuilddir) \
- 	      -o $@ dmsetup.o -ldevmapper $(M_LIBS) $(PTHREAD_LIBS) $(STATIC_LIBS) $(LIBS)
- 
- all: device-mapper
-@@ -159,7 +159,7 @@
- 
- lvm.static: $(OBJECTS) lvm-static.o $(top_builddir)/lib/liblvm-internal.a  $(interfacebuilddir)/libdevmapper.a
- 	@echo "    [CC] $@"
--	$(Q) $(CC) $(CFLAGS) $(LDFLAGS) -static -L$(interfacebuilddir) -o $@ \
-+	$(Q) $(CC) $(CFLAGS) $(LDFLAGS) $(STATIC_LDFLAGS) -static -L$(interfacebuilddir) -o $@ \
- 	      $(OBJECTS) lvm-static.o $(LVMLIBS) $(STATIC_LIBS) $(LIBS)
- 
- liblvm2cmd.a: $(top_builddir)/lib/liblvm-internal.a $(OBJECTS) lvmcmdlib.o lvm2cmd.o

diff --git a/sys-fs/lvm2/files/lvm2-2.02.178-example.conf.in.patch b/sys-fs/lvm2/files/lvm2-2.02.178-example.conf.in.patch
deleted file mode 100644
index 34c710d4392c..000000000000
--- a/sys-fs/lvm2/files/lvm2-2.02.178-example.conf.in.patch
+++ /dev/null
@@ -1,50 +0,0 @@
---- LVM2.2.02.178/conf/example.conf.in
-+++ LVM2.2.02.178/conf/example.conf.in
-@@ -128,6 +128,9 @@
- 	# Example
- 	# Accept every block device:
- 	# filter = [ "a|.*/|" ]
-+	# Gentoo: we exclude /dev/nbd by default, because it makes a lot of kernel
-+	# noise when you probed while not available.
-+	filter = [ "r|/dev/nbd.*|", "a/.*/" ]
- 	# Reject the cdrom drive:
- 	# filter = [ "r|/dev/cdrom|" ]
- 	# Work with just loopback devices, e.g. for testing:
-@@ -704,7 +707,8 @@
- 	# Configuration option global/fallback_to_lvm1.
- 	# This setting is no longer used.
- 	# This configuration option has an automatic default value.
--	# fallback_to_lvm1 = 0
-+	# Gentoo: the LVM tools are a seperate package.
-+	fallback_to_lvm1 = 0
- 
- 	# Configuration option global/format.
- 	# This setting is no longer used.
-@@ -1508,7 +1512,7 @@
- 
- # Configuration section metadata.
- # This configuration section has an automatic default value.
--# metadata {
-+metadata {
- 
- 	# Configuration option metadata/check_pv_device_sizes.
- 	# Check device sizes are not smaller than corresponding PV sizes.
-@@ -1553,7 +1557,8 @@
- 	# 
- 	# This configuration option is advanced.
- 	# This configuration option has an automatic default value.
--	# pvmetadatacopies = 1
-+	# Gentoo: enable for data safety, but PV resize is then disabled.
-+	# pvmetadatacopies = 2
- 
- 	# Configuration option metadata/vgmetadatacopies.
- 	# Number of copies of metadata to maintain for each VG.
-@@ -1608,7 +1613,7 @@
- 	# 
- 	# This configuration option is advanced.
- 	# This configuration option does not have a default value defined.
--# }
-+}
- 
- # Configuration section report.
- # LVM report command output formatting.

diff --git a/sys-fs/lvm2/files/lvm2-2.02.178-static-pkgconfig-libs.patch b/sys-fs/lvm2/files/lvm2-2.02.178-static-pkgconfig-libs.patch
deleted file mode 100644
index 989b3082576d..000000000000
--- a/sys-fs/lvm2/files/lvm2-2.02.178-static-pkgconfig-libs.patch
+++ /dev/null
@@ -1,102 +0,0 @@
---- LVM2.2.02.178/configure.ac
-+++ LVM2.2.02.178/configure.ac
-@@ -1238,6 +1238,7 @@
- 	PKG_CHECK_MODULES(BLKID, blkid >= 2.24,
- 			  [ BLKID_WIPING=yes
- 			    BLKID_PC="blkid"
-+			    BLKID_STATIC_LIBS=`$PKG_CONFIG --static --libs $BLKID_PC`
- 			    DEFAULT_USE_BLKID_WIPING=1
- 			    AC_DEFINE([BLKID_WIPING_SUPPORT], 1, [Define to 1 to use libblkid detection of signatures when wiping.])
- 			  ], [if test "$BLKID_WIPING" = maybe; then
-@@ -1286,6 +1287,7 @@
- if test "$UDEV_SYNC" = yes; then
- 	pkg_config_init
- 	PKG_CHECK_MODULES(UDEV, libudev >= 143, [UDEV_PC="libudev"])
-+	UDEV_STATIC_LIBS=`$PKG_CONFIG --static --libs libudev`
- 	AC_DEFINE([UDEV_SYNC_SUPPORT], 1, [Define to 1 to enable synchronisation with udev processing.])
- 
- 	AC_CHECK_LIB(udev, udev_device_get_is_initialized, AC_DEFINE([HAVE_LIBUDEV_UDEV_DEVICE_GET_IS_INITIALIZED], 1,
-@@ -1564,19 +1566,32 @@
- if test "$SELINUX" = yes; then
- 	AC_CHECK_LIB([sepol], [sepol_check_context], [
- 		AC_DEFINE([HAVE_SEPOL], 1, [Define to 1 if sepol_check_context is available.])
--		SELINUX_LIBS="-lsepol"])
-+		SEPOL_LIBS="-lsepol"])
-+
-+	dnl -- init pkgconfig if required
-+	if  test x$PKGCONFIG_INIT != x1; then
-+		pkg_config_init
-+	fi
-+	PKG_CHECK_MODULES(SELINUX, libselinux, [
-+		SELINUX_PC="libselinux"
-+		SELINUX_STATIC_LIBS=`$PKG_CONFIG --static --libs libselinux`
-+		SELINUX_LIBS="$SELINUX_LIBS $SEPOL_LIBS"
-+		AC_DEFINE([HAVE_SELINUX], 1, [Define to 1 to include support for selinux.])
-+	],[
-+		dnl -- old non-pkgconfig method, is buggy with static builds
- 
- 	AC_CHECK_LIB([selinux], [is_selinux_enabled], [
- 		AC_CHECK_HEADERS([selinux/selinux.h],, hard_bailout)
- 		AC_CHECK_HEADERS([selinux/label.h])
- 		AC_DEFINE([HAVE_SELINUX], 1, [Define to 1 to include support for selinux.])
--		SELINUX_LIBS="-lselinux $SELINUX_LIBS"
-+		SELINUX_LIBS="-lselinux $SEPOL_LIBS"
- 		SELINUX_PC="libselinux"
- 		HAVE_SELINUX=yes ], [
- 		AC_MSG_WARN(Disabling selinux)
- 		SELINUX_LIBS=
- 		SELINUX_PC=
- 		HAVE_SELINUX=no ])
-+	])
- fi
- 
- ################################################################################
-@@ -1927,6 +1942,7 @@
- ################################################################################
- AC_SUBST(APPLIB)
- AC_SUBST(AWK)
-+AC_SUBST(BLKID_STATIC_LIBS)
- AC_SUBST(BLKID_PC)
- AC_SUBST(BUILD_CMIRRORD)
- AC_SUBST(BUILD_DMEVENTD)
-@@ -2037,6 +2053,7 @@
- AC_SUBST(SALCK_LIBS)
- AC_SUBST(SBINDIR)
- AC_SUBST(SELINUX_LIBS)
-+AC_SUBST(SELINUX_STATIC_LIBS)
- AC_SUBST(SELINUX_PC)
- AC_SUBST(SYSCONFDIR)
- AC_SUBST(SYSTEMD_LIBS)
-@@ -2053,6 +2070,7 @@
- AC_SUBST(CACHE_DUMP_CMD)
- AC_SUBST(CACHE_REPAIR_CMD)
- AC_SUBST(CACHE_RESTORE_CMD)
-+AC_SUBST(UDEV_STATIC_LIBS)
- AC_SUBST(UDEV_PC)
- AC_SUBST(UDEV_RULES)
- AC_SUBST(UDEV_SYNC)
---- LVM2.2.02.178/make.tmpl.in
-+++ LVM2.2.02.178/make.tmpl.in
-@@ -59,7 +59,7 @@
- 
- LIBS = @LIBS@
- # Extra libraries always linked with static binaries
--STATIC_LIBS = $(SELINUX_LIBS) $(UDEV_LIBS) $(BLKID_LIBS)
-+STATIC_LIBS = $(SELINUX_STATIC_LIBS) $(UDEV_STATIC_LIBS) $(BLKID_STATIC_LIBS)
- DEFS += @DEFS@
- # FIXME set this only where it's needed, not globally?
- CFLAGS ?= @COPTIMISE_FLAG@ @CFLAGS@
-@@ -75,10 +75,13 @@
- PTHREAD_LIBS = @PTHREAD_LIBS@
- READLINE_LIBS = @READLINE_LIBS@
- SELINUX_LIBS = @SELINUX_LIBS@
-+SELINUX_STATIC_LIBS = @SELINUX_STATIC_LIBS@
- UDEV_CFLAGS = @UDEV_CFLAGS@
- UDEV_LIBS = @UDEV_LIBS@
-+UDEV_STATIC_LIBS = @UDEV_STATIC_LIBS@
- BLKID_CFLAGS = @BLKID_CFLAGS@
- BLKID_LIBS = @BLKID_LIBS@
-+BLKID_STATIC_LIBS = @BLKID_STATIC_LIBS@
- SYSTEMD_LIBS = @SYSTEMD_LIBS@
- VALGRIND_CFLAGS = @VALGRIND_CFLAGS@
- 

diff --git a/sys-fs/lvm2/files/lvm2-2.02.184-allow-reading-metadata-with-invalid-creation_time.patch b/sys-fs/lvm2/files/lvm2-2.02.184-allow-reading-metadata-with-invalid-creation_time.patch
deleted file mode 100644
index 34968c7c2eb7..000000000000
--- a/sys-fs/lvm2/files/lvm2-2.02.184-allow-reading-metadata-with-invalid-creation_time.patch
+++ /dev/null
@@ -1,72 +0,0 @@
-From a397b69ce33d811aba7d64d54b5c8e0efb86fd15 Mon Sep 17 00:00:00 2001
-From: Zdenek Kabelac <zkabelac@redhat.com>
-Date: Fri, 10 May 2019 14:40:11 +0200
-Subject: [PATCH] metadata: allow reading metadata with invalid creation_time
-
-lvm2 till version 2.02.169 (commit 78d004efa8a1809cea68283e6204edfa9d7c1091)
-was printing invalid creation_time argument into metadata on 32bit arch.
-
-However with commit ba9820b14223b731125c83dbc9709aa44fdcdbf1 we started
-to properly validate all input numbers and thus we refused to accept
-invalid metadata with 'garbage' string - but this results in the
-situation where metadata produced on older lvm2 on 32 bit architecture
-will become unreadable after upgrade.
-
-To fix this case - extend libdm parser in a way, that whenever we
-find error integer value, we also check if the parsed value is not for
-creation_time node and in this case we let the metadata pass through
-with made-up date 2018-05-24 (release date of 2.02.169).
----
- libdm/libdm-config.c | 18 +++++++++++++++---
- 1 file changed, 15 insertions(+), 3 deletions(-)
-
-diff --git a/libdm/libdm-config.c b/libdm/libdm-config.c
-index 3f0d2510e..382f86bbf 100644
---- a/libdm/libdm-config.c
-+++ b/libdm/libdm-config.c
-@@ -51,6 +51,8 @@ struct parser {
- 
- 	struct dm_pool *mem;
- 	int no_dup_node_check;	/* whether to disable dup node checking */
-+	const char *key;        /* last obtained key */
-+	unsigned ignored_creation_time;
- };
- 
- struct config_output {
-@@ -176,7 +178,7 @@ static int _do_dm_config_parse(struct dm_config_tree *cft, const char *start, co
- 	/* TODO? if (start == end) return 1; */
- 
- 	struct parser *p;
--	if (!(p = dm_pool_alloc(cft->mem, sizeof(*p))))
-+	if (!(p = dm_pool_zalloc(cft->mem, sizeof(*p))))
- 		return_0;
- 
- 	p->mem = cft->mem;
-@@ -615,6 +617,7 @@ static struct dm_config_node *_section(struct parser *p, struct dm_config_node *
- 		match(TOK_SECTION_E);
- 	} else {
- 		match(TOK_EQ);
-+		p->key = root->key;
- 		if (!(value = _value(p)))
- 			return_NULL;
- 		if (root->v)
-@@ -682,8 +685,17 @@ static struct dm_config_value *_type(struct parser *p)
- 		errno = 0;
- 		v->v.i = strtoll(p->tb, NULL, 0);	/* FIXME: check error */
- 		if (errno) {
--			log_error("Failed to read int token.");
--			return NULL;
-+			if (errno == ERANGE && p->key &&
-+			    strcmp("creation_time", p->key) == 0) {
-+				/* Due to a bug in some older 32bit builds (<2.02.169),
-+				 * lvm was able to produce invalid creation_time string */
-+				v->v.i = 1527120000; /* Pick 2018-05-24 day instead */
-+				if (!p->ignored_creation_time++)
-+					log_warn("WARNING: Invalid creation_time found in metadata (repaired with next metadata update).");
-+			} else {
-+				log_error("Failed to read int token.");
-+				return NULL;
-+			}
- 		}
- 		match(TOK_INT);
- 		break;

diff --git a/sys-fs/lvm2/files/lvm2-2.02.184-dmeventd-no-idle-exit.patch b/sys-fs/lvm2/files/lvm2-2.02.184-dmeventd-no-idle-exit.patch
deleted file mode 100644
index c80bd2ba2bec..000000000000
--- a/sys-fs/lvm2/files/lvm2-2.02.184-dmeventd-no-idle-exit.patch
+++ /dev/null
@@ -1,68 +0,0 @@
-From: "Robin H. Johnson" <robbat2@gentoo.org>
-Date: Wed, 17 Apr 2019 06:54:27 +0000
-Subject: [PATCH] dmeventd configurable idle exit time
-
-dmeventd nominally exits after 1 hour of idle time. There are use cases for
-this, esp. with socket activation, but also cases where users don't expect
-dmeventd to exit.
-
-Provide a tuning knob via environment variable, DMEVENTD_IDLE_EXIT_TIMEOUT,
-that can be -1 to not exit, or a configurable time for different idle exit.
-
-Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
-Fixes: https://bugs.gentoo.org/682556
-
-diff -Nuar LVM2.2.02.184.orig/daemons/dmeventd/dmeventd.c LVM2.2.02.184/daemons/dmeventd/dmeventd.c
---- LVM2.2.02.184.orig/daemons/dmeventd/dmeventd.c	2019-03-22 03:14:59.000000000 -0700
-+++ LVM2.2.02.184/daemons/dmeventd/dmeventd.c	2019-04-17 00:18:23.535029906 -0700
-@@ -2158,6 +2158,18 @@
- 		.server_path = DM_EVENT_FIFO_SERVER
- 	};
- 	time_t now, idle_exit_timeout = DMEVENTD_IDLE_EXIT_TIMEOUT;
-+
-+	/* Provide a basic way to config the idle timeout */
-+	char* idle_exit_timeout_env = getenv("DMEVENTD_IDLE_EXIT_TIMEOUT") ? : NULL;
-+	if(NULL != idle_exit_timeout_env) {
-+		char* endptr;
-+		idle_exit_timeout = strtol(idle_exit_timeout_env, &endptr, 10);
-+		if (errno == ERANGE || *endptr != '\0') {
-+			fprintf(stderr, "DMEVENTD_IDLE_EXIT_TIMEOUT: bad time input\n");
-+			exit(EXIT_FAILURE);
-+		}
-+	}
-+
- 	opterr = 0;
- 	optind = 0;
- 
-@@ -2253,7 +2265,7 @@
- 		_process_initial_registrations();
- 
- 	for (;;) {
--		if (_idle_since) {
-+		if (_idle_since || _exit_now) {
- 			if (_exit_now) {
- 				if (_exit_now == DM_SCHEDULED_EXIT)
- 					break; /* Only prints shutdown message */
-@@ -2262,7 +2274,7 @@
- 					 (long) (time(NULL) - _idle_since));
- 				break;
- 			}
--			if (idle_exit_timeout) {
-+			if (idle_exit_timeout && idle_exit_timeout > 0) {
- 				now = time(NULL);
- 				if (now < _idle_since)
- 					_idle_since = now; /* clock change? */
-diff -Nuar LVM2.2.02.184.orig/man/dmeventd.8_main LVM2.2.02.184/man/dmeventd.8_main
---- LVM2.2.02.184.orig/man/dmeventd.8_main	2019-03-22 03:15:00.000000000 -0700
-+++ LVM2.2.02.184/man/dmeventd.8_main	2019-04-17 00:17:46.076023638 -0700
-@@ -143,6 +143,10 @@
- Variable is set by thin plugin to prohibit recursive interation
- with dmeventd by any executed lvm2 command from
- a thin_command environment.
-+.TP
-+.B DMEVENTD_IDLE_EXIT_TIMEOUT
-+Configure the dmeventd idle exit timeout behavior, value in seconds. Default
-+is 3600 (1 hour). -1 means do not exit.
- .
- .SH SEE ALSO
- .

diff --git a/sys-fs/lvm2/files/lvm2-2.02.186-udev_remove_unsupported_option.patch b/sys-fs/lvm2/files/lvm2-2.02.186-udev_remove_unsupported_option.patch
deleted file mode 100644
index f895e1921e09..000000000000
--- a/sys-fs/lvm2/files/lvm2-2.02.186-udev_remove_unsupported_option.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-From f98f79a047dd1c4980008e0ed6c9ad4e18596cdc Mon Sep 17 00:00:00 2001
-From: Peter Rajnoha <prajnoha@redhat.com>
-Date: Tue, 13 Aug 2019 15:18:30 +0200
-Subject: [PATCH] udev: remove unsupported OPTIONS+="event_timeout" rule
-
-The OPTIONS+="event_timeout" is Unsupported since systemd/udev version 216,
-that is ~5 years ago.
-
-Since systemd/udev version 243, there's a new message printed if unsupported
-OPTIONS value is used:
-
-  Invalid value for OPTIONS key, ignoring: 'event_timeout=180'
-
-Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1740666
----
- udev/11-dm-lvm.rules.in | 2 --
- 1 file changed, 2 deletions(-)
-
-diff --git a/udev/11-dm-lvm.rules.in b/udev/11-dm-lvm.rules.in
-index 91cb991df9..7c589943b7 100644
---- a/udev/11-dm-lvm.rules.in
-+++ b/udev/11-dm-lvm.rules.in
-@@ -37,8 +37,6 @@ ENV{DM_SUBSYSTEM_UDEV_FLAG0}!="1", ENV{DM_NOSCAN}=="1", ENV{DM_UDEV_DISABLE_OTHE
- 
- ENV{DM_UDEV_DISABLE_SUBSYSTEM_RULES_FLAG}=="1", GOTO="lvm_end"
- 
--OPTIONS+="event_timeout=180"
--
- # Do not create symlinks for inappropriate subdevices.
- ENV{DM_LV_NAME}=="pvmove?*|?*_vorigin", GOTO="lvm_disable"
- ENV{DM_LV_LAYER}=="?*", GOTO="lvm_disable"
--- 
-2.24.0
-

diff --git a/sys-fs/lvm2/files/lvm2-2.02.63-always-make-static-libdm.patch b/sys-fs/lvm2/files/lvm2-2.02.63-always-make-static-libdm.patch
deleted file mode 100644
index 5ddcb4e56711..000000000000
--- a/sys-fs/lvm2/files/lvm2-2.02.63-always-make-static-libdm.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-diff -Nuar --exclude '*~' LVM2.2.02.63.orig/daemons/dmeventd/Makefile.in LVM2.2.02.63/daemons/dmeventd/Makefile.in
---- LVM2.2.02.63.orig/daemons/dmeventd/Makefile.in	2010-04-09 14:42:48.000000000 -0700
-+++ LVM2.2.02.63/daemons/dmeventd/Makefile.in	2010-04-19 11:53:27.000000000 -0700
-@@ -28,11 +28,12 @@
- INSTALL_LIB_TARGETS = install_lib_dynamic
- 
- LIB_NAME = libdevmapper-event
-+LIB_STATIC = $(LIB_NAME).a
-+INSTALL_LIB_TARGETS += install_lib_static
-+TARGETS += $(LIB_STATIC)
- ifeq ("@STATIC_LINK@", "yes")
--  LIB_STATIC = $(LIB_NAME).a
--  TARGETS += $(LIB_STATIC) dmeventd.static
-+  TARGETS += dmeventd.static
-   INSTALL_DMEVENTD_TARGETS += install_dmeventd_static
--  INSTALL_LIB_TARGETS += install_lib_static
- endif
- 
- LIB_VERSION = $(LIB_VERSION_DM)
-diff -Nuar --exclude '*~' LVM2.2.02.63.orig/libdm/Makefile.in LVM2.2.02.63/libdm/Makefile.in
---- LVM2.2.02.63.orig/libdm/Makefile.in	2010-04-09 14:42:51.000000000 -0700
-+++ LVM2.2.02.63/libdm/Makefile.in	2010-04-19 11:52:20.000000000 -0700
-@@ -34,8 +34,8 @@
- 
- INCLUDES = -I$(srcdir)/$(interface) -I$(srcdir)
- 
--ifeq ("@STATIC_LINK@", "yes")
- LIB_STATIC = $(interface)/libdevmapper.a
-+ifeq ("@STATIC_LINK@", "yes")
- endif
- 
- LIB_SHARED = $(interface)/libdevmapper.$(LIB_SUFFIX)
-@@ -63,8 +63,8 @@
- 
- INSTALL_TYPE = install_dynamic
- 
--ifeq ("@STATIC_LINK@", "yes")
-   INSTALL_TYPE += install_static
-+ifeq ("@STATIC_LINK@", "yes")
- endif
- 
- ifeq ("@PKGCONFIG@", "yes")

diff --git a/sys-fs/lvm2/lvm2-2.02.188-r3.ebuild b/sys-fs/lvm2/lvm2-2.02.188-r3.ebuild
deleted file mode 100644
index e6fd683ff142..000000000000
--- a/sys-fs/lvm2/lvm2-2.02.188-r3.ebuild
+++ /dev/null
@@ -1,308 +0,0 @@
-# Copyright 1999-2022 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-TMPFILES_OPTIONAL=1
-inherit autotools linux-info systemd toolchain-funcs tmpfiles udev flag-o-matic
-
-DESCRIPTION="User-land utilities for LVM2 (device-mapper) software"
-HOMEPAGE="https://sourceware.org/lvm2/"
-SRC_URI="ftp://sourceware.org/pub/lvm2/${PN/lvm/LVM}.${PV}.tgz
-	ftp://sourceware.org/pub/lvm2/old/${PN/lvm/LVM}.${PV}.tgz"
-
-LICENSE="GPL-2"
-SLOT="0"
-KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux"
-IUSE="readline static static-libs systemd lvm2create-initrd sanlock selinux +udev +thin device-mapper-only"
-REQUIRED_USE="device-mapper-only? ( !lvm2create-initrd !sanlock !thin )
-	static? ( !systemd !udev )
-	static-libs? ( !udev )
-	systemd? ( udev )"
-
-DEPEND_COMMON="
-	dev-libs/libaio[static-libs?]
-	static? ( dev-libs/libaio[static-libs] )
-	!static? ( dev-libs/libaio[static-libs?] )
-	readline? ( sys-libs/readline:0= )
-	sanlock? ( sys-cluster/sanlock )
-	systemd? ( >=sys-apps/systemd-205:0= )
-	udev? ( >=virtual/libudev-208:= )"
-# /run is now required for locking during early boot. /var cannot be assumed to
-# be available -- thus, pull in recent enough baselayout for /run.
-# This version of LVM is incompatible with cryptsetup <1.1.2.
-RDEPEND="${DEPEND_COMMON}
-	>=sys-apps/baselayout-2.2
-	>=sys-apps/util-linux-2.16
-	lvm2create-initrd? ( sys-apps/makedev )
-	!device-mapper-only? ( virtual/tmpfiles )
-	thin? ( >=sys-block/thin-provisioning-tools-0.3.0 )"
-# note: thin- 0.3.0 is required to avoid --disable-thin_check_needs_check
-DEPEND="${DEPEND_COMMON}
-	static? (
-		selinux? ( sys-libs/libselinux[static-libs] )
-		>=sys-apps/util-linux-2.16[static-libs]
-	)"
-BDEPEND="
-	sys-devel/autoconf-archive
-	virtual/pkgconfig
-"
-
-S="${WORKDIR}/${PN/lvm/LVM}.${PV}"
-
-PATCHES=(
-	# Gentoo specific modification(s):
-	"${FILESDIR}"/${PN}-2.02.178-example.conf.in.patch
-
-	# For upstream -- review and forward:
-	"${FILESDIR}"/${PN}-2.02.63-always-make-static-libdm.patch
-	"${FILESDIR}"/${PN}-2.02.56-lvm2create_initrd.patch
-	"${FILESDIR}"/${PN}-2.02.67-createinitrd.patch #301331
-	"${FILESDIR}"/${PN}-2.02.99-locale-muck.patch #330373
-	"${FILESDIR}"/${PN}-2.02.178-asneeded.patch # -Wl,--as-needed
-	"${FILESDIR}"/${PN}-2.02.178-dynamic-static-ldflags.patch #332905
-	"${FILESDIR}"/${PN}-2.02.178-static-pkgconfig-libs.patch #370217, #439414 + blkid
-	"${FILESDIR}"/${PN}-2.02.176-pthread-pkgconfig.patch #492450
-	"${FILESDIR}"/${PN}-2.02.171-static-libm.patch #617756
-	"${FILESDIR}"/${PN}-2.02.166-HPPA-no-O_DIRECT.patch #657446
-	#"${FILESDIR}"/${PN}-2.02.145-mkdev.patch #580062 # Merged upstream
-	"${FILESDIR}"/${PN}-2.02.184-dmeventd-no-idle-exit.patch
-	#"${FILESDIR}"/${PN}-2.02.184-allow-reading-metadata-with-invalid-creation_time.patch #682380 # merged upstream
-	"${FILESDIR}"/${PN}-2.02.184-mksh_build.patch #686652
-	"${FILESDIR}"/${PN}-2.02.186-udev_remove_unsupported_option.patch #700160
-)
-
-pkg_setup() {
-	local CONFIG_CHECK="~SYSVIPC"
-
-	if use udev; then
-		local WARNING_SYSVIPC="CONFIG_SYSVIPC:\tis not set (required for udev sync)\n"
-		if linux_config_exists; then
-			local uevent_helper_path=$(linux_chkconfig_string UEVENT_HELPER_PATH)
-			if [[ -n "${uevent_helper_path}" ]] && [[ "${uevent_helper_path}" != '""' ]]; then
-				ewarn "It's recommended to set an empty value to the following kernel config option:"
-				ewarn "CONFIG_UEVENT_HELPER_PATH=${uevent_helper_path}"
-			fi
-		fi
-	fi
-
-	check_extra_config
-
-	# 1. Genkernel no longer copies /sbin/lvm blindly.
-	if use static; then
-		elog "Warning, we no longer overwrite /sbin/lvm and /sbin/dmsetup with"
-		elog "their static versions. If you need the static binaries,"
-		elog "you must append .static to the filename!"
-	fi
-}
-
-src_prepare() {
-	default
-
-	sed -i \
-		-e "1iAR = $(tc-getAR)" \
-		-e "s:CC ?= @CC@:CC = $(tc-getCC):" \
-		make.tmpl.in || die #444082
-
-	sed -i -e '/FLAG/s:-O2::' configure{.ac,} || die #480212
-
-	if use udev && ! use device-mapper-only; then
-		sed -i -e '/use_lvmetad =/s:0:1:' conf/example.conf.in || die #514196
-		elog "Notice that \"use_lvmetad\" setting is enabled with USE=\"udev\" in"
-		elog "/etc/lvm/lvm.conf, which will require restart of udev, lvm, and lvmetad"
-		elog "if it was previously disabled."
-	fi
-
-	sed -i -e "s:/usr/bin/true:$(type -P true):" scripts/blk_availability_systemd_red_hat.service.in || die #517514
-
-	# Don't install thin man page when not requested
-	if ! use thin ; then
-		sed -i -e 's/^\(MAN7+=.*\) $(LVMTHINMAN) \(.*\)$/\1 \2/' man/Makefile.in || die
-	fi
-
-	eautoreconf
-}
-
-src_configure() {
-	filter-flags -flto
-	local myeconfargs=()
-
-	# Most of this package does weird stuff.
-	# The build options are tristate, and --without is NOT supported
-	# options: 'none', 'internal', 'shared'
-	myeconfargs+=(
-		$(use_enable !device-mapper-only dmfilemapd)
-		$(use_enable !device-mapper-only dmeventd)
-		$(use_enable !device-mapper-only cmdlib)
-		$(use_enable !device-mapper-only applib)
-		$(use_enable !device-mapper-only fsadm)
-		$(use_enable !device-mapper-only lvmetad)
-		$(use_enable !device-mapper-only lvmpolld)
-		$(usex device-mapper-only --disable-udev-systemd-background-jobs '')
-
-		# This only causes the .static versions to become available
-		$(usex static --enable-static_link '')
-
-		# dmeventd requires mirrors to be internal, and snapshot available
-		# so we cannot disable them
-		--with-mirrors="$(usex device-mapper-only none internal)"
-		--with-snapshots="$(usex device-mapper-only none internal)"
-
-		# disable O_DIRECT support on hppa, breaks pv detection (#99532)
-		$(usex hppa --disable-o_direct '')
-	)
-
-	if use thin; then
-		myeconfargs+=( --with-thin=internal --with-cache=internal )
-		local texec
-		for texec in check dump repair restore; do
-			myeconfargs+=( --with-thin-${texec}="${EPREFIX}"/sbin/thin_${texec} )
-			myeconfargs+=( --with-cache-${texec}="${EPREFIX}"/sbin/cache_${texec} )
-		done
-	else
-		myeconfargs+=( --with-thin=none --with-cache=none )
-	fi
-
-	myeconfargs+=( --with-clvmd=none --with-cluster=none )
-
-	myeconfargs+=(
-		$(use_enable readline)
-		$(use_enable selinux)
-		--enable-pkgconfig
-		--with-confdir="${EPREFIX}"/etc
-		--exec-prefix="${EPREFIX}"
-		--sbindir="${EPREFIX}/sbin"
-		--with-staticdir="${EPREFIX}"/sbin
-		--libdir="${EPREFIX}/$(get_libdir)"
-		--with-usrlibdir="${EPREFIX}/usr/$(get_libdir)"
-		--with-default-dm-run-dir=/run
-		--with-default-run-dir=/run/lvm
-		--with-default-locking-dir=/run/lock/lvm
-		--with-default-pid-dir=/run
-		$(use_enable udev udev_rules)
-		$(use_enable udev udev_sync)
-		$(use_with udev udevdir "$(get_udevdir)"/rules.d)
-		$(use_enable sanlock lvmlockd-sanlock)
-		$(use_enable systemd udev-systemd-background-jobs)
-		$(use_enable systemd notify-dbus)
-		--with-systemdsystemunitdir="$(systemd_get_systemunitdir)"
-		CLDFLAGS="${LDFLAGS}"
-	)
-	# Hard-wire this to bash as some shells (dash) don't know
-	# "-o pipefail" #682404
-	CONFIG_SHELL="/bin/bash" \
-	econf "${myeconfargs[@]}"
-}
-
-src_compile() {
-	pushd include >/dev/null
-	emake V=1
-	popd >/dev/null
-
-	if use device-mapper-only ; then
-		emake V=1 device-mapper
-	else
-		emake V=1
-		emake V=1 CC="$(tc-getCC)" -C scripts lvm2_activation_generator_systemd_red_hat
-	fi
-}
-
-src_test() {
-	einfo "Tests are disabled because of device-node mucking, if you want to"
-	einfo "run tests, compile the package and see ${S}/tests"
-}
-
-src_install() {
-	local inst
-	local INSTALL_TARGETS=( install install_tmpfiles_configuration )
-	# install systemd related files only when requested, bug #522430
-	use systemd && INSTALL_TARGETS+=( SYSTEMD_GENERATOR_DIR="$(systemd_get_systemgeneratordir)" install_systemd_units install_systemd_generators )
-	use device-mapper-only && INSTALL_TARGETS=( install_device-mapper )
-	emake V=1 DESTDIR="${D}" "${INSTALL_TARGETS[@]}"
-
-	newinitd "${FILESDIR}"/device-mapper.rc-2.02.105-r2 device-mapper
-	newconfd "${FILESDIR}"/device-mapper.conf-1.02.22-r3 device-mapper
-
-	if use !device-mapper-only ; then
-		newinitd "${FILESDIR}"/dmeventd.initd-2.02.184-r2 dmeventd
-		newinitd "${FILESDIR}"/lvm.rc-2.02.187 lvm
-		newconfd "${FILESDIR}"/lvm.confd-2.02.184-r3 lvm
-		if ! use udev ; then
-			# We keep the variable but remove udev from it.
-			sed -r -i \
-				-e '/^rc_need=/s/\<udev\>//g' \
-				"${ED}/etc/conf.d/lvm" || die "Could not drop udev from rc_need"
-		fi
-
-		newinitd "${FILESDIR}"/lvm-monitoring.initd-2.02.105-r2 lvm-monitoring
-		newinitd "${FILESDIR}"/lvmetad.initd-2.02.116-r3 lvmetad
-		newinitd "${FILESDIR}"/lvmpolld.initd-2.02.183 lvmpolld
-	fi
-
-	if use sanlock; then
-		newinitd "${FILESDIR}"/lvmlockd.initd-2.02.166-r1 lvmlockd
-	fi
-
-	if use static-libs; then
-		dolib.a libdm/ioctl/libdevmapper.a
-		if use !device-mapper-only; then
-			# depends on lvmetad
-			dolib.a libdaemon/client/libdaemonclient.a #462908
-			# depends on dmeventd
-			dolib.a daemons/dmeventd/libdevmapper-event.a
-		fi
-	else
-		rm -f "${ED}"/usr/$(get_libdir)/{libdevmapper-event,liblvm2cmd,liblvm2app,libdevmapper}.a
-	fi
-
-	if use lvm2create-initrd; then
-		dosbin scripts/lvm2create_initrd/lvm2create_initrd
-		doman scripts/lvm2create_initrd/lvm2create_initrd.8
-		newdoc scripts/lvm2create_initrd/README README.lvm2create_initrd
-	fi
-
-	insinto /etc
-	doins "${FILESDIR}"/dmtab
-
-	dodoc README VERSION* WHATS_NEW WHATS_NEW_DM doc/*.{c,txt} conf/*.conf
-}
-
-pkg_postinst() {
-	if ! use device-mapper-only; then
-		tmpfiles_process lvm2.conf
-	fi
-
-	if use udev; then
-		udev_reload
-	fi
-
-	if [[ -z "${REPLACING_VERSIONS}" ]]; then
-		# This is a new installation
-		ewarn "Make sure the \"lvm\" init script is in the runlevels:"
-		ewarn "# rc-update add lvm boot"
-		ewarn
-		ewarn "Make sure to enable lvmetad in /etc/lvm/lvm.conf if you want"
-		ewarn "to enable lvm autoactivation and metadata caching."
-	fi
-
-	if use udev && [[ -d /run ]] ; then
-		local permission_run_expected="drwxr-xr-x"
-		local permission_run=$(stat -c "%A" /run)
-		if [[ "${permission_run}" != "${permission_run_expected}" ]] ; then
-			ewarn "Found the following problematic permissions:"
-			ewarn ""
-			ewarn "    ${permission_run} /run"
-			ewarn ""
-			ewarn "Expected:"
-			ewarn ""
-			ewarn "    ${permission_run_expected} /run"
-			ewarn ""
-			ewarn "This is known to be causing problems for UDEV-enabled LVM services."
-		fi
-	fi
-}
-
-pkg_postrm() {
-	if use udev && [[ -z ${REPLACED_BY_VERSION} ]]; then
-		udev_reload
-	fi
-}


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-fs/lvm2/, sys-fs/lvm2/files/
@ 2022-10-27 17:13 Robin H. Johnson
  0 siblings, 0 replies; 29+ messages in thread
From: Robin H. Johnson @ 2022-10-27 17:13 UTC (permalink / raw
  To: gentoo-commits

commit:     f85aba8b222771e8cc87a6e75d0220cdb2717f78
Author:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
AuthorDate: Thu Oct 27 17:13:09 2022 +0000
Commit:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Thu Oct 27 17:13:23 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f85aba8b

sys-fs/lvm2: fix hardcoded readelf

Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>
Close: https://bugs.gentoo.org/840628

 sys-fs/lvm2/files/lvm2-2.03.16-readelf.patch | 25 +++++++++++++++++++++++++
 sys-fs/lvm2/lvm2-2.03.16.ebuild              |  3 +++
 2 files changed, 28 insertions(+)

diff --git a/sys-fs/lvm2/files/lvm2-2.03.16-readelf.patch b/sys-fs/lvm2/files/lvm2-2.03.16-readelf.patch
new file mode 100644
index 000000000000..b4d60c5825db
--- /dev/null
+++ b/sys-fs/lvm2/files/lvm2-2.03.16-readelf.patch
@@ -0,0 +1,25 @@
+diff -Nuar LVM2.2.03.16.orig/libdm/Makefile.in LVM2.2.03.16/libdm/Makefile.in
+--- LVM2.2.03.16.orig/libdm/Makefile.in	2022-05-18 09:24:20.000000000 -0700
++++ LVM2.2.03.16/libdm/Makefile.in	2022-10-27 10:09:29.283631020 -0700
+@@ -59,6 +59,10 @@
+ 
+ PROGS_CFLAGS = $(UDEV_CFLAGS)
+ 
++ifeq ($(strip $(READELF)),)
++READELF := readelf
++endif
++
+ device-mapper: $(TARGETS)
+ 
+ dm-tools.device-mapper: device-mapper
+@@ -71,8 +75,8 @@
+ # also the older symbol is built-in
+ .symver_check: $(LIB_SHARED)
+ 	@echo "    [CHECK] $<"
+-	$(Q) if readelf -Ws $< | grep -q dm_stats_create_region@@; then \
+-	SYM=$$(readelf -Ws $< | grep dm_stats_create_region@DM_1_02_106); \
++	$(Q) if $(READELF) -Ws $< | grep -q dm_stats_create_region@@; then \
++	SYM=$$( $(READELF) -Ws $< | grep dm_stats_create_region@DM_1_02_106); \
+ 	if test -n "$$SYM"; then touch $@; \
+ 	else echo >&2 "Missing versioned symbols in $<"; false; fi; \
+ 	else touch $@; fi

diff --git a/sys-fs/lvm2/lvm2-2.03.16.ebuild b/sys-fs/lvm2/lvm2-2.03.16.ebuild
index 30a41a0a959c..d3922e5152cf 100644
--- a/sys-fs/lvm2/lvm2-2.03.16.ebuild
+++ b/sys-fs/lvm2/lvm2-2.03.16.ebuild
@@ -69,6 +69,7 @@ PATCHES=(
 	"${FILESDIR}"/${PN}-2.03.14-r1-fopen-to-freopen.patch
 	"${FILESDIR}"/${PN}-2.03.14-r1-mallinfo.patch
 	"${FILESDIR}"/${PN}-2.03.14-freopen_n2.patch
+	"${FILESDIR}"/${PN}-2.03.16-readelf.patch
 )
 
 pkg_setup() {
@@ -162,6 +163,7 @@ src_configure() {
 		myeconfargs+=( --with-thin=none --with-cache=none )
 	fi
 
+	export READELF="$(tc-getREADELF)"
 	myeconfargs+=(
 		$(use_enable readline)
 		$(use_enable selinux)
@@ -184,6 +186,7 @@ src_configure() {
 		$(use_enable systemd notify-dbus)
 		--with-systemdsystemunitdir="$(systemd_get_systemunitdir)"
 		CLDFLAGS="${LDFLAGS}"
+		READELF="${READELF}"
 	)
 	# Hard-wire this to bash as some shells (dash) don't know
 	# "-o pipefail" #682404


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-fs/lvm2/, sys-fs/lvm2/files/
@ 2022-11-18 17:59 Sam James
  0 siblings, 0 replies; 29+ messages in thread
From: Sam James @ 2022-11-18 17:59 UTC (permalink / raw
  To: gentoo-commits

commit:     39e348fad976c54d3980c2149de6365e8d035a4d
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Nov 18 17:59:02 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Nov 18 17:59:02 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=39e348fa

sys-fs/lvm2: fix strerror_r check for musl

Closes: https://bugs.gentoo.org/869404
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../lvm2/files/lvm2-2.03.16-musl-strerror_r.patch  | 23 ++++++++++++++++++++++
 sys-fs/lvm2/lvm2-2.03.16-r2.ebuild                 |  1 +
 2 files changed, 24 insertions(+)

diff --git a/sys-fs/lvm2/files/lvm2-2.03.16-musl-strerror_r.patch b/sys-fs/lvm2/files/lvm2-2.03.16-musl-strerror_r.patch
new file mode 100644
index 000000000000..d485e75ca811
--- /dev/null
+++ b/sys-fs/lvm2/files/lvm2-2.03.16-musl-strerror_r.patch
@@ -0,0 +1,23 @@
+From a06e401bd0479f25631bdfeffaa01d150e5efe59 Mon Sep 17 00:00:00 2001
+From: Sam James <sam@gentoo.org>
+Date: Fri, 18 Nov 2022 17:57:34 +0000
+Subject: [PATCH] Fix strerror_r check for musl
+
+We can't assume that strerror_r returns char* just because _GNU_SOURCE is defined. We already call the appropriate autoconf test, so let's use its result
+(STRERROR_R_CHAR_P).
+
+Note that in configure, _GNU_SOURCE is always set, but we add a defined guard just in case for futureproofing.
+
+Bug: https://bugs.gentoo.org/869404
+Signed-off-by: Sam James <sam@gentoo.org>
+--- a/daemons/lvmpolld/lvmpolld-core.c
++++ b/daemons/lvmpolld/lvmpolld-core.c
+@@ -52,7 +52,7 @@ static pthread_key_t key;
+ 
+ static const char *_strerror_r(int errnum, struct lvmpolld_thread_data *data)
+ {
+-#ifdef _GNU_SOURCE
++#if defined(_GNU_SOURCE) && defined(STRERROR_R_CHAR_P)
+ 	return strerror_r(errnum, data->buf, sizeof(data->buf)); /* never returns NULL */
+ #elif (_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600)
+ 	return strerror_r(errnum, data->buf, sizeof(data->buf)) ? "" : data->buf;

diff --git a/sys-fs/lvm2/lvm2-2.03.16-r2.ebuild b/sys-fs/lvm2/lvm2-2.03.16-r2.ebuild
index 2397a59911fa..dca72ccfd4a0 100644
--- a/sys-fs/lvm2/lvm2-2.03.16-r2.ebuild
+++ b/sys-fs/lvm2/lvm2-2.03.16-r2.ebuild
@@ -73,6 +73,7 @@ PATCHES=(
 	"${FILESDIR}"/${PN}-2.03.14-r1-mallinfo.patch
 	"${FILESDIR}"/${PN}-2.03.14-freopen_n2.patch
 	"${FILESDIR}"/${PN}-2.03.16-readelf.patch
+	"${FILESDIR}"/${PN}-2.03.16-musl-strerror_r.patch
 )
 
 QA_CONFIGURE_OPTIONS="--disable-static"


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-fs/lvm2/, sys-fs/lvm2/files/
@ 2022-11-19 21:05 David Seifert
  0 siblings, 0 replies; 29+ messages in thread
From: David Seifert @ 2022-11-19 21:05 UTC (permalink / raw
  To: gentoo-commits

commit:     e7148c5f08552659798d8e85c45293c2bdad70d4
Author:     David Seifert <soap <AT> gentoo <DOT> org>
AuthorDate: Sat Nov 19 21:04:24 2022 +0000
Commit:     David Seifert <soap <AT> gentoo <DOT> org>
CommitDate: Sat Nov 19 21:04:24 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e7148c5f

sys-fs/lvm2: add 2.03.17

Signed-off-by: David Seifert <soap <AT> gentoo.org>

 sys-fs/lvm2/Manifest                               |   1 +
 .../lvm2-2.03.17-dynamic-static-ldflags.patch      |  50 ++++
 .../lvm2/files/lvm2-2.03.17-example.conf.in.patch  |  42 +++
 sys-fs/lvm2/files/lvm2-2.03.17-locale-muck.patch   |  11 +
 .../files/lvm2-2.03.17-pthread-pkgconfig.patch     |  31 +++
 sys-fs/lvm2/files/lvm2-2.03.17-readelf.patch       |  56 ++++
 sys-fs/lvm2/lvm2-2.03.17.ebuild                    | 303 +++++++++++++++++++++
 7 files changed, 494 insertions(+)

diff --git a/sys-fs/lvm2/Manifest b/sys-fs/lvm2/Manifest
index 27b129ed6b96..d460e037d4b5 100644
--- a/sys-fs/lvm2/Manifest
+++ b/sys-fs/lvm2/Manifest
@@ -1,2 +1,3 @@
 DIST LVM2.2.03.14.tgz 2639538 BLAKE2B 806f5e9cb76a05febef6f8ce8cfc42c92927b9538f62a21029c5ffc426a4fd7c3f32709be08dbd8028b53891b1075d1d13cb3b0d7b1815071ee8eb927d8f3ed3 SHA512 6a93bed1d5cf36f0f48d4d413d028b0e480cd4fc20e25d173770a892f265d2a0cc68d01a720b1513469953649e989532cd0c45f9538f92a4190eb3dc4555857d
 DIST LVM2.2.03.16.tgz 2658805 BLAKE2B 05c6089adff0c61ff1281a05a917f75480ad4acc28cb0214a42589d206a61168f68de07891b9af9814ed7998f16aff6f29ba29b85b23de36f38bf3b5f27802c1 SHA512 084ba4080537359458db936637fc7f83bb9bfcf2de9f3660882551b5c31c7e9900c7d381b238ce1bb7629942c740c121f0dea5e404c302d31ed028b5c65efaa5
+DIST LVM2.2.03.17.tgz 2726793 BLAKE2B 425e52fe2d7832f8440203d2b6ffc3a097903abea8be07bbbf4864001d5f55083954e561a92b0fe4fc467533e465af3958b25cf33d2693f50f077dc3d9b74bd2 SHA512 ce9f4c10a7e89b397fa021098976117c062227da4f25996296dd3678c0aeb826edf9b7e4f5d3992f42156865ae47cb98671ec37a26868710174a473b42cc70a9

diff --git a/sys-fs/lvm2/files/lvm2-2.03.17-dynamic-static-ldflags.patch b/sys-fs/lvm2/files/lvm2-2.03.17-dynamic-static-ldflags.patch
new file mode 100644
index 000000000000..e3228945a325
--- /dev/null
+++ b/sys-fs/lvm2/files/lvm2-2.03.17-dynamic-static-ldflags.patch
@@ -0,0 +1,50 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -32,6 +32,7 @@
+ 	linux*)
+ 		# equivalent to -rdynamic
+ 		ELDFLAGS="-Wl,--export-dynamic"
++		STATIC_LDFLAGS="-Wl,--no-export-dynamic"
+ 		# FIXME Generate list and use --dynamic-list=.dlopen.sym
+ 		CLDWHOLEARCHIVE="-Wl,-whole-archive"
+ 		CLDNOWHOLEARCHIVE="-Wl,-no-whole-archive"
+@@ -1945,6 +1946,7 @@
+ AC_SUBST(SYSCONFDIR)
+ AC_SUBST(SNAPSHOTS)
+ AC_SUBST(STATICDIR)
++AC_SUBST(STATIC_LDFLAGS)
+ AC_SUBST(STATIC_LINK)
+ AC_SUBST(TESTSUITE_DATA)
+ AC_SUBST(THIN)
+--- a/daemons/dmeventd/Makefile.in
++++ b/daemons/dmeventd/Makefile.in
+@@ -76,7 +76,7 @@
+ 
+ dmeventd.static: $(LIB_STATIC) dmeventd.o
+ 	@echo "    [CC] $@"
+-	$(Q) $(CC) $(CFLAGS) $(LDFLAGS) -static dmeventd.o \
++	$(Q) $(CC) $(CFLAGS) $(LDFLAGS) $(STATIC_LDFLAGS) -static dmeventd.o \
+ 		-o $@ $(DL_LIBS) $(DMEVENT_LIBS) $(LIBS) $(STATIC_LIBS)
+ 
+ ifeq ("@PKGCONFIG@", "yes")
+--- a/make.tmpl.in
++++ b/make.tmpl.in
+@@ -64,6 +64,7 @@
+ # FIXME set this only where it's needed, not globally?
+ CFLAGS ?= @COPTIMISE_FLAG@ @CFLAGS@
+ LDFLAGS ?= @LDFLAGS@
++STATIC_LDFLAGS += @STATIC_LDFLAGS@
+ CLDFLAGS += @CLDFLAGS@
+ ELDFLAGS += @ELDFLAGS@
+ LDDEPS += @LDDEPS@
+--- a/tools/Makefile.in
++++ b/tools/Makefile.in
+@@ -137,7 +137,7 @@
+ 
+ lvm.static: $(OBJECTS) lvm-static.o $(LVMINTERNAL_LIBS)
+ 	@echo "    [CC] $@"
+-	$(Q) $(CC) $(CFLAGS) $(LDFLAGS) -static -L$(interfacebuilddir) \
++	$(Q) $(CC) $(CFLAGS) $(LDFLAGS) $(STATIC_LDFLAGS) -static -L$(interfacebuilddir) \
+ 		-o $@ $+ $(LVMLIBS) $(STATIC_LIBS)
+ 
+ liblvm2cmd.a: $(top_builddir)/lib/liblvm-internal.a $(OBJECTS) lvmcmdlib.o lvm2cmd.o

diff --git a/sys-fs/lvm2/files/lvm2-2.03.17-example.conf.in.patch b/sys-fs/lvm2/files/lvm2-2.03.17-example.conf.in.patch
new file mode 100644
index 000000000000..b63b681e5fab
--- /dev/null
+++ b/sys-fs/lvm2/files/lvm2-2.03.17-example.conf.in.patch
@@ -0,0 +1,42 @@
+Add Gentoo specific changes
+
+--- a/conf/example.conf.in
++++ b/conf/example.conf.in
+@@ -170,6 +170,9 @@
+ 	# Example
+ 	# Accept every block device:
+ 	# filter = [ "a|.*|" ]
++	# Gentoo: we exclude /dev/nbd by default, because it makes a lot of kernel
++	# noise when you probed while not available.
++	filter = [ "r|/dev/nbd.*|", "a|.*|" ]
+ 	# Reject the cdrom drive:
+ 	# filter = [ "r|/dev/cdrom|" ]
+ 	# Work with just loopback devices, e.g. for testing:
+@@ -1843,7 +1846,7 @@
+ 
+ # Configuration section metadata.
+ # This configuration section has an automatic default value.
+-# metadata {
++metadata {
+ 
+ 	# Configuration option metadata/check_pv_device_sizes.
+ 	# Check device sizes are not smaller than corresponding PV sizes.
+@@ -1888,7 +1891,8 @@
+ 	#
+ 	# This configuration option is advanced.
+ 	# This configuration option has an automatic default value.
+-	# pvmetadatacopies = 1
++	# Gentoo: enable for data safety, but PV resize is then disabled.
++	# pvmetadatacopies = 2
+ 
+ 	# Configuration option metadata/vgmetadatacopies.
+ 	# Number of copies of metadata to maintain for each VG.
+@@ -1931,7 +1935,7 @@
+ 	# This configuration option is advanced.
+ 	# This configuration option has an automatic default value.
+ 	# stripesize = 64
+-# }
++}
+ 
+ # Configuration section report.
+ # LVM report command output formatting.

diff --git a/sys-fs/lvm2/files/lvm2-2.03.17-locale-muck.patch b/sys-fs/lvm2/files/lvm2-2.03.17-locale-muck.patch
new file mode 100644
index 000000000000..c672a10e2cf6
--- /dev/null
+++ b/sys-fs/lvm2/files/lvm2-2.03.17-locale-muck.patch
@@ -0,0 +1,11 @@
+--- a/make.tmpl.in
++++ b/make.tmpl.in
+@@ -571,7 +571,7 @@
+ 	( cat $(srcdir)/.exported_symbols; \
+ 	  if test -n "$(EXPORTED_HEADER)"; then \
+ 		$(CC) -E -P $(INCLUDES) $(DEFS) $(EXPORTED_HEADER) | \
+-		$(SED) -ne "/^typedef|}/!s/.*[ *]\($(EXPORTED_FN_PREFIX)_[a-z0-9_]*\)(.*/\1/p"; \
++		LC_ALL=C $(SED) -ne "/^typedef|}/!s/.*[ *]\($(EXPORTED_FN_PREFIX)_[a-z0-9_]*\)(.*/\1/p"; \
+ 	  fi \
+ 	) > $@
+ 

diff --git a/sys-fs/lvm2/files/lvm2-2.03.17-pthread-pkgconfig.patch b/sys-fs/lvm2/files/lvm2-2.03.17-pthread-pkgconfig.patch
new file mode 100644
index 000000000000..828cf66667b1
--- /dev/null
+++ b/sys-fs/lvm2/files/lvm2-2.03.17-pthread-pkgconfig.patch
@@ -0,0 +1,31 @@
+Add pthread to libdevmapper pkgconfig file
+
+--- a/libdm/libdevmapper.pc.in
++++ b/libdm/libdevmapper.pc.in
+@@ -9,4 +9,4 @@
+ Cflags: -I${includedir} 
+ Libs: -L${libdir} -ldevmapper
+ Requires.private: @SELINUX_PC@ @UDEV_PC@
+-Libs.private: -lm @RT_LIBS@
++Libs.private: -lm @RT_LIBS@ @PTHREAD_LIBS@
+--- a/tools/Makefile.in
++++ b/tools/Makefile.in
+@@ -89,6 +89,7 @@
+   TARGETS += lvm.static
+   INSTALL_LVM_TARGETS += install_tools_static
+   INSTALL_CMDLIB_TARGETS += install_cmdlib_static
++  STATIC_LIBS += @PTHREAD_LIBS@
+ endif
+ 
+ LIB_VERSION = $(LIB_VERSION_LVM)
+@@ -114,6 +115,10 @@
+ 
+ include $(top_builddir)/make.tmpl
+ 
++ifeq ("@STATIC_LINK@", "yes")
++    STATIC_LIBS += @PTHREAD_LIBS@
++endif
++
+ device-mapper:
+ 
+ all: device-mapper

diff --git a/sys-fs/lvm2/files/lvm2-2.03.17-readelf.patch b/sys-fs/lvm2/files/lvm2-2.03.17-readelf.patch
new file mode 100644
index 000000000000..82870b108e09
--- /dev/null
+++ b/sys-fs/lvm2/files/lvm2-2.03.17-readelf.patch
@@ -0,0 +1,56 @@
+From 2de7e5c222ff114f41dadcf904061d6c2a77eae2 Mon Sep 17 00:00:00 2001
+From: David Seifert <soap@gentoo.org>
+Date: Sat, 19 Nov 2022 17:05:31 +0100
+Subject: [PATCH 1/2] Allow for overriding of `readelf`
+
+* This allows users to use e.g. `llvm-readelf` on systems with binutils as default.
+
+Bug: https://bugs.gentoo.org/840628
+---
+ configure.ac       | 1 +
+ libdm/Makefile.in  | 4 ++--
+ libdm/make.tmpl.in | 1 +
+ 3 files changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 704772b62..f39c87d08 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -83,6 +83,7 @@ AC_PROG_LN_S
+ AC_PROG_MAKE_SET
+ AC_PROG_MKDIR_P
+ AC_PROG_RANLIB
++AC_CHECK_TOOL([READELF], [readelf])
+ AC_CHECK_TOOL(AR, ar)
+ AC_PATH_TOOL(CFLOW_CMD, cflow)
+ AC_PATH_TOOL(CSCOPE_CMD, cscope)
+diff --git a/libdm/Makefile.in b/libdm/Makefile.in
+index 35115d7f0..2758648e6 100644
+--- a/libdm/Makefile.in
++++ b/libdm/Makefile.in
+@@ -71,8 +71,8 @@ libdevmapper.$(LIB_SUFFIX) libdevmapper.$(LIB_SUFFIX).$(LIB_VERSION): $(LIB_SHAR
+ # also the older symbol is built-in
+ .symver_check: $(LIB_SHARED)
+ 	@echo "    [CHECK] $<"
+-	$(Q) if readelf -Ws $< | grep -q dm_stats_create_region@@; then \
+-	SYM=$$(readelf -Ws $< | grep dm_stats_create_region@DM_1_02_106); \
++	$(Q) if $(READELF) -Ws $< | grep -q dm_stats_create_region@@; then \
++	SYM=$$($(READELF) -Ws $< | grep dm_stats_create_region@DM_1_02_106); \
+ 	if test -n "$$SYM"; then touch $@; \
+ 	else echo >&2 "Missing versioned symbols in $<"; false; fi; \
+ 	else touch $@; fi
+diff --git a/libdm/make.tmpl.in b/libdm/make.tmpl.in
+index f1c88fac0..095fb028a 100644
+--- a/libdm/make.tmpl.in
++++ b/libdm/make.tmpl.in
+@@ -34,6 +34,7 @@ ifeq ($(CC), cc)
+ endif
+ 
+ RANLIB = @RANLIB@
++READELF = @READELF@
+ INSTALL = @INSTALL@
+ MKDIR_P = @MKDIR_P@
+ MSGFMT = @MSGFMT@
+-- 
+2.38.1
+

diff --git a/sys-fs/lvm2/lvm2-2.03.17.ebuild b/sys-fs/lvm2/lvm2-2.03.17.ebuild
new file mode 100644
index 000000000000..01f3f1dd4f90
--- /dev/null
+++ b/sys-fs/lvm2/lvm2-2.03.17.ebuild
@@ -0,0 +1,303 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+TMPFILES_OPTIONAL=1
+inherit autotools linux-info systemd toolchain-funcs tmpfiles udev flag-o-matic
+
+DESCRIPTION="User-land utilities for LVM2 (device-mapper) software"
+HOMEPAGE="https://sourceware.org/lvm2/"
+SRC_URI="https://sourceware.org/ftp/lvm2/${PN^^}.${PV}.tgz"
+S="${WORKDIR}/${PN^^}.${PV}"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux"
+IUSE="+lvm lvm2create-initrd readline sanlock selinux static static-libs systemd +thin +udev"
+REQUIRED_USE="
+	static? ( !systemd !udev )
+	static-libs? ( static !udev )
+	systemd? ( udev )
+	thin? ( lvm )"
+
+DEPEND_COMMON="
+	udev? ( virtual/libudev:= )
+	lvm? (
+		dev-libs/libaio
+		sys-apps/util-linux
+		readline? ( sys-libs/readline:= )
+		sanlock? ( sys-cluster/sanlock )
+		systemd? ( sys-apps/systemd:= )
+	)"
+# /run is now required for locking during early boot. /var cannot be assumed to
+# be available -- thus, pull in recent enough baselayout for /run.
+# This version of LVM is incompatible with cryptsetup <1.1.2.
+RDEPEND="${DEPEND_COMMON}
+	>=sys-apps/baselayout-2.2
+	lvm? (
+		virtual/tmpfiles
+		lvm2create-initrd? ( sys-apps/makedev )
+		thin? ( sys-block/thin-provisioning-tools )
+	)"
+# note: thin- 0.3.0 is required to avoid --disable-thin_check_needs_check
+DEPEND="${DEPEND_COMMON}
+	static? (
+		lvm? (
+			dev-libs/libaio[static-libs]
+			sys-apps/util-linux[static-libs]
+			readline? ( sys-libs/readline[static-libs] )
+		)
+		selinux? ( sys-libs/libselinux[static-libs] )
+	)"
+BDEPEND="
+	sys-devel/autoconf-archive
+	virtual/pkgconfig"
+
+PATCHES=(
+	# Gentoo specific modification(s):
+	"${FILESDIR}"/${PN}-2.03.17-example.conf.in.patch
+
+	# For upstream -- review and forward:
+	"${FILESDIR}"/${PN}-2.02.56-lvm2create_initrd.patch
+	"${FILESDIR}"/${PN}-2.02.67-createinitrd.patch #301331
+	"${FILESDIR}"/${PN}-2.03.17-locale-muck.patch #330373
+	"${FILESDIR}"/${PN}-2.03.17-dynamic-static-ldflags.patch #332905
+	"${FILESDIR}"/${PN}-2.03.14-static-pkgconfig-libs.patch #370217, #439414 + blkid
+	"${FILESDIR}"/${PN}-2.03.12-static-pkgconfig-libs-2.patch
+	"${FILESDIR}"/${PN}-2.03.17-pthread-pkgconfig.patch #492450
+	"${FILESDIR}"/${PN}-2.03.12-static-libm.patch #617756
+	"${FILESDIR}"/${PN}-2.02.166-HPPA-no-O_DIRECT.patch #657446
+	"${FILESDIR}"/${PN}-2.03.05-dmeventd-no-idle-exit.patch
+	"${FILESDIR}"/${PN}-2.03.14-r1-fopen-to-freopen.patch
+	"${FILESDIR}"/${PN}-2.03.14-freopen_n2.patch
+	"${FILESDIR}"/${PN}-2.03.16-musl-strerror_r.patch
+	"${FILESDIR}"/${PN}-2.03.17-readelf.patch
+)
+
+QA_CONFIGURE_OPTIONS="--disable-static"
+
+pkg_setup() {
+	local CONFIG_CHECK="~SYSVIPC"
+
+	if use udev; then
+		local WARNING_SYSVIPC="CONFIG_SYSVIPC:\tis not set (required for udev sync)\n"
+		if linux_config_exists; then
+			local uevent_helper_path=$(linux_chkconfig_string UEVENT_HELPER_PATH)
+			if [[ -n "${uevent_helper_path}" ]] && [[ "${uevent_helper_path}" != '""' ]]; then
+				ewarn "It's recommended to set an empty value to the following kernel config option:"
+				ewarn "CONFIG_UEVENT_HELPER_PATH=${uevent_helper_path}"
+			fi
+		fi
+	fi
+
+	check_extra_config
+
+	# 1. Genkernel no longer copies /sbin/lvm blindly.
+	if use static; then
+		elog "Warning, we no longer overwrite /sbin/lvm and /sbin/dmsetup with"
+		elog "their static versions. If you need the static binaries,"
+		elog "you must append .static to the filename!"
+	fi
+}
+
+src_prepare() {
+	default
+
+	# Users without systemd get no auto-activation of any logical volume
+	if ! use systemd ; then
+		eapply "${FILESDIR}"/${PN}-2.03.16-dm_lvm_rules_no_systemd.patch
+	fi
+
+	sed -i -e "s:/usr/bin/true:$(type -P true):" scripts/blk_availability_systemd_red_hat.service.in || die #517514
+
+	eautoreconf
+}
+
+src_configure() {
+	filter-flags -flto
+
+	# Workaround for bug #822210
+	tc-ld-disable-gold
+
+	# Most of this package does weird stuff.
+	# The build options are tristate, and --without is NOT supported
+	# options: 'none', 'internal', 'shared'
+	local myeconfargs=(
+		$(use_enable lvm dmfilemapd)
+		$(use_enable lvm dmeventd)
+		$(use_enable lvm cmdlib)
+		$(use_enable lvm fsadm)
+		$(use_enable lvm lvmpolld)
+		$(usev !lvm --disable-udev-systemd-background-jobs)
+
+		# This only causes the .static versions to become available
+		$(usev static --enable-static_link)
+
+		# dmeventd requires mirrors to be internal, and snapshot available
+		# so we cannot disable them
+		--with-mirrors="$(usex lvm internal none)"
+		--with-snapshots="$(usex lvm internal none)"
+
+		# disable O_DIRECT support on hppa, breaks pv detection (#99532)
+		$(usev hppa --disable-o_direct)
+	)
+
+	if use lvm && use thin; then
+		myeconfargs+=( --with-thin=internal --with-cache=internal )
+		local texec
+		for texec in check dump repair restore; do
+			myeconfargs+=( --with-thin-${texec}="${EPREFIX}"/sbin/thin_${texec} )
+			myeconfargs+=( --with-cache-${texec}="${EPREFIX}"/sbin/cache_${texec} )
+		done
+	else
+		myeconfargs+=( --with-thin=none --with-cache=none )
+	fi
+
+	myeconfargs+=(
+		# musl doesn't do symbol versioning so can end up with
+		# runtime breakage.
+		--with-symvers=$(usex elibc_glibc 'gnu' 'no')
+		$(use_enable readline)
+		$(use_enable selinux)
+		--enable-pkgconfig
+		--with-confdir="${EPREFIX}"/etc
+		--exec-prefix="${EPREFIX}"
+		--sbindir="${EPREFIX}/sbin"
+		--with-staticdir="${EPREFIX}"/sbin
+		--libdir="${EPREFIX}/$(get_libdir)"
+		--with-usrlibdir="${EPREFIX}/usr/$(get_libdir)"
+		--with-default-dm-run-dir=/run
+		--with-default-run-dir=/run/lvm
+		--with-default-locking-dir=/run/lock/lvm
+		--with-default-pid-dir=/run
+		$(use_enable udev udev_rules)
+		$(use_enable udev udev_sync)
+		$(use_with udev udevdir "${EPREFIX}$(get_udevdir)"/rules.d)
+		# USE=sanlock requires USE=lvm
+		$(use_enable $(usex lvm sanlock lvm) lvmlockd-sanlock)
+		$(use_enable systemd udev-systemd-background-jobs)
+		$(use_enable systemd notify-dbus)
+		--with-systemdsystemunitdir="$(systemd_get_systemunitdir)"
+		CLDFLAGS="${LDFLAGS}"
+	)
+
+	# Hard-wire this to bash as some shells (dash) don't know
+	# "-o pipefail" #682404
+	CONFIG_SHELL="${BROOT}"/bin/bash econf "${myeconfargs[@]}"
+}
+
+src_compile() {
+	emake V=1 -C include
+
+	if use lvm ; then
+		emake V=1
+		emake V=1 CC="$(tc-getCC)" -C scripts
+	else
+		emake V=1 device-mapper
+		# https://bugs.gentoo.org/878131
+		emake V=1 -C libdm/dm-tools device-mapper
+	fi
+}
+
+src_test() {
+	einfo "Tests are disabled because of device-node mucking, if you want to"
+	einfo "run tests, compile the package and see ${S}/tests"
+}
+
+src_install() {
+	local INSTALL_TARGETS=(
+		# full LVM2
+		$(usev lvm "install install_tmpfiles_configuration")
+		# install systemd related files only when requested, bug #522430
+		$(usev $(usex lvm systemd lvm) "SYSTEMD_GENERATOR_DIR=$(systemd_get_systemgeneratordir) install_systemd_units install_systemd_generators")
+
+		# install dm unconditionally
+		install_device-mapper
+	)
+	emake V=1 DESTDIR="${D}" "${INSTALL_TARGETS[@]}"
+
+	newinitd "${FILESDIR}"/device-mapper.rc-2.02.105-r2 device-mapper
+	newconfd "${FILESDIR}"/device-mapper.conf-1.02.22-r3 device-mapper
+
+	if use lvm ; then
+		newinitd "${FILESDIR}"/dmeventd.initd-2.02.184-r2 dmeventd
+		newinitd "${FILESDIR}"/lvm.rc-2.02.187 lvm
+		newconfd "${FILESDIR}"/lvm.confd-2.02.184-r3 lvm
+		if ! use udev ; then
+			# We keep the variable but remove udev from it.
+			sed -r -i \
+				-e '/^rc_need=/s/\<udev\>//g' \
+				"${ED}"/etc/conf.d/lvm || die "Could not drop udev from rc_need"
+		fi
+
+		newinitd "${FILESDIR}"/lvm-monitoring.initd-2.02.105-r2 lvm-monitoring
+		newinitd "${FILESDIR}"/lvmpolld.initd-2.02.183 lvmpolld
+
+		if use lvm2create-initrd; then
+			dosbin scripts/lvm2create_initrd/lvm2create_initrd
+			doman scripts/lvm2create_initrd/lvm2create_initrd.8
+			newdoc scripts/lvm2create_initrd/README README.lvm2create_initrd
+		fi
+
+		if use sanlock; then
+			newinitd "${FILESDIR}"/lvmlockd.initd-2.02.166-r1 lvmlockd
+		fi
+	fi
+
+	if use static-libs; then
+		dolib.a libdm/ioctl/libdevmapper.a
+		if use lvm; then
+			# depends on lvmetad
+			dolib.a libdaemon/client/libdaemonclient.a #462908
+			# depends on dmeventd
+			dolib.a daemons/dmeventd/libdevmapper-event.a
+		fi
+	else
+		rm -f "${ED}"/usr/$(get_libdir)/{libdevmapper-event,liblvm2cmd,liblvm2app,libdevmapper}.a || die
+	fi
+
+	insinto /etc
+	doins "${FILESDIR}"/dmtab
+
+	dodoc README VERSION* WHATS_NEW WHATS_NEW_DM doc/*.{c,txt} conf/*.conf
+}
+
+pkg_postinst() {
+	use lvm && tmpfiles_process lvm2.conf
+
+	if use udev; then
+		udev_reload
+	fi
+
+	if [[ -z "${REPLACING_VERSIONS}" ]]; then
+		# This is a new installation
+		ewarn "Make sure the \"lvm\" init script is in the runlevels:"
+		ewarn "# rc-update add lvm boot"
+		ewarn
+		ewarn "Make sure to enable lvmetad in /etc/lvm/lvm.conf if you want"
+		ewarn "to enable lvm autoactivation and metadata caching."
+	fi
+
+	if use udev && [[ -d /run ]] ; then
+		local permission_run_expected="drwxr-xr-x"
+		local permission_run=$(stat -c "%A" /run)
+		if [[ "${permission_run}" != "${permission_run_expected}" ]] ; then
+			ewarn "Found the following problematic permissions:"
+			ewarn ""
+			ewarn "    ${permission_run} /run"
+			ewarn ""
+			ewarn "Expected:"
+			ewarn ""
+			ewarn "    ${permission_run_expected} /run"
+			ewarn ""
+			ewarn "This is known to be causing problems for UDEV-enabled LVM services."
+		fi
+	fi
+}
+
+pkg_postrm() {
+	if use udev && [[ -z ${REPLACED_BY_VERSION} ]]; then
+		udev_reload
+	fi
+}


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-fs/lvm2/, sys-fs/lvm2/files/
@ 2023-01-13 11:11 David Seifert
  0 siblings, 0 replies; 29+ messages in thread
From: David Seifert @ 2023-01-13 11:11 UTC (permalink / raw
  To: gentoo-commits

commit:     12dbea87d40f1e338ae9ca7f9b4afdbb2114df2d
Author:     David Seifert <soap <AT> gentoo <DOT> org>
AuthorDate: Fri Jan 13 11:11:29 2023 +0000
Commit:     David Seifert <soap <AT> gentoo <DOT> org>
CommitDate: Fri Jan 13 11:11:29 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=12dbea87

sys-fs/lvm2: drop 2.03.14-r5

Signed-off-by: David Seifert <soap <AT> gentoo.org>

 sys-fs/lvm2/Manifest                               |   1 -
 .../files/lvm2-2.02.166-HPPA-no-O_DIRECT.patch     |  12 -
 sys-fs/lvm2/files/lvm2-2.02.184-mksh_build.patch   |  13 -
 sys-fs/lvm2/files/lvm2-2.02.99-locale-muck.patch   |  11 -
 .../files/lvm2-2.03.05-pthread-pkgconfig.patch     |  48 ----
 .../lvm2/files/lvm2-2.03.06-example.conf.in.patch  |  56 ----
 .../lvm2-2.03.12-dynamic-static-ldflags.patch      |  76 -----
 .../lvm2-2.03.14-dm_lvm_rules_no_systemd.patch     |  37 ---
 sys-fs/lvm2/files/lvm2-2.03.14-r1-add-fcntl.patch  |  24 --
 sys-fs/lvm2/files/lvm2-2.03.14-r1-mallinfo.patch   |  18 --
 sys-fs/lvm2/lvm2-2.03.14-r5.ebuild                 | 312 ---------------------
 11 files changed, 608 deletions(-)

diff --git a/sys-fs/lvm2/Manifest b/sys-fs/lvm2/Manifest
index 5d8395d11f1b..97f6f93fc328 100644
--- a/sys-fs/lvm2/Manifest
+++ b/sys-fs/lvm2/Manifest
@@ -1,2 +1 @@
-DIST LVM2.2.03.14.tgz 2639538 BLAKE2B 806f5e9cb76a05febef6f8ce8cfc42c92927b9538f62a21029c5ffc426a4fd7c3f32709be08dbd8028b53891b1075d1d13cb3b0d7b1815071ee8eb927d8f3ed3 SHA512 6a93bed1d5cf36f0f48d4d413d028b0e480cd4fc20e25d173770a892f265d2a0cc68d01a720b1513469953649e989532cd0c45f9538f92a4190eb3dc4555857d
 DIST LVM2.2.03.17.tgz 2726793 BLAKE2B 425e52fe2d7832f8440203d2b6ffc3a097903abea8be07bbbf4864001d5f55083954e561a92b0fe4fc467533e465af3958b25cf33d2693f50f077dc3d9b74bd2 SHA512 ce9f4c10a7e89b397fa021098976117c062227da4f25996296dd3678c0aeb826edf9b7e4f5d3992f42156865ae47cb98671ec37a26868710174a473b42cc70a9

diff --git a/sys-fs/lvm2/files/lvm2-2.02.166-HPPA-no-O_DIRECT.patch b/sys-fs/lvm2/files/lvm2-2.02.166-HPPA-no-O_DIRECT.patch
deleted file mode 100644
index 0f830e428b10..000000000000
--- a/sys-fs/lvm2/files/lvm2-2.02.166-HPPA-no-O_DIRECT.patch
+++ /dev/null
@@ -1,12 +0,0 @@
---- a/lib/device/dev-io.c
-+++ b/lib/device/dev-io.c
-@@ -505,7 +505,9 @@
- 			dev->flags |= DEV_NOT_O_NOATIME;
- 			if ((dev->fd = open(name, flags, 0777)) >= 0) {
- 				log_debug_devs("%s: Not using O_NOATIME", name);
-+#ifdef O_DIRECT_SUPPORT
- 				goto opened;
-+#endif
- 			}
- 		}
- #endif

diff --git a/sys-fs/lvm2/files/lvm2-2.02.184-mksh_build.patch b/sys-fs/lvm2/files/lvm2-2.02.184-mksh_build.patch
deleted file mode 100644
index 49c6853f23a7..000000000000
--- a/sys-fs/lvm2/files/lvm2-2.02.184-mksh_build.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-https://bugs.gentoo.org/686652
-
---- LVM2.2.02.184/tools/Makefile.in
-+++ LVM2.2.02.184/tools/Makefile.in
-@@ -220,6 +220,6 @@
- 	  echo "/* Do not edit. This file is generated by the Makefile. */" && \
- 	  echo -en "const char _command_input[] =\n\n\"" && \
- 	  $(EGREP) -v '^#|\-\-\-|^$$' $(srcdir)/command-lines.in | $(AWK) 'BEGIN {ORS = "\\n\"\n\""} //' && \
--	  echo "\\n\";" \
-+	  printf "%s\n" "\\n\";" \
- 	) > $@
- 
- $(SOURCES:%.c=%.d) $(SOURCES2:%.c=%.d): command-lines-input.h command-count.h cmds.h

diff --git a/sys-fs/lvm2/files/lvm2-2.02.99-locale-muck.patch b/sys-fs/lvm2/files/lvm2-2.02.99-locale-muck.patch
deleted file mode 100644
index fe7ec87931e3..000000000000
--- a/sys-fs/lvm2/files/lvm2-2.02.99-locale-muck.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- LVM2/make.tmpl.in
-+++ LVM2/make.tmpl.in
-@@ -395,7 +395,7 @@
- 	( cat $(srcdir)/.exported_symbols; \
- 	  if test x$(EXPORTED_HEADER) != x; then \
- 		$(CC) -E -P $(INCLUDES) $(DEFS) $(EXPORTED_HEADER) | \
--		$(SED) -ne "/^typedef|}/!s/.*[ *]\($(EXPORTED_FN_PREFIX)_[a-z0-9_]*\)(.*/\1/p"; \
-+		LC_ALL=C $(SED) -ne "/^typedef|}/!s/.*[ *]\($(EXPORTED_FN_PREFIX)_[a-z0-9_]*\)(.*/\1/p"; \
- 	  fi \
- 	) > $@
- 

diff --git a/sys-fs/lvm2/files/lvm2-2.03.05-pthread-pkgconfig.patch b/sys-fs/lvm2/files/lvm2-2.03.05-pthread-pkgconfig.patch
deleted file mode 100644
index 56aa2a7b79fc..000000000000
--- a/sys-fs/lvm2/files/lvm2-2.03.05-pthread-pkgconfig.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-From dbb68df8d02eff87f10df331e17bd0940e158f56 Mon Sep 17 00:00:00 2001
-From: "Robin H. Johnson" <robbat2@gentoo.org>
-Date: Wed, 24 Jul 2019 11:15:59 +0200
-Subject: [PATCH] Add pthread to libdevmapper pkgconfig file
-
-Forward-ported from 2.02.176 to 2.03.05
-Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>
----
- libdm/libdevmapper.pc.in | 2 +-
- tools/Makefile.in        | 5 +++++
- 2 files changed, 6 insertions(+), 1 deletion(-)
-
-diff --git a/libdm/libdevmapper.pc.in b/libdm/libdevmapper.pc.in
-index a325aeb9e0..aa0980378f 100644
---- a/libdm/libdevmapper.pc.in
-+++ b/libdm/libdevmapper.pc.in
-@@ -9,4 +9,4 @@ Version: @DM_LIB_PATCHLEVEL@
- Cflags: -I${includedir} 
- Libs: -L${libdir} -ldevmapper
- Requires.private: @SELINUX_PC@ @UDEV_PC@
--Libs.private: -lm @RT_LIBS@
-+Libs.private: -lm @RT_LIBS@ @PTHREAD_LIBS@
-diff --git a/tools/Makefile.in b/tools/Makefile.in
-index e5fc9c4ae4..12e4de2c63 100644
---- a/tools/Makefile.in
-+++ b/tools/Makefile.in
-@@ -87,6 +87,7 @@ ifeq ("@STATIC_LINK@", "yes")
-   TARGETS += lvm.static
-   INSTALL_LVM_TARGETS += install_tools_static
-   INSTALL_CMDLIB_TARGETS += install_cmdlib_static
-+  STATIC_LIBS += @PTHREAD_LIBS@
- endif
- 
- LVMLIBS = $(SYSTEMD_LIBS) -L$(top_builddir)/libdm -ldevmapper $(LIBS) -laio
-@@ -113,6 +114,10 @@ CFLOW_TARGET = lvm
- 
- include $(top_builddir)/make.tmpl
- 
-+ifeq ("@STATIC_LINK@", "yes")
-+    STATIC_LIBS += @PTHREAD_LIBS@
-+endif
-+
- device-mapper:
- 
- all: device-mapper
--- 
-2.22.0
-

diff --git a/sys-fs/lvm2/files/lvm2-2.03.06-example.conf.in.patch b/sys-fs/lvm2/files/lvm2-2.03.06-example.conf.in.patch
deleted file mode 100644
index 329bfde6ca91..000000000000
--- a/sys-fs/lvm2/files/lvm2-2.03.06-example.conf.in.patch
+++ /dev/null
@@ -1,56 +0,0 @@
-From a26cc1e7e299b61d1877ead03aacafef9fbe81ff Mon Sep 17 00:00:00 2001
-From: "Robin H. Johnson" <robbat2@gentoo.org>
-Date: Fri, 25 Oct 2019 08:45:17 +0200
-Subject: [PATCH] Add Gentoo specific changes
-
-Forward-ported from 2.03.05 to 2.03.06
-Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>
----
- conf/example.conf.in | 10 +++++++---
- 1 file changed, 7 insertions(+), 3 deletions(-)
-
-diff --git a/conf/example.conf.in b/conf/example.conf.in
-index 05b0857920..33ffb0097c 100644
---- a/conf/example.conf.in
-+++ b/conf/example.conf.in
-@@ -143,6 +143,9 @@ devices {
- 	# Example
- 	# Accept every block device:
- 	# filter = [ "a|.*|" ]
-+	# Gentoo: we exclude /dev/nbd by default, because it makes a lot of kernel
-+	# noise when you probed while not available.
-+	filter = [ "r|/dev/nbd.*|", "a|.*|" ]
- 	# Reject the cdrom drive:
- 	# filter = [ "r|/dev/cdrom|" ]
- 	# Work with just loopback devices, e.g. for testing:
-@@ -1680,7 +1683,7 @@ activation {
- 
- # Configuration section metadata.
- # This configuration section has an automatic default value.
--# metadata {
-+metadata {
- 
- 	# Configuration option metadata/check_pv_device_sizes.
- 	# Check device sizes are not smaller than corresponding PV sizes.
-@@ -1725,7 +1728,8 @@ activation {
- 	# 
- 	# This configuration option is advanced.
- 	# This configuration option has an automatic default value.
--	# pvmetadatacopies = 1
-+	# Gentoo: enable for data safety, but PV resize is then disabled.
-+	# pvmetadatacopies = 2
- 
- 	# Configuration option metadata/vgmetadatacopies.
- 	# Number of copies of metadata to maintain for each VG.
-@@ -1768,7 +1772,7 @@ activation {
- 	# This configuration option is advanced.
- 	# This configuration option has an automatic default value.
- 	# stripesize = 64
--# }
-+}
- 
- # Configuration section report.
- # LVM report command output formatting.
--- 
-2.24.0.rc1
-

diff --git a/sys-fs/lvm2/files/lvm2-2.03.12-dynamic-static-ldflags.patch b/sys-fs/lvm2/files/lvm2-2.03.12-dynamic-static-ldflags.patch
deleted file mode 100644
index 80b6bc7a023f..000000000000
--- a/sys-fs/lvm2/files/lvm2-2.03.12-dynamic-static-ldflags.patch
+++ /dev/null
@@ -1,76 +0,0 @@
-From 4bdd215fd84e83a8119d0b971904221743a87a23 Mon Sep 17 00:00:00 2001
-From: "Robin H. Johnson" <robbat2@gentoo.org>
-Date: Wed, 24 Jul 2019 11:11:35 +0200
-Subject: [PATCH] Add dynamic static ldflags
-
-Forward-ported from 2.02.178 to 2.03.05
-Forward-ported from 2.03.05 to 2.03.12
-Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>
----
- configure.ac                 | 2 ++
- daemons/dmeventd/Makefile.in | 2 +-
- make.tmpl.in                 | 1 +
- tools/Makefile.in            | 2 +-
- 4 files changed, 5 insertions(+), 2 deletions(-)
-
-diff --git a/configure.ac b/configure.ac
-index 1a49e7fe7e..354b53b5ec 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -32,6 +32,7 @@ case "$host_os" in
- 	linux*)
- 		# equivalent to -rdynamic
- 		ELDFLAGS="-Wl,--export-dynamic"
-+		STATIC_LDFLAGS="-Wl,--no-export-dynamic"
- 		# FIXME Generate list and use --dynamic-list=.dlopen.sym
- 		CLDWHOLEARCHIVE="-Wl,-whole-archive"
- 		CLDNOWHOLEARCHIVE="-Wl,-no-whole-archive"
-@@ -1860,6 +1861,7 @@ AC_SUBST(SYSCONFDIR)
- AC_SUBST(SYSTEMD_LIBS)
- AC_SUBST(SNAPSHOTS)
- AC_SUBST(STATICDIR)
-+AC_SUBST(STATIC_LDFLAGS)
- AC_SUBST(STATIC_LINK)
- AC_SUBST(TESTSUITE_DATA)
- AC_SUBST(THIN)
-diff --git a/daemons/dmeventd/Makefile.in b/daemons/dmeventd/Makefile.in
-index af51198aae..f7896e581e 100644
---- a/daemons/dmeventd/Makefile.in
-+++ b/daemons/dmeventd/Makefile.in
-@@ -76,7 +76,7 @@ dmeventd: $(LIB_SHARED) dmeventd.o
- 
- dmeventd.static: $(LIB_STATIC) dmeventd.o
- 	@echo "    [CC] $@"
--	$(Q) $(CC) $(CFLAGS) $(LDFLAGS) -static dmeventd.o \
-+	$(Q) $(CC) $(CFLAGS) $(LDFLAGS) $(STATIC_LDFLAGS) -static dmeventd.o \
- 		-o $@ $(DL_LIBS) $(DMEVENT_LIBS) $(LIBS) $(STATIC_LIBS)
- 
- ifeq ("@PKGCONFIG@", "yes")
-diff --git a/make.tmpl.in b/make.tmpl.in
-index 200ea2e05f..99f02e8b77 100644
---- a/make.tmpl.in
-+++ b/make.tmpl.in
-@@ -69,6 +69,7 @@ DEFS += @DEFS@
- # FIXME set this only where it's needed, not globally?
- CFLAGS ?= @COPTIMISE_FLAG@ @CFLAGS@
- LDFLAGS ?= @LDFLAGS@
-+STATIC_LDFLAGS += @STATIC_LDFLAGS@
- CLDFLAGS += @CLDFLAGS@
- ELDFLAGS += @ELDFLAGS@
- LDDEPS += @LDDEPS@
-diff --git a/tools/Makefile.in b/tools/Makefile.in
-index ec546ca632..cdede2a058 100644
---- a/tools/Makefile.in
-+++ b/tools/Makefile.in
-@@ -137,7 +137,7 @@ man-generator: man-generator.o
- 
- lvm.static: $(OBJECTS) lvm-static.o $(LVMINTERNAL_LIBS)
- 	@echo "    [CC] $@"
--	$(Q) $(CC) $(CFLAGS) $(LDFLAGS) -static -L$(interfacebuilddir) \
-+	$(Q) $(CC) $(CFLAGS) $(LDFLAGS) $(STATIC_LDFLAGS) -static -L$(interfacebuilddir) \
- 		-o $@ $+ $(LVMLIBS) $(STATIC_LIBS)
- 
- liblvm2cmd.a: $(top_builddir)/lib/liblvm-internal.a $(OBJECTS) lvmcmdlib.o lvm2cmd.o
--- 
-2.31.1
-

diff --git a/sys-fs/lvm2/files/lvm2-2.03.14-dm_lvm_rules_no_systemd.patch b/sys-fs/lvm2/files/lvm2-2.03.14-dm_lvm_rules_no_systemd.patch
deleted file mode 100644
index 0b4a156c630f..000000000000
--- a/sys-fs/lvm2/files/lvm2-2.03.14-dm_lvm_rules_no_systemd.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-From 88d5b3d711c8546864e57dbfba7591a19be80c4d Mon Sep 17 00:00:00 2001
-From: Lars Wendler <polynomial-c@gentoo.org>
-Date: Mon, 27 Dec 2021 00:53:21 +0100
-Subject: [PATCH] Don't use systemd-run in 69-dm-lvm.rules
-
-some people don't run systemd
----
- udev/69-dm-lvm.rules.in | 6 +++---
- 1 file changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/udev/69-dm-lvm.rules.in b/udev/69-dm-lvm.rules.in
-index 39e5b9807..6ba4efa0f 100644
---- a/udev/69-dm-lvm.rules.in
-+++ b/udev/69-dm-lvm.rules.in
-@@ -62,8 +62,8 @@ ENV{SYSTEMD_READY}="1"
- # LVM_VG_NAME_COMPLETE='foo'
- #
- # When the VG is complete it can be activated, so
--# vgchange -aay <vgname> is run.  It is run via
--# systemd since it can take longer to run than
-+# vgchange -aay <vgname> is run.  It can take
-+# longer to run than
- # udev wants to block when processing rules.
- # (if there are hundreds of LVs to activate,
- # the vgchange can take many seconds.)
-@@ -80,7 +80,7 @@ ENV{SYSTEMD_READY}="1"
- # it's better suited to appearing in the journal.
- 
- IMPORT{program}="(LVM_EXEC)/lvm pvscan --cache --listvg --checkcomplete --vgonline --udevoutput --journal=output $env{DEVNAME}"
--ENV{LVM_VG_NAME_COMPLETE}=="?*", RUN+="/usr/bin/systemd-run -r --no-block --property DefaultDependencies=no --unit lvm-activate-$env{LVM_VG_NAME_COMPLETE} lvm vgchange -aay --nohints $env{LVM_VG_NAME_COMPLETE}"
-+ENV{LVM_VG_NAME_COMPLETE}=="?*", RUN+="(LVM_EXEC)/lvm vgchange -aay --nohints $env{LVM_VG_NAME_COMPLETE}"
- GOTO="lvm_end"
- 
- LABEL="lvm_end"
--- 
-2.34.1
-

diff --git a/sys-fs/lvm2/files/lvm2-2.03.14-r1-add-fcntl.patch b/sys-fs/lvm2/files/lvm2-2.03.14-r1-add-fcntl.patch
deleted file mode 100644
index 1b5524a61405..000000000000
--- a/sys-fs/lvm2/files/lvm2-2.03.14-r1-add-fcntl.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-https://bugs.gentoo.org/712336
-https://bugs.gentoo.org/549506
-
-Adds fcntl.h into daemon-server.c to define fcntl and some constants.
-
----
- libdaemon/server/daemon-server.c | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/libdaemon/server/daemon-server.c b/libdaemon/server/daemon-server.c
-index 88905a7..771b021 100644
---- a/libdaemon/server/daemon-server.c
-+++ b/libdaemon/server/daemon-server.c
-@@ -28,6 +28,7 @@
- #include <sys/un.h>
- #include <unistd.h>
- #include <signal.h>
-+#include <fcntl.h>
- 
- #include <syslog.h> /* FIXME. For the global closelog(). */
- 
--- 
-2.35.1
-

diff --git a/sys-fs/lvm2/files/lvm2-2.03.14-r1-mallinfo.patch b/sys-fs/lvm2/files/lvm2-2.03.14-r1-mallinfo.patch
deleted file mode 100644
index af4cbc0d5aab..000000000000
--- a/sys-fs/lvm2/files/lvm2-2.03.14-r1-mallinfo.patch
+++ /dev/null
@@ -1,18 +0,0 @@
-https://git.alpinelinux.org/aports/tree/main/lvm2/mallinfo.patch
-
-Patch from Alpine, disables _allocate_memory since mallinfo isn't defined in musl.
-19:17 <@sam_> your caution is well-advised, but it should be safe enough given it's only affecting the non-glibc path
-
-Should be looked back to!
-
---- ./lib/mm/memlock.c.orig	2015-03-09 11:18:41.560028850 -0100
-+++ ./lib/mm/memlock.c	2015-03-09 11:19:54.504373309 -0100
-@@ -137,7 +137,7 @@
- 
- static void _allocate_memory(void)
- {
--#ifndef VALGRIND_POOL
-+#if !defined(VALGRIND_POOL) && defined(__GLIBC__)
- 	void *stack_mem;
- 	struct rlimit limit;
- 	int i, area = 0, missing = _size_malloc_tmp, max_areas = 32, hblks;

diff --git a/sys-fs/lvm2/lvm2-2.03.14-r5.ebuild b/sys-fs/lvm2/lvm2-2.03.14-r5.ebuild
deleted file mode 100644
index f07d1b50f8f3..000000000000
--- a/sys-fs/lvm2/lvm2-2.03.14-r5.ebuild
+++ /dev/null
@@ -1,312 +0,0 @@
-# Copyright 1999-2023 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-TMPFILES_OPTIONAL=1
-inherit autotools linux-info systemd toolchain-funcs tmpfiles udev flag-o-matic
-
-DESCRIPTION="User-land utilities for LVM2 (device-mapper) software"
-HOMEPAGE="https://sourceware.org/lvm2/"
-SRC_URI="ftp://sourceware.org/pub/lvm2/${PN/lvm/LVM}.${PV}.tgz
-	ftp://sourceware.org/pub/lvm2/old/${PN/lvm/LVM}.${PV}.tgz"
-
-LICENSE="GPL-2"
-SLOT="0"
-KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux"
-IUSE="readline static static-libs systemd lvm lvm2create-initrd sanlock selinux +udev thin"
-REQUIRED_USE="!lvm? ( !lvm2create-initrd !sanlock !thin )
-	static? ( !systemd !udev )
-	static-libs? ( static !udev )
-	systemd? ( udev )"
-
-DEPEND_COMMON="
-	dev-libs/libaio[static-libs?]
-	static? ( dev-libs/libaio[static-libs] )
-	!static? ( dev-libs/libaio[static-libs?] )
-	readline? ( sys-libs/readline:0= )
-	sanlock? ( sys-cluster/sanlock )
-	systemd? ( >=sys-apps/systemd-205:0= )
-	udev? ( >=virtual/libudev-208:= )"
-# /run is now required for locking during early boot. /var cannot be assumed to
-# be available -- thus, pull in recent enough baselayout for /run.
-# This version of LVM is incompatible with cryptsetup <1.1.2.
-RDEPEND="${DEPEND_COMMON}
-	>=sys-apps/baselayout-2.2
-	>=sys-apps/util-linux-2.16
-	lvm2create-initrd? ( sys-apps/makedev )
-	lvm? ( virtual/tmpfiles )
-	thin? ( >=sys-block/thin-provisioning-tools-0.3.0 )"
-# note: thin- 0.3.0 is required to avoid --disable-thin_check_needs_check
-DEPEND="${DEPEND_COMMON}
-	static? (
-		readline? ( sys-libs/readline[static-libs] )
-		selinux? ( sys-libs/libselinux[static-libs] )
-		>=sys-apps/util-linux-2.16[static-libs]
-	)"
-BDEPEND="
-	sys-devel/autoconf-archive
-	virtual/pkgconfig
-"
-
-S="${WORKDIR}/${PN/lvm/LVM}.${PV}"
-
-PATCHES=(
-	# Gentoo specific modification(s):
-	"${FILESDIR}"/${PN}-2.03.06-example.conf.in.patch
-
-	# For upstream -- review and forward:
-	"${FILESDIR}"/${PN}-2.02.56-lvm2create_initrd.patch
-	"${FILESDIR}"/${PN}-2.02.67-createinitrd.patch #301331
-	"${FILESDIR}"/${PN}-2.02.99-locale-muck.patch #330373
-	"${FILESDIR}"/${PN}-2.03.12-dynamic-static-ldflags.patch #332905
-	"${FILESDIR}"/${PN}-2.03.14-static-pkgconfig-libs.patch #370217, #439414 + blkid
-	"${FILESDIR}"/${PN}-2.03.12-static-pkgconfig-libs-2.patch
-	"${FILESDIR}"/${PN}-2.03.05-pthread-pkgconfig.patch #492450
-	"${FILESDIR}"/${PN}-2.03.12-static-libm.patch #617756
-	"${FILESDIR}"/${PN}-2.02.166-HPPA-no-O_DIRECT.patch #657446
-	"${FILESDIR}"/${PN}-2.03.05-dmeventd-no-idle-exit.patch
-	"${FILESDIR}"/${PN}-2.02.184-mksh_build.patch #686652
-	"${FILESDIR}"/${PN}-2.03.14-r1-add-fcntl.patch
-	"${FILESDIR}"/${PN}-2.03.14-r1-fopen-to-freopen.patch
-	"${FILESDIR}"/${PN}-2.03.14-r1-mallinfo.patch
-	"${FILESDIR}"/${PN}-2.03.14-freopen_n2.patch
-)
-
-pkg_setup() {
-	local CONFIG_CHECK="~SYSVIPC"
-
-	if use udev; then
-		local WARNING_SYSVIPC="CONFIG_SYSVIPC:\tis not set (required for udev sync)\n"
-		if linux_config_exists; then
-			local uevent_helper_path=$(linux_chkconfig_string UEVENT_HELPER_PATH)
-			if [[ -n "${uevent_helper_path}" ]] && [[ "${uevent_helper_path}" != '""' ]]; then
-				ewarn "It's recommended to set an empty value to the following kernel config option:"
-				ewarn "CONFIG_UEVENT_HELPER_PATH=${uevent_helper_path}"
-			fi
-		fi
-	fi
-
-	check_extra_config
-
-	# 1. Genkernel no longer copies /sbin/lvm blindly.
-	if use static; then
-		elog "Warning, we no longer overwrite /sbin/lvm and /sbin/dmsetup with"
-		elog "their static versions. If you need the static binaries,"
-		elog "you must append .static to the filename!"
-	fi
-}
-
-src_prepare() {
-	default
-
-	# Users without systemd get no auto-activation of any logical volume
-	if ! use systemd ; then
-		eapply "${FILESDIR}"/${PN}-2.03.14-dm_lvm_rules_no_systemd.patch
-		sed -i -e '/^USE_SD_NOTIFY=yes$/s/yes/no/' daemons/lvmlockd/Makefile.in || die
-	fi
-
-	sed -i \
-		-e "1iAR = $(tc-getAR)" \
-		-e "s:CC ?= @CC@:CC = $(tc-getCC):" \
-		make.tmpl.in || die #444082
-
-	sed -i -e '/FLAG/s:-O2::' configure{.ac,} || die #480212
-
-	sed -i -e "s:/usr/bin/true:$(type -P true):" scripts/blk_availability_systemd_red_hat.service.in || die #517514
-
-	# Don't install thin man page when not requested
-	if ! use thin ; then
-		sed -i -e 's/^\(MAN7+=.*\) $(LVMTHINMAN) \(.*\)$/\1 \2/' man/Makefile.in || die
-	fi
-
-	eautoreconf
-}
-
-src_configure() {
-	filter-flags -flto
-
-	# Workaround for bug #822210
-	tc-ld-disable-gold
-
-	local myeconfargs=()
-
-	# Most of this package does weird stuff.
-	# The build options are tristate, and --without is NOT supported
-	# options: 'none', 'internal', 'shared'
-	myeconfargs+=(
-		$(use_enable lvm dmfilemapd)
-		$(use_enable lvm dmeventd)
-		$(use_enable lvm cmdlib)
-		$(use_enable lvm fsadm)
-		$(use_enable lvm lvmpolld)
-		$(usex !lvm --disable-udev-systemd-background-jobs '')
-
-		# This only causes the .static versions to become available
-		$(usex static --enable-static_link '')
-
-		# dmeventd requires mirrors to be internal, and snapshot available
-		# so we cannot disable them
-		--with-mirrors="$(usex !lvm none internal)"
-		--with-snapshots="$(usex !lvm none internal)"
-
-		# disable O_DIRECT support on hppa, breaks pv detection (#99532)
-		$(usex hppa --disable-o_direct '')
-	)
-
-	if use thin; then
-		myeconfargs+=( --with-thin=internal --with-cache=internal )
-		local texec
-		for texec in check dump repair restore; do
-			myeconfargs+=( --with-thin-${texec}="${EPREFIX}"/sbin/thin_${texec} )
-			myeconfargs+=( --with-cache-${texec}="${EPREFIX}"/sbin/cache_${texec} )
-		done
-	else
-		myeconfargs+=( --with-thin=none --with-cache=none )
-	fi
-
-	myeconfargs+=(
-		$(use_enable readline)
-		$(use_enable selinux)
-		--enable-pkgconfig
-		--with-confdir="${EPREFIX}"/etc
-		--exec-prefix="${EPREFIX}"
-		--sbindir="${EPREFIX}/sbin"
-		--with-staticdir="${EPREFIX}"/sbin
-		--libdir="${EPREFIX}/$(get_libdir)"
-		--with-usrlibdir="${EPREFIX}/usr/$(get_libdir)"
-		--with-default-dm-run-dir=/run
-		--with-default-run-dir=/run/lvm
-		--with-default-locking-dir=/run/lock/lvm
-		--with-default-pid-dir=/run
-		$(use_enable udev udev_rules)
-		$(use_enable udev udev_sync)
-		$(use_with udev udevdir "${EPREFIX}$(get_udevdir)"/rules.d)
-		$(use_enable sanlock lvmlockd-sanlock)
-		$(use_enable systemd udev-systemd-background-jobs)
-		$(use_enable systemd notify-dbus)
-		$(use_enable systemd app-machineid)
-		$(use_enable systemd systemd-journal)
-		--with-systemdsystemunitdir="$(systemd_get_systemunitdir)"
-		CLDFLAGS="${LDFLAGS}"
-	)
-	# Hard-wire this to bash as some shells (dash) don't know
-	# "-o pipefail" #682404
-	CONFIG_SHELL="/bin/bash" \
-	econf "${myeconfargs[@]}"
-}
-
-src_compile() {
-	pushd include >/dev/null
-	emake V=1
-	popd >/dev/null
-
-	if use !lvm ; then
-		emake V=1 device-mapper
-		# https://bugs.gentoo.org/878131
-		emake -C libdm/dm-tools V=1 device-mapper
-	else
-		emake V=1
-		emake V=1 CC="$(tc-getCC)" -C scripts lvm2_activation_generator_systemd_red_hat
-	fi
-}
-
-src_test() {
-	einfo "Tests are disabled because of device-node mucking, if you want to"
-	einfo "run tests, compile the package and see ${S}/tests"
-}
-
-src_install() {
-	local inst
-	local INSTALL_TARGETS=( install install_tmpfiles_configuration )
-	# install systemd related files only when requested, bug #522430
-	use systemd && INSTALL_TARGETS+=( SYSTEMD_GENERATOR_DIR="$(systemd_get_systemgeneratordir)" install_systemd_units install_systemd_generators )
-	use !lvm && INSTALL_TARGETS=( install_device-mapper )
-	emake V=1 DESTDIR="${D}" "${INSTALL_TARGETS[@]}"
-
-	newinitd "${FILESDIR}"/device-mapper.rc-2.02.105-r2 device-mapper
-	newconfd "${FILESDIR}"/device-mapper.conf-1.02.22-r3 device-mapper
-
-	if use lvm ; then
-		newinitd "${FILESDIR}"/dmeventd.initd-2.02.184-r2 dmeventd
-		newinitd "${FILESDIR}"/lvm.rc-2.02.187 lvm
-		newconfd "${FILESDIR}"/lvm.confd-2.02.184-r3 lvm
-		if ! use udev ; then
-			# We keep the variable but remove udev from it.
-			sed -r -i \
-				-e '/^rc_need=/s/\<udev\>//g' \
-				"${ED}/etc/conf.d/lvm" || die "Could not drop udev from rc_need"
-		fi
-
-		newinitd "${FILESDIR}"/lvm-monitoring.initd-2.02.105-r2 lvm-monitoring
-		newinitd "${FILESDIR}"/lvmpolld.initd-2.02.183 lvmpolld
-	fi
-
-	if use sanlock; then
-		newinitd "${FILESDIR}"/lvmlockd.initd-2.02.166-r1 lvmlockd
-	fi
-
-	if use static-libs; then
-		dolib.a libdm/ioctl/libdevmapper.a
-		if use lvm; then
-			# depends on lvmetad
-			dolib.a libdaemon/client/libdaemonclient.a #462908
-			# depends on dmeventd
-			dolib.a daemons/dmeventd/libdevmapper-event.a
-		fi
-	else
-		rm -f "${ED}"/usr/$(get_libdir)/{libdevmapper-event,liblvm2cmd,liblvm2app,libdevmapper}.a
-	fi
-
-	if use lvm2create-initrd; then
-		dosbin scripts/lvm2create_initrd/lvm2create_initrd
-		doman scripts/lvm2create_initrd/lvm2create_initrd.8
-		newdoc scripts/lvm2create_initrd/README README.lvm2create_initrd
-	fi
-
-	insinto /etc
-	doins "${FILESDIR}"/dmtab
-
-	dodoc README VERSION* WHATS_NEW WHATS_NEW_DM doc/*.{c,txt} conf/*.conf
-}
-
-pkg_postinst() {
-	if use lvm; then
-		tmpfiles_process lvm2.conf
-	fi
-
-	if use udev; then
-		udev_reload
-	fi
-
-	if [[ -z "${REPLACING_VERSIONS}" ]]; then
-		# This is a new installation
-		ewarn "Make sure the \"lvm\" init script is in the runlevels:"
-		ewarn "# rc-update add lvm boot"
-		ewarn
-		ewarn "Make sure to enable lvmetad in /etc/lvm/lvm.conf if you want"
-		ewarn "to enable lvm autoactivation and metadata caching."
-	fi
-
-	if use udev && [[ -d /run ]] ; then
-		local permission_run_expected="drwxr-xr-x"
-		local permission_run=$(stat -c "%A" /run)
-		if [[ "${permission_run}" != "${permission_run_expected}" ]] ; then
-			ewarn "Found the following problematic permissions:"
-			ewarn ""
-			ewarn "    ${permission_run} /run"
-			ewarn ""
-			ewarn "Expected:"
-			ewarn ""
-			ewarn "    ${permission_run_expected} /run"
-			ewarn ""
-			ewarn "This is known to be causing problems for UDEV-enabled LVM services."
-		fi
-	fi
-}
-
-pkg_postrm() {
-	if use udev && [[ -z ${REPLACED_BY_VERSION} ]]; then
-		udev_reload
-	fi
-}


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-fs/lvm2/, sys-fs/lvm2/files/
@ 2023-01-28 13:38 David Seifert
  0 siblings, 0 replies; 29+ messages in thread
From: David Seifert @ 2023-01-28 13:38 UTC (permalink / raw
  To: gentoo-commits

commit:     a426f18f919e26917aa46b8791931a29c779a2cb
Author:     David Seifert <soap <AT> gentoo <DOT> org>
AuthorDate: Sat Jan 28 13:38:18 2023 +0000
Commit:     David Seifert <soap <AT> gentoo <DOT> org>
CommitDate: Sat Jan 28 13:38:18 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a426f18f

sys-fs/lvm2: add 2.03.18

Signed-off-by: David Seifert <soap <AT> gentoo.org>

 sys-fs/lvm2/Manifest                              |   1 +
 sys-fs/lvm2/files/lvm2-2.03.18-freopen-musl.patch |  60 +++++
 sys-fs/lvm2/lvm2-2.03.18.ebuild                   | 315 ++++++++++++++++++++++
 3 files changed, 376 insertions(+)

diff --git a/sys-fs/lvm2/Manifest b/sys-fs/lvm2/Manifest
index 97f6f93fc328..b7ce1cc25e6d 100644
--- a/sys-fs/lvm2/Manifest
+++ b/sys-fs/lvm2/Manifest
@@ -1 +1,2 @@
 DIST LVM2.2.03.17.tgz 2726793 BLAKE2B 425e52fe2d7832f8440203d2b6ffc3a097903abea8be07bbbf4864001d5f55083954e561a92b0fe4fc467533e465af3958b25cf33d2693f50f077dc3d9b74bd2 SHA512 ce9f4c10a7e89b397fa021098976117c062227da4f25996296dd3678c0aeb826edf9b7e4f5d3992f42156865ae47cb98671ec37a26868710174a473b42cc70a9
+DIST LVM2.2.03.18.tgz 2728113 BLAKE2B 59df1a6ece11473d3f15a8b81701faa363be556f7668a34d2cbbf9221a014f268c230f08d3bd873bbebee89480c787a6f358b2edf8777c990c62e7c6a36aecad SHA512 58043bdcad882065f15d772401d29fc7fb2d0a6b6b75063915dc38bb11cd847517dd18ae7e2acb3935e6c32ef620a275c2b2b9c307434f7457ea3203b87254c1

diff --git a/sys-fs/lvm2/files/lvm2-2.03.18-freopen-musl.patch b/sys-fs/lvm2/files/lvm2-2.03.18-freopen-musl.patch
new file mode 100644
index 000000000000..13afb81796ac
--- /dev/null
+++ b/sys-fs/lvm2/files/lvm2-2.03.18-freopen-musl.patch
@@ -0,0 +1,60 @@
+From c2817ff30c4ad1e1a171ee0e914dbecdd486e3cf Mon Sep 17 00:00:00 2001
+From: David Seifert <soap@gentoo.org>
+Date: Sat, 28 Jan 2023 14:22:42 +0100
+Subject: [PATCH] Use `freopen()` on {stdin,stdout,stderr}
+
+* ISO C does not guarantee that the standard streams are modifiable
+  lvalues. Glibc even calls out this behaviour as non-portable:
+    https://www.gnu.org/software/libc/manual/html_node/Standard-Streams.html
+---
+ lib/log/log.c      | 2 +-
+ tools/lvmcmdline.c | 6 +++---
+ 2 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/lib/log/log.c b/lib/log/log.c
+index 118a3ba42..aecc72611 100644
+--- a/lib/log/log.c
++++ b/lib/log/log.c
+@@ -208,7 +208,7 @@ int reopen_standard_stream(FILE **stream, const char *mode)
+ 
+ 	_check_and_replace_standard_log_streams(old_stream, new_stream);
+ 
+-	*stream = new_stream;
++	freopen(NULL, mode, *stream);
+ 	return 1;
+ }
+ 
+diff --git a/tools/lvmcmdline.c b/tools/lvmcmdline.c
+index a5bb6a5c5..0ebfa375c 100644
+--- a/tools/lvmcmdline.c
++++ b/tools/lvmcmdline.c
+@@ -3422,7 +3422,7 @@ static int _check_standard_fds(void)
+ 	int err = is_valid_fd(STDERR_FILENO);
+ 
+ 	if (!is_valid_fd(STDIN_FILENO) &&
+-	    !(stdin = fopen(_PATH_DEVNULL, "r"))) {
++	    !freopen(_PATH_DEVNULL, "r", stdin)) {
+ 		if (err)
+ 			perror("stdin stream open");
+ 		else
+@@ -3432,7 +3432,7 @@ static int _check_standard_fds(void)
+ 	}
+ 
+ 	if (!is_valid_fd(STDOUT_FILENO) &&
+-	    !(stdout = fopen(_PATH_DEVNULL, "w"))) {
++	    !freopen(_PATH_DEVNULL, "w", stdout)) {
+ 		if (err)
+ 			perror("stdout stream open");
+ 		/* else no stdout */
+@@ -3440,7 +3440,7 @@ static int _check_standard_fds(void)
+ 	}
+ 
+ 	if (!is_valid_fd(STDERR_FILENO) &&
+-	    !(stderr = fopen(_PATH_DEVNULL, "w"))) {
++	    !freopen(_PATH_DEVNULL, "w", stderr)) {
+ 		printf("stderr stream open: %s\n",
+ 		       strerror(errno));
+ 		return 0;
+-- 
+2.39.1
+

diff --git a/sys-fs/lvm2/lvm2-2.03.18.ebuild b/sys-fs/lvm2/lvm2-2.03.18.ebuild
new file mode 100644
index 000000000000..b93eea6a507f
--- /dev/null
+++ b/sys-fs/lvm2/lvm2-2.03.18.ebuild
@@ -0,0 +1,315 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+TMPFILES_OPTIONAL=1
+inherit autotools linux-info systemd toolchain-funcs tmpfiles udev flag-o-matic
+
+DESCRIPTION="User-land utilities for LVM2 (device-mapper) software"
+HOMEPAGE="https://sourceware.org/lvm2/"
+SRC_URI="https://sourceware.org/ftp/lvm2/${PN^^}.${PV}.tgz"
+S="${WORKDIR}/${PN^^}.${PV}"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux"
+IUSE="lvm lvm2create-initrd readline sanlock selinux static static-libs systemd thin +udev"
+REQUIRED_USE="
+	static? ( !systemd !udev )
+	static-libs? ( static !udev )
+	systemd? ( udev )
+	thin? ( lvm )"
+
+DEPEND_COMMON="
+	udev? ( virtual/libudev:= )
+	lvm? (
+		dev-libs/libaio
+		sys-apps/util-linux
+		readline? ( sys-libs/readline:= )
+		sanlock? ( sys-cluster/sanlock )
+		systemd? ( sys-apps/systemd:= )
+	)"
+# /run is now required for locking during early boot. /var cannot be assumed to
+# be available -- thus, pull in recent enough baselayout for /run.
+# This version of LVM is incompatible with cryptsetup <1.1.2.
+RDEPEND="${DEPEND_COMMON}
+	>=sys-apps/baselayout-2.2
+	lvm? (
+		virtual/tmpfiles
+		lvm2create-initrd? ( sys-apps/makedev )
+		thin? ( sys-block/thin-provisioning-tools )
+	)"
+# note: thin- 0.3.0 is required to avoid --disable-thin_check_needs_check
+DEPEND="${DEPEND_COMMON}
+	static? (
+		lvm? (
+			dev-libs/libaio[static-libs]
+			sys-apps/util-linux[static-libs]
+			readline? ( sys-libs/readline[static-libs] )
+		)
+		selinux? ( sys-libs/libselinux[static-libs] )
+	)"
+BDEPEND="
+	sys-devel/autoconf-archive
+	virtual/pkgconfig"
+
+PATCHES=(
+	# Gentoo specific modification(s):
+	"${FILESDIR}"/${PN}-2.03.17-example.conf.in.patch
+
+	# For upstream -- review and forward:
+	"${FILESDIR}"/${PN}-2.02.56-lvm2create_initrd.patch
+	"${FILESDIR}"/${PN}-2.02.67-createinitrd.patch #301331
+	"${FILESDIR}"/${PN}-2.03.17-locale-muck.patch #330373
+	"${FILESDIR}"/${PN}-2.03.17-dynamic-static-ldflags.patch #332905
+	"${FILESDIR}"/${PN}-2.03.14-static-pkgconfig-libs.patch #370217, #439414 + blkid
+	"${FILESDIR}"/${PN}-2.03.12-static-pkgconfig-libs-2.patch
+	"${FILESDIR}"/${PN}-2.03.17-pthread-pkgconfig.patch #492450
+	"${FILESDIR}"/${PN}-2.03.12-static-libm.patch #617756
+	"${FILESDIR}"/${PN}-2.03.05-dmeventd-no-idle-exit.patch
+	"${FILESDIR}"/${PN}-2.03.18-freopen-musl.patch
+	"${FILESDIR}"/${PN}-2.03.17-musl-LOCK_EX.patch #887259
+)
+
+pkg_setup() {
+	local CONFIG_CHECK="~SYSVIPC"
+
+	if use udev; then
+		local WARNING_SYSVIPC="CONFIG_SYSVIPC:\tis not set (required for udev sync)\n"
+		if linux_config_exists; then
+			local uevent_helper_path=$(linux_chkconfig_string UEVENT_HELPER_PATH)
+			if [[ -n "${uevent_helper_path}" ]] && [[ "${uevent_helper_path}" != '""' ]]; then
+				ewarn "It's recommended to set an empty value to the following kernel config option:"
+				ewarn "CONFIG_UEVENT_HELPER_PATH=${uevent_helper_path}"
+			fi
+		fi
+	fi
+
+	check_extra_config
+
+	# 1. Genkernel no longer copies /sbin/lvm blindly.
+	if use static; then
+		elog "Warning, we no longer overwrite /sbin/lvm and /sbin/dmsetup with"
+		elog "their static versions. If you need the static binaries,"
+		elog "you must append .static to the filename!"
+	fi
+}
+
+src_prepare() {
+	default
+
+	# Users without systemd get no auto-activation of any logical volume
+	if ! use systemd ; then
+		eapply "${FILESDIR}"/${PN}-2.03.16-dm_lvm_rules_no_systemd.patch
+		sed -i -e '/^USE_SD_NOTIFY=yes$/s/yes/no/' daemons/lvmlockd/Makefile.in || die
+	fi
+
+	sed -i -e "s:/usr/bin/true:$(type -P true):" scripts/blk_availability_systemd_red_hat.service.in || die #517514
+
+	eautoreconf
+}
+
+src_configure() {
+	filter-flags -flto
+
+	# Workaround for bug #822210
+	tc-ld-disable-gold
+
+	# Most of this package does weird stuff.
+	# The build options are tristate, and --without is NOT supported
+	# options: 'none', 'internal', 'shared'
+	local myeconfargs=(
+		$(use_enable lvm dmfilemapd)
+		$(use_enable lvm dmeventd)
+		$(use_enable lvm cmdlib)
+		$(use_enable lvm fsadm)
+		$(use_enable lvm lvmpolld)
+		$(usev !lvm --disable-udev-systemd-background-jobs)
+
+		# This only causes the .static versions to become available
+		$(usev static --enable-static_link)
+
+		# dmeventd requires mirrors to be internal, and snapshot available
+		# so we cannot disable them
+		--with-mirrors="$(usex lvm internal none)"
+		--with-snapshots="$(usex lvm internal none)"
+	)
+
+	if use lvm && use thin; then
+		myeconfargs+=( --with-thin=internal --with-cache=internal )
+		local texec
+		for texec in check dump repair restore; do
+			myeconfargs+=( --with-thin-${texec}="${EPREFIX}"/sbin/thin_${texec} )
+			myeconfargs+=( --with-cache-${texec}="${EPREFIX}"/sbin/cache_${texec} )
+		done
+	else
+		myeconfargs+=( --with-thin=none --with-cache=none )
+	fi
+
+	myeconfargs+=(
+		# musl doesn't do symbol versioning so can end up with
+		# runtime breakage.
+		--with-symvers=$(usex elibc_glibc 'gnu' 'no')
+		$(use_enable readline)
+		$(use_enable selinux)
+		--enable-pkgconfig
+		--with-confdir="${EPREFIX}"/etc
+		--exec-prefix="${EPREFIX}"
+		--sbindir="${EPREFIX}/sbin"
+		--with-staticdir="${EPREFIX}"/sbin
+		--libdir="${EPREFIX}/$(get_libdir)"
+		--with-usrlibdir="${EPREFIX}/usr/$(get_libdir)"
+		--with-default-dm-run-dir=/run
+		--with-default-run-dir=/run/lvm
+		--with-default-locking-dir=/run/lock/lvm
+		--with-default-pid-dir=/run
+		$(use_enable udev udev_rules)
+		$(use_enable udev udev_sync)
+		$(use_with udev udevdir "${EPREFIX}$(get_udevdir)"/rules.d)
+		# USE=sanlock requires USE=lvm
+		$(use_enable $(usex lvm sanlock lvm) lvmlockd-sanlock)
+		$(use_enable systemd udev-systemd-background-jobs)
+		$(use_enable systemd notify-dbus)
+		$(use_enable systemd app-machineid)
+		$(use_enable systemd systemd-journal)
+		--with-systemdsystemunitdir="$(systemd_get_systemunitdir)"
+		CLDFLAGS="${LDFLAGS}"
+	)
+
+	# Hard-wire this to bash as some shells (dash) don't know
+	# "-o pipefail" #682404
+	CONFIG_SHELL="${BROOT}"/bin/bash econf "${myeconfargs[@]}"
+}
+
+src_compile() {
+	emake V=1 -C include
+
+	if use lvm ; then
+		emake V=1
+		emake V=1 CC="$(tc-getCC)" -C scripts
+	else
+		emake V=1 device-mapper
+		# https://bugs.gentoo.org/878131
+		emake V=1 -C libdm/dm-tools device-mapper
+	fi
+}
+
+src_test() {
+	einfo "Tests are disabled because of device-node mucking, if you want to"
+	einfo "run tests, compile the package and see ${S}/tests"
+}
+
+src_install() {
+	local INSTALL_TARGETS=(
+		# full LVM2
+		$(usev lvm "install install_tmpfiles_configuration")
+		# install systemd related files only when requested, bug #522430
+		$(usev $(usex lvm systemd lvm) "SYSTEMD_GENERATOR_DIR=$(systemd_get_systemgeneratordir) install_systemd_units install_systemd_generators")
+
+		# install dm unconditionally
+		install_device-mapper
+	)
+	emake V=1 DESTDIR="${D}" "${INSTALL_TARGETS[@]}"
+
+	newinitd "${FILESDIR}"/device-mapper.rc-2.02.105-r2 device-mapper
+	newconfd "${FILESDIR}"/device-mapper.conf-1.02.22-r3 device-mapper
+
+	if use lvm ; then
+		newinitd "${FILESDIR}"/dmeventd.initd-2.02.184-r2 dmeventd
+		newinitd "${FILESDIR}"/lvm.rc-2.02.187 lvm
+		newconfd "${FILESDIR}"/lvm.confd-2.02.184-r3 lvm
+		if ! use udev ; then
+			# We keep the variable but remove udev from it.
+			sed -r -i \
+				-e '/^rc_need=/s/\<udev\>//g' \
+				"${ED}"/etc/conf.d/lvm || die "Could not drop udev from rc_need"
+		fi
+
+		newinitd "${FILESDIR}"/lvm-monitoring.initd-2.02.105-r2 lvm-monitoring
+		newinitd "${FILESDIR}"/lvmpolld.initd-2.02.183 lvmpolld
+
+		if use lvm2create-initrd; then
+			dosbin scripts/lvm2create_initrd/lvm2create_initrd
+			doman scripts/lvm2create_initrd/lvm2create_initrd.8
+			newdoc scripts/lvm2create_initrd/README README.lvm2create_initrd
+		fi
+
+		if use sanlock; then
+			newinitd "${FILESDIR}"/lvmlockd.initd-2.02.166-r1 lvmlockd
+		fi
+	fi
+
+	if use static-libs; then
+		dolib.a libdm/ioctl/libdevmapper.a
+		if use lvm; then
+			# depends on lvmetad
+			dolib.a libdaemon/client/libdaemonclient.a #462908
+			# depends on dmeventd
+			dolib.a daemons/dmeventd/libdevmapper-event.a
+		fi
+	else
+		rm -f "${ED}"/usr/$(get_libdir)/{libdevmapper-event,liblvm2cmd,liblvm2app,libdevmapper}.a || die
+	fi
+
+	insinto /etc
+	doins "${FILESDIR}"/dmtab
+
+	dodoc README VERSION* WHATS_NEW WHATS_NEW_DM doc/*.{c,txt} conf/*.conf
+}
+
+pkg_preinst() {
+	HAD_LVM=0
+
+	if has_version 'sys-fs/lvm2[lvm(+)]' ; then
+		HAD_LVM=1
+	fi
+}
+
+pkg_postinst() {
+	use lvm && tmpfiles_process lvm2.conf
+	use udev && udev_reload
+
+	# This is a new installation
+	if [[ -z "${REPLACING_VERSIONS}" ]]; then
+		if use lvm ; then
+			ewarn "Make sure the \"lvm\" init script is in the runlevels:"
+			ewarn "# rc-update add lvm boot"
+			ewarn
+			ewarn "Make sure to enable lvmetad in ${EROOT}/etc/lvm/lvm.conf if you want"
+			ewarn "to enable lvm autoactivation and metadata caching."
+		else
+			ewarn "Please enable USE=lvm if you need the LVM daemon and"
+			ewarn "tools like 'lvchange', 'vgchange', etc!"
+		fi
+	else
+		if ! use lvm && [[ ${HAD_LVM} -eq 1 ]] ; then
+			ewarn "LVM was previously enabled but is now disabled."
+			ewarn "Please enable USE=lvm if you need the LVM daemon and"
+			ewarn "tools like 'lvchange', 'vgchange', etc!"
+			ewarn "See the 2022-11-19-lvm2-default-USE-flags news item for more details."
+		fi
+	fi
+
+	if use udev && [[ -d /run ]] ; then
+		local permission_run_expected="drwxr-xr-x"
+		local permission_run=$(stat -c "%A" /run)
+		if [[ "${permission_run}" != "${permission_run_expected}" ]] ; then
+			ewarn "Found the following problematic permissions:"
+			ewarn ""
+			ewarn "    ${permission_run} /run"
+			ewarn ""
+			ewarn "Expected:"
+			ewarn ""
+			ewarn "    ${permission_run_expected} /run"
+			ewarn ""
+			ewarn "This is known to cause problems for udev-enabled LVM services."
+		fi
+	fi
+}
+
+pkg_postrm() {
+	if use udev && [[ -z ${REPLACED_BY_VERSION} ]]; then
+		udev_reload
+	fi
+}


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-fs/lvm2/, sys-fs/lvm2/files/
@ 2023-02-21 20:29 David Seifert
  0 siblings, 0 replies; 29+ messages in thread
From: David Seifert @ 2023-02-21 20:29 UTC (permalink / raw
  To: gentoo-commits

commit:     62d0dc13d15389c1332eed076ab9214879743258
Author:     David Seifert <soap <AT> gentoo <DOT> org>
AuthorDate: Tue Feb 21 20:29:11 2023 +0000
Commit:     David Seifert <soap <AT> gentoo <DOT> org>
CommitDate: Tue Feb 21 20:29:11 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=62d0dc13

sys-fs/lvm2: add 2.03.19

Signed-off-by: David Seifert <soap <AT> gentoo.org>

 sys-fs/lvm2/Manifest                               |   1 +
 .../lvm2-2.03.19-dm_lvm_rules_no_systemd.patch     |  11 +
 .../files/lvm2-2.03.19-dmeventd-no-idle-exit.patch |  73 +++++
 .../lvm2-2.03.19-dynamic-static-ldflags.patch      |  50 ++++
 sys-fs/lvm2/files/lvm2-2.03.19-freopen-musl.patch  |  63 +++++
 .../files/lvm2-2.03.19-static-pkgconfig-libs.patch | 130 +++++++++
 sys-fs/lvm2/lvm2-2.03.19.ebuild                    | 306 +++++++++++++++++++++
 7 files changed, 634 insertions(+)

diff --git a/sys-fs/lvm2/Manifest b/sys-fs/lvm2/Manifest
index b7ce1cc25e6d..c1c32f79b536 100644
--- a/sys-fs/lvm2/Manifest
+++ b/sys-fs/lvm2/Manifest
@@ -1,2 +1,3 @@
 DIST LVM2.2.03.17.tgz 2726793 BLAKE2B 425e52fe2d7832f8440203d2b6ffc3a097903abea8be07bbbf4864001d5f55083954e561a92b0fe4fc467533e465af3958b25cf33d2693f50f077dc3d9b74bd2 SHA512 ce9f4c10a7e89b397fa021098976117c062227da4f25996296dd3678c0aeb826edf9b7e4f5d3992f42156865ae47cb98671ec37a26868710174a473b42cc70a9
 DIST LVM2.2.03.18.tgz 2728113 BLAKE2B 59df1a6ece11473d3f15a8b81701faa363be556f7668a34d2cbbf9221a014f268c230f08d3bd873bbebee89480c787a6f358b2edf8777c990c62e7c6a36aecad SHA512 58043bdcad882065f15d772401d29fc7fb2d0a6b6b75063915dc38bb11cd847517dd18ae7e2acb3935e6c32ef620a275c2b2b9c307434f7457ea3203b87254c1
+DIST LVM2.2.03.19.tgz 2732219 BLAKE2B 7a5bd024312f149d95361ea24a282c8c68e371687fe8f7c853fa0748ce854bc991cdade999835666a5ece569e80dd9be85d4fae7fc5cc75b912de00f170cf66e SHA512 a40691f6f4c9300c95784be0fcb055a2b8e07bfdc87f000f2357ccb54fdb814a679fb79f5c9790a7440ef538e9997e46d56e539814bfdf138b4e76603aeb2994

diff --git a/sys-fs/lvm2/files/lvm2-2.03.19-dm_lvm_rules_no_systemd.patch b/sys-fs/lvm2/files/lvm2-2.03.19-dm_lvm_rules_no_systemd.patch
new file mode 100644
index 000000000000..e39d7959b331
--- /dev/null
+++ b/sys-fs/lvm2/files/lvm2-2.03.19-dm_lvm_rules_no_systemd.patch
@@ -0,0 +1,11 @@
+--- a/udev/69-dm-lvm.rules.in
++++ b/udev/69-dm-lvm.rules.in
+@@ -76,7 +76,7 @@
+ # it's better suited to appearing in the journal.
+ 
+ IMPORT{program}="(LVM_EXEC)/lvm pvscan --cache --listvg --checkcomplete --vgonline --autoactivation event --udevoutput --journal=output $env{DEVNAME}"
+-ENV{LVM_VG_NAME_COMPLETE}=="?*", RUN+="(SYSTEMDRUN) --no-block --property DefaultDependencies=no --unit lvm-activate-$env{LVM_VG_NAME_COMPLETE} (LVM_EXEC)/lvm vgchange -aay --autoactivation event $env{LVM_VG_NAME_COMPLETE}"
++ENV{LVM_VG_NAME_COMPLETE}=="?*", RUN+="(LVM_EXEC)/lvm vgchange -aay --nohints --autoactivation event $env{LVM_VG_NAME_COMPLETE}"
+ GOTO="lvm_end"
+ 
+ LABEL="lvm_end"

diff --git a/sys-fs/lvm2/files/lvm2-2.03.19-dmeventd-no-idle-exit.patch b/sys-fs/lvm2/files/lvm2-2.03.19-dmeventd-no-idle-exit.patch
new file mode 100644
index 000000000000..b7030ccc084d
--- /dev/null
+++ b/sys-fs/lvm2/files/lvm2-2.03.19-dmeventd-no-idle-exit.patch
@@ -0,0 +1,73 @@
+From ab3ae0a22dfbe20e2d17e7dc60e0f76184ec098c Mon Sep 17 00:00:00 2001
+From: "Robin H. Johnson" <robbat2@gentoo.org>
+Date: Wed, 24 Jul 2019 11:22:32 +0200
+Subject: [PATCH] dmeventd configurable idle exit time
+
+dmeventd nominally exits after 1 hour of idle time. There are use cases for
+this, esp. with socket activation, but also cases where users don't expect
+dmeventd to exit.
+
+Provide a tuning knob via environment variable, DMEVENTD_IDLE_EXIT_TIMEOUT,
+that can be -1 to not exit, or a configurable time for different idle exit.
+
+Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
+Fixes: https://bugs.gentoo.org/682556
+---
+ daemons/dmeventd/dmeventd.c | 16 ++++++++++++++--
+ man/dmeventd.8_main         |  4 ++++
+ 2 files changed, 18 insertions(+), 2 deletions(-)
+
+diff --git a/daemons/dmeventd/dmeventd.c b/daemons/dmeventd/dmeventd.c
+index 33859ef414..ac0b9743fc 100644
+--- a/daemons/dmeventd/dmeventd.c
++++ b/daemons/dmeventd/dmeventd.c
+@@ -2169,6 +2169,18 @@
+ 		.server_path = DM_EVENT_FIFO_SERVER
+ 	};
+ 	time_t now, idle_exit_timeout = DMEVENTD_IDLE_EXIT_TIMEOUT;
++
++	/* Provide a basic way to config the idle timeout */
++	char* idle_exit_timeout_env = getenv("DMEVENTD_IDLE_EXIT_TIMEOUT") ? : NULL;
++	if(NULL != idle_exit_timeout_env) {
++		char* endptr;
++		idle_exit_timeout = strtol(idle_exit_timeout_env, &endptr, 10);
++		if (errno == ERANGE || *endptr != '\0') {
++			fprintf(stderr, "DMEVENTD_IDLE_EXIT_TIMEOUT: bad time input\n");
++			exit(EXIT_FAILURE);
++		}
++	}
++
+ 	opterr = 0;
+ 	optind = 0;
+ 
+@@ -2265,7 +2277,7 @@
+ 		_process_initial_registrations();
+ 
+ 	for (;;) {
+-		if (_idle_since) {
++		if (_idle_since || _exit_now) {
+ 			if (_exit_now) {
+ 				if (_exit_now == DM_SCHEDULED_EXIT)
+ 					break; /* Only prints shutdown message */
+@@ -2274,7 +2286,7 @@
+ 					 (long) (time(NULL) - _idle_since));
+ 				break;
+ 			}
+-			if (idle_exit_timeout) {
++			if (idle_exit_timeout && idle_exit_timeout > 0) {
+ 				now = time(NULL);
+ 				if (now < _idle_since)
+ 					_idle_since = now; /* clock change? */
+--- a/man/dmeventd.8_main
++++ b/man/dmeventd.8_main
+@@ -169,6 +169,10 @@
+ Variable is set by thin and vdo plugin to prohibit recursive interaction
+ with dmeventd by any executed lvm2 command from
+ a thin_command, vdo_command environment.
++.TP
++.B DMEVENTD_IDLE_EXIT_TIMEOUT
++Configure the dmeventd idle exit timeout behavior, value in seconds. Default
++is 3600 (1 hour). -1 means do not exit.
+ .
+ .SH SEE ALSO
+ .

diff --git a/sys-fs/lvm2/files/lvm2-2.03.19-dynamic-static-ldflags.patch b/sys-fs/lvm2/files/lvm2-2.03.19-dynamic-static-ldflags.patch
new file mode 100644
index 000000000000..3aae81984506
--- /dev/null
+++ b/sys-fs/lvm2/files/lvm2-2.03.19-dynamic-static-ldflags.patch
@@ -0,0 +1,50 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -32,6 +32,7 @@
+ 	[linux*], [
+ 		# equivalent to -rdynamic
+ 		ELDFLAGS="-Wl,--export-dynamic"
++		STATIC_LDFLAGS="-Wl,--no-export-dynamic"
+ 		# FIXME Generate list and use --dynamic-list=.dlopen.sym
+ 		CLDWHOLEARCHIVE="-Wl,-whole-archive"
+ 		CLDNOWHOLEARCHIVE="-Wl,-no-whole-archive"
+@@ -1875,6 +1876,7 @@
+ AC_SUBST(SYSTEMD_RUN_CMD)
+ AC_SUBST(SNAPSHOTS)
+ AC_SUBST(STATICDIR)
++AC_SUBST(STATIC_LDFLAGS)
+ AC_SUBST(STATIC_LINK)
+ AC_SUBST(TESTSUITE_DATA)
+ AC_SUBST(THIN)
+--- a/daemons/dmeventd/Makefile.in
++++ b/daemons/dmeventd/Makefile.in
+@@ -76,7 +76,7 @@
+ 
+ dmeventd.static: $(LIB_STATIC) dmeventd.o
+ 	@echo "    [CC] $@"
+-	$(Q) $(CC) $(CFLAGS) $(LDFLAGS) -static dmeventd.o \
++	$(Q) $(CC) $(CFLAGS) $(LDFLAGS) $(STATIC_LDFLAGS) -static dmeventd.o \
+ 		-o $@ $(DL_LIBS) $(DMEVENT_LIBS) $(LIBS) $(STATIC_LIBS)
+ 
+ ifeq ("@PKGCONFIG@", "yes")
+--- a/make.tmpl.in
++++ b/make.tmpl.in
+@@ -65,6 +65,7 @@
+ CFLAGS ?= @COPTIMISE_FLAG@ @CFLAGS@
+ CPPFLAGS ?= @CPPFLAGS@
+ LDFLAGS ?= @LDFLAGS@
++STATIC_LDFLAGS += @STATIC_LDFLAGS@
+ CLDFLAGS += @CLDFLAGS@
+ ELDFLAGS += @ELDFLAGS@
+ LDDEPS += @LDDEPS@
+--- a/tools/Makefile.in
++++ b/tools/Makefile.in
+@@ -137,7 +137,7 @@
+ 
+ lvm.static: $(OBJECTS) lvm-static.o $(LVMINTERNAL_LIBS)
+ 	@echo "    [CC] $@"
+-	$(Q) $(CC) $(CFLAGS) $(LDFLAGS) -static -L$(interfacebuilddir) \
++	$(Q) $(CC) $(CFLAGS) $(LDFLAGS) $(STATIC_LDFLAGS) -static -L$(interfacebuilddir) \
+ 		-o $@ $+ $(LVMLIBS) $(STATIC_LIBS)
+ 
+ liblvm2cmd.a: $(top_builddir)/lib/liblvm-internal.a $(OBJECTS) lvmcmdlib.o lvm2cmd.o

diff --git a/sys-fs/lvm2/files/lvm2-2.03.19-freopen-musl.patch b/sys-fs/lvm2/files/lvm2-2.03.19-freopen-musl.patch
new file mode 100644
index 000000000000..cc231d9251bd
--- /dev/null
+++ b/sys-fs/lvm2/files/lvm2-2.03.19-freopen-musl.patch
@@ -0,0 +1,63 @@
+From 4cf08811e112100a2b10c60047f3c537ad21d674 Mon Sep 17 00:00:00 2001
+From: David Seifert <soap@gentoo.org>
+Date: Sat, 28 Jan 2023 14:22:42 +0100
+Subject: [PATCH] Use `freopen()` on {stdin,stdout,stderr}
+
+* ISO C does not guarantee that the standard streams are modifiable
+  lvalues. Glibc even calls out this behaviour as non-portable:
+    https://www.gnu.org/software/libc/manual/html_node/Standard-Streams.html
+---
+ lib/log/log.c      | 4 ++++
+ tools/lvmcmdline.c | 6 +++---
+ 2 files changed, 7 insertions(+), 3 deletions(-)
+
+diff --git a/lib/log/log.c b/lib/log/log.c
+index 118a3ba42..a94016d81 100644
+--- a/lib/log/log.c
++++ b/lib/log/log.c
+@@ -208,7 +208,11 @@ int reopen_standard_stream(FILE **stream, const char *mode)
+ 
+ 	_check_and_replace_standard_log_streams(old_stream, new_stream);
+ 
++#ifdef __GLIBC__
+ 	*stream = new_stream;
++#else
++	freopen(NULL, mode, *stream);
++#endif
+ 	return 1;
+ }
+ 
+diff --git a/tools/lvmcmdline.c b/tools/lvmcmdline.c
+index a5bb6a5c5..0ebfa375c 100644
+--- a/tools/lvmcmdline.c
++++ b/tools/lvmcmdline.c
+@@ -3422,7 +3422,7 @@ static int _check_standard_fds(void)
+ 	int err = is_valid_fd(STDERR_FILENO);
+ 
+ 	if (!is_valid_fd(STDIN_FILENO) &&
+-	    !(stdin = fopen(_PATH_DEVNULL, "r"))) {
++	    !freopen(_PATH_DEVNULL, "r", stdin)) {
+ 		if (err)
+ 			perror("stdin stream open");
+ 		else
+@@ -3432,7 +3432,7 @@ static int _check_standard_fds(void)
+ 	}
+ 
+ 	if (!is_valid_fd(STDOUT_FILENO) &&
+-	    !(stdout = fopen(_PATH_DEVNULL, "w"))) {
++	    !freopen(_PATH_DEVNULL, "w", stdout)) {
+ 		if (err)
+ 			perror("stdout stream open");
+ 		/* else no stdout */
+@@ -3440,7 +3440,7 @@ static int _check_standard_fds(void)
+ 	}
+ 
+ 	if (!is_valid_fd(STDERR_FILENO) &&
+-	    !(stderr = fopen(_PATH_DEVNULL, "w"))) {
++	    !freopen(_PATH_DEVNULL, "w", stderr)) {
+ 		printf("stderr stream open: %s\n",
+ 		       strerror(errno));
+ 		return 0;
+-- 
+2.39.2
+

diff --git a/sys-fs/lvm2/files/lvm2-2.03.19-static-pkgconfig-libs.patch b/sys-fs/lvm2/files/lvm2-2.03.19-static-pkgconfig-libs.patch
new file mode 100644
index 000000000000..52f2cc0cb7fe
--- /dev/null
+++ b/sys-fs/lvm2/files/lvm2-2.03.19-static-pkgconfig-libs.patch
@@ -0,0 +1,130 @@
+From ac7cce039825ff779795b5c2ae0ecf00ba43a401 Mon Sep 17 00:00:00 2001
+From: "Robin H. Johnson" <robbat2@gentoo.org>
+Date: Sun, 9 May 2021 11:00:22 +0200
+Subject: [PATCH] Use pkgconfig to detect static libs
+
+--- a/configure.ac
++++ b/configure.ac
+@@ -1139,6 +1139,7 @@
+ 	AS_IF([test "$HAVE_BLKID" = "yes"], [
+ 		BLKID_WIPING="yes"
+ 		BLKID_PC="blkid"
++		BLKID_STATIC_LIBS=`$PKG_CONFIG --static --libs $BLKID_PC`
+ 		DEFAULT_USE_BLKID_WIPING=1
+ 		AC_DEFINE([BLKID_WIPING_SUPPORT], 1, [Define to 1 to use libblkid detection of signatures when wiping.])
+ 	], [
+@@ -1165,6 +1166,7 @@
+ 
+ AS_IF([test "$UDEV_SYNC" = "yes"], [
+ 	PKG_CHECK_MODULES(UDEV, libudev >= 143, [UDEV_PC="libudev"])
++	UDEV_STATIC_LIBS=`$PKG_CONFIG --static --libs libudev`
+ 	AC_DEFINE([UDEV_SYNC_SUPPORT], 1, [Define to 1 to enable synchronisation with udev processing.])
+ 
+ 	AC_CHECK_LIB(udev, udev_device_get_is_initialized, AC_DEFINE([HAVE_LIBUDEV_UDEV_DEVICE_GET_IS_INITIALIZED], 1,
+@@ -1382,19 +1384,28 @@
+ AS_IF([test "$SELINUX" = "yes"], [
+ 	AC_CHECK_LIB([sepol], [sepol_check_context], [
+ 		AC_DEFINE([HAVE_SEPOL], 1, [Define to 1 if sepol_check_context is available.])
+-		SELINUX_LIBS="-lsepol"])
++		SEPOL_LIBS="-lsepol"])
++
++	PKG_CHECK_MODULES(SELINUX, libselinux, [
++		SELINUX_PC="libselinux"
++		SELINUX_STATIC_LIBS=`$PKG_CONFIG --static --libs libselinux`
++		SELINUX_LIBS="$SELINUX_LIBS $SEPOL_LIBS"
++		AC_DEFINE([HAVE_SELINUX], 1, [Define to 1 to include support for selinux.])
++	], [
++		dnl -- old non-pkgconfig method, is buggy with static builds
+ 
+ 	AC_CHECK_LIB([selinux], [is_selinux_enabled], [
+ 		AC_CHECK_HEADERS([selinux/selinux.h],, hard_bailout)
+ 		AC_CHECK_HEADERS([selinux/label.h])
+ 		AC_DEFINE([HAVE_SELINUX], 1, [Define to 1 to include support for selinux.])
+-		SELINUX_LIBS="-lselinux $SELINUX_LIBS"
++		SELINUX_LIBS="-lselinux $SEPOL_LIBS"
+ 		SELINUX_PC="libselinux"
+ 		HAVE_SELINUX=yes ], [
+ 		AC_MSG_WARN(Disabling selinux)
+ 		SELINUX_LIBS=
+ 		SELINUX_PC=
+ 		HAVE_SELINUX=no ])
++	])
+ ])
+ 
+ ################################################################################
+@@ -1790,6 +1801,7 @@
+ ################################################################################
+ AC_SUBST(AWK)
+ AC_SUBST(BLKID_PC)
++AC_SUBST(BLKID_STATIC_LIBS)
+ AC_SUBST(BUILD_CMIRRORD)
+ AC_SUBST(BUILD_DMEVENTD)
+ AC_SUBST(BUILD_LVMDBUSD)
+@@ -1872,6 +1884,7 @@
+ AC_SUBST(SBINDIR)
+ AC_SUBST(SELINUX_LIBS)
+ AC_SUBST(SELINUX_PC)
++AC_SUBST(SELINUX_STATIC_LIBS)
+ AC_SUBST(SYSCONFDIR)
+ AC_SUBST(SYSTEMD_RUN_CMD)
+ AC_SUBST(SNAPSHOTS)
+@@ -1890,6 +1903,7 @@
+ AC_SUBST(CACHE_RESTORE_CMD)
+ AC_SUBST(UDEV_PC)
+ AC_SUBST(UDEV_RULES)
++AC_SUBST(UDEV_STATIC_LIBS)
+ AC_SUBST(UDEV_SYNC)
+ AC_SUBST(UDEV_RULE_EXEC_DETECTION)
+ AC_SUBST(UDEV_HAS_BUILTIN_BLKID)
+--- a/libdm/make.tmpl.in
++++ b/libdm/make.tmpl.in
+@@ -54,7 +54,7 @@
+ 
+ LIBS += @LIBS@ $(PTHREAD_LIBS) $(SELINUX_LIBS) $(UDEV_LIBS) $(RT_LIBS) $(M_LIBS)
+ # Extra libraries always linked with static binaries
+-STATIC_LIBS = $(PTHREAD_LIBS)
++STATIC_LIBS = $(PTHREAD_LIBS) $(SELINUX_STATIC_LIBS) $(UDEV_STATIC_LIBS)
+ DEFS += @DEFS@
+ # FIXME set this only where it's needed, not globally?
+ CFLAGS ?= @COPTIMISE_FLAG@ @CFLAGS@
+@@ -71,8 +71,10 @@
+ READLINE_LIBS = @READLINE_LIBS@
+ EDITLINE_LIBS = @EDITLINE_LIBS@
+ SELINUX_LIBS = @SELINUX_LIBS@
++SELINUX_STATIC_LIBS = @SELINUX_STATIC_LIBS@
+ UDEV_CFLAGS = @UDEV_CFLAGS@
+ UDEV_LIBS = @UDEV_LIBS@
++UDEV_STATIC_LIBS = @UDEV_STATIC_LIBS@
+ BLKID_CFLAGS = @BLKID_CFLAGS@
+ BLKID_LIBS = @BLKID_LIBS@
+ LIBSYSTEMD_LIBS = @LIBSYSTEMD_LIBS@
+--- a/make.tmpl.in
++++ b/make.tmpl.in
+@@ -59,7 +59,7 @@
+ LIBS += @LIBS@ $(SELINUX_LIBS) $(UDEV_LIBS) $(RT_LIBS) $(M_LIBS)
+ LVMLIBS = $(DMEVENT_LIBS) $(READLINE_LIBS) $(EDITLINE_LIBS) $(LIBSYSTEMD_LIBS) $(BLKID_LIBS) $(AIO_LIBS) $(LIBS)
+ # Extra libraries always linked with static binaries
+-STATIC_LIBS = $(PTHREAD_LIBS)
++STATIC_LIBS = $(PTHREAD_LIBS) $(SELINUX_STATIC_LIBS) $(UDEV_STATIC_LIBS) $(BLKID_STATIC_LIBS) $(M_LIBS)
+ DEFS += @DEFS@
+ # FIXME set this only where it's needed, not globally?
+ CFLAGS ?= @COPTIMISE_FLAG@ @CFLAGS@
+@@ -79,6 +79,7 @@
+ AIO_LIBS = @AIO_LIBS@
+ BLKID_CFLAGS = @BLKID_CFLAGS@
+ BLKID_LIBS = @BLKID_LIBS@
++BLKID_STATIC_LIBS = @BLKID_STATIC_LIBS@
+ CPG_CFLAGS = @CPG_CFLAGS@
+ CPG_LIBS = @CPG_LIBS@
+ EDITLINE_CFLAGS = @EDITLINE_CFLAGS@
+@@ -97,8 +98,10 @@
+ READLINE_CFLAGS = @READLINE_CFLAGS@
+ READLINE_LIBS = @READLINE_LIBS@
+ SELINUX_LIBS = @SELINUX_LIBS@
++SELINUX_STATIC_LIBS = @SELINUX_STATIC_LIBS@
+ UDEV_CFLAGS = @UDEV_CFLAGS@
+ UDEV_LIBS = @UDEV_LIBS@
++UDEV_STATIC_LIBS = @UDEV_STATIC_LIBS@
+ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@
+ VALGRIND_LIBS = @VALGRIND_LIBS@
+ 

diff --git a/sys-fs/lvm2/lvm2-2.03.19.ebuild b/sys-fs/lvm2/lvm2-2.03.19.ebuild
new file mode 100644
index 000000000000..f318272b48ea
--- /dev/null
+++ b/sys-fs/lvm2/lvm2-2.03.19.ebuild
@@ -0,0 +1,306 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+TMPFILES_OPTIONAL=1
+inherit autotools linux-info systemd toolchain-funcs tmpfiles udev flag-o-matic
+
+DESCRIPTION="User-land utilities for LVM2 (device-mapper) software"
+HOMEPAGE="https://sourceware.org/lvm2/"
+SRC_URI="https://sourceware.org/ftp/lvm2/${PN^^}.${PV}.tgz"
+S="${WORKDIR}/${PN^^}.${PV}"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux"
+IUSE="lvm lvm2create-initrd readline sanlock selinux static static-libs systemd thin +udev"
+REQUIRED_USE="
+	static? ( !systemd !udev )
+	static-libs? ( static !udev )
+	systemd? ( udev )
+	thin? ( lvm )"
+
+DEPEND_COMMON="
+	udev? ( virtual/libudev:= )
+	lvm? (
+		dev-libs/libaio
+		sys-apps/util-linux
+		readline? ( sys-libs/readline:= )
+		sanlock? ( sys-cluster/sanlock )
+		systemd? ( sys-apps/systemd:= )
+	)"
+# /run is now required for locking during early boot. /var cannot be assumed to
+# be available -- thus, pull in recent enough baselayout for /run.
+# This version of LVM is incompatible with cryptsetup <1.1.2.
+RDEPEND="${DEPEND_COMMON}
+	>=sys-apps/baselayout-2.2
+	lvm? (
+		virtual/tmpfiles
+		lvm2create-initrd? ( sys-apps/makedev )
+		thin? ( sys-block/thin-provisioning-tools )
+	)"
+# note: thin- 0.3.0 is required to avoid --disable-thin_check_needs_check
+DEPEND="${DEPEND_COMMON}
+	static? (
+		lvm? (
+			dev-libs/libaio[static-libs]
+			sys-apps/util-linux[static-libs]
+			readline? ( sys-libs/readline[static-libs] )
+		)
+		selinux? ( sys-libs/libselinux[static-libs] )
+	)"
+BDEPEND="
+	sys-devel/autoconf-archive
+	virtual/pkgconfig"
+
+PATCHES=(
+	# Gentoo specific modification(s):
+	"${FILESDIR}"/${PN}-2.03.17-example.conf.in.patch
+
+	# For upstream -- review and forward:
+	"${FILESDIR}"/${PN}-2.02.56-lvm2create_initrd.patch
+	"${FILESDIR}"/${PN}-2.02.67-createinitrd.patch #301331
+	"${FILESDIR}"/${PN}-2.03.17-locale-muck.patch #330373
+	"${FILESDIR}"/${PN}-2.03.19-dynamic-static-ldflags.patch #332905
+	"${FILESDIR}"/${PN}-2.03.19-static-pkgconfig-libs.patch #370217, #439414 + blkid, #617756
+	"${FILESDIR}"/${PN}-2.03.17-pthread-pkgconfig.patch #492450
+	"${FILESDIR}"/${PN}-2.03.19-dmeventd-no-idle-exit.patch
+	"${FILESDIR}"/${PN}-2.03.19-freopen-musl.patch
+)
+
+pkg_setup() {
+	local CONFIG_CHECK="~SYSVIPC"
+
+	if use udev; then
+		local WARNING_SYSVIPC="CONFIG_SYSVIPC:\tis not set (required for udev sync)\n"
+		if linux_config_exists; then
+			local uevent_helper_path=$(linux_chkconfig_string UEVENT_HELPER_PATH)
+			if [[ -n "${uevent_helper_path}" ]] && [[ "${uevent_helper_path}" != '""' ]]; then
+				ewarn "It's recommended to set an empty value to the following kernel config option:"
+				ewarn "CONFIG_UEVENT_HELPER_PATH=${uevent_helper_path}"
+			fi
+		fi
+	fi
+
+	check_extra_config
+
+	# 1. Genkernel no longer copies /sbin/lvm blindly.
+	if use static; then
+		elog "Warning, we no longer overwrite /sbin/lvm and /sbin/dmsetup with"
+		elog "their static versions. If you need the static binaries,"
+		elog "you must append .static to the filename!"
+	fi
+}
+
+src_prepare() {
+	default
+
+	# Users without systemd get no auto-activation of any logical volume
+	if ! use systemd ; then
+		eapply "${FILESDIR}"/${PN}-2.03.19-dm_lvm_rules_no_systemd.patch
+	fi
+
+	eautoreconf
+}
+
+src_configure() {
+	filter-flags -flto
+
+	# Workaround for bug #822210
+	tc-ld-disable-gold
+
+	# Most of this package does weird stuff.
+	# The build options are tristate, and --without is NOT supported
+	# options: 'none', 'internal', 'shared'
+	local myeconfargs=(
+		$(use_enable lvm dmfilemapd)
+		$(use_enable lvm dmeventd)
+		$(use_enable lvm cmdlib)
+		$(use_enable lvm fsadm)
+		$(use_enable lvm lvmpolld)
+
+		# This only causes the .static versions to become available
+		$(usev static --enable-static_link)
+
+		# dmeventd requires mirrors to be internal, and snapshot available
+		# so we cannot disable them
+		--with-mirrors="$(usex lvm internal none)"
+		--with-snapshots="$(usex lvm internal none)"
+	)
+
+	if use lvm && use thin; then
+		myeconfargs+=( --with-thin=internal --with-cache=internal )
+		local texec
+		for texec in check dump repair restore; do
+			myeconfargs+=( --with-thin-${texec}="${EPREFIX}"/sbin/thin_${texec} )
+			myeconfargs+=( --with-cache-${texec}="${EPREFIX}"/sbin/cache_${texec} )
+		done
+	else
+		myeconfargs+=( --with-thin=none --with-cache=none )
+	fi
+
+	myeconfargs+=(
+		# musl doesn't do symbol versioning so can end up with
+		# runtime breakage.
+		--with-symvers=$(usex elibc_glibc 'gnu' 'no')
+		$(use_enable readline)
+		$(use_enable selinux)
+		--enable-pkgconfig
+		--with-confdir="${EPREFIX}"/etc
+		--exec-prefix="${EPREFIX}"
+		--sbindir="${EPREFIX}/sbin"
+		--with-staticdir="${EPREFIX}"/sbin
+		--libdir="${EPREFIX}/$(get_libdir)"
+		--with-usrlibdir="${EPREFIX}/usr/$(get_libdir)"
+		--with-default-dm-run-dir=/run
+		--with-default-run-dir=/run/lvm
+		--with-default-locking-dir=/run/lock/lvm
+		--with-default-pid-dir=/run
+		$(use_enable udev udev_rules)
+		$(use_enable udev udev_sync)
+		$(use_with udev udevdir "${EPREFIX}$(get_udevdir)"/rules.d)
+		# USE=sanlock requires USE=lvm
+		$(use_enable $(usex lvm sanlock lvm) lvmlockd-sanlock)
+		$(use_enable systemd notify-dbus)
+		$(use_enable systemd app-machineid)
+		$(use_enable systemd systemd-journal)
+		$(use_with systemd systemd-run "/usr/bin/systemd-run")
+		--with-systemdsystemunitdir="$(systemd_get_systemunitdir)"
+		CLDFLAGS="${LDFLAGS}"
+	)
+
+	econf "${myeconfargs[@]}"
+}
+
+src_compile() {
+	emake V=1 -C include
+
+	if use lvm ; then
+		emake V=1
+		emake V=1 CC="$(tc-getCC)" -C scripts
+	else
+		emake V=1 device-mapper
+		# https://bugs.gentoo.org/878131
+		emake V=1 -C libdm/dm-tools device-mapper
+	fi
+}
+
+src_test() {
+	einfo "Tests are disabled because of device-node mucking, if you want to"
+	einfo "run tests, compile the package and see ${S}/tests"
+}
+
+src_install() {
+	local INSTALL_TARGETS=(
+		# full LVM2
+		$(usev lvm "install install_tmpfiles_configuration")
+		# install systemd related files only when requested, bug #522430
+		$(usev $(usex lvm systemd lvm) "SYSTEMD_GENERATOR_DIR=$(systemd_get_systemgeneratordir) install_systemd_units install_systemd_generators")
+
+		# install dm unconditionally
+		install_device-mapper
+	)
+	emake V=1 DESTDIR="${D}" "${INSTALL_TARGETS[@]}"
+
+	newinitd "${FILESDIR}"/device-mapper.rc-2.02.105-r2 device-mapper
+	newconfd "${FILESDIR}"/device-mapper.conf-1.02.22-r3 device-mapper
+
+	if use lvm ; then
+		newinitd "${FILESDIR}"/dmeventd.initd-2.02.184-r2 dmeventd
+		newinitd "${FILESDIR}"/lvm.rc-2.02.187 lvm
+		newconfd "${FILESDIR}"/lvm.confd-2.02.184-r3 lvm
+		if ! use udev ; then
+			# We keep the variable but remove udev from it.
+			sed -r -i \
+				-e '/^rc_need=/s/\<udev\>//g' \
+				"${ED}"/etc/conf.d/lvm || die "Could not drop udev from rc_need"
+		fi
+
+		newinitd "${FILESDIR}"/lvm-monitoring.initd-2.02.105-r2 lvm-monitoring
+		newinitd "${FILESDIR}"/lvmpolld.initd-2.02.183 lvmpolld
+
+		if use lvm2create-initrd; then
+			dosbin scripts/lvm2create_initrd/lvm2create_initrd
+			doman scripts/lvm2create_initrd/lvm2create_initrd.8
+			newdoc scripts/lvm2create_initrd/README README.lvm2create_initrd
+		fi
+
+		if use sanlock; then
+			newinitd "${FILESDIR}"/lvmlockd.initd-2.02.166-r1 lvmlockd
+		fi
+	fi
+
+	if use static-libs; then
+		dolib.a libdm/ioctl/libdevmapper.a
+		if use lvm; then
+			# depends on lvmetad
+			dolib.a libdaemon/client/libdaemonclient.a #462908
+			# depends on dmeventd
+			dolib.a daemons/dmeventd/libdevmapper-event.a
+		fi
+	else
+		rm -f "${ED}"/usr/$(get_libdir)/{libdevmapper-event,liblvm2cmd,liblvm2app,libdevmapper}.a || die
+	fi
+
+	insinto /etc
+	doins "${FILESDIR}"/dmtab
+
+	dodoc README VERSION* WHATS_NEW WHATS_NEW_DM doc/*.{c,txt} conf/*.conf
+}
+
+pkg_preinst() {
+	HAD_LVM=0
+
+	if has_version 'sys-fs/lvm2[lvm(+)]' ; then
+		HAD_LVM=1
+	fi
+}
+
+pkg_postinst() {
+	use lvm && tmpfiles_process lvm2.conf
+	use udev && udev_reload
+
+	# This is a new installation
+	if [[ -z "${REPLACING_VERSIONS}" ]]; then
+		if use lvm ; then
+			ewarn "Make sure the \"lvm\" init script is in the runlevels:"
+			ewarn "# rc-update add lvm boot"
+			ewarn
+			ewarn "Make sure to enable lvmetad in ${EROOT}/etc/lvm/lvm.conf if you want"
+			ewarn "to enable lvm autoactivation and metadata caching."
+		else
+			ewarn "Please enable USE=lvm if you need the LVM daemon and"
+			ewarn "tools like 'lvchange', 'vgchange', etc!"
+		fi
+	else
+		if ! use lvm && [[ ${HAD_LVM} -eq 1 ]] ; then
+			ewarn "LVM was previously enabled but is now disabled."
+			ewarn "Please enable USE=lvm if you need the LVM daemon and"
+			ewarn "tools like 'lvchange', 'vgchange', etc!"
+			ewarn "See the 2022-11-19-lvm2-default-USE-flags news item for more details."
+		fi
+	fi
+
+	if use udev && [[ -d /run ]] ; then
+		local permission_run_expected="drwxr-xr-x"
+		local permission_run=$(stat -c "%A" /run)
+		if [[ "${permission_run}" != "${permission_run_expected}" ]] ; then
+			ewarn "Found the following problematic permissions:"
+			ewarn ""
+			ewarn "    ${permission_run} /run"
+			ewarn ""
+			ewarn "Expected:"
+			ewarn ""
+			ewarn "    ${permission_run_expected} /run"
+			ewarn ""
+			ewarn "This is known to cause problems for udev-enabled LVM services."
+		fi
+	fi
+}
+
+pkg_postrm() {
+	if use udev && [[ -z ${REPLACED_BY_VERSION} ]]; then
+		udev_reload
+	fi
+}


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-fs/lvm2/, sys-fs/lvm2/files/
@ 2023-04-13 11:10 David Seifert
  0 siblings, 0 replies; 29+ messages in thread
From: David Seifert @ 2023-04-13 11:10 UTC (permalink / raw
  To: gentoo-commits

commit:     51b0c9a4812615501458b662e2f25554a77d87e0
Author:     David Seifert <soap <AT> gentoo <DOT> org>
AuthorDate: Thu Apr 13 11:10:36 2023 +0000
Commit:     David Seifert <soap <AT> gentoo <DOT> org>
CommitDate: Thu Apr 13 11:10:36 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=51b0c9a4

sys-fs/lvm2: drop 2.03.17-r2

Signed-off-by: David Seifert <soap <AT> gentoo.org>

 sys-fs/lvm2/Manifest                               |   1 -
 .../files/lvm2-2.03.05-dmeventd-no-idle-exit.patch |  81 ------
 sys-fs/lvm2/files/lvm2-2.03.12-static-libm.patch   |  25 --
 .../lvm2-2.03.12-static-pkgconfig-libs-2.patch     |  38 ---
 sys-fs/lvm2/files/lvm2-2.03.14-freopen_n2.patch    |  34 ---
 .../files/lvm2-2.03.14-r1-fopen-to-freopen.patch   |  43 ---
 .../files/lvm2-2.03.14-static-pkgconfig-libs.patch | 124 --------
 .../lvm2-2.03.16-dm_lvm_rules_no_systemd.patch     |  11 -
 .../lvm2/files/lvm2-2.03.16-musl-strerror_r.patch  |  23 --
 .../lvm2-2.03.17-dynamic-static-ldflags.patch      |  50 ----
 sys-fs/lvm2/files/lvm2-2.03.17-musl-LOCK_EX.patch  |  20 --
 sys-fs/lvm2/files/lvm2-2.03.17-readelf.patch       |  56 ----
 sys-fs/lvm2/lvm2-2.03.17-r2.ebuild                 | 320 ---------------------
 13 files changed, 826 deletions(-)

diff --git a/sys-fs/lvm2/Manifest b/sys-fs/lvm2/Manifest
index c3f6f492d6d4..43acdc74f34c 100644
--- a/sys-fs/lvm2/Manifest
+++ b/sys-fs/lvm2/Manifest
@@ -1,3 +1,2 @@
-DIST LVM2.2.03.17.tgz 2726793 BLAKE2B 425e52fe2d7832f8440203d2b6ffc3a097903abea8be07bbbf4864001d5f55083954e561a92b0fe4fc467533e465af3958b25cf33d2693f50f077dc3d9b74bd2 SHA512 ce9f4c10a7e89b397fa021098976117c062227da4f25996296dd3678c0aeb826edf9b7e4f5d3992f42156865ae47cb98671ec37a26868710174a473b42cc70a9
 DIST LVM2.2.03.19.tgz 2732219 BLAKE2B 7a5bd024312f149d95361ea24a282c8c68e371687fe8f7c853fa0748ce854bc991cdade999835666a5ece569e80dd9be85d4fae7fc5cc75b912de00f170cf66e SHA512 a40691f6f4c9300c95784be0fcb055a2b8e07bfdc87f000f2357ccb54fdb814a679fb79f5c9790a7440ef538e9997e46d56e539814bfdf138b4e76603aeb2994
 DIST LVM2.2.03.20.tgz 2739763 BLAKE2B 4dc223eca1a370450c3985a5f962a2450a2ed08f1fa40af98d181a1530960a7caa3e896a3b54f0f333e2d6818bf35378b9c491a1488a4d3815959ab0e1f987de SHA512 202ff19f6ab1e1ecdf448beec6c7db1a80885efda1a6eeabf44cd2cea40577405c388eabd86f59f34c6e9e400188050bc6d1a5d5daf02f2beda87eee73cd1a2d

diff --git a/sys-fs/lvm2/files/lvm2-2.03.05-dmeventd-no-idle-exit.patch b/sys-fs/lvm2/files/lvm2-2.03.05-dmeventd-no-idle-exit.patch
deleted file mode 100644
index ec37e5da1dc7..000000000000
--- a/sys-fs/lvm2/files/lvm2-2.03.05-dmeventd-no-idle-exit.patch
+++ /dev/null
@@ -1,81 +0,0 @@
-From ab3ae0a22dfbe20e2d17e7dc60e0f76184ec098c Mon Sep 17 00:00:00 2001
-From: "Robin H. Johnson" <robbat2@gentoo.org>
-Date: Wed, 24 Jul 2019 11:22:32 +0200
-Subject: [PATCH] dmeventd configurable idle exit time
-
-dmeventd nominally exits after 1 hour of idle time. There are use cases for
-this, esp. with socket activation, but also cases where users don't expect
-dmeventd to exit.
-
-Provide a tuning knob via environment variable, DMEVENTD_IDLE_EXIT_TIMEOUT,
-that can be -1 to not exit, or a configurable time for different idle exit.
-
-Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
-Fixes: https://bugs.gentoo.org/682556
-
-Forward-ported from 2.02.184 to 2.03.05
-Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>
----
- daemons/dmeventd/dmeventd.c | 16 ++++++++++++++--
- man/dmeventd.8_main         |  4 ++++
- 2 files changed, 18 insertions(+), 2 deletions(-)
-
-diff --git a/daemons/dmeventd/dmeventd.c b/daemons/dmeventd/dmeventd.c
-index 33859ef414..ac0b9743fc 100644
---- a/daemons/dmeventd/dmeventd.c
-+++ b/daemons/dmeventd/dmeventd.c
-@@ -2158,6 +2158,18 @@ int main(int argc, char *argv[])
- 		.server_path = DM_EVENT_FIFO_SERVER
- 	};
- 	time_t now, idle_exit_timeout = DMEVENTD_IDLE_EXIT_TIMEOUT;
-+
-+	/* Provide a basic way to config the idle timeout */
-+	char* idle_exit_timeout_env = getenv("DMEVENTD_IDLE_EXIT_TIMEOUT") ? : NULL;
-+	if(NULL != idle_exit_timeout_env) {
-+		char* endptr;
-+		idle_exit_timeout = strtol(idle_exit_timeout_env, &endptr, 10);
-+		if (errno == ERANGE || *endptr != '\0') {
-+			fprintf(stderr, "DMEVENTD_IDLE_EXIT_TIMEOUT: bad time input\n");
-+			exit(EXIT_FAILURE);
-+		}
-+	}
-+
- 	opterr = 0;
- 	optind = 0;
- 
-@@ -2253,7 +2265,7 @@ int main(int argc, char *argv[])
- 		_process_initial_registrations();
- 
- 	for (;;) {
--		if (_idle_since) {
-+		if (_idle_since || _exit_now) {
- 			if (_exit_now) {
- 				if (_exit_now == DM_SCHEDULED_EXIT)
- 					break; /* Only prints shutdown message */
-@@ -2262,7 +2274,7 @@ int main(int argc, char *argv[])
- 					 (long) (time(NULL) - _idle_since));
- 				break;
- 			}
--			if (idle_exit_timeout) {
-+			if (idle_exit_timeout && idle_exit_timeout > 0) {
- 				now = time(NULL);
- 				if (now < _idle_since)
- 					_idle_since = now; /* clock change? */
-diff --git a/man/dmeventd.8_main b/man/dmeventd.8_main
-index dc4abf627e..4b0e522041 100644
---- a/man/dmeventd.8_main
-+++ b/man/dmeventd.8_main
-@@ -178,6 +178,10 @@ is processed.
- Variable is set by thin and vdo plugin to prohibit recursive interation
- with dmeventd by any executed lvm2 command from
- a thin_command, vdo_command environment.
-+.TP
-+.B DMEVENTD_IDLE_EXIT_TIMEOUT
-+Configure the dmeventd idle exit timeout behavior, value in seconds. Default
-+is 3600 (1 hour). -1 means do not exit.
- .
- .SH SEE ALSO
- .
--- 
-2.22.0
-

diff --git a/sys-fs/lvm2/files/lvm2-2.03.12-static-libm.patch b/sys-fs/lvm2/files/lvm2-2.03.12-static-libm.patch
deleted file mode 100644
index 5bb776c9b5ed..000000000000
--- a/sys-fs/lvm2/files/lvm2-2.03.12-static-libm.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From 4917d9c8b6227256a4a83ff937119d6aa53d654e Mon Sep 17 00:00:00 2001
-From: "Robin H. Johnson" <robbat2@gentoo.org>
-Date: Sun, 9 May 2021 11:02:54 +0200
-Subject: [PATCH] Add libm to static libs
-
----
- make.tmpl.in | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/make.tmpl.in b/make.tmpl.in
-index ae189546d0..8ee00bd9e8 100644
---- a/make.tmpl.in
-+++ b/make.tmpl.in
-@@ -64,7 +64,7 @@ PYCOMPILE = $(top_srcdir)/autoconf/py-compile
- LIBS += @LIBS@ $(SELINUX_LIBS) $(UDEV_LIBS) $(RT_LIBS) $(M_LIBS)
- LVMLIBS = $(DMEVENT_LIBS) $(READLINE_LIBS) $(EDITLINE_LIBS) $(SYSTEMD_LIBS) $(BLKID_LIBS) $(AIO_LIBS) $(LIBS)
- # Extra libraries always linked with static binaries
--STATIC_LIBS = $(PTHREAD_LIBS) $(SELINUX_STATIC_LIBS) $(UDEV_STATIC_LIBS) $(BLKID_STATIC_LIBS)
-+STATIC_LIBS = $(PTHREAD_LIBS) $(SELINUX_STATIC_LIBS) $(UDEV_STATIC_LIBS) $(BLKID_STATIC_LIBS) $(M_LIBS)
- DEFS += @DEFS@
- # FIXME set this only where it's needed, not globally?
- CFLAGS ?= @COPTIMISE_FLAG@ @CFLAGS@
--- 
-2.31.1
-

diff --git a/sys-fs/lvm2/files/lvm2-2.03.12-static-pkgconfig-libs-2.patch b/sys-fs/lvm2/files/lvm2-2.03.12-static-pkgconfig-libs-2.patch
deleted file mode 100644
index a3a4642e8281..000000000000
--- a/sys-fs/lvm2/files/lvm2-2.03.12-static-pkgconfig-libs-2.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-From 27ab05863dc56fcd7254bccf30797f9e3c448cac Mon Sep 17 00:00:00 2001
-From: Mike Gilbert <floppym@gentoo.org>
-Date: Mon, 12 Jul 2021 10:36:04 -0400
-Subject: [PATCH] libdm: add SELINUX_STATIC_LIBS and UDEV_STATIC_LIBS to
- make.tmpl.in
-
-Fixes link failure for dmsetup.static.
----
- libdm/make.tmpl.in | 4 +++-
- 1 file changed, 3 insertions(+), 1 deletion(-)
-
-diff --git a/libdm/make.tmpl.in b/libdm/make.tmpl.in
-index a306101d5..2309fb3e5 100644
---- a/libdm/make.tmpl.in
-+++ b/libdm/make.tmpl.in
-@@ -55,7 +55,7 @@ RM = rm -f
- 
- LIBS += @LIBS@ $(PTHREAD_LIBS) $(SELINUX_LIBS) $(UDEV_LIBS) $(RT_LIBS) $(M_LIBS)
- # Extra libraries always linked with static binaries
--STATIC_LIBS = $(PTHREAD_LIBS)
-+STATIC_LIBS = $(PTHREAD_LIBS) $(SELINUX_STATIC_LIBS) $(UDEV_STATIC_LIBS)
- DEFS += @DEFS@
- # FIXME set this only where it's needed, not globally?
- CFLAGS ?= @COPTIMISE_FLAG@ @CFLAGS@
-@@ -71,8 +71,10 @@ PTHREAD_LIBS = @PTHREAD_LIBS@
- READLINE_LIBS = @READLINE_LIBS@
- EDITLINE_LIBS = @EDITLINE_LIBS@
- SELINUX_LIBS = @SELINUX_LIBS@
-+SELINUX_STATIC_LIBS = @SELINUX_STATIC_LIBS@
- UDEV_CFLAGS = @UDEV_CFLAGS@
- UDEV_LIBS = @UDEV_LIBS@
-+UDEV_STATIC_LIBS = @UDEV_STATIC_LIBS@
- BLKID_CFLAGS = @BLKID_CFLAGS@
- BLKID_LIBS = @BLKID_LIBS@
- SYSTEMD_LIBS = @SYSTEMD_LIBS@
--- 
-2.32.0
-

diff --git a/sys-fs/lvm2/files/lvm2-2.03.14-freopen_n2.patch b/sys-fs/lvm2/files/lvm2-2.03.14-freopen_n2.patch
deleted file mode 100644
index 5ca32f19fc54..000000000000
--- a/sys-fs/lvm2/files/lvm2-2.03.14-freopen_n2.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-In musl, the standard streams are read-only. To modify them we need to
-use freopen. This patch does the same as lvm2-2.03.14-r1-fopen-to-freopen.patch
-
-https://listman.redhat.com/archives/lvm-devel/2022-June/024203.html
-
-See also:
-https://wiki.gentoo.org/wiki/User:Sam/Musl_porting_notes#error:_assignment_of_read-only_variable_.27.5Bstdout.7Cstdin.7Cstderr.5D.27
-https://www.gnu.org/software/libc/manual/html_node/Standard-Streams.html
-
----
- lib/log/log.c | 6 +++++-
- 1 file changed, 5 insertions(+), 1 deletion(-)
-
-diff --git a/lib/log/log.c b/lib/log/log.c
-index 7b4d537..897c183 100644
---- a/lib/log/log.c
-+++ b/lib/log/log.c
-@@ -207,8 +207,12 @@ int reopen_standard_stream(FILE **stream, const char *mode)
- 	}
- 
- 	_check_and_replace_standard_log_streams(old_stream, new_stream);
--
-+	
-+#ifdef __GLIBC__
- 	*stream = new_stream;
-+#else
-+	freopen(NULL, mode, *stream);
-+#endif
- 	return 1;
- }
- 
--- 
-2.35.1
-

diff --git a/sys-fs/lvm2/files/lvm2-2.03.14-r1-fopen-to-freopen.patch b/sys-fs/lvm2/files/lvm2-2.03.14-r1-fopen-to-freopen.patch
deleted file mode 100644
index 56248e10e5d6..000000000000
--- a/sys-fs/lvm2/files/lvm2-2.03.14-r1-fopen-to-freopen.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-In musl stdout, stdin and stderr are read-only unlike in glibc.
-This patch changes std* = fopen(...) to freopen(..., std*).
-
-See: https://www.gnu.org/software/libc/manual/html_node/Standard-Streams.html and https://wiki.gentoo.org/wiki/User:Sam/Musl_porting_notes
-
----
- tools/lvmcmdline.c | 6 +++---
- 1 file changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/tools/lvmcmdline.c b/tools/lvmcmdline.c
-index 1e12bed..19da1e5 100644
---- a/tools/lvmcmdline.c
-+++ b/tools/lvmcmdline.c
-@@ -3384,7 +3384,7 @@ static int _check_standard_fds(void)
- 	int err = is_valid_fd(STDERR_FILENO);
- 
- 	if (!is_valid_fd(STDIN_FILENO) &&
--	    !(stdin = fopen(_PATH_DEVNULL, "r"))) {
-+		!freopen(_PATH_DEVNULL, "r", stdin)) {
- 		if (err)
- 			perror("stdin stream open");
- 		else
-@@ -3394,7 +3394,7 @@ static int _check_standard_fds(void)
- 	}
- 
- 	if (!is_valid_fd(STDOUT_FILENO) &&
--	    !(stdout = fopen(_PATH_DEVNULL, "w"))) {
-+		!freopen(_PATH_DEVNULL, "w", stdout)) {
- 		if (err)
- 			perror("stdout stream open");
- 		/* else no stdout */
-@@ -3402,7 +3402,7 @@ static int _check_standard_fds(void)
- 	}
- 
- 	if (!is_valid_fd(STDERR_FILENO) &&
--	    !(stderr = fopen(_PATH_DEVNULL, "w"))) {
-+		!freopen(_PATH_DEVNULL, "w", stderr)) {
- 		printf("stderr stream open: %s\n",
- 		       strerror(errno));
- 		return 0;
--- 
-2.35.1
-

diff --git a/sys-fs/lvm2/files/lvm2-2.03.14-static-pkgconfig-libs.patch b/sys-fs/lvm2/files/lvm2-2.03.14-static-pkgconfig-libs.patch
deleted file mode 100644
index e259547a47b0..000000000000
--- a/sys-fs/lvm2/files/lvm2-2.03.14-static-pkgconfig-libs.patch
+++ /dev/null
@@ -1,124 +0,0 @@
-From ac7cce039825ff779795b5c2ae0ecf00ba43a401 Mon Sep 17 00:00:00 2001
-From: "Robin H. Johnson" <robbat2@gentoo.org>
-Date: Sun, 9 May 2021 11:00:22 +0200
-Subject: [PATCH] Use pkgconfig to detect static libs
-
----
- configure.ac | 20 ++++++++++++++++++--
- make.tmpl.in |  5 ++++-
- 2 files changed, 22 insertions(+), 3 deletions(-)
-
-diff --git a/configure.ac b/configure.ac
-index 6cdf1a7e65..90452ebf7c 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -1168,6 +1168,7 @@ if test "$BLKID_WIPING" != no; then
- 	PKG_CHECK_MODULES(BLKID, blkid >= 2.24,
- 			  [ BLKID_WIPING=yes
- 			    BLKID_PC="blkid"
-+			    BLKID_STATIC_LIBS=`$PKG_CONFIG --static --libs $BLKID_PC`
- 			    DEFAULT_USE_BLKID_WIPING=1
- 			    AC_DEFINE([BLKID_WIPING_SUPPORT], 1, [Define to 1 to use libblkid detection of signatures when wiping.])
- 			  ], [if test "$BLKID_WIPING" = maybe; then
-@@ -1213,6 +1214,7 @@ AC_MSG_RESULT($UDEV_SYNC)
- if test "$UDEV_SYNC" = yes; then
- 	pkg_config_init
- 	PKG_CHECK_MODULES(UDEV, libudev >= 143, [UDEV_PC="libudev"])
-+	UDEV_STATIC_LIBS=`$PKG_CONFIG --static --libs libudev`
- 	AC_DEFINE([UDEV_SYNC_SUPPORT], 1, [Define to 1 to enable synchronisation with udev processing.])
- 
- 	AC_CHECK_LIB(udev, udev_device_get_is_initialized, AC_DEFINE([HAVE_LIBUDEV_UDEV_DEVICE_GET_IS_INITIALIZED], 1,
-@@ -1432,19 +1434,30 @@ dnl -- Check for selinux
- if test "$SELINUX" = yes; then
- 	AC_CHECK_LIB([sepol], [sepol_check_context], [
- 		AC_DEFINE([HAVE_SEPOL], 1, [Define to 1 if sepol_check_context is available.])
--		SELINUX_LIBS="-lsepol"])
-+		SEPOL_LIBS="-lsepol"])
-+
-+	dnl -- init pkgconfig if required
-+	AS_IF([test x$PKGCONFIG_INIT != x1], [pkg_config_init])
-+	PKG_CHECK_MODULES(SELINUX, libselinux, [
-+		SELINUX_PC="libselinux"
-+		SELINUX_STATIC_LIBS=`$PKG_CONFIG --static --libs libselinux`
-+		SELINUX_LIBS="$SELINUX_LIBS $SEPOL_LIBS"
-+		AC_DEFINE([HAVE_SELINUX], 1, [Define to 1 to include support for selinux.])
-+	], [
-+		dnl -- old non-pkgconfig method, is buggy with static builds
- 
- 	AC_CHECK_LIB([selinux], [is_selinux_enabled], [
- 		AC_CHECK_HEADERS([selinux/selinux.h],, hard_bailout)
- 		AC_CHECK_HEADERS([selinux/label.h])
- 		AC_DEFINE([HAVE_SELINUX], 1, [Define to 1 to include support for selinux.])
--		SELINUX_LIBS="-lselinux $SELINUX_LIBS"
-+		SELINUX_LIBS="-lselinux $SEPOL_LIBS"
- 		SELINUX_PC="libselinux"
- 		HAVE_SELINUX=yes ], [
- 		AC_MSG_WARN(Disabling selinux)
- 		SELINUX_LIBS=
- 		SELINUX_PC=
- 		HAVE_SELINUX=no ])
-+	])
- fi
- 
- ################################################################################
-@@ -1834,6 +1847,7 @@ AC_ARG_VAR([UDEV_LIBS], [linker flags for udev])
- ################################################################################
- AC_SUBST(AWK)
- AC_SUBST(BLKID_PC)
-+AC_SUBST(BLKID_STATIC_LIBS)
- AC_SUBST(BUILD_CMIRRORD)
- AC_SUBST(BUILD_DMEVENTD)
- AC_SUBST(BUILD_LVMDBUSD)
-@@ -1934,6 +1948,7 @@ AC_SUBST(SALCK_LIBS)
- AC_SUBST(SBINDIR)
- AC_SUBST(SELINUX_LIBS)
- AC_SUBST(SELINUX_PC)
-+AC_SUBST(SELINUX_STATIC_LIBS)
- AC_SUBST(SYSCONFDIR)
- AC_SUBST(SNAPSHOTS)
- AC_SUBST(STATICDIR)
-@@ -1950,6 +1965,7 @@ AC_SUBST(CACHE_REPAIR_CMD)
- AC_SUBST(CACHE_RESTORE_CMD)
- AC_SUBST(UDEV_PC)
- AC_SUBST(UDEV_RULES)
-+AC_SUBST(UDEV_STATIC_LIBS)
- AC_SUBST(UDEV_SYNC)
- AC_SUBST(UDEV_SYSTEMD_BACKGROUND_JOBS)
- AC_SUBST(UDEV_RULE_EXEC_DETECTION)
-diff --git a/make.tmpl.in b/make.tmpl.in
-index cccda10d6f..bf6c3e5596 100644
---- a/make.tmpl.in
-+++ b/make.tmpl.in
-@@ -64,7 +64,7 @@ PYCOMPILE = $(top_srcdir)/autoconf/py-compile
- LIBS += @LIBS@ $(SELINUX_LIBS) $(UDEV_LIBS) $(RT_LIBS) $(M_LIBS)
- LVMLIBS = $(DMEVENT_LIBS) $(READLINE_LIBS) $(EDITLINE_LIBS) $(SYSTEMD_LIBS) $(BLKID_LIBS) $(AIO_LIBS) $(LIBS)
- # Extra libraries always linked with static binaries
--STATIC_LIBS = $(PTHREAD_LIBS)
-+STATIC_LIBS = $(PTHREAD_LIBS) $(SELINUX_STATIC_LIBS) $(UDEV_STATIC_LIBS) $(BLKID_STATIC_LIBS)
- DEFS += @DEFS@
- # FIXME set this only where it's needed, not globally?
- CFLAGS ?= @COPTIMISE_FLAG@ @CFLAGS@
-@@ -82,6 +82,7 @@ AIO_CFLAGS = @AIO_CFLAGS@
- AIO_LIBS = @AIO_LIBS@
- BLKID_CFLAGS = @BLKID_CFLAGS@
- BLKID_LIBS = @BLKID_LIBS@
-+BLKID_STATIC_LIBS = @BLKID_STATIC_LIBS@
- CPG_CFLAGS = @CPG_CFLAGS@
- CPG_LIBS = @CPG_LIBS@
- EDITLINE_CFLAGS = @EDITLINE_CFLAGS@
-@@ -90,10 +91,12 @@ PTHREAD_LIBS = @PTHREAD_LIBS@
- READLINE_CFLAGS = @READLINE_CFLAGS@
- READLINE_LIBS = @READLINE_LIBS@
- SELINUX_LIBS = @SELINUX_LIBS@
-+SELINUX_STATIC_LIBS = @SELINUX_STATIC_LIBS@
- SYSTEMD_CFLAGS = @SYSTEMD_CFLAGS@
- SYSTEMD_LIBS = @SYSTEMD_LIBS@
- UDEV_CFLAGS = @UDEV_CFLAGS@
- UDEV_LIBS = @UDEV_LIBS@
-+UDEV_STATIC_LIBS = @UDEV_STATIC_LIBS@
- VALGRIND_CFLAGS = @VALGRIND_CFLAGS@
- VALGRIND_LIBS = @VALGRIND_LIBS@
- 
--- 
-2.33.1
-

diff --git a/sys-fs/lvm2/files/lvm2-2.03.16-dm_lvm_rules_no_systemd.patch b/sys-fs/lvm2/files/lvm2-2.03.16-dm_lvm_rules_no_systemd.patch
deleted file mode 100644
index c4f74a49b8d0..000000000000
--- a/sys-fs/lvm2/files/lvm2-2.03.16-dm_lvm_rules_no_systemd.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- LVM2.2.03.16/udev/69-dm-lvm.rules.in.orig	2022-10-26 15:58:07.504434946 -0700
-+++ LVM2.2.03.16/udev/69-dm-lvm.rules.in	2022-10-26 16:01:52.122204592 -0700
-@@ -80,7 +80,7 @@
- # it's better suited to appearing in the journal.
- 
- IMPORT{program}="(LVM_EXEC)/lvm pvscan --cache --listvg --checkcomplete --vgonline --autoactivation event --udevoutput --journal=output $env{DEVNAME}"
--ENV{LVM_VG_NAME_COMPLETE}=="?*", RUN+="/usr/bin/systemd-run --no-block --property DefaultDependencies=no --unit lvm-activate-$env{LVM_VG_NAME_COMPLETE} (LVM_EXEC)/lvm vgchange -aay --autoactivation event $env{LVM_VG_NAME_COMPLETE}"
-+ENV{LVM_VG_NAME_COMPLETE}=="?*", RUN+="(LVM_EXEC)/lvm vgchange -aay --nohints --autoactivation event $env{LVM_VG_NAME_COMPLETE}"
- GOTO="lvm_end"
- 
- LABEL="lvm_end"

diff --git a/sys-fs/lvm2/files/lvm2-2.03.16-musl-strerror_r.patch b/sys-fs/lvm2/files/lvm2-2.03.16-musl-strerror_r.patch
deleted file mode 100644
index d485e75ca811..000000000000
--- a/sys-fs/lvm2/files/lvm2-2.03.16-musl-strerror_r.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-From a06e401bd0479f25631bdfeffaa01d150e5efe59 Mon Sep 17 00:00:00 2001
-From: Sam James <sam@gentoo.org>
-Date: Fri, 18 Nov 2022 17:57:34 +0000
-Subject: [PATCH] Fix strerror_r check for musl
-
-We can't assume that strerror_r returns char* just because _GNU_SOURCE is defined. We already call the appropriate autoconf test, so let's use its result
-(STRERROR_R_CHAR_P).
-
-Note that in configure, _GNU_SOURCE is always set, but we add a defined guard just in case for futureproofing.
-
-Bug: https://bugs.gentoo.org/869404
-Signed-off-by: Sam James <sam@gentoo.org>
---- a/daemons/lvmpolld/lvmpolld-core.c
-+++ b/daemons/lvmpolld/lvmpolld-core.c
-@@ -52,7 +52,7 @@ static pthread_key_t key;
- 
- static const char *_strerror_r(int errnum, struct lvmpolld_thread_data *data)
- {
--#ifdef _GNU_SOURCE
-+#if defined(_GNU_SOURCE) && defined(STRERROR_R_CHAR_P)
- 	return strerror_r(errnum, data->buf, sizeof(data->buf)); /* never returns NULL */
- #elif (_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600)
- 	return strerror_r(errnum, data->buf, sizeof(data->buf)) ? "" : data->buf;

diff --git a/sys-fs/lvm2/files/lvm2-2.03.17-dynamic-static-ldflags.patch b/sys-fs/lvm2/files/lvm2-2.03.17-dynamic-static-ldflags.patch
deleted file mode 100644
index e3228945a325..000000000000
--- a/sys-fs/lvm2/files/lvm2-2.03.17-dynamic-static-ldflags.patch
+++ /dev/null
@@ -1,50 +0,0 @@
---- a/configure.ac
-+++ b/configure.ac
-@@ -32,6 +32,7 @@
- 	linux*)
- 		# equivalent to -rdynamic
- 		ELDFLAGS="-Wl,--export-dynamic"
-+		STATIC_LDFLAGS="-Wl,--no-export-dynamic"
- 		# FIXME Generate list and use --dynamic-list=.dlopen.sym
- 		CLDWHOLEARCHIVE="-Wl,-whole-archive"
- 		CLDNOWHOLEARCHIVE="-Wl,-no-whole-archive"
-@@ -1945,6 +1946,7 @@
- AC_SUBST(SYSCONFDIR)
- AC_SUBST(SNAPSHOTS)
- AC_SUBST(STATICDIR)
-+AC_SUBST(STATIC_LDFLAGS)
- AC_SUBST(STATIC_LINK)
- AC_SUBST(TESTSUITE_DATA)
- AC_SUBST(THIN)
---- a/daemons/dmeventd/Makefile.in
-+++ b/daemons/dmeventd/Makefile.in
-@@ -76,7 +76,7 @@
- 
- dmeventd.static: $(LIB_STATIC) dmeventd.o
- 	@echo "    [CC] $@"
--	$(Q) $(CC) $(CFLAGS) $(LDFLAGS) -static dmeventd.o \
-+	$(Q) $(CC) $(CFLAGS) $(LDFLAGS) $(STATIC_LDFLAGS) -static dmeventd.o \
- 		-o $@ $(DL_LIBS) $(DMEVENT_LIBS) $(LIBS) $(STATIC_LIBS)
- 
- ifeq ("@PKGCONFIG@", "yes")
---- a/make.tmpl.in
-+++ b/make.tmpl.in
-@@ -64,6 +64,7 @@
- # FIXME set this only where it's needed, not globally?
- CFLAGS ?= @COPTIMISE_FLAG@ @CFLAGS@
- LDFLAGS ?= @LDFLAGS@
-+STATIC_LDFLAGS += @STATIC_LDFLAGS@
- CLDFLAGS += @CLDFLAGS@
- ELDFLAGS += @ELDFLAGS@
- LDDEPS += @LDDEPS@
---- a/tools/Makefile.in
-+++ b/tools/Makefile.in
-@@ -137,7 +137,7 @@
- 
- lvm.static: $(OBJECTS) lvm-static.o $(LVMINTERNAL_LIBS)
- 	@echo "    [CC] $@"
--	$(Q) $(CC) $(CFLAGS) $(LDFLAGS) -static -L$(interfacebuilddir) \
-+	$(Q) $(CC) $(CFLAGS) $(LDFLAGS) $(STATIC_LDFLAGS) -static -L$(interfacebuilddir) \
- 		-o $@ $+ $(LVMLIBS) $(STATIC_LIBS)
- 
- liblvm2cmd.a: $(top_builddir)/lib/liblvm-internal.a $(OBJECTS) lvmcmdlib.o lvm2cmd.o

diff --git a/sys-fs/lvm2/files/lvm2-2.03.17-musl-LOCK_EX.patch b/sys-fs/lvm2/files/lvm2-2.03.17-musl-LOCK_EX.patch
deleted file mode 100644
index acb5e903b45a..000000000000
--- a/sys-fs/lvm2/files/lvm2-2.03.17-musl-LOCK_EX.patch
+++ /dev/null
@@ -1,20 +0,0 @@
-https://bugs.gentoo.org/887259
-
-From ab715e56feec4bbb135cc97d2d1e8e7340a8ee44 Mon Sep 17 00:00:00 2001
-From: Jory Pratt <anarchy@gentoo.org>
-Date: Tue, 20 Dec 2022 08:12:49 -0600
-Subject: [PATCH] Add missing include for LOCK_EX
-
-Signed-off-by: Jory Pratt <anarchy@gentoo.org>
---- a/tools/vgimportdevices.c
-+++ b/tools/vgimportdevices.c
-@@ -15,6 +15,7 @@
- #include "tools.h"
- #include "lib/cache/lvmcache.h"
- #include "lib/device/device_id.h"
-+#include <sys/file.h>
- 
- struct vgimportdevices_params {
- 	uint32_t added_devices;
--- 
-2.38.2

diff --git a/sys-fs/lvm2/files/lvm2-2.03.17-readelf.patch b/sys-fs/lvm2/files/lvm2-2.03.17-readelf.patch
deleted file mode 100644
index 82870b108e09..000000000000
--- a/sys-fs/lvm2/files/lvm2-2.03.17-readelf.patch
+++ /dev/null
@@ -1,56 +0,0 @@
-From 2de7e5c222ff114f41dadcf904061d6c2a77eae2 Mon Sep 17 00:00:00 2001
-From: David Seifert <soap@gentoo.org>
-Date: Sat, 19 Nov 2022 17:05:31 +0100
-Subject: [PATCH 1/2] Allow for overriding of `readelf`
-
-* This allows users to use e.g. `llvm-readelf` on systems with binutils as default.
-
-Bug: https://bugs.gentoo.org/840628
----
- configure.ac       | 1 +
- libdm/Makefile.in  | 4 ++--
- libdm/make.tmpl.in | 1 +
- 3 files changed, 4 insertions(+), 2 deletions(-)
-
-diff --git a/configure.ac b/configure.ac
-index 704772b62..f39c87d08 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -83,6 +83,7 @@ AC_PROG_LN_S
- AC_PROG_MAKE_SET
- AC_PROG_MKDIR_P
- AC_PROG_RANLIB
-+AC_CHECK_TOOL([READELF], [readelf])
- AC_CHECK_TOOL(AR, ar)
- AC_PATH_TOOL(CFLOW_CMD, cflow)
- AC_PATH_TOOL(CSCOPE_CMD, cscope)
-diff --git a/libdm/Makefile.in b/libdm/Makefile.in
-index 35115d7f0..2758648e6 100644
---- a/libdm/Makefile.in
-+++ b/libdm/Makefile.in
-@@ -71,8 +71,8 @@ libdevmapper.$(LIB_SUFFIX) libdevmapper.$(LIB_SUFFIX).$(LIB_VERSION): $(LIB_SHAR
- # also the older symbol is built-in
- .symver_check: $(LIB_SHARED)
- 	@echo "    [CHECK] $<"
--	$(Q) if readelf -Ws $< | grep -q dm_stats_create_region@@; then \
--	SYM=$$(readelf -Ws $< | grep dm_stats_create_region@DM_1_02_106); \
-+	$(Q) if $(READELF) -Ws $< | grep -q dm_stats_create_region@@; then \
-+	SYM=$$($(READELF) -Ws $< | grep dm_stats_create_region@DM_1_02_106); \
- 	if test -n "$$SYM"; then touch $@; \
- 	else echo >&2 "Missing versioned symbols in $<"; false; fi; \
- 	else touch $@; fi
-diff --git a/libdm/make.tmpl.in b/libdm/make.tmpl.in
-index f1c88fac0..095fb028a 100644
---- a/libdm/make.tmpl.in
-+++ b/libdm/make.tmpl.in
-@@ -34,6 +34,7 @@ ifeq ($(CC), cc)
- endif
- 
- RANLIB = @RANLIB@
-+READELF = @READELF@
- INSTALL = @INSTALL@
- MKDIR_P = @MKDIR_P@
- MSGFMT = @MSGFMT@
--- 
-2.38.1
-

diff --git a/sys-fs/lvm2/lvm2-2.03.17-r2.ebuild b/sys-fs/lvm2/lvm2-2.03.17-r2.ebuild
deleted file mode 100644
index 27f458ee325f..000000000000
--- a/sys-fs/lvm2/lvm2-2.03.17-r2.ebuild
+++ /dev/null
@@ -1,320 +0,0 @@
-# Copyright 1999-2023 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-TMPFILES_OPTIONAL=1
-inherit autotools linux-info systemd toolchain-funcs tmpfiles udev flag-o-matic
-
-DESCRIPTION="User-land utilities for LVM2 (device-mapper) software"
-HOMEPAGE="https://sourceware.org/lvm2/"
-SRC_URI="https://sourceware.org/ftp/lvm2/${PN^^}.${PV}.tgz"
-S="${WORKDIR}/${PN^^}.${PV}"
-
-LICENSE="GPL-2"
-SLOT="0"
-KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux"
-IUSE="lvm lvm2create-initrd readline sanlock selinux static static-libs systemd thin +udev"
-REQUIRED_USE="
-	static? ( !systemd !udev )
-	static-libs? ( static !udev )
-	systemd? ( udev )
-	thin? ( lvm )"
-
-DEPEND_COMMON="
-	udev? ( virtual/libudev:= )
-	lvm? (
-		dev-libs/libaio
-		sys-apps/util-linux
-		readline? ( sys-libs/readline:= )
-		sanlock? ( sys-cluster/sanlock )
-		systemd? ( sys-apps/systemd:= )
-	)"
-# /run is now required for locking during early boot. /var cannot be assumed to
-# be available -- thus, pull in recent enough baselayout for /run.
-# This version of LVM is incompatible with cryptsetup <1.1.2.
-RDEPEND="${DEPEND_COMMON}
-	>=sys-apps/baselayout-2.2
-	lvm? (
-		virtual/tmpfiles
-		lvm2create-initrd? ( sys-apps/makedev )
-		thin? ( sys-block/thin-provisioning-tools )
-	)"
-# note: thin- 0.3.0 is required to avoid --disable-thin_check_needs_check
-DEPEND="${DEPEND_COMMON}
-	static? (
-		lvm? (
-			dev-libs/libaio[static-libs]
-			sys-apps/util-linux[static-libs]
-			readline? ( sys-libs/readline[static-libs] )
-		)
-		selinux? ( sys-libs/libselinux[static-libs] )
-	)"
-BDEPEND="
-	sys-devel/autoconf-archive
-	virtual/pkgconfig"
-
-PATCHES=(
-	# Gentoo specific modification(s):
-	"${FILESDIR}"/${PN}-2.03.17-example.conf.in.patch
-
-	# For upstream -- review and forward:
-	"${FILESDIR}"/${PN}-2.02.56-lvm2create_initrd.patch
-	"${FILESDIR}"/${PN}-2.02.67-createinitrd.patch #301331
-	"${FILESDIR}"/${PN}-2.03.17-locale-muck.patch #330373
-	"${FILESDIR}"/${PN}-2.03.17-dynamic-static-ldflags.patch #332905
-	"${FILESDIR}"/${PN}-2.03.14-static-pkgconfig-libs.patch #370217, #439414 + blkid
-	"${FILESDIR}"/${PN}-2.03.12-static-pkgconfig-libs-2.patch
-	"${FILESDIR}"/${PN}-2.03.17-pthread-pkgconfig.patch #492450
-	"${FILESDIR}"/${PN}-2.03.12-static-libm.patch #617756
-	"${FILESDIR}"/${PN}-2.03.05-dmeventd-no-idle-exit.patch
-	"${FILESDIR}"/${PN}-2.03.14-r1-fopen-to-freopen.patch
-	"${FILESDIR}"/${PN}-2.03.14-freopen_n2.patch
-	"${FILESDIR}"/${PN}-2.03.16-musl-strerror_r.patch
-	"${FILESDIR}"/${PN}-2.03.17-readelf.patch
-	"${FILESDIR}"/${PN}-2.03.17-musl-LOCK_EX.patch #887259
-)
-
-QA_CONFIGURE_OPTIONS="--disable-static"
-
-pkg_setup() {
-	local CONFIG_CHECK="~SYSVIPC"
-
-	if use udev; then
-		local WARNING_SYSVIPC="CONFIG_SYSVIPC:\tis not set (required for udev sync)\n"
-		if linux_config_exists; then
-			local uevent_helper_path=$(linux_chkconfig_string UEVENT_HELPER_PATH)
-			if [[ -n "${uevent_helper_path}" ]] && [[ "${uevent_helper_path}" != '""' ]]; then
-				ewarn "It's recommended to set an empty value to the following kernel config option:"
-				ewarn "CONFIG_UEVENT_HELPER_PATH=${uevent_helper_path}"
-			fi
-		fi
-	fi
-
-	check_extra_config
-
-	# 1. Genkernel no longer copies /sbin/lvm blindly.
-	if use static; then
-		elog "Warning, we no longer overwrite /sbin/lvm and /sbin/dmsetup with"
-		elog "their static versions. If you need the static binaries,"
-		elog "you must append .static to the filename!"
-	fi
-}
-
-src_prepare() {
-	default
-
-	# Users without systemd get no auto-activation of any logical volume
-	if ! use systemd ; then
-		eapply "${FILESDIR}"/${PN}-2.03.16-dm_lvm_rules_no_systemd.patch
-		sed -i -e '/^USE_SD_NOTIFY=yes$/s/yes/no/' daemons/lvmlockd/Makefile.in || die
-	fi
-
-	sed -i -e "s:/usr/bin/true:$(type -P true):" scripts/blk_availability_systemd_red_hat.service.in || die #517514
-
-	eautoreconf
-}
-
-src_configure() {
-	filter-flags -flto
-
-	# Workaround for bug #822210
-	tc-ld-disable-gold
-
-	# Most of this package does weird stuff.
-	# The build options are tristate, and --without is NOT supported
-	# options: 'none', 'internal', 'shared'
-	local myeconfargs=(
-		$(use_enable lvm dmfilemapd)
-		$(use_enable lvm dmeventd)
-		$(use_enable lvm cmdlib)
-		$(use_enable lvm fsadm)
-		$(use_enable lvm lvmpolld)
-		$(usev !lvm --disable-udev-systemd-background-jobs)
-
-		# This only causes the .static versions to become available
-		$(usev static --enable-static_link)
-
-		# dmeventd requires mirrors to be internal, and snapshot available
-		# so we cannot disable them
-		--with-mirrors="$(usex lvm internal none)"
-		--with-snapshots="$(usex lvm internal none)"
-	)
-
-	if use lvm && use thin; then
-		myeconfargs+=( --with-thin=internal --with-cache=internal )
-		local texec
-		for texec in check dump repair restore; do
-			myeconfargs+=( --with-thin-${texec}="${EPREFIX}"/sbin/thin_${texec} )
-			myeconfargs+=( --with-cache-${texec}="${EPREFIX}"/sbin/cache_${texec} )
-		done
-	else
-		myeconfargs+=( --with-thin=none --with-cache=none )
-	fi
-
-	myeconfargs+=(
-		# musl doesn't do symbol versioning so can end up with
-		# runtime breakage.
-		--with-symvers=$(usex elibc_glibc 'gnu' 'no')
-		$(use_enable readline)
-		$(use_enable selinux)
-		--enable-pkgconfig
-		--with-confdir="${EPREFIX}"/etc
-		--exec-prefix="${EPREFIX}"
-		--sbindir="${EPREFIX}/sbin"
-		--with-staticdir="${EPREFIX}"/sbin
-		--libdir="${EPREFIX}/$(get_libdir)"
-		--with-usrlibdir="${EPREFIX}/usr/$(get_libdir)"
-		--with-default-dm-run-dir=/run
-		--with-default-run-dir=/run/lvm
-		--with-default-locking-dir=/run/lock/lvm
-		--with-default-pid-dir=/run
-		$(use_enable udev udev_rules)
-		$(use_enable udev udev_sync)
-		$(use_with udev udevdir "${EPREFIX}$(get_udevdir)"/rules.d)
-		# USE=sanlock requires USE=lvm
-		$(use_enable $(usex lvm sanlock lvm) lvmlockd-sanlock)
-		$(use_enable systemd udev-systemd-background-jobs)
-		$(use_enable systemd notify-dbus)
-		$(use_enable systemd app-machineid)
-		$(use_enable systemd systemd-journal)
-		--with-systemdsystemunitdir="$(systemd_get_systemunitdir)"
-		CLDFLAGS="${LDFLAGS}"
-	)
-
-	# Hard-wire this to bash as some shells (dash) don't know
-	# "-o pipefail" #682404
-	CONFIG_SHELL="${BROOT}"/bin/bash econf "${myeconfargs[@]}"
-}
-
-src_compile() {
-	emake V=1 -C include
-
-	if use lvm ; then
-		emake V=1
-		emake V=1 CC="$(tc-getCC)" -C scripts
-	else
-		emake V=1 device-mapper
-		# https://bugs.gentoo.org/878131
-		emake V=1 -C libdm/dm-tools device-mapper
-	fi
-}
-
-src_test() {
-	einfo "Tests are disabled because of device-node mucking, if you want to"
-	einfo "run tests, compile the package and see ${S}/tests"
-}
-
-src_install() {
-	local INSTALL_TARGETS=(
-		# full LVM2
-		$(usev lvm "install install_tmpfiles_configuration")
-		# install systemd related files only when requested, bug #522430
-		$(usev $(usex lvm systemd lvm) "SYSTEMD_GENERATOR_DIR=$(systemd_get_systemgeneratordir) install_systemd_units install_systemd_generators")
-
-		# install dm unconditionally
-		install_device-mapper
-	)
-	emake V=1 DESTDIR="${D}" "${INSTALL_TARGETS[@]}"
-
-	newinitd "${FILESDIR}"/device-mapper.rc-2.02.105-r2 device-mapper
-	newconfd "${FILESDIR}"/device-mapper.conf-1.02.22-r3 device-mapper
-
-	if use lvm ; then
-		newinitd "${FILESDIR}"/dmeventd.initd-2.02.184-r2 dmeventd
-		newinitd "${FILESDIR}"/lvm.rc-2.02.187 lvm
-		newconfd "${FILESDIR}"/lvm.confd-2.02.184-r3 lvm
-		if ! use udev ; then
-			# We keep the variable but remove udev from it.
-			sed -r -i \
-				-e '/^rc_need=/s/\<udev\>//g' \
-				"${ED}"/etc/conf.d/lvm || die "Could not drop udev from rc_need"
-		fi
-
-		newinitd "${FILESDIR}"/lvm-monitoring.initd-2.02.105-r2 lvm-monitoring
-		newinitd "${FILESDIR}"/lvmpolld.initd-2.02.183 lvmpolld
-
-		if use lvm2create-initrd; then
-			dosbin scripts/lvm2create_initrd/lvm2create_initrd
-			doman scripts/lvm2create_initrd/lvm2create_initrd.8
-			newdoc scripts/lvm2create_initrd/README README.lvm2create_initrd
-		fi
-
-		if use sanlock; then
-			newinitd "${FILESDIR}"/lvmlockd.initd-2.02.166-r1 lvmlockd
-		fi
-	fi
-
-	if use static-libs; then
-		dolib.a libdm/ioctl/libdevmapper.a
-		if use lvm; then
-			# depends on lvmetad
-			dolib.a libdaemon/client/libdaemonclient.a #462908
-			# depends on dmeventd
-			dolib.a daemons/dmeventd/libdevmapper-event.a
-		fi
-	else
-		rm -f "${ED}"/usr/$(get_libdir)/{libdevmapper-event,liblvm2cmd,liblvm2app,libdevmapper}.a || die
-	fi
-
-	insinto /etc
-	doins "${FILESDIR}"/dmtab
-
-	dodoc README VERSION* WHATS_NEW WHATS_NEW_DM doc/*.{c,txt} conf/*.conf
-}
-
-pkg_preinst() {
-	HAD_LVM=0
-
-	if has_version 'sys-fs/lvm2[lvm(+)]' ; then
-		HAD_LVM=1
-	fi
-}
-
-pkg_postinst() {
-	use lvm && tmpfiles_process lvm2.conf
-	use udev && udev_reload
-
-	# This is a new installation
-	if [[ -z "${REPLACING_VERSIONS}" ]]; then
-		if use lvm ; then
-			ewarn "Make sure the \"lvm\" init script is in the runlevels:"
-			ewarn "# rc-update add lvm boot"
-			ewarn
-			ewarn "Make sure to enable lvmetad in ${EROOT}/etc/lvm/lvm.conf if you want"
-			ewarn "to enable lvm autoactivation and metadata caching."
-		else
-			ewarn "Please enable USE=lvm if you need the LVM daemon and"
-			ewarn "tools like 'lvchange', 'vgchange', etc!"
-		fi
-	else
-		if ! use lvm && [[ ${HAD_LVM} -eq 1 ]] ; then
-			ewarn "LVM was previously enabled but is now disabled."
-			ewarn "Please enable USE=lvm if you need the LVM daemon and"
-			ewarn "tools like 'lvchange', 'vgchange', etc!"
-			ewarn "See the 2022-11-19-lvm2-default-USE-flags news item for more details."
-		fi
-	fi
-
-	if use udev && [[ -d /run ]] ; then
-		local permission_run_expected="drwxr-xr-x"
-		local permission_run=$(stat -c "%A" /run)
-		if [[ "${permission_run}" != "${permission_run_expected}" ]] ; then
-			ewarn "Found the following problematic permissions:"
-			ewarn ""
-			ewarn "    ${permission_run} /run"
-			ewarn ""
-			ewarn "Expected:"
-			ewarn ""
-			ewarn "    ${permission_run_expected} /run"
-			ewarn ""
-			ewarn "This is known to cause problems for udev-enabled LVM services."
-		fi
-	fi
-}
-
-pkg_postrm() {
-	if use udev && [[ -z ${REPLACED_BY_VERSION} ]]; then
-		udev_reload
-	fi
-}


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-fs/lvm2/, sys-fs/lvm2/files/
@ 2023-05-10  8:57 David Seifert
  0 siblings, 0 replies; 29+ messages in thread
From: David Seifert @ 2023-05-10  8:57 UTC (permalink / raw
  To: gentoo-commits

commit:     fcac868e886c7056c5ff1291e76df53f28152f63
Author:     David Seifert <soap <AT> gentoo <DOT> org>
AuthorDate: Wed May 10 08:56:53 2023 +0000
Commit:     David Seifert <soap <AT> gentoo <DOT> org>
CommitDate: Wed May 10 08:56:53 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fcac868e

sys-fs/lvm2: drop 2.03.19

Signed-off-by: David Seifert <soap <AT> gentoo.org>

 sys-fs/lvm2/Manifest                               |   1 -
 .../files/lvm2-2.03.17-pthread-pkgconfig.patch     |  31 ---
 .../lvm2-2.03.19-dynamic-static-ldflags.patch      |  50 ----
 .../files/lvm2-2.03.19-static-pkgconfig-libs.patch | 130 ---------
 sys-fs/lvm2/lvm2-2.03.19.ebuild                    | 306 ---------------------
 5 files changed, 518 deletions(-)

diff --git a/sys-fs/lvm2/Manifest b/sys-fs/lvm2/Manifest
index 0ed5e8cc1061..01f7b2833c23 100644
--- a/sys-fs/lvm2/Manifest
+++ b/sys-fs/lvm2/Manifest
@@ -1,3 +1,2 @@
-DIST LVM2.2.03.19.tgz 2732219 BLAKE2B 7a5bd024312f149d95361ea24a282c8c68e371687fe8f7c853fa0748ce854bc991cdade999835666a5ece569e80dd9be85d4fae7fc5cc75b912de00f170cf66e SHA512 a40691f6f4c9300c95784be0fcb055a2b8e07bfdc87f000f2357ccb54fdb814a679fb79f5c9790a7440ef538e9997e46d56e539814bfdf138b4e76603aeb2994
 DIST LVM2.2.03.20.tgz 2739763 BLAKE2B 4dc223eca1a370450c3985a5f962a2450a2ed08f1fa40af98d181a1530960a7caa3e896a3b54f0f333e2d6818bf35378b9c491a1488a4d3815959ab0e1f987de SHA512 202ff19f6ab1e1ecdf448beec6c7db1a80885efda1a6eeabf44cd2cea40577405c388eabd86f59f34c6e9e400188050bc6d1a5d5daf02f2beda87eee73cd1a2d
 DIST LVM2.2.03.21.tgz 2742294 BLAKE2B 529bc01b3d1ba6207c9ddc95309b39e6293fcd0286334240b9fdc076da0b7bc7e026338ec0243564ec153f2fb5009014149c3f8e0db0cd47a29418af62068728 SHA512 6024811c3fa92afd2fc13a10d1c3542352aa9a016f40c3ef588bd2f5f3e41245fed4b36c8a87d9f7f8dddc6e13b7253396f5c811f99665df27751676dc7b5bde

diff --git a/sys-fs/lvm2/files/lvm2-2.03.17-pthread-pkgconfig.patch b/sys-fs/lvm2/files/lvm2-2.03.17-pthread-pkgconfig.patch
deleted file mode 100644
index 828cf66667b1..000000000000
--- a/sys-fs/lvm2/files/lvm2-2.03.17-pthread-pkgconfig.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-Add pthread to libdevmapper pkgconfig file
-
---- a/libdm/libdevmapper.pc.in
-+++ b/libdm/libdevmapper.pc.in
-@@ -9,4 +9,4 @@
- Cflags: -I${includedir} 
- Libs: -L${libdir} -ldevmapper
- Requires.private: @SELINUX_PC@ @UDEV_PC@
--Libs.private: -lm @RT_LIBS@
-+Libs.private: -lm @RT_LIBS@ @PTHREAD_LIBS@
---- a/tools/Makefile.in
-+++ b/tools/Makefile.in
-@@ -89,6 +89,7 @@
-   TARGETS += lvm.static
-   INSTALL_LVM_TARGETS += install_tools_static
-   INSTALL_CMDLIB_TARGETS += install_cmdlib_static
-+  STATIC_LIBS += @PTHREAD_LIBS@
- endif
- 
- LIB_VERSION = $(LIB_VERSION_LVM)
-@@ -114,6 +115,10 @@
- 
- include $(top_builddir)/make.tmpl
- 
-+ifeq ("@STATIC_LINK@", "yes")
-+    STATIC_LIBS += @PTHREAD_LIBS@
-+endif
-+
- device-mapper:
- 
- all: device-mapper

diff --git a/sys-fs/lvm2/files/lvm2-2.03.19-dynamic-static-ldflags.patch b/sys-fs/lvm2/files/lvm2-2.03.19-dynamic-static-ldflags.patch
deleted file mode 100644
index 3aae81984506..000000000000
--- a/sys-fs/lvm2/files/lvm2-2.03.19-dynamic-static-ldflags.patch
+++ /dev/null
@@ -1,50 +0,0 @@
---- a/configure.ac
-+++ b/configure.ac
-@@ -32,6 +32,7 @@
- 	[linux*], [
- 		# equivalent to -rdynamic
- 		ELDFLAGS="-Wl,--export-dynamic"
-+		STATIC_LDFLAGS="-Wl,--no-export-dynamic"
- 		# FIXME Generate list and use --dynamic-list=.dlopen.sym
- 		CLDWHOLEARCHIVE="-Wl,-whole-archive"
- 		CLDNOWHOLEARCHIVE="-Wl,-no-whole-archive"
-@@ -1875,6 +1876,7 @@
- AC_SUBST(SYSTEMD_RUN_CMD)
- AC_SUBST(SNAPSHOTS)
- AC_SUBST(STATICDIR)
-+AC_SUBST(STATIC_LDFLAGS)
- AC_SUBST(STATIC_LINK)
- AC_SUBST(TESTSUITE_DATA)
- AC_SUBST(THIN)
---- a/daemons/dmeventd/Makefile.in
-+++ b/daemons/dmeventd/Makefile.in
-@@ -76,7 +76,7 @@
- 
- dmeventd.static: $(LIB_STATIC) dmeventd.o
- 	@echo "    [CC] $@"
--	$(Q) $(CC) $(CFLAGS) $(LDFLAGS) -static dmeventd.o \
-+	$(Q) $(CC) $(CFLAGS) $(LDFLAGS) $(STATIC_LDFLAGS) -static dmeventd.o \
- 		-o $@ $(DL_LIBS) $(DMEVENT_LIBS) $(LIBS) $(STATIC_LIBS)
- 
- ifeq ("@PKGCONFIG@", "yes")
---- a/make.tmpl.in
-+++ b/make.tmpl.in
-@@ -65,6 +65,7 @@
- CFLAGS ?= @COPTIMISE_FLAG@ @CFLAGS@
- CPPFLAGS ?= @CPPFLAGS@
- LDFLAGS ?= @LDFLAGS@
-+STATIC_LDFLAGS += @STATIC_LDFLAGS@
- CLDFLAGS += @CLDFLAGS@
- ELDFLAGS += @ELDFLAGS@
- LDDEPS += @LDDEPS@
---- a/tools/Makefile.in
-+++ b/tools/Makefile.in
-@@ -137,7 +137,7 @@
- 
- lvm.static: $(OBJECTS) lvm-static.o $(LVMINTERNAL_LIBS)
- 	@echo "    [CC] $@"
--	$(Q) $(CC) $(CFLAGS) $(LDFLAGS) -static -L$(interfacebuilddir) \
-+	$(Q) $(CC) $(CFLAGS) $(LDFLAGS) $(STATIC_LDFLAGS) -static -L$(interfacebuilddir) \
- 		-o $@ $+ $(LVMLIBS) $(STATIC_LIBS)
- 
- liblvm2cmd.a: $(top_builddir)/lib/liblvm-internal.a $(OBJECTS) lvmcmdlib.o lvm2cmd.o

diff --git a/sys-fs/lvm2/files/lvm2-2.03.19-static-pkgconfig-libs.patch b/sys-fs/lvm2/files/lvm2-2.03.19-static-pkgconfig-libs.patch
deleted file mode 100644
index 52f2cc0cb7fe..000000000000
--- a/sys-fs/lvm2/files/lvm2-2.03.19-static-pkgconfig-libs.patch
+++ /dev/null
@@ -1,130 +0,0 @@
-From ac7cce039825ff779795b5c2ae0ecf00ba43a401 Mon Sep 17 00:00:00 2001
-From: "Robin H. Johnson" <robbat2@gentoo.org>
-Date: Sun, 9 May 2021 11:00:22 +0200
-Subject: [PATCH] Use pkgconfig to detect static libs
-
---- a/configure.ac
-+++ b/configure.ac
-@@ -1139,6 +1139,7 @@
- 	AS_IF([test "$HAVE_BLKID" = "yes"], [
- 		BLKID_WIPING="yes"
- 		BLKID_PC="blkid"
-+		BLKID_STATIC_LIBS=`$PKG_CONFIG --static --libs $BLKID_PC`
- 		DEFAULT_USE_BLKID_WIPING=1
- 		AC_DEFINE([BLKID_WIPING_SUPPORT], 1, [Define to 1 to use libblkid detection of signatures when wiping.])
- 	], [
-@@ -1165,6 +1166,7 @@
- 
- AS_IF([test "$UDEV_SYNC" = "yes"], [
- 	PKG_CHECK_MODULES(UDEV, libudev >= 143, [UDEV_PC="libudev"])
-+	UDEV_STATIC_LIBS=`$PKG_CONFIG --static --libs libudev`
- 	AC_DEFINE([UDEV_SYNC_SUPPORT], 1, [Define to 1 to enable synchronisation with udev processing.])
- 
- 	AC_CHECK_LIB(udev, udev_device_get_is_initialized, AC_DEFINE([HAVE_LIBUDEV_UDEV_DEVICE_GET_IS_INITIALIZED], 1,
-@@ -1382,19 +1384,28 @@
- AS_IF([test "$SELINUX" = "yes"], [
- 	AC_CHECK_LIB([sepol], [sepol_check_context], [
- 		AC_DEFINE([HAVE_SEPOL], 1, [Define to 1 if sepol_check_context is available.])
--		SELINUX_LIBS="-lsepol"])
-+		SEPOL_LIBS="-lsepol"])
-+
-+	PKG_CHECK_MODULES(SELINUX, libselinux, [
-+		SELINUX_PC="libselinux"
-+		SELINUX_STATIC_LIBS=`$PKG_CONFIG --static --libs libselinux`
-+		SELINUX_LIBS="$SELINUX_LIBS $SEPOL_LIBS"
-+		AC_DEFINE([HAVE_SELINUX], 1, [Define to 1 to include support for selinux.])
-+	], [
-+		dnl -- old non-pkgconfig method, is buggy with static builds
- 
- 	AC_CHECK_LIB([selinux], [is_selinux_enabled], [
- 		AC_CHECK_HEADERS([selinux/selinux.h],, hard_bailout)
- 		AC_CHECK_HEADERS([selinux/label.h])
- 		AC_DEFINE([HAVE_SELINUX], 1, [Define to 1 to include support for selinux.])
--		SELINUX_LIBS="-lselinux $SELINUX_LIBS"
-+		SELINUX_LIBS="-lselinux $SEPOL_LIBS"
- 		SELINUX_PC="libselinux"
- 		HAVE_SELINUX=yes ], [
- 		AC_MSG_WARN(Disabling selinux)
- 		SELINUX_LIBS=
- 		SELINUX_PC=
- 		HAVE_SELINUX=no ])
-+	])
- ])
- 
- ################################################################################
-@@ -1790,6 +1801,7 @@
- ################################################################################
- AC_SUBST(AWK)
- AC_SUBST(BLKID_PC)
-+AC_SUBST(BLKID_STATIC_LIBS)
- AC_SUBST(BUILD_CMIRRORD)
- AC_SUBST(BUILD_DMEVENTD)
- AC_SUBST(BUILD_LVMDBUSD)
-@@ -1872,6 +1884,7 @@
- AC_SUBST(SBINDIR)
- AC_SUBST(SELINUX_LIBS)
- AC_SUBST(SELINUX_PC)
-+AC_SUBST(SELINUX_STATIC_LIBS)
- AC_SUBST(SYSCONFDIR)
- AC_SUBST(SYSTEMD_RUN_CMD)
- AC_SUBST(SNAPSHOTS)
-@@ -1890,6 +1903,7 @@
- AC_SUBST(CACHE_RESTORE_CMD)
- AC_SUBST(UDEV_PC)
- AC_SUBST(UDEV_RULES)
-+AC_SUBST(UDEV_STATIC_LIBS)
- AC_SUBST(UDEV_SYNC)
- AC_SUBST(UDEV_RULE_EXEC_DETECTION)
- AC_SUBST(UDEV_HAS_BUILTIN_BLKID)
---- a/libdm/make.tmpl.in
-+++ b/libdm/make.tmpl.in
-@@ -54,7 +54,7 @@
- 
- LIBS += @LIBS@ $(PTHREAD_LIBS) $(SELINUX_LIBS) $(UDEV_LIBS) $(RT_LIBS) $(M_LIBS)
- # Extra libraries always linked with static binaries
--STATIC_LIBS = $(PTHREAD_LIBS)
-+STATIC_LIBS = $(PTHREAD_LIBS) $(SELINUX_STATIC_LIBS) $(UDEV_STATIC_LIBS)
- DEFS += @DEFS@
- # FIXME set this only where it's needed, not globally?
- CFLAGS ?= @COPTIMISE_FLAG@ @CFLAGS@
-@@ -71,8 +71,10 @@
- READLINE_LIBS = @READLINE_LIBS@
- EDITLINE_LIBS = @EDITLINE_LIBS@
- SELINUX_LIBS = @SELINUX_LIBS@
-+SELINUX_STATIC_LIBS = @SELINUX_STATIC_LIBS@
- UDEV_CFLAGS = @UDEV_CFLAGS@
- UDEV_LIBS = @UDEV_LIBS@
-+UDEV_STATIC_LIBS = @UDEV_STATIC_LIBS@
- BLKID_CFLAGS = @BLKID_CFLAGS@
- BLKID_LIBS = @BLKID_LIBS@
- LIBSYSTEMD_LIBS = @LIBSYSTEMD_LIBS@
---- a/make.tmpl.in
-+++ b/make.tmpl.in
-@@ -59,7 +59,7 @@
- LIBS += @LIBS@ $(SELINUX_LIBS) $(UDEV_LIBS) $(RT_LIBS) $(M_LIBS)
- LVMLIBS = $(DMEVENT_LIBS) $(READLINE_LIBS) $(EDITLINE_LIBS) $(LIBSYSTEMD_LIBS) $(BLKID_LIBS) $(AIO_LIBS) $(LIBS)
- # Extra libraries always linked with static binaries
--STATIC_LIBS = $(PTHREAD_LIBS)
-+STATIC_LIBS = $(PTHREAD_LIBS) $(SELINUX_STATIC_LIBS) $(UDEV_STATIC_LIBS) $(BLKID_STATIC_LIBS) $(M_LIBS)
- DEFS += @DEFS@
- # FIXME set this only where it's needed, not globally?
- CFLAGS ?= @COPTIMISE_FLAG@ @CFLAGS@
-@@ -79,6 +79,7 @@
- AIO_LIBS = @AIO_LIBS@
- BLKID_CFLAGS = @BLKID_CFLAGS@
- BLKID_LIBS = @BLKID_LIBS@
-+BLKID_STATIC_LIBS = @BLKID_STATIC_LIBS@
- CPG_CFLAGS = @CPG_CFLAGS@
- CPG_LIBS = @CPG_LIBS@
- EDITLINE_CFLAGS = @EDITLINE_CFLAGS@
-@@ -97,8 +98,10 @@
- READLINE_CFLAGS = @READLINE_CFLAGS@
- READLINE_LIBS = @READLINE_LIBS@
- SELINUX_LIBS = @SELINUX_LIBS@
-+SELINUX_STATIC_LIBS = @SELINUX_STATIC_LIBS@
- UDEV_CFLAGS = @UDEV_CFLAGS@
- UDEV_LIBS = @UDEV_LIBS@
-+UDEV_STATIC_LIBS = @UDEV_STATIC_LIBS@
- VALGRIND_CFLAGS = @VALGRIND_CFLAGS@
- VALGRIND_LIBS = @VALGRIND_LIBS@
- 

diff --git a/sys-fs/lvm2/lvm2-2.03.19.ebuild b/sys-fs/lvm2/lvm2-2.03.19.ebuild
deleted file mode 100644
index f58841267b59..000000000000
--- a/sys-fs/lvm2/lvm2-2.03.19.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
-
-TMPFILES_OPTIONAL=1
-inherit autotools linux-info systemd toolchain-funcs tmpfiles udev flag-o-matic
-
-DESCRIPTION="User-land utilities for LVM2 (device-mapper) software"
-HOMEPAGE="https://sourceware.org/lvm2/"
-SRC_URI="https://sourceware.org/ftp/lvm2/${PN^^}.${PV}.tgz"
-S="${WORKDIR}/${PN^^}.${PV}"
-
-LICENSE="GPL-2"
-SLOT="0"
-KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux"
-IUSE="lvm lvm2create-initrd readline sanlock selinux static static-libs systemd thin +udev"
-REQUIRED_USE="
-	static? ( !systemd !udev )
-	static-libs? ( static !udev )
-	systemd? ( udev )
-	thin? ( lvm )"
-
-DEPEND_COMMON="
-	udev? ( virtual/libudev:= )
-	lvm? (
-		dev-libs/libaio
-		sys-apps/util-linux
-		readline? ( sys-libs/readline:= )
-		sanlock? ( sys-cluster/sanlock )
-		systemd? ( sys-apps/systemd:= )
-	)"
-# /run is now required for locking during early boot. /var cannot be assumed to
-# be available -- thus, pull in recent enough baselayout for /run.
-# This version of LVM is incompatible with cryptsetup <1.1.2.
-RDEPEND="${DEPEND_COMMON}
-	>=sys-apps/baselayout-2.2
-	lvm? (
-		virtual/tmpfiles
-		lvm2create-initrd? ( sys-apps/makedev )
-		thin? ( sys-block/thin-provisioning-tools )
-	)"
-# note: thin- 0.3.0 is required to avoid --disable-thin_check_needs_check
-DEPEND="${DEPEND_COMMON}
-	static? (
-		lvm? (
-			dev-libs/libaio[static-libs]
-			sys-apps/util-linux[static-libs]
-			readline? ( sys-libs/readline[static-libs] )
-		)
-		selinux? ( sys-libs/libselinux[static-libs] )
-	)"
-BDEPEND="
-	sys-devel/autoconf-archive
-	virtual/pkgconfig"
-
-PATCHES=(
-	# Gentoo specific modification(s):
-	"${FILESDIR}"/${PN}-2.03.17-example.conf.in.patch
-
-	# For upstream -- review and forward:
-	"${FILESDIR}"/${PN}-2.02.56-lvm2create_initrd.patch
-	"${FILESDIR}"/${PN}-2.02.67-createinitrd.patch #301331
-	"${FILESDIR}"/${PN}-2.03.17-locale-muck.patch #330373
-	"${FILESDIR}"/${PN}-2.03.19-dynamic-static-ldflags.patch #332905
-	"${FILESDIR}"/${PN}-2.03.19-static-pkgconfig-libs.patch #370217, #439414 + blkid, #617756
-	"${FILESDIR}"/${PN}-2.03.17-pthread-pkgconfig.patch #492450
-	"${FILESDIR}"/${PN}-2.03.19-dmeventd-no-idle-exit.patch
-	"${FILESDIR}"/${PN}-2.03.19-freopen-musl.patch
-)
-
-pkg_setup() {
-	local CONFIG_CHECK="~SYSVIPC"
-
-	if use udev; then
-		local WARNING_SYSVIPC="CONFIG_SYSVIPC:\tis not set (required for udev sync)\n"
-		if linux_config_exists; then
-			local uevent_helper_path=$(linux_chkconfig_string UEVENT_HELPER_PATH)
-			if [[ -n "${uevent_helper_path}" ]] && [[ "${uevent_helper_path}" != '""' ]]; then
-				ewarn "It's recommended to set an empty value to the following kernel config option:"
-				ewarn "CONFIG_UEVENT_HELPER_PATH=${uevent_helper_path}"
-			fi
-		fi
-	fi
-
-	check_extra_config
-
-	# 1. Genkernel no longer copies /sbin/lvm blindly.
-	if use static; then
-		elog "Warning, we no longer overwrite /sbin/lvm and /sbin/dmsetup with"
-		elog "their static versions. If you need the static binaries,"
-		elog "you must append .static to the filename!"
-	fi
-}
-
-src_prepare() {
-	default
-
-	# Users without systemd get no auto-activation of any logical volume
-	if ! use systemd ; then
-		eapply "${FILESDIR}"/${PN}-2.03.19-dm_lvm_rules_no_systemd.patch
-	fi
-
-	eautoreconf
-}
-
-src_configure() {
-	filter-flags -flto
-
-	# Workaround for bug #822210
-	tc-ld-disable-gold
-
-	# Most of this package does weird stuff.
-	# The build options are tristate, and --without is NOT supported
-	# options: 'none', 'internal', 'shared'
-	local myeconfargs=(
-		$(use_enable lvm dmfilemapd)
-		$(use_enable lvm dmeventd)
-		$(use_enable lvm cmdlib)
-		$(use_enable lvm fsadm)
-		$(use_enable lvm lvmpolld)
-
-		# This only causes the .static versions to become available
-		$(usev static --enable-static_link)
-
-		# dmeventd requires mirrors to be internal, and snapshot available
-		# so we cannot disable them
-		--with-mirrors="$(usex lvm internal none)"
-		--with-snapshots="$(usex lvm internal none)"
-	)
-
-	if use lvm && use thin; then
-		myeconfargs+=( --with-thin=internal --with-cache=internal )
-		local texec
-		for texec in check dump repair restore; do
-			myeconfargs+=( --with-thin-${texec}="${EPREFIX}"/sbin/thin_${texec} )
-			myeconfargs+=( --with-cache-${texec}="${EPREFIX}"/sbin/cache_${texec} )
-		done
-	else
-		myeconfargs+=( --with-thin=none --with-cache=none )
-	fi
-
-	myeconfargs+=(
-		# musl doesn't do symbol versioning so can end up with
-		# runtime breakage.
-		--with-symvers=$(usex elibc_glibc 'gnu' 'no')
-		$(use_enable readline)
-		$(use_enable selinux)
-		--enable-pkgconfig
-		--with-confdir="${EPREFIX}"/etc
-		--exec-prefix="${EPREFIX}"
-		--sbindir="${EPREFIX}/sbin"
-		--with-staticdir="${EPREFIX}"/sbin
-		--libdir="${EPREFIX}/$(get_libdir)"
-		--with-usrlibdir="${EPREFIX}/usr/$(get_libdir)"
-		--with-default-dm-run-dir=/run
-		--with-default-run-dir=/run/lvm
-		--with-default-locking-dir=/run/lock/lvm
-		--with-default-pid-dir=/run
-		$(use_enable udev udev_rules)
-		$(use_enable udev udev_sync)
-		$(use_with udev udevdir "${EPREFIX}$(get_udevdir)"/rules.d)
-		# USE=sanlock requires USE=lvm
-		$(use_enable $(usex lvm sanlock lvm) lvmlockd-sanlock)
-		$(use_enable systemd notify-dbus)
-		$(use_enable systemd app-machineid)
-		$(use_enable systemd systemd-journal)
-		$(use_with systemd systemd-run "/usr/bin/systemd-run")
-		--with-systemdsystemunitdir="$(systemd_get_systemunitdir)"
-		CLDFLAGS="${LDFLAGS}"
-	)
-
-	econf "${myeconfargs[@]}"
-}
-
-src_compile() {
-	emake V=1 -C include
-
-	if use lvm ; then
-		emake V=1
-		emake V=1 CC="$(tc-getCC)" -C scripts
-	else
-		emake V=1 device-mapper
-		# https://bugs.gentoo.org/878131
-		emake V=1 -C libdm/dm-tools device-mapper
-	fi
-}
-
-src_test() {
-	einfo "Tests are disabled because of device-node mucking, if you want to"
-	einfo "run tests, compile the package and see ${S}/tests"
-}
-
-src_install() {
-	local INSTALL_TARGETS=(
-		# full LVM2
-		$(usev lvm "install install_tmpfiles_configuration")
-		# install systemd related files only when requested, bug #522430
-		$(usev $(usex lvm systemd lvm) "SYSTEMD_GENERATOR_DIR=$(systemd_get_systemgeneratordir) install_systemd_units install_systemd_generators")
-
-		# install dm unconditionally
-		install_device-mapper
-	)
-	emake V=1 DESTDIR="${D}" "${INSTALL_TARGETS[@]}"
-
-	newinitd "${FILESDIR}"/device-mapper.rc-2.02.105-r2 device-mapper
-	newconfd "${FILESDIR}"/device-mapper.conf-1.02.22-r3 device-mapper
-
-	if use lvm ; then
-		newinitd "${FILESDIR}"/dmeventd.initd-2.02.184-r2 dmeventd
-		newinitd "${FILESDIR}"/lvm.rc-2.02.187 lvm
-		newconfd "${FILESDIR}"/lvm.confd-2.02.184-r3 lvm
-		if ! use udev ; then
-			# We keep the variable but remove udev from it.
-			sed -r -i \
-				-e '/^rc_need=/s/\<udev\>//g' \
-				"${ED}"/etc/conf.d/lvm || die "Could not drop udev from rc_need"
-		fi
-
-		newinitd "${FILESDIR}"/lvm-monitoring.initd-2.02.105-r2 lvm-monitoring
-		newinitd "${FILESDIR}"/lvmpolld.initd-2.02.183 lvmpolld
-
-		if use lvm2create-initrd; then
-			dosbin scripts/lvm2create_initrd/lvm2create_initrd
-			doman scripts/lvm2create_initrd/lvm2create_initrd.8
-			newdoc scripts/lvm2create_initrd/README README.lvm2create_initrd
-		fi
-
-		if use sanlock; then
-			newinitd "${FILESDIR}"/lvmlockd.initd-2.02.166-r1 lvmlockd
-		fi
-	fi
-
-	if use static-libs; then
-		dolib.a libdm/ioctl/libdevmapper.a
-		if use lvm; then
-			# depends on lvmetad
-			dolib.a libdaemon/client/libdaemonclient.a #462908
-			# depends on dmeventd
-			dolib.a daemons/dmeventd/libdevmapper-event.a
-		fi
-	else
-		rm -f "${ED}"/usr/$(get_libdir)/{libdevmapper-event,liblvm2cmd,liblvm2app,libdevmapper}.a || die
-	fi
-
-	insinto /etc
-	doins "${FILESDIR}"/dmtab
-
-	dodoc README VERSION* WHATS_NEW WHATS_NEW_DM doc/*.{c,txt} conf/*.conf
-}
-
-pkg_preinst() {
-	HAD_LVM=0
-
-	if has_version 'sys-fs/lvm2[lvm(+)]' ; then
-		HAD_LVM=1
-	fi
-}
-
-pkg_postinst() {
-	use lvm && tmpfiles_process lvm2.conf
-	use udev && udev_reload
-
-	# This is a new installation
-	if [[ -z "${REPLACING_VERSIONS}" ]]; then
-		if use lvm ; then
-			ewarn "Make sure the \"lvm\" init script is in the runlevels:"
-			ewarn "# rc-update add lvm boot"
-			ewarn
-			ewarn "Make sure to enable lvmetad in ${EROOT}/etc/lvm/lvm.conf if you want"
-			ewarn "to enable lvm autoactivation and metadata caching."
-		else
-			ewarn "Please enable USE=lvm if you need the LVM daemon and"
-			ewarn "tools like 'lvchange', 'vgchange', etc!"
-		fi
-	else
-		if ! use lvm && [[ ${HAD_LVM} -eq 1 ]] ; then
-			ewarn "LVM was previously enabled but is now disabled."
-			ewarn "Please enable USE=lvm if you need the LVM daemon and"
-			ewarn "tools like 'lvchange', 'vgchange', etc!"
-			ewarn "See the 2022-11-19-lvm2-default-USE-flags news item for more details."
-		fi
-	fi
-
-	if use udev && [[ -d /run ]] ; then
-		local permission_run_expected="drwxr-xr-x"
-		local permission_run=$(stat -c "%A" /run)
-		if [[ "${permission_run}" != "${permission_run_expected}" ]] ; then
-			ewarn "Found the following problematic permissions:"
-			ewarn ""
-			ewarn "    ${permission_run} /run"
-			ewarn ""
-			ewarn "Expected:"
-			ewarn ""
-			ewarn "    ${permission_run_expected} /run"
-			ewarn ""
-			ewarn "This is known to cause problems for udev-enabled LVM services."
-		fi
-	fi
-}
-
-pkg_postrm() {
-	if use udev && [[ -z ${REPLACED_BY_VERSION} ]]; then
-		udev_reload
-	fi
-}


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-fs/lvm2/, sys-fs/lvm2/files/
@ 2023-05-10  8:57 David Seifert
  0 siblings, 0 replies; 29+ messages in thread
From: David Seifert @ 2023-05-10  8:57 UTC (permalink / raw
  To: gentoo-commits

commit:     f1d8b9e871854b3bb0f5c810a4883ab8d8f114eb
Author:     David Seifert <soap <AT> gentoo <DOT> org>
AuthorDate: Wed May 10 08:56:54 2023 +0000
Commit:     David Seifert <soap <AT> gentoo <DOT> org>
CommitDate: Wed May 10 08:56:54 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f1d8b9e8

sys-fs/lvm2: clean up patches

Signed-off-by: David Seifert <soap <AT> gentoo.org>

 ...apper.conf-1.02.22-r3 => device-mapper.conf-r4} |  0
 ...e-mapper.rc-2.02.105-r2 => device-mapper.rc-r3} |  0
 ...meventd.initd-2.02.184-r2 => dmeventd.initd-r3} |  0
 ...g.initd-2.02.105-r2 => lvm-monitoring.initd-r3} |  0
 .../files/{lvm.confd-2.02.184-r3 => lvm.confd-r4}  |  0
 sys-fs/lvm2/files/{lvm.rc-2.02.187 => lvm.rc-r1}   |  0
 ...nitrd.patch => lvm2-2.03.20-createinitrd.patch} |  0
 ... => lvm2-2.03.20-dm_lvm_rules_no_systemd.patch} |  0
 ...ch => lvm2-2.03.20-dmeventd-no-idle-exit.patch} |  0
 ...in.patch => lvm2-2.03.20-example.conf.in.patch} |  0
 ...-musl.patch => lvm2-2.03.20-freopen-musl.patch} |  0
 ...e-muck.patch => lvm2-2.03.20-locale-muck.patch} |  0
 ....patch => lvm2-2.03.20-lvm2create_initrd.patch} |  0
 ...vmlockd.initd-2.02.166-r1 => lvmlockd.initd-r2} |  0
 .../{lvmpolld.initd-2.02.183 => lvmpolld.initd-r1} |  0
 sys-fs/lvm2/lvm2-2.03.20.ebuild                    | 30 +++++++++++-----------
 sys-fs/lvm2/lvm2-2.03.21.ebuild                    | 30 +++++++++++-----------
 17 files changed, 30 insertions(+), 30 deletions(-)

diff --git a/sys-fs/lvm2/files/device-mapper.conf-1.02.22-r3 b/sys-fs/lvm2/files/device-mapper.conf-r4
similarity index 100%
rename from sys-fs/lvm2/files/device-mapper.conf-1.02.22-r3
rename to sys-fs/lvm2/files/device-mapper.conf-r4

diff --git a/sys-fs/lvm2/files/device-mapper.rc-2.02.105-r2 b/sys-fs/lvm2/files/device-mapper.rc-r3
similarity index 100%
rename from sys-fs/lvm2/files/device-mapper.rc-2.02.105-r2
rename to sys-fs/lvm2/files/device-mapper.rc-r3

diff --git a/sys-fs/lvm2/files/dmeventd.initd-2.02.184-r2 b/sys-fs/lvm2/files/dmeventd.initd-r3
similarity index 100%
rename from sys-fs/lvm2/files/dmeventd.initd-2.02.184-r2
rename to sys-fs/lvm2/files/dmeventd.initd-r3

diff --git a/sys-fs/lvm2/files/lvm-monitoring.initd-2.02.105-r2 b/sys-fs/lvm2/files/lvm-monitoring.initd-r3
similarity index 100%
rename from sys-fs/lvm2/files/lvm-monitoring.initd-2.02.105-r2
rename to sys-fs/lvm2/files/lvm-monitoring.initd-r3

diff --git a/sys-fs/lvm2/files/lvm.confd-2.02.184-r3 b/sys-fs/lvm2/files/lvm.confd-r4
similarity index 100%
rename from sys-fs/lvm2/files/lvm.confd-2.02.184-r3
rename to sys-fs/lvm2/files/lvm.confd-r4

diff --git a/sys-fs/lvm2/files/lvm.rc-2.02.187 b/sys-fs/lvm2/files/lvm.rc-r1
similarity index 100%
rename from sys-fs/lvm2/files/lvm.rc-2.02.187
rename to sys-fs/lvm2/files/lvm.rc-r1

diff --git a/sys-fs/lvm2/files/lvm2-2.02.67-createinitrd.patch b/sys-fs/lvm2/files/lvm2-2.03.20-createinitrd.patch
similarity index 100%
rename from sys-fs/lvm2/files/lvm2-2.02.67-createinitrd.patch
rename to sys-fs/lvm2/files/lvm2-2.03.20-createinitrd.patch

diff --git a/sys-fs/lvm2/files/lvm2-2.03.19-dm_lvm_rules_no_systemd.patch b/sys-fs/lvm2/files/lvm2-2.03.20-dm_lvm_rules_no_systemd.patch
similarity index 100%
rename from sys-fs/lvm2/files/lvm2-2.03.19-dm_lvm_rules_no_systemd.patch
rename to sys-fs/lvm2/files/lvm2-2.03.20-dm_lvm_rules_no_systemd.patch

diff --git a/sys-fs/lvm2/files/lvm2-2.03.19-dmeventd-no-idle-exit.patch b/sys-fs/lvm2/files/lvm2-2.03.20-dmeventd-no-idle-exit.patch
similarity index 100%
rename from sys-fs/lvm2/files/lvm2-2.03.19-dmeventd-no-idle-exit.patch
rename to sys-fs/lvm2/files/lvm2-2.03.20-dmeventd-no-idle-exit.patch

diff --git a/sys-fs/lvm2/files/lvm2-2.03.17-example.conf.in.patch b/sys-fs/lvm2/files/lvm2-2.03.20-example.conf.in.patch
similarity index 100%
rename from sys-fs/lvm2/files/lvm2-2.03.17-example.conf.in.patch
rename to sys-fs/lvm2/files/lvm2-2.03.20-example.conf.in.patch

diff --git a/sys-fs/lvm2/files/lvm2-2.03.19-freopen-musl.patch b/sys-fs/lvm2/files/lvm2-2.03.20-freopen-musl.patch
similarity index 100%
rename from sys-fs/lvm2/files/lvm2-2.03.19-freopen-musl.patch
rename to sys-fs/lvm2/files/lvm2-2.03.20-freopen-musl.patch

diff --git a/sys-fs/lvm2/files/lvm2-2.03.17-locale-muck.patch b/sys-fs/lvm2/files/lvm2-2.03.20-locale-muck.patch
similarity index 100%
rename from sys-fs/lvm2/files/lvm2-2.03.17-locale-muck.patch
rename to sys-fs/lvm2/files/lvm2-2.03.20-locale-muck.patch

diff --git a/sys-fs/lvm2/files/lvm2-2.02.56-lvm2create_initrd.patch b/sys-fs/lvm2/files/lvm2-2.03.20-lvm2create_initrd.patch
similarity index 100%
rename from sys-fs/lvm2/files/lvm2-2.02.56-lvm2create_initrd.patch
rename to sys-fs/lvm2/files/lvm2-2.03.20-lvm2create_initrd.patch

diff --git a/sys-fs/lvm2/files/lvmlockd.initd-2.02.166-r1 b/sys-fs/lvm2/files/lvmlockd.initd-r2
similarity index 100%
rename from sys-fs/lvm2/files/lvmlockd.initd-2.02.166-r1
rename to sys-fs/lvm2/files/lvmlockd.initd-r2

diff --git a/sys-fs/lvm2/files/lvmpolld.initd-2.02.183 b/sys-fs/lvm2/files/lvmpolld.initd-r1
similarity index 100%
rename from sys-fs/lvm2/files/lvmpolld.initd-2.02.183
rename to sys-fs/lvm2/files/lvmpolld.initd-r1

diff --git a/sys-fs/lvm2/lvm2-2.03.20.ebuild b/sys-fs/lvm2/lvm2-2.03.20.ebuild
index 84c67872e4f6..4ea94fc558fe 100644
--- a/sys-fs/lvm2/lvm2-2.03.20.ebuild
+++ b/sys-fs/lvm2/lvm2-2.03.20.ebuild
@@ -56,14 +56,14 @@ BDEPEND="
 
 PATCHES=(
 	# Gentoo specific modification(s):
-	"${FILESDIR}"/${PN}-2.03.17-example.conf.in.patch
+	"${FILESDIR}"/${PN}-2.03.20-example.conf.in.patch
 
 	# For upstream -- review and forward:
-	"${FILESDIR}"/${PN}-2.02.56-lvm2create_initrd.patch
-	"${FILESDIR}"/${PN}-2.02.67-createinitrd.patch #301331
-	"${FILESDIR}"/${PN}-2.03.17-locale-muck.patch #330373
-	"${FILESDIR}"/${PN}-2.03.19-dmeventd-no-idle-exit.patch
-	"${FILESDIR}"/${PN}-2.03.19-freopen-musl.patch
+	"${FILESDIR}"/${PN}-2.03.20-lvm2create_initrd.patch
+	"${FILESDIR}"/${PN}-2.03.20-createinitrd.patch #301331
+	"${FILESDIR}"/${PN}-2.03.20-locale-muck.patch #330373
+	"${FILESDIR}"/${PN}-2.03.20-dmeventd-no-idle-exit.patch
+	"${FILESDIR}"/${PN}-2.03.20-freopen-musl.patch
 )
 
 pkg_setup() {
@@ -95,7 +95,7 @@ src_prepare() {
 
 	# Users without systemd get no auto-activation of any logical volume
 	if ! use systemd ; then
-		eapply "${FILESDIR}"/${PN}-2.03.19-dm_lvm_rules_no_systemd.patch
+		eapply "${FILESDIR}"/${PN}-2.03.20-dm_lvm_rules_no_systemd.patch
 	fi
 
 	eautoreconf
@@ -200,13 +200,13 @@ src_install() {
 	)
 	emake V=1 DESTDIR="${D}" "${INSTALL_TARGETS[@]}"
 
-	newinitd "${FILESDIR}"/device-mapper.rc-2.02.105-r2 device-mapper
-	newconfd "${FILESDIR}"/device-mapper.conf-1.02.22-r3 device-mapper
+	newinitd "${FILESDIR}"/device-mapper.rc-r3 device-mapper
+	newconfd "${FILESDIR}"/device-mapper.conf-r4 device-mapper
 
 	if use lvm ; then
-		newinitd "${FILESDIR}"/dmeventd.initd-2.02.184-r2 dmeventd
-		newinitd "${FILESDIR}"/lvm.rc-2.02.187 lvm
-		newconfd "${FILESDIR}"/lvm.confd-2.02.184-r3 lvm
+		newinitd "${FILESDIR}"/dmeventd.initd-r3 dmeventd
+		newinitd "${FILESDIR}"/lvm.rc-r1 lvm
+		newconfd "${FILESDIR}"/lvm.confd-r4 lvm
 		if ! use udev ; then
 			# We keep the variable but remove udev from it.
 			sed -r -i \
@@ -214,8 +214,8 @@ src_install() {
 				"${ED}"/etc/conf.d/lvm || die "Could not drop udev from rc_need"
 		fi
 
-		newinitd "${FILESDIR}"/lvm-monitoring.initd-2.02.105-r2 lvm-monitoring
-		newinitd "${FILESDIR}"/lvmpolld.initd-2.02.183 lvmpolld
+		newinitd "${FILESDIR}"/lvm-monitoring.initd-r3 lvm-monitoring
+		newinitd "${FILESDIR}"/lvmpolld.initd-r1 lvmpolld
 
 		if use lvm2create-initrd; then
 			dosbin scripts/lvm2create_initrd/lvm2create_initrd
@@ -224,7 +224,7 @@ src_install() {
 		fi
 
 		if use sanlock; then
-			newinitd "${FILESDIR}"/lvmlockd.initd-2.02.166-r1 lvmlockd
+			newinitd "${FILESDIR}"/lvmlockd.initd-r2 lvmlockd
 		fi
 	fi
 

diff --git a/sys-fs/lvm2/lvm2-2.03.21.ebuild b/sys-fs/lvm2/lvm2-2.03.21.ebuild
index 5d9eb0ac9398..12b85fc8045c 100644
--- a/sys-fs/lvm2/lvm2-2.03.21.ebuild
+++ b/sys-fs/lvm2/lvm2-2.03.21.ebuild
@@ -56,14 +56,14 @@ BDEPEND="
 
 PATCHES=(
 	# Gentoo specific modification(s):
-	"${FILESDIR}"/${PN}-2.03.17-example.conf.in.patch
+	"${FILESDIR}"/${PN}-2.03.20-example.conf.in.patch
 
 	# For upstream -- review and forward:
-	"${FILESDIR}"/${PN}-2.02.56-lvm2create_initrd.patch
-	"${FILESDIR}"/${PN}-2.02.67-createinitrd.patch #301331
-	"${FILESDIR}"/${PN}-2.03.17-locale-muck.patch #330373
-	"${FILESDIR}"/${PN}-2.03.19-dmeventd-no-idle-exit.patch
-	"${FILESDIR}"/${PN}-2.03.19-freopen-musl.patch
+	"${FILESDIR}"/${PN}-2.03.20-lvm2create_initrd.patch
+	"${FILESDIR}"/${PN}-2.03.20-createinitrd.patch #301331
+	"${FILESDIR}"/${PN}-2.03.20-locale-muck.patch #330373
+	"${FILESDIR}"/${PN}-2.03.20-dmeventd-no-idle-exit.patch
+	"${FILESDIR}"/${PN}-2.03.20-freopen-musl.patch
 )
 
 pkg_setup() {
@@ -95,7 +95,7 @@ src_prepare() {
 
 	# Users without systemd get no auto-activation of any logical volume
 	if ! use systemd ; then
-		eapply "${FILESDIR}"/${PN}-2.03.19-dm_lvm_rules_no_systemd.patch
+		eapply "${FILESDIR}"/${PN}-2.03.20-dm_lvm_rules_no_systemd.patch
 	fi
 
 	eautoreconf
@@ -201,13 +201,13 @@ src_install() {
 	)
 	emake V=1 DESTDIR="${D}" "${INSTALL_TARGETS[@]}"
 
-	newinitd "${FILESDIR}"/device-mapper.rc-2.02.105-r2 device-mapper
-	newconfd "${FILESDIR}"/device-mapper.conf-1.02.22-r3 device-mapper
+	newinitd "${FILESDIR}"/device-mapper.rc-r3 device-mapper
+	newconfd "${FILESDIR}"/device-mapper.conf-r4 device-mapper
 
 	if use lvm ; then
-		newinitd "${FILESDIR}"/dmeventd.initd-2.02.184-r2 dmeventd
-		newinitd "${FILESDIR}"/lvm.rc-2.02.187 lvm
-		newconfd "${FILESDIR}"/lvm.confd-2.02.184-r3 lvm
+		newinitd "${FILESDIR}"/dmeventd.initd-r3 dmeventd
+		newinitd "${FILESDIR}"/lvm.rc-r1 lvm
+		newconfd "${FILESDIR}"/lvm.confd-r4 lvm
 		if ! use udev ; then
 			# We keep the variable but remove udev from it.
 			sed -r -i \
@@ -215,8 +215,8 @@ src_install() {
 				"${ED}"/etc/conf.d/lvm || die "Could not drop udev from rc_need"
 		fi
 
-		newinitd "${FILESDIR}"/lvm-monitoring.initd-2.02.105-r2 lvm-monitoring
-		newinitd "${FILESDIR}"/lvmpolld.initd-2.02.183 lvmpolld
+		newinitd "${FILESDIR}"/lvm-monitoring.initd-r3 lvm-monitoring
+		newinitd "${FILESDIR}"/lvmpolld.initd-r1 lvmpolld
 
 		if use lvm2create-initrd; then
 			dosbin scripts/lvm2create_initrd/lvm2create_initrd
@@ -225,7 +225,7 @@ src_install() {
 		fi
 
 		if use sanlock; then
-			newinitd "${FILESDIR}"/lvmlockd.initd-2.02.166-r1 lvmlockd
+			newinitd "${FILESDIR}"/lvmlockd.initd-r2 lvmlockd
 		fi
 	fi
 


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-fs/lvm2/, sys-fs/lvm2/files/
@ 2023-06-02 13:02 David Seifert
  0 siblings, 0 replies; 29+ messages in thread
From: David Seifert @ 2023-06-02 13:02 UTC (permalink / raw
  To: gentoo-commits

commit:     74999508c7b1a19ad0422a22c35bc11e4e79cb1b
Author:     David Seifert <soap <AT> gentoo <DOT> org>
AuthorDate: Fri Jun  2 13:02:37 2023 +0000
Commit:     David Seifert <soap <AT> gentoo <DOT> org>
CommitDate: Fri Jun  2 13:02:37 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=74999508

sys-fs/lvm2: drop 2.03.20

Signed-off-by: David Seifert <soap <AT> gentoo.org>

 sys-fs/lvm2/Manifest                               |   1 -
 sys-fs/lvm2/files/lvm2-2.03.20-locale-muck.patch   |  11 -
 .../files/lvm2-2.03.20-lvm2create_initrd.patch     |  79 ------
 sys-fs/lvm2/lvm2-2.03.20.ebuild                    | 302 ---------------------
 4 files changed, 393 deletions(-)

diff --git a/sys-fs/lvm2/Manifest b/sys-fs/lvm2/Manifest
index 01f7b2833c23..8d5003223fb4 100644
--- a/sys-fs/lvm2/Manifest
+++ b/sys-fs/lvm2/Manifest
@@ -1,2 +1 @@
-DIST LVM2.2.03.20.tgz 2739763 BLAKE2B 4dc223eca1a370450c3985a5f962a2450a2ed08f1fa40af98d181a1530960a7caa3e896a3b54f0f333e2d6818bf35378b9c491a1488a4d3815959ab0e1f987de SHA512 202ff19f6ab1e1ecdf448beec6c7db1a80885efda1a6eeabf44cd2cea40577405c388eabd86f59f34c6e9e400188050bc6d1a5d5daf02f2beda87eee73cd1a2d
 DIST LVM2.2.03.21.tgz 2742294 BLAKE2B 529bc01b3d1ba6207c9ddc95309b39e6293fcd0286334240b9fdc076da0b7bc7e026338ec0243564ec153f2fb5009014149c3f8e0db0cd47a29418af62068728 SHA512 6024811c3fa92afd2fc13a10d1c3542352aa9a016f40c3ef588bd2f5f3e41245fed4b36c8a87d9f7f8dddc6e13b7253396f5c811f99665df27751676dc7b5bde

diff --git a/sys-fs/lvm2/files/lvm2-2.03.20-locale-muck.patch b/sys-fs/lvm2/files/lvm2-2.03.20-locale-muck.patch
deleted file mode 100644
index c672a10e2cf6..000000000000
--- a/sys-fs/lvm2/files/lvm2-2.03.20-locale-muck.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/make.tmpl.in
-+++ b/make.tmpl.in
-@@ -571,7 +571,7 @@
- 	( cat $(srcdir)/.exported_symbols; \
- 	  if test -n "$(EXPORTED_HEADER)"; then \
- 		$(CC) -E -P $(INCLUDES) $(DEFS) $(EXPORTED_HEADER) | \
--		$(SED) -ne "/^typedef|}/!s/.*[ *]\($(EXPORTED_FN_PREFIX)_[a-z0-9_]*\)(.*/\1/p"; \
-+		LC_ALL=C $(SED) -ne "/^typedef|}/!s/.*[ *]\($(EXPORTED_FN_PREFIX)_[a-z0-9_]*\)(.*/\1/p"; \
- 	  fi \
- 	) > $@
- 

diff --git a/sys-fs/lvm2/files/lvm2-2.03.20-lvm2create_initrd.patch b/sys-fs/lvm2/files/lvm2-2.03.20-lvm2create_initrd.patch
deleted file mode 100644
index 007b2b5c1e3a..000000000000
--- a/sys-fs/lvm2/files/lvm2-2.03.20-lvm2create_initrd.patch
+++ /dev/null
@@ -1,79 +0,0 @@
---- a/scripts/lvm2create_initrd/lvm2create_initrd
-+++ b/scripts/lvm2create_initrd/lvm2create_initrd
-@@ -54,7 +54,9 @@
- DEVRAM=/tmp/initrd.$$
- 
- # set defaults
--BINFILES=${BINFILES:-"`which lvm` `which bash` `which busybox` `which pivot_root`"}
-+LVM=`which lvm.static`
-+LVM=${LVM:-"`which lvm`"}
-+BINFILES=${BINFILES:-"${LVM} `which bash` `which busybox` `which pivot_root`"}
- BASICDEVICES=${BASICDEVICES:-"std consoleonly fd"}
- BLOCKDEVICES=${BLOCKDEVICES:-"md hda hdb hdc hdd sda sdb sdc sdd"}
- MAKEDEV=${MAKEDEV:-"debian"}
-@@ -119,6 +121,10 @@
- echo "$PRE Mounting /proc"
- mount -t proc none /proc
- 
-+# We need /sys for lvm
-+echo "$PRE Mounting /sys"
-+mount -t sysfs sysfs /sys
-+
- # plug in modules listed in /etc/modules
- if [ -f /etc/modules ]; then
-     echo -n "$PRE plugging in kernel modules:"
-@@ -179,26 +185,29 @@
- # run a shell if we're passed lvm2rescue on commandline
- grep lvm2rescue /proc/cmdline 1>/dev/null 2>&1
- if [ $? -eq 0 ]; then
--    lvm vgchange --ignorelockingfailure -P -a y
-+    $LVM vgchange --ignorelockingfailure -P -a y
-     do_shell
- else
--    lvm vgchange --ignorelockingfailure -a y
-+    $LVM vgchange --ignorelockingfailure -a y
- fi
- 
- echo "$PRE Mounting root filesystem $rootvol ro"
- mkdir /rootvol
- if ! mount -t auto -o ro $rootvol /rootvol; then
--	echo "\t*FAILED*";
-+	echo "\t*FAILED TRYING TO MOUNT ROOTVOL*";
- 	do_shell
- fi
- 
- echo "$PRE Umounting /proc"
- umount /proc
- 
-+echo "$PRE Umounting /sys"
-+umount /sys
-+
- echo "$PRE Changing roots"
- cd /rootvol
- if ! pivot_root . initrd ; then
--	echo "\t*FAILED*"
-+	echo "\t*FAILED PIVOT TO NEW ROOT*"
- 	do_shell
- fi
- 
-@@ -356,7 +365,7 @@
- fi
- 
- verbose "creating basic set of directories in $TMPMNT"
--(cd $TMPMNT; mkdir bin dev etc lib proc sbin var)
-+(cd $TMPMNT; mkdir bin dev etc lib proc sbin sys var)
- if [ $? -ne 0 ]; then
-    echo "$cmd -- ERROR creating directories in $TMPMNT"
-    cleanup 1
-@@ -460,9 +469,9 @@
- rmdir $TMPMNT/lost+found
- 
- echo "$cmd -- ummounting ram disk"
--umount $DEVRAM
-+umount $TMPMNT
- if [ $? -ne 0 ]; then
--   echo "$cmd -- ERROR umounting $DEVRAM"
-+   echo "$cmd -- ERROR umounting $TMPMNT"
-    cleanup 1
- fi
- 

diff --git a/sys-fs/lvm2/lvm2-2.03.20.ebuild b/sys-fs/lvm2/lvm2-2.03.20.ebuild
deleted file mode 100644
index 1c7fd041e178..000000000000
--- a/sys-fs/lvm2/lvm2-2.03.20.ebuild
+++ /dev/null
@@ -1,302 +0,0 @@
-# Copyright 1999-2023 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-TMPFILES_OPTIONAL=1
-inherit autotools linux-info systemd toolchain-funcs tmpfiles udev flag-o-matic
-
-DESCRIPTION="User-land utilities for LVM2 (device-mapper) software"
-HOMEPAGE="https://sourceware.org/lvm2/"
-SRC_URI="https://sourceware.org/ftp/lvm2/${PN^^}.${PV}.tgz"
-S="${WORKDIR}/${PN^^}.${PV}"
-
-LICENSE="GPL-2"
-SLOT="0"
-KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux"
-IUSE="lvm lvm2create-initrd readline sanlock selinux static static-libs systemd thin +udev"
-REQUIRED_USE="
-	static? ( !systemd !udev )
-	static-libs? ( static !udev )
-	systemd? ( udev )
-	thin? ( lvm )"
-
-DEPEND_COMMON="
-	udev? ( virtual/libudev:= )
-	lvm? (
-		dev-libs/libaio
-		sys-apps/util-linux
-		readline? ( sys-libs/readline:= )
-		sanlock? ( sys-cluster/sanlock )
-		systemd? ( sys-apps/systemd:= )
-	)"
-# /run is now required for locking during early boot. /var cannot be assumed to
-# be available -- thus, pull in recent enough baselayout for /run.
-# This version of LVM is incompatible with cryptsetup <1.1.2.
-RDEPEND="${DEPEND_COMMON}
-	>=sys-apps/baselayout-2.2
-	lvm? (
-		virtual/tmpfiles
-		lvm2create-initrd? ( sys-apps/makedev )
-		thin? ( sys-block/thin-provisioning-tools )
-	)"
-# note: thin- 0.3.0 is required to avoid --disable-thin_check_needs_check
-DEPEND="${DEPEND_COMMON}
-	static? (
-		lvm? (
-			dev-libs/libaio[static-libs]
-			sys-apps/util-linux[static-libs]
-			readline? ( sys-libs/readline[static-libs] )
-		)
-		selinux? ( sys-libs/libselinux[static-libs] )
-	)"
-BDEPEND="
-	sys-devel/autoconf-archive
-	virtual/pkgconfig"
-
-PATCHES=(
-	# Gentoo specific modification(s):
-	"${FILESDIR}"/${PN}-2.03.20-example.conf.in.patch
-
-	# For upstream -- review and forward:
-	"${FILESDIR}"/${PN}-2.03.20-lvm2create_initrd.patch
-	"${FILESDIR}"/${PN}-2.03.20-locale-muck.patch #330373
-	"${FILESDIR}"/${PN}-2.03.20-dmeventd-no-idle-exit.patch
-	"${FILESDIR}"/${PN}-2.03.20-freopen-musl.patch
-)
-
-pkg_setup() {
-	local CONFIG_CHECK="~SYSVIPC"
-
-	if use udev; then
-		local WARNING_SYSVIPC="CONFIG_SYSVIPC:\tis not set (required for udev sync)\n"
-		if linux_config_exists; then
-			local uevent_helper_path=$(linux_chkconfig_string UEVENT_HELPER_PATH)
-			if [[ -n "${uevent_helper_path}" ]] && [[ "${uevent_helper_path}" != '""' ]]; then
-				ewarn "It's recommended to set an empty value to the following kernel config option:"
-				ewarn "CONFIG_UEVENT_HELPER_PATH=${uevent_helper_path}"
-			fi
-		fi
-	fi
-
-	check_extra_config
-
-	# 1. Genkernel no longer copies /sbin/lvm blindly.
-	if use static; then
-		elog "Warning, we no longer overwrite /sbin/lvm and /sbin/dmsetup with"
-		elog "their static versions. If you need the static binaries,"
-		elog "you must append .static to the filename!"
-	fi
-}
-
-src_prepare() {
-	default
-
-	# Users without systemd get no auto-activation of any logical volume
-	if ! use systemd ; then
-		eapply "${FILESDIR}"/${PN}-2.03.20-dm_lvm_rules_no_systemd.patch
-	fi
-
-	eautoreconf
-}
-
-src_configure() {
-	filter-flags -flto
-
-	# Workaround for bug #822210
-	tc-ld-disable-gold
-
-	# Most of this package does weird stuff.
-	# The build options are tristate, and --without is NOT supported
-	# options: 'none', 'internal', 'shared'
-	local myeconfargs=(
-		$(use_enable lvm dmfilemapd)
-		$(use_enable lvm dmeventd)
-		$(use_enable lvm cmdlib)
-		$(use_enable lvm fsadm)
-		$(use_enable lvm lvmpolld)
-
-		# This only causes the .static versions to become available
-		$(usev static --enable-static_link)
-
-		# dmeventd requires mirrors to be internal, and snapshot available
-		# so we cannot disable them
-		--with-mirrors="$(usex lvm internal none)"
-		--with-snapshots="$(usex lvm internal none)"
-	)
-
-	if use lvm && use thin; then
-		myeconfargs+=( --with-thin=internal --with-cache=internal )
-		local texec
-		for texec in check dump repair restore; do
-			myeconfargs+=( --with-thin-${texec}="${EPREFIX}"/sbin/thin_${texec} )
-			myeconfargs+=( --with-cache-${texec}="${EPREFIX}"/sbin/cache_${texec} )
-		done
-	else
-		myeconfargs+=( --with-thin=none --with-cache=none )
-	fi
-
-	myeconfargs+=(
-		# musl doesn't do symbol versioning so can end up with
-		# runtime breakage.
-		--with-symvers=$(usex elibc_glibc 'gnu' 'no')
-		$(use_enable readline)
-		$(use_enable selinux)
-		--enable-pkgconfig
-		--with-confdir="${EPREFIX}"/etc
-		--exec-prefix="${EPREFIX}"
-		--sbindir="${EPREFIX}/sbin"
-		--with-staticdir="${EPREFIX}"/sbin
-		--libdir="${EPREFIX}/$(get_libdir)"
-		--with-usrlibdir="${EPREFIX}/usr/$(get_libdir)"
-		--with-default-dm-run-dir=/run
-		--with-default-run-dir=/run/lvm
-		--with-default-locking-dir=/run/lock/lvm
-		--with-default-pid-dir=/run
-		$(use_enable udev udev_rules)
-		$(use_enable udev udev_sync)
-		$(use_with udev udevdir "${EPREFIX}$(get_udevdir)"/rules.d)
-		# USE=sanlock requires USE=lvm
-		$(use_enable $(usex lvm sanlock lvm) lvmlockd-sanlock)
-		$(use_enable systemd notify-dbus)
-		$(use_enable systemd app-machineid)
-		$(use_enable systemd systemd-journal)
-		$(use_with systemd systemd-run "/usr/bin/systemd-run")
-		--with-systemdsystemunitdir="$(systemd_get_systemunitdir)"
-		CLDFLAGS="${LDFLAGS}"
-	)
-
-	econf "${myeconfargs[@]}"
-}
-
-src_compile() {
-	emake V=1 -C include
-
-	if use lvm ; then
-		emake V=1
-		emake V=1 CC="$(tc-getCC)" -C scripts
-	else
-		emake V=1 device-mapper
-		# https://bugs.gentoo.org/878131
-		emake V=1 -C libdm/dm-tools device-mapper
-	fi
-}
-
-src_test() {
-	einfo "Tests are disabled because of device-node mucking, if you want to"
-	einfo "run tests, compile the package and see ${S}/tests"
-}
-
-src_install() {
-	local INSTALL_TARGETS=(
-		# full LVM2
-		$(usev lvm "install install_tmpfiles_configuration")
-		# install systemd related files only when requested, bug #522430
-		$(usev $(usex lvm systemd lvm) "SYSTEMD_GENERATOR_DIR=$(systemd_get_systemgeneratordir) install_systemd_units install_systemd_generators")
-
-		# install dm unconditionally
-		install_device-mapper
-	)
-	emake V=1 DESTDIR="${D}" "${INSTALL_TARGETS[@]}"
-
-	newinitd "${FILESDIR}"/device-mapper.rc-r3 device-mapper
-	newconfd "${FILESDIR}"/device-mapper.conf-r4 device-mapper
-
-	if use lvm ; then
-		newinitd "${FILESDIR}"/dmeventd.initd-r3 dmeventd
-		newinitd "${FILESDIR}"/lvm.rc-r1 lvm
-		newconfd "${FILESDIR}"/lvm.confd-r4 lvm
-		if ! use udev ; then
-			# We keep the variable but remove udev from it.
-			sed -r -i \
-				-e '/^rc_need=/s/\<udev\>//g' \
-				"${ED}"/etc/conf.d/lvm || die "Could not drop udev from rc_need"
-		fi
-
-		newinitd "${FILESDIR}"/lvm-monitoring.initd-r3 lvm-monitoring
-		newinitd "${FILESDIR}"/lvmpolld.initd-r1 lvmpolld
-
-		if use lvm2create-initrd; then
-			dosbin scripts/lvm2create_initrd/lvm2create_initrd
-			doman scripts/lvm2create_initrd/lvm2create_initrd.8
-			newdoc scripts/lvm2create_initrd/README README.lvm2create_initrd
-		fi
-
-		if use sanlock; then
-			newinitd "${FILESDIR}"/lvmlockd.initd-r2 lvmlockd
-		fi
-	fi
-
-	if use static-libs; then
-		dolib.a libdm/ioctl/libdevmapper.a
-		if use lvm; then
-			# depends on lvmetad
-			dolib.a libdaemon/client/libdaemonclient.a #462908
-			# depends on dmeventd
-			dolib.a daemons/dmeventd/libdevmapper-event.a
-		fi
-	else
-		rm -f "${ED}"/usr/$(get_libdir)/{libdevmapper-event,liblvm2cmd,liblvm2app,libdevmapper}.a || die
-	fi
-
-	insinto /etc
-	doins "${FILESDIR}"/dmtab
-
-	dodoc README VERSION* WHATS_NEW WHATS_NEW_DM doc/*.{c,txt} conf/*.conf
-}
-
-pkg_preinst() {
-	HAD_LVM=0
-
-	if has_version 'sys-fs/lvm2[lvm(+)]' ; then
-		HAD_LVM=1
-	fi
-}
-
-pkg_postinst() {
-	use lvm && tmpfiles_process lvm2.conf
-	use udev && udev_reload
-
-	# This is a new installation
-	if [[ -z "${REPLACING_VERSIONS}" ]]; then
-		if use lvm ; then
-			ewarn "Make sure the \"lvm\" init script is in the runlevels:"
-			ewarn "# rc-update add lvm boot"
-			ewarn
-			ewarn "Make sure to enable lvmetad in ${EROOT}/etc/lvm/lvm.conf if you want"
-			ewarn "to enable lvm autoactivation and metadata caching."
-		else
-			ewarn "Please enable USE=lvm if you need the LVM daemon and"
-			ewarn "tools like 'lvchange', 'vgchange', etc!"
-		fi
-	else
-		if ! use lvm && [[ ${HAD_LVM} -eq 1 ]] ; then
-			ewarn "LVM was previously enabled but is now disabled."
-			ewarn "Please enable USE=lvm if you need the LVM daemon and"
-			ewarn "tools like 'lvchange', 'vgchange', etc!"
-			ewarn "See the 2022-11-19-lvm2-default-USE-flags news item for more details."
-		fi
-	fi
-
-	if use udev && [[ -d /run ]] ; then
-		local permission_run_expected="drwxr-xr-x"
-		local permission_run=$(stat -c "%A" /run)
-		if [[ "${permission_run}" != "${permission_run_expected}" ]] ; then
-			ewarn "Found the following problematic permissions:"
-			ewarn ""
-			ewarn "    ${permission_run} /run"
-			ewarn ""
-			ewarn "Expected:"
-			ewarn ""
-			ewarn "    ${permission_run_expected} /run"
-			ewarn ""
-			ewarn "This is known to cause problems for udev-enabled LVM services."
-		fi
-	fi
-}
-
-pkg_postrm() {
-	if use udev && [[ -z ${REPLACED_BY_VERSION} ]]; then
-		udev_reload
-	fi
-}


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-fs/lvm2/, sys-fs/lvm2/files/
@ 2024-05-02 15:21 Mike Gilbert
  0 siblings, 0 replies; 29+ messages in thread
From: Mike Gilbert @ 2024-05-02 15:21 UTC (permalink / raw
  To: gentoo-commits

commit:     50cdc115fe2fcf6b96a88e071eccb7b1b0f86586
Author:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Thu May  2 15:19:10 2024 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Thu May  2 15:21:27 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=50cdc115

sys-fs/lvm2: backport fix for thin-provisioning-tools version check

Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>

 .../files/lvm2-2.03.22-thin-version-checking.patch | 59 ++++++++++++++++++++++
 ...m2-2.03.22-r4.ebuild => lvm2-2.03.22-r5.ebuild} |  1 +
 2 files changed, 60 insertions(+)

diff --git a/sys-fs/lvm2/files/lvm2-2.03.22-thin-version-checking.patch b/sys-fs/lvm2/files/lvm2-2.03.22-thin-version-checking.patch
new file mode 100644
index 000000000000..28d901bc7d61
--- /dev/null
+++ b/sys-fs/lvm2/files/lvm2-2.03.22-thin-version-checking.patch
@@ -0,0 +1,59 @@
+From f117d47ffa781f7f1ad452505c250b4826cdcc7f Mon Sep 17 00:00:00 2001
+From: Zdenek Kabelac <zkabelac@redhat.com>
+Date: Tue, 10 Oct 2023 22:03:50 +0200
+Subject: [PATCH] configure.ac: version checking for new dmpd tools
+
+New rust version of thin_check returns now also binary name in version,
+so adapt the version checking to handle this variant.
+---
+ configure.ac | 8 +++++---
+ 1 file changed, 5 insertions(+), 3 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 1550f1f70..59d4b65af 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -426,6 +426,7 @@ AS_CASE(["$THIN"],
+ 	])
+ 	AS_IF([test "$THIN_CHECK_NEEDS_CHECK" = "yes" && test "$THIN_CONFIGURE_WARN" != "y"], [
+ 		THIN_CHECK_VSN=$("$THIN_CHECK_CMD" -V 2>/dev/null)
++		THIN_CHECK_VSN=${THIN_CHECK_VSN##* }  # trim away all before the first space
+ 		THIN_CHECK_VSN_MAJOR=$(echo "$THIN_CHECK_VSN" | $AWK -F '.' '{print $1}')
+ 		THIN_CHECK_VSN_MINOR=$(echo "$THIN_CHECK_VSN" | $AWK -F '.' '{print $2}')
+ 
+@@ -467,7 +468,7 @@ AS_CASE(["$THIN"],
+ 		])
+ 	])
+ 
+-	AC_MSG_CHECKING([whether thin_check supports the needs-check flag])
++	AC_MSG_CHECKING([whether $THIN_CHECK_CMD ($THIN_CHECK_VSN_MAJOR.$THIN_CHECK_VSN_MINOR) supports the needs-check flag])
+ 	AC_MSG_RESULT([$THIN_CHECK_NEEDS_CHECK])
+ 	AS_IF([test "$THIN_CHECK_NEEDS_CHECK" = "yes"], [
+ 		AC_DEFINE([THIN_CHECK_NEEDS_CHECK], 1, [Define to 1 if the external 'thin_check' tool requires the --clear-needs-check-flag option])
+@@ -537,12 +538,13 @@ AS_CASE(["$CACHE"],
+ 		])
+ 	])
+ 	AS_IF([test "$CACHE_CHECK_NEEDS_CHECK" = "yes" && test "$CACHE_CONFIGURE_WARN" != "y"], [
+-		$CACHE_CHECK_CMD -V 2>/dev/null >conftest.tmp
++		"$CACHE_CHECK_CMD" -V 2>/dev/null >conftest.tmp
+ 		read -r CACHE_CHECK_VSN < conftest.tmp
+ 		IFS=.- read -r CACHE_CHECK_VSN_MAJOR CACHE_CHECK_VSN_MINOR CACHE_CHECK_VSN_PATCH LEFTOVER < conftest.tmp
+ 		rm -f conftest.tmp
+ 
+ 		# Require version >= 0.5.4 for --clear-needs-check-flag
++		CACHE_CHECK_VSN_MAJOR=${CACHE_CHECK_VSN_MAJOR##* }
+ 		AS_IF([test -z "$CACHE_CHECK_VSN_MAJOR" \
+ 			|| test -z "$CACHE_CHECK_VSN_MINOR" \
+ 			|| test -z "$CACHE_CHECK_VSN_PATCH"], [
+@@ -590,7 +592,7 @@ AS_CASE(["$CACHE"],
+ 		])
+ 	])
+ 
+-	AC_MSG_CHECKING([whether cache_check supports the needs-check flag])
++	AC_MSG_CHECKING([whether $CACHE_CHECK_CMD ($CACHE_CHECK_VSN_MAJOR.$CACHE_CHECK_VSN_MINOR.$CACHE_CHECK_VSN_PATCH) supports the needs-check flag])
+ 	AC_MSG_RESULT([$CACHE_CHECK_NEEDS_CHECK])
+ 	AS_IF([test "$CACHE_CHECK_NEEDS_CHECK" = "yes"], [
+ 		AC_DEFINE([CACHE_CHECK_NEEDS_CHECK], 1, [Define to 1 if the external 'cache_check' tool requires the --clear-needs-check-flag option])
+-- 
+2.45.0
+

diff --git a/sys-fs/lvm2/lvm2-2.03.22-r4.ebuild b/sys-fs/lvm2/lvm2-2.03.22-r5.ebuild
similarity index 99%
rename from sys-fs/lvm2/lvm2-2.03.22-r4.ebuild
rename to sys-fs/lvm2/lvm2-2.03.22-r5.ebuild
index 42b6ae927976..5b95dd0b2940 100644
--- a/sys-fs/lvm2/lvm2-2.03.22-r4.ebuild
+++ b/sys-fs/lvm2/lvm2-2.03.22-r5.ebuild
@@ -69,6 +69,7 @@ PATCHES=(
 	"${FILESDIR}"/${PN}-2.03.20-dmeventd-no-idle-exit.patch
 	"${FILESDIR}"/${PN}-2.03.20-freopen-musl.patch
 	"${FILESDIR}"/${PN}-2.03.22-autoconf-2.72-egrep.patch
+	"${FILESDIR}"/${PN}-2.03.22-thin-version-checking.patch
 )
 
 pkg_setup() {


^ permalink raw reply related	[flat|nested] 29+ messages in thread

end of thread, other threads:[~2024-05-02 15:21 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-06-18  9:03 [gentoo-commits] repo/gentoo:master commit in: sys-fs/lvm2/, sys-fs/lvm2/files/ Lars Wendler
  -- strict thread matches above, loose matches on Subject: below --
2024-05-02 15:21 Mike Gilbert
2023-06-02 13:02 David Seifert
2023-05-10  8:57 David Seifert
2023-05-10  8:57 David Seifert
2023-04-13 11:10 David Seifert
2023-02-21 20:29 David Seifert
2023-01-28 13:38 David Seifert
2023-01-13 11:11 David Seifert
2022-11-19 21:05 David Seifert
2022-11-18 17:59 Sam James
2022-10-27 17:13 Robin H. Johnson
2022-10-26 19:17 Mike Gilbert
2022-07-07 15:10 Mike Gilbert
2022-06-16 22:10 Sam James
2021-05-09  9:05 Lars Wendler
2020-03-26 20:24 Lars Wendler
2019-11-28 22:45 Robin H. Johnson
2019-11-27 16:16 Lars Wendler
2019-07-24  9:54 Lars Wendler
2019-06-18  5:27 Robin H. Johnson
2019-05-07 19:16 Robin H. Johnson
2019-04-17  7:26 Robin H. Johnson
2016-04-20  3:58 Mike Frysinger
2016-04-02  5:07 Mike Frysinger
2016-03-09 20:12 Robin H. Johnson
2016-01-25  2:40 Marc Schiffbauer
2015-12-28  0:30 Robin H. Johnson
2015-12-03 11:33 Lars Wendler

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox