Upgraded packages to latest upstream

Upgraded sys-fs/lvm2 to v2-2.03.20

BUG=b/278834986
TEST=presubmit
RELEASE_NOTE=Upgraded sys-fs/lvm2 to v2-2.03.20.

Change-Id: I69fa4123c0f8314d8f42f184ad7294acf7d1c87f
Reviewed-on: https://cos-review.googlesource.com/c/third_party/overlays/portage-stable/+/46971
Reviewed-by: He Gao <hegao@google.com>
Tested-by: Cusky Presubmit Bot <presubmit@cos-infra-prod.iam.gserviceaccount.com>
diff --git a/sys-fs/lvm2/Manifest b/sys-fs/lvm2/Manifest
index f62db72..43acdc7 100644
--- a/sys-fs/lvm2/Manifest
+++ b/sys-fs/lvm2/Manifest
@@ -1,2 +1,2 @@
-DIST LVM2.2.02.188.tgz 2421550 BLAKE2B bed90c8454cd4b20fdeec6dcbf5a9f97c9310671aea3b2252f8069cfa439fcb050f5ad95f928a7125a1734a4dc5ac985da99a4a570538e377a7205191a505476 SHA512 8c9db17c49dc8ebcab6c7f246ab85870a80658be811cf7f4d8f36abbebafa355b030bfc1e3bcbad73ccccb7fcd06d4a95ac547ca15d18d33715126da92703dca
-DIST LVM2.2.03.14.tgz 2639538 BLAKE2B 806f5e9cb76a05febef6f8ce8cfc42c92927b9538f62a21029c5ffc426a4fd7c3f32709be08dbd8028b53891b1075d1d13cb3b0d7b1815071ee8eb927d8f3ed3 SHA512 6a93bed1d5cf36f0f48d4d413d028b0e480cd4fc20e25d173770a892f265d2a0cc68d01a720b1513469953649e989532cd0c45f9538f92a4190eb3dc4555857d
+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.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 0f830e4..0000000
--- 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.171-static-libm.patch b/sys-fs/lvm2/files/lvm2-2.02.171-static-libm.patch
deleted file mode 100644
index 1cbf956..0000000
--- 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 c0265e8..0000000
--- 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 c831c6d..0000000
--- 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 0a0e732..0000000
--- 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 34c710d..0000000
--- 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 989b308..0000000
--- 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 34968c7..0000000
--- 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 c80bd2b..0000000
--- 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.184-mksh_build.patch b/sys-fs/lvm2/files/lvm2-2.02.184-mksh_build.patch
deleted file mode 100644
index 49c6853..0000000
--- 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.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 f895e19..0000000
--- 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 5ddcb4e..0000000
--- 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/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 56aa2a7..0000000
--- 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.12-dynamic-static-ldflags.patch b/sys-fs/lvm2/files/lvm2-2.03.12-dynamic-static-ldflags.patch
deleted file mode 100644
index 80b6bc7..0000000
--- 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.12-static-libm.patch b/sys-fs/lvm2/files/lvm2-2.03.12-static-libm.patch
deleted file mode 100644
index 5bb776c..0000000
--- 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 a3a4642..0000000
--- 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-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 0b4a156..0000000
--- 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-freopen_n2.patch b/sys-fs/lvm2/files/lvm2-2.03.14-freopen_n2.patch
deleted file mode 100644
index 5ca32f1..0000000
--- 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-add-fcntl.patch b/sys-fs/lvm2/files/lvm2-2.03.14-r1-add-fcntl.patch
deleted file mode 100644
index 1b5524a..0000000
--- 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-fopen-to-freopen.patch b/sys-fs/lvm2/files/lvm2-2.03.14-r1-fopen-to-freopen.patch
deleted file mode 100644
index 56248e1..0000000
--- 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-r1-mallinfo.patch b/sys-fs/lvm2/files/lvm2-2.03.14-r1-mallinfo.patch
deleted file mode 100644
index af4cbc0..0000000
--- 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/files/lvm2-2.03.06-example.conf.in.patch b/sys-fs/lvm2/files/lvm2-2.03.17-example.conf.in.patch
similarity index 65%
rename from sys-fs/lvm2/files/lvm2-2.03.06-example.conf.in.patch
rename to sys-fs/lvm2/files/lvm2-2.03.17-example.conf.in.patch
index 329bfde..b63b681 100644
--- a/sys-fs/lvm2/files/lvm2-2.03.06-example.conf.in.patch
+++ b/sys-fs/lvm2/files/lvm2-2.03.17-example.conf.in.patch
@@ -1,19 +1,8 @@
-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
+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 {
+@@ -170,6 +170,9 @@
  	# Example
  	# Accept every block device:
  	# filter = [ "a|.*|" ]
@@ -23,7 +12,7 @@
  	# Reject the cdrom drive:
  	# filter = [ "r|/dev/cdrom|" ]
  	# Work with just loopback devices, e.g. for testing:
-@@ -1680,7 +1683,7 @@ activation {
+@@ -1843,7 +1846,7 @@
  
  # Configuration section metadata.
  # This configuration section has an automatic default value.
@@ -32,8 +21,8 @@
  
  	# Configuration option metadata/check_pv_device_sizes.
  	# Check device sizes are not smaller than corresponding PV sizes.
-@@ -1725,7 +1728,8 @@ activation {
- 	# 
+@@ -1888,7 +1891,8 @@
+ 	#
  	# This configuration option is advanced.
  	# This configuration option has an automatic default value.
 -	# pvmetadatacopies = 1
@@ -42,7 +31,7 @@
  
  	# Configuration option metadata/vgmetadatacopies.
  	# Number of copies of metadata to maintain for each VG.
-@@ -1768,7 +1772,7 @@ activation {
+@@ -1931,7 +1935,7 @@
  	# This configuration option is advanced.
  	# This configuration option has an automatic default value.
  	# stripesize = 64
@@ -51,6 +40,3 @@
  
  # Configuration section report.
  # LVM report command output formatting.
--- 
-2.24.0.rc1
-
diff --git a/sys-fs/lvm2/files/lvm2-2.02.99-locale-muck.patch b/sys-fs/lvm2/files/lvm2-2.03.17-locale-muck.patch
similarity index 73%
rename from sys-fs/lvm2/files/lvm2-2.02.99-locale-muck.patch
rename to sys-fs/lvm2/files/lvm2-2.03.17-locale-muck.patch
index fe7ec87..c672a10e 100644
--- a/sys-fs/lvm2/files/lvm2-2.02.99-locale-muck.patch
+++ b/sys-fs/lvm2/files/lvm2-2.03.17-locale-muck.patch
@@ -1,8 +1,8 @@
---- LVM2/make.tmpl.in
-+++ LVM2/make.tmpl.in
-@@ -395,7 +395,7 @@
+--- a/make.tmpl.in
++++ b/make.tmpl.in
+@@ -571,7 +571,7 @@
  	( cat $(srcdir)/.exported_symbols; \
- 	  if test x$(EXPORTED_HEADER) != x; then \
+ 	  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"; \
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 0000000..828cf66
--- /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.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 0000000..e39d795
--- /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.05-dmeventd-no-idle-exit.patch b/sys-fs/lvm2/files/lvm2-2.03.19-dmeventd-no-idle-exit.patch
similarity index 85%
rename from sys-fs/lvm2/files/lvm2-2.03.05-dmeventd-no-idle-exit.patch
rename to sys-fs/lvm2/files/lvm2-2.03.19-dmeventd-no-idle-exit.patch
index ec37e5d..b7030cc 100644
--- a/sys-fs/lvm2/files/lvm2-2.03.05-dmeventd-no-idle-exit.patch
+++ b/sys-fs/lvm2/files/lvm2-2.03.19-dmeventd-no-idle-exit.patch
@@ -12,9 +12,6 @@
 
 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 ++++
@@ -24,7 +21,7 @@
 index 33859ef414..ac0b9743fc 100644
 --- a/daemons/dmeventd/dmeventd.c
 +++ b/daemons/dmeventd/dmeventd.c
-@@ -2158,6 +2158,18 @@ int main(int argc, char *argv[])
+@@ -2169,6 +2169,18 @@
  		.server_path = DM_EVENT_FIFO_SERVER
  	};
  	time_t now, idle_exit_timeout = DMEVENTD_IDLE_EXIT_TIMEOUT;
@@ -43,7 +40,7 @@
  	opterr = 0;
  	optind = 0;
  
-@@ -2253,7 +2265,7 @@ int main(int argc, char *argv[])
+@@ -2265,7 +2277,7 @@
  		_process_initial_registrations();
  
  	for (;;) {
@@ -52,7 +49,7 @@
  			if (_exit_now) {
  				if (_exit_now == DM_SCHEDULED_EXIT)
  					break; /* Only prints shutdown message */
-@@ -2262,7 +2274,7 @@ int main(int argc, char *argv[])
+@@ -2274,7 +2286,7 @@
  					 (long) (time(NULL) - _idle_since));
  				break;
  			}
@@ -61,12 +58,10 @@
  				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
+@@ -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
@@ -76,6 +71,3 @@
  .
  .SH SEE ALSO
  .
--- 
-2.22.0
-
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 0000000..3aae819
--- /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 0000000..cc231d9
--- /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.14-static-pkgconfig-libs.patch b/sys-fs/lvm2/files/lvm2-2.03.19-static-pkgconfig-libs.patch
similarity index 66%
rename from sys-fs/lvm2/files/lvm2-2.03.14-static-pkgconfig-libs.patch
rename to sys-fs/lvm2/files/lvm2-2.03.19-static-pkgconfig-libs.patch
index e259547..52f2cc0 100644
--- a/sys-fs/lvm2/files/lvm2-2.03.14-static-pkgconfig-libs.patch
+++ b/sys-fs/lvm2/files/lvm2-2.03.19-static-pkgconfig-libs.patch
@@ -3,40 +3,31 @@
 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
+@@ -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,
-@@ -1432,19 +1434,30 @@ dnl -- Check for selinux
- if test "$SELINUX" = yes; then
+@@ -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"])
 +
-+	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`
@@ -58,10 +49,10 @@
  		SELINUX_PC=
  		HAVE_SELINUX=no ])
 +	])
- fi
+ ])
  
  ################################################################################
-@@ -1834,6 +1847,7 @@ AC_ARG_VAR([UDEV_LIBS], [linker flags for udev])
+@@ -1790,6 +1801,7 @@
  ################################################################################
  AC_SUBST(AWK)
  AC_SUBST(BLKID_PC)
@@ -69,36 +60,56 @@
  AC_SUBST(BUILD_CMIRRORD)
  AC_SUBST(BUILD_DMEVENTD)
  AC_SUBST(BUILD_LVMDBUSD)
-@@ -1934,6 +1948,7 @@ AC_SUBST(SALCK_LIBS)
+@@ -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)
- AC_SUBST(STATICDIR)
-@@ -1950,6 +1965,7 @@ AC_SUBST(CACHE_REPAIR_CMD)
+@@ -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_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)
+ 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) $(BLKID_STATIC_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@
-@@ -82,6 +82,7 @@ AIO_CFLAGS = @AIO_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@
@@ -106,19 +117,14 @@
  CPG_CFLAGS = @CPG_CFLAGS@
  CPG_LIBS = @CPG_LIBS@
  EDITLINE_CFLAGS = @EDITLINE_CFLAGS@
-@@ -90,10 +91,12 @@ PTHREAD_LIBS = @PTHREAD_LIBS@
+@@ -97,8 +98,10 @@
  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/lvmetad.initd-2.02.116-r3 b/sys-fs/lvm2/files/lvmetad.initd-2.02.116-r3
deleted file mode 100644
index 55bbf9c..0000000
--- a/sys-fs/lvm2/files/lvmetad.initd-2.02.116-r3
+++ /dev/null
@@ -1,17 +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() {
-	:
-}
-
-start_pre()
-{
-	checkpath --directory /run/lvm || return 1
-}
diff --git a/sys-fs/lvm2/lvm2-2.03.14-r3.ebuild b/sys-fs/lvm2/lvm2-2.03.14-r3.ebuild
deleted file mode 100644
index a181f9f..0000000
--- a/sys-fs/lvm2/lvm2-2.03.14-r3.ebuild
+++ /dev/null
@@ -1,310 +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="*"
-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? ( 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 )
-	!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? (
-		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.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.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.02.145-mkdev.patch #580062 # Merged upstream
-	"${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
-	"${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
-	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 !device-mapper-only dmfilemapd)
-		$(use_enable !device-mapper-only dmeventd)
-		$(use_enable !device-mapper-only cmdlib)
-		$(use_enable !device-mapper-only fsadm)
-		$(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+=(
-		$(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)
-		--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}"/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
-}
diff --git a/sys-fs/lvm2/lvm2-2.03.20.ebuild b/sys-fs/lvm2/lvm2-2.03.20.ebuild
new file mode 100644
index 0000000..892179e
--- /dev/null
+++ b/sys-fs/lvm2/lvm2-2.03.20.ebuild
@@ -0,0 +1,304 @@
+# 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="https://sourceware.org/ftp/lvm2/${PN^^}.${PV}.tgz"
+S="${WORKDIR}/${PN^^}.${PV}"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="*"
+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-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=(
+		# install dm unconditionally
+		install_device-mapper
+	)
+
+	# full LVM2
+	use lvm && 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 )
+
+	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
+}
diff --git a/sys-fs/lvm2/metadata.xml b/sys-fs/lvm2/metadata.xml
index a9013d4..e668a8b 100644
--- a/sys-fs/lvm2/metadata.xml
+++ b/sys-fs/lvm2/metadata.xml
@@ -5,18 +5,18 @@
 		<email>base-system@gentoo.org</email>
 		<name>Gentoo Base System</name>
 	</maintainer>
-	<maintainer type="person" proxied="yes">
-		<email>agk@redhat.com</email>
-		<name>Alasdair Kergon</name>
-		<description>Upstream Maintainer (please CC on bugs)</description>
-	</maintainer>
 	<use>
 		<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>
+		<flag name="lvm">
+			Build all of LVM2 including daemons and tools like lvchange, not just the device-mapper library (for other packages to use).
+
+			If your system uses LVM2 for managing disks and partitions, enable this flag.
+		</flag>
 		<flag name="sanlock">Enable lvmlockd with support for sanlock</flag>
 	</use>
 	<upstream>
 		<remote-id type="cpe">cpe:/a:heinz_mauelshagen:lvm2</remote-id>
+		<remote-id type="github">lvmteam/lvm2</remote-id>
 	</upstream>
 </pkgmetadata>