From 2719f73b6813d11d13a9650cdd2ab8ec6e69385d Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Sat, 9 Jul 2022 15:43:36 +0100 Subject: gentoo resync : 09.07.2022 --- sys-fs/lvm2/Manifest | 5 +- sys-fs/lvm2/files/lvm2-2.03.14-freopen_n2.patch | 34 +++ sys-fs/lvm2/lvm2-2.02.188-r3.ebuild | 16 +- sys-fs/lvm2/lvm2-2.03.14-r2.ebuild | 299 ----------------------- sys-fs/lvm2/lvm2-2.03.14-r3.ebuild | 310 ++++++++++++++++++++++++ 5 files changed, 360 insertions(+), 304 deletions(-) create mode 100644 sys-fs/lvm2/files/lvm2-2.03.14-freopen_n2.patch delete mode 100644 sys-fs/lvm2/lvm2-2.03.14-r2.ebuild create mode 100644 sys-fs/lvm2/lvm2-2.03.14-r3.ebuild (limited to 'sys-fs/lvm2') diff --git a/sys-fs/lvm2/Manifest b/sys-fs/lvm2/Manifest index ce2807a8684f..4c601b8e7157 100644 --- a/sys-fs/lvm2/Manifest +++ b/sys-fs/lvm2/Manifest @@ -27,6 +27,7 @@ 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-freopen_n2.patch 907 BLAKE2B 895bdb47da976a17fa61fc7a18c4647dc2b97f4d7eb665b66d253a880977977a4012a064ef460c2e9e6e24b94ac0a6f8021d73fffe8e56a93461fd8a9804ff52 SHA512 3cce840d54b9c52b4ae1c253fda3e29261284d873442ad646daa5cb41fcf154fd86b5683f7cf919ed226faef2f450b0b50bfc77ab161aa67c2823ecf38538b2b 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 @@ -36,6 +37,6 @@ AUX lvmlockd.initd-2.02.166-r1 390 BLAKE2B aebfa2a654eca784da24fd4e4d46b3e6c9725 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-r3.ebuild 10149 BLAKE2B d7a19efe883eb5a8fc0ec8fa7d41de9ace13cd72f3dcad28148471dff8dddc458b68f65d8d0c1b57af9ef647a3e5102db340521b43a81b8a9fdba1f3388868d7 SHA512 dc0deeb6fafa4f59888b3b4061a2375e2621c5cfe1e8ae061c3b516c8bb6a7260cbe6907739bed161baa7f8db3fd113563be22018618b8d88f92673bd46cd55b -EBUILD lvm2-2.03.14-r2.ebuild 10095 BLAKE2B edaaf7652cbb178abd142f06a04125944a26dc15dd54e929f1ff4b95faff34b6a8393bf5ae4db2ba5ab7ab094db020c0be8b8054cff9dc5c2375f00411d18103 SHA512 ea45bc3f47b5464c2240eeef77590bf8be333382f32a85c702f151c58222a3bf8a9aea8a621658c85596378c3730d2f411abbadd5d47d07cd5c4c4abfdff5e26 +EBUILD lvm2-2.02.188-r3.ebuild 10277 BLAKE2B f276a47825b148aaca7b5248693d59f1fa2fb1cd67207f51f59e2ad3a92496bd63ed7c425ee60560fdaca624a2a81edf2dd1f02c9e80a184df6e1ac115c472ab SHA512 4cfdffdb6555ca357a88a936d560b9314cd1bcd0ef05bcfc9fbbac6069cd73e833bda57d10deed141781b55b8aec3a5f2ac8ee8145c065c55436a46a11284905 +EBUILD lvm2-2.03.14-r3.ebuild 10269 BLAKE2B dd80b933020369555d9b3904c0ca60171af0902ca203828daafae12443fbb7ca4cfaf05438cb8585691c787b3c0ebff35b078b732a1de80b89a4183068ea2236 SHA512 c1932e10550310bc531c096c65baf532c854508f2009ecce84bf6a804b77f14516c94aeaa0b5da0c096a6864f8fb7337c8f5a8f16beb4973867d727f33f7940e MISC metadata.xml 1035 BLAKE2B b9a3162e72e1ea09c7530edca817046434186c3948ef763c1a4efedb45aa8f842b7819efdbb09fb40897368e61b26a43896ef28a4a9d1ae554ea3cdb81f88dc7 SHA512 a16653a343d66eab8bd790eb974cc95d75f48321051ebb37eef87b3c7ad9903b2be1f0c70aff4b711b4469fa2715a5fb0c8566c46e6a83173bf998cf182ce964 diff --git a/sys-fs/lvm2/files/lvm2-2.03.14-freopen_n2.patch b/sys-fs/lvm2/files/lvm2-2.03.14-freopen_n2.patch new file mode 100644 index 000000000000..5ca32f19fc54 --- /dev/null +++ b/sys-fs/lvm2/files/lvm2-2.03.14-freopen_n2.patch @@ -0,0 +1,34 @@ +In musl, the standard streams are read-only. To modify them we need to +use freopen. This patch does the same as lvm2-2.03.14-r1-fopen-to-freopen.patch + +https://listman.redhat.com/archives/lvm-devel/2022-June/024203.html + +See also: +https://wiki.gentoo.org/wiki/User:Sam/Musl_porting_notes#error:_assignment_of_read-only_variable_.27.5Bstdout.7Cstdin.7Cstderr.5D.27 +https://www.gnu.org/software/libc/manual/html_node/Standard-Streams.html + +--- + lib/log/log.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/lib/log/log.c b/lib/log/log.c +index 7b4d537..897c183 100644 +--- a/lib/log/log.c ++++ b/lib/log/log.c +@@ -207,8 +207,12 @@ int reopen_standard_stream(FILE **stream, const char *mode) + } + + _check_and_replace_standard_log_streams(old_stream, new_stream); +- ++ ++#ifdef __GLIBC__ + *stream = new_stream; ++#else ++ freopen(NULL, mode, *stream); ++#endif + return 1; + } + +-- +2.35.1 + diff --git a/sys-fs/lvm2/lvm2-2.02.188-r3.ebuild b/sys-fs/lvm2/lvm2-2.02.188-r3.ebuild index 50111c5fabb3..e6fd683ff142 100644 --- a/sys-fs/lvm2/lvm2-2.02.188-r3.ebuild +++ b/sys-fs/lvm2/lvm2-2.02.188-r3.ebuild @@ -206,6 +206,11 @@ src_compile() { 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 ) @@ -266,6 +271,10 @@ pkg_postinst() { 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:" @@ -292,7 +301,8 @@ pkg_postinst() { 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" +pkg_postrm() { + if use udev && [[ -z ${REPLACED_BY_VERSION} ]]; then + udev_reload + fi } diff --git a/sys-fs/lvm2/lvm2-2.03.14-r2.ebuild b/sys-fs/lvm2/lvm2-2.03.14-r2.ebuild deleted file mode 100644 index 2da81764efe4..000000000000 --- a/sys-fs/lvm2/lvm2-2.03.14-r2.ebuild +++ /dev/null @@ -1,299 +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 - "${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" -} diff --git a/sys-fs/lvm2/lvm2-2.03.14-r3.ebuild b/sys-fs/lvm2/lvm2-2.03.14-r3.ebuild new file mode 100644 index 000000000000..6af624f3fbc9 --- /dev/null +++ b/sys-fs/lvm2/lvm2-2.03.14-r3.ebuild @@ -0,0 +1,310 @@ +# 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 + "${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/\//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 +} -- cgit v1.2.3