From 0f558761aa2dee1017b4751e4017205e015a9560 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Wed, 29 Jun 2022 12:04:12 +0100 Subject: gentoo resync : 29.12.2022 --- sys-fs/lvm2/Manifest | 7 +- 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.02.188-r2.ebuild | 298 -------------------- sys-fs/lvm2/lvm2-2.02.188-r3.ebuild | 298 ++++++++++++++++++++ sys-fs/lvm2/lvm2-2.03.14-r1.ebuild | 296 -------------------- sys-fs/lvm2/lvm2-2.03.14-r2.ebuild | 299 +++++++++++++++++++++ 8 files changed, 687 insertions(+), 596 deletions(-) create mode 100644 sys-fs/lvm2/files/lvm2-2.03.14-r1-add-fcntl.patch create mode 100644 sys-fs/lvm2/files/lvm2-2.03.14-r1-fopen-to-freopen.patch create mode 100644 sys-fs/lvm2/files/lvm2-2.03.14-r1-mallinfo.patch delete mode 100644 sys-fs/lvm2/lvm2-2.02.188-r2.ebuild create mode 100644 sys-fs/lvm2/lvm2-2.02.188-r3.ebuild delete mode 100644 sys-fs/lvm2/lvm2-2.03.14-r1.ebuild create mode 100644 sys-fs/lvm2/lvm2-2.03.14-r2.ebuild (limited to 'sys-fs/lvm2') diff --git a/sys-fs/lvm2/Manifest b/sys-fs/lvm2/Manifest index 0f636bf8b5ef..ce2807a8684f 100644 --- a/sys-fs/lvm2/Manifest +++ b/sys-fs/lvm2/Manifest @@ -27,12 +27,15 @@ AUX lvm2-2.03.12-dynamic-static-ldflags.patch 2591 BLAKE2B b1edda6bd715d805ae129 AUX lvm2-2.03.12-static-libm.patch 1000 BLAKE2B 4bde7eda80a00f7c692341ebc74ab30308f3157162caba4d789dac42318fd5a16d6b1471463bc2a1f02f50313ce274ecc5aeb039c90e0b979d73146cc9497fba SHA512 cc7764fdaadd767e88d68a3a071f72a7ce30e5bc98fb55b49cf8ba00c3c5a1cac288f2aad0fec94eba5dd2100108756f1315b9704e872d7d64100bbeff1b7a17 AUX lvm2-2.03.12-static-pkgconfig-libs-2.patch 1260 BLAKE2B 3ee43306af649c4d23ac9b096f0649b48f40416a6e77098e449429e6b8a881a23e8e1158be72ab4c2b5d9bf11dda4b983da1b03d13ec614250d530b57d6d8ec1 SHA512 94704e273c82272fcb3e77da66894204f96bfa28343d3f3edc3aa90aeba6334872bace17c57c64cf35114113cd6d20d628702d1516b7c1296f6ceafd75c5c3b6 AUX lvm2-2.03.14-dm_lvm_rules_no_systemd.patch 1502 BLAKE2B 26cc1f98dd8d286bf74e60ddf02b0658e83a69017743aeaa56ce8a05f6dc03a2322deecaa136713c683882fa85517c9798ce18a2a8de05cd3bbb101cb2ba1c2b SHA512 46bda571f85650d5382f173ad7cce9a055f39e783961bbe8272e2492f4e5ec60f5af231302596a01a4f3ca3cba48b05383a5b0458ab6b85c6d726253f0f45d23 +AUX lvm2-2.03.14-r1-add-fcntl.patch 578 BLAKE2B 7368a1853bdd6fa5aac526a39911b848fb446f14a44700586d6c87974cf898e4290a16335c61d515ea41f1a67de72ce887a227bf3a5fc0af8baafe3a6e8a2af1 SHA512 97d9d00831df2715ccfebf5342aaefac8ae1441eae263af5c1785ab34563a52bfc1aa0870e16bd677c5451889bee647bedff5417920d7dd816b3269b5ae23c77 +AUX lvm2-2.03.14-r1-fopen-to-freopen.patch 1306 BLAKE2B bba58efc587529f30e187c35be97241519d6d31173605bed72aab876500e4cad057d9de9998834581a3d221f1196c466e45aac5ee86d9a3bbbc0d6a2725401f8 SHA512 29c1bac1f669199d1fcb1ec45e3eed593337ad5e09e238cc871b5878fe2ec2e3c07204f48ad939dad2a12c7e523601bfbd6cec4145fc3e1994b85836c4ed02eb +AUX lvm2-2.03.14-r1-mallinfo.patch 665 BLAKE2B 2fdec28a0f889fe8f64b4c134c0b4a86a55a7d2a0dce90f7ed5e314dc89c4b94ec17764aea9307d5b45b89b700e5a89bf905ebdb4b7480d50610b26504cd7c32 SHA512 09ef2e8b3c6019d87e59dce2dcc00bcf243402c92559b38966e800a38ff24028962fcb96bbb1cb22228deb1a2c95ecfc079b1387523799daf477641f43669fec AUX lvm2-2.03.14-static-pkgconfig-libs.patch 4600 BLAKE2B 18fb5d69fb77625189539a64d4189b8ec5bc783ddb10e6e38033633b9a7049203264f0cd7b6c4b6c999c9767130f5da3526a805ffdb187c7aff98de592c11b35 SHA512 c2bc3b7b92bdfed028703a5bb57873c976978a6c84a409098828b96258b0fa349715bd2f140d6d41cbbacbfc34fc7c7901428e21716e04bfbf2d58847653c34e AUX lvmetad.initd-2.02.116-r3 345 BLAKE2B d458efd01fa08debe0857072c880adf951477445dd619a052f50cab9da39d8a38c9d480fc2d20fe899e01dcbcdaea0696d5c3e65af128652feea3186857d206e SHA512 f3143c6e1d00893009c68141f5ffd7e1e6bcf5b7ef0ff8505bc6c7049d83b2f9ddd2dc5a3cfdc2641a20603830b5dba07d73740cc5ce82e6b1b602a9b737a241 AUX lvmlockd.initd-2.02.166-r1 390 BLAKE2B aebfa2a654eca784da24fd4e4d46b3e6c97256a42b725e015a13c9673e79c0d1a10213d1eecb6c75d4ce1ebd99e6200010f19c36d758018bdef303ea08ee5549 SHA512 6359b3cbff1fa05944fb69582234220cac593b2c8f8317162a728bac72ced4f8b492ce11e6ced6d848a7654fa4a506c1e658f546cff302344a739646479a62dc AUX lvmpolld.initd-2.02.183 348 BLAKE2B cba0419add6591320dc60ef7616b66706e042b566284a4ec42002fbb5331a7173fc8b4b39be7198426fe4bbdcd3ad94b69fc3d8950705b6331c5f3f4cda4ad66 SHA512 b9b8376cbc8b6703868afab18e5baa4ef5354569e57f0596d38a8005fa725299f6858ac86b39fcca10e5a0f1adbd3a4cfa6cc6b62405e78916cc1287d8b36d0d DIST LVM2.2.02.188.tgz 2421550 BLAKE2B bed90c8454cd4b20fdeec6dcbf5a9f97c9310671aea3b2252f8069cfa439fcb050f5ad95f928a7125a1734a4dc5ac985da99a4a570538e377a7205191a505476 SHA512 8c9db17c49dc8ebcab6c7f246ab85870a80658be811cf7f4d8f36abbebafa355b030bfc1e3bcbad73ccccb7fcd06d4a95ac547ca15d18d33715126da92703dca DIST LVM2.2.03.14.tgz 2639538 BLAKE2B 806f5e9cb76a05febef6f8ce8cfc42c92927b9538f62a21029c5ffc426a4fd7c3f32709be08dbd8028b53891b1075d1d13cb3b0d7b1815071ee8eb927d8f3ed3 SHA512 6a93bed1d5cf36f0f48d4d413d028b0e480cd4fc20e25d173770a892f265d2a0cc68d01a720b1513469953649e989532cd0c45f9538f92a4190eb3dc4555857d -EBUILD lvm2-2.02.188-r2.ebuild 10131 BLAKE2B b0e8167b45500bfe2e59b8ebedf1de36a12b897776b64e9945084f77049174a7006414072a14ba69738d9dae11ccd8335ca5ed4c7072127380290d4e58c0f8ec SHA512 b3d8fd243c6f00cb89e3e992fdeee7a614512422e07da9c84d4baeb27186d302678334105fb0ef25501a8c8d47e6f76b7ff1f00c77ff3b417a739ba7d8f920d9 -EBUILD lvm2-2.03.14-r1.ebuild 9927 BLAKE2B c4fbf2a105638effcc0f203f31fdfff23f41d7a6ad6754bfdefefaef13595acc1f2262a18fe5f47a35939e9f538e4b3ffb9c0105e39368e980edc1995a92eaea SHA512 0c2da826d111d0331fb096d785f57886bca0517a23dc66f707279a62ab30ab4cd5bdc852bdb0ae52eda04d6967f1b749e33604be70665276ecc26e22e9e5ba66 +EBUILD lvm2-2.02.188-r3.ebuild 10149 BLAKE2B d7a19efe883eb5a8fc0ec8fa7d41de9ace13cd72f3dcad28148471dff8dddc458b68f65d8d0c1b57af9ef647a3e5102db340521b43a81b8a9fdba1f3388868d7 SHA512 dc0deeb6fafa4f59888b3b4061a2375e2621c5cfe1e8ae061c3b516c8bb6a7260cbe6907739bed161baa7f8db3fd113563be22018618b8d88f92673bd46cd55b +EBUILD lvm2-2.03.14-r2.ebuild 10095 BLAKE2B edaaf7652cbb178abd142f06a04125944a26dc15dd54e929f1ff4b95faff34b6a8393bf5ae4db2ba5ab7ab094db020c0be8b8054cff9dc5c2375f00411d18103 SHA512 ea45bc3f47b5464c2240eeef77590bf8be333382f32a85c702f151c58222a3bf8a9aea8a621658c85596378c3730d2f411abbadd5d47d07cd5c4c4abfdff5e26 MISC metadata.xml 1035 BLAKE2B b9a3162e72e1ea09c7530edca817046434186c3948ef763c1a4efedb45aa8f842b7819efdbb09fb40897368e61b26a43896ef28a4a9d1ae554ea3cdb81f88dc7 SHA512 a16653a343d66eab8bd790eb974cc95d75f48321051ebb37eef87b3c7ad9903b2be1f0c70aff4b711b4469fa2715a5fb0c8566c46e6a83173bf998cf182ce964 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 + #include + #include ++#include + + #include /* 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.02.188-r2.ebuild b/sys-fs/lvm2/lvm2-2.02.188-r2.ebuild deleted file mode 100644 index a3e76755f1d5..000000000000 --- a/sys-fs/lvm2/lvm2-2.02.188-r2.ebuild +++ /dev/null @@ -1,298 +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_install() { - local inst - local INSTALL_TARGETS=( install install_tmpfiles_configuration ) - # install systemd related files only when requested, bug #522430 - use systemd && INSTALL_TARGETS+=( systemdutildir="$(systemd_get_utildir)" 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/\//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 [[ -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 -} - -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.188-r3.ebuild b/sys-fs/lvm2/lvm2-2.02.188-r3.ebuild new file mode 100644 index 000000000000..50111c5fabb3 --- /dev/null +++ b/sys-fs/lvm2/lvm2-2.02.188-r3.ebuild @@ -0,0 +1,298 @@ +# 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_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/\//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 [[ -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 +} + +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.03.14-r1.ebuild b/sys-fs/lvm2/lvm2-2.03.14-r1.ebuild deleted file mode 100644 index f3bc54eebc36..000000000000 --- a/sys-fs/lvm2/lvm2-2.03.14-r1.ebuild +++ /dev/null @@ -1,296 +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 ~loong ~m68k ~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? ( 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 -) - -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_install() { - local inst - local INSTALL_TARGETS=( install install_tmpfiles_configuration ) - # install systemd related files only when requested, bug #522430 - use systemd && INSTALL_TARGETS+=( systemdutildir="$(systemd_get_utildir)" 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/\//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 [[ -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 -} - -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.03.14-r2.ebuild b/sys-fs/lvm2/lvm2-2.03.14-r2.ebuild new file mode 100644 index 000000000000..2da81764efe4 --- /dev/null +++ b/sys-fs/lvm2/lvm2-2.03.14-r2.ebuild @@ -0,0 +1,299 @@ +# 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 ~loong ~m68k ~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? ( 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 +) + +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_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/\//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 [[ -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 +} + +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" +} -- cgit v1.2.3