summaryrefslogtreecommitdiff
path: root/sys-fs/lvm2
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2019-05-18 00:10:51 +0100
committerV3n3RiX <venerix@redcorelinux.org>2019-05-18 00:10:51 +0100
commiteccb70a7f91b2d22582587f26d1a28bb31408b45 (patch)
tree3223e1fd54201bcf4ebecac6fbe87361cbe643e2 /sys-fs/lvm2
parenta2810985afabcc31d3eace5e61d8ea25b852ba17 (diff)
gentoo resync : 18.05.2019
Diffstat (limited to 'sys-fs/lvm2')
-rw-r--r--sys-fs/lvm2/Manifest5
-rw-r--r--sys-fs/lvm2/files/lvm.confd-2.02.184-r39
-rw-r--r--sys-fs/lvm2/files/lvm.rc-2.02.184-r3154
-rw-r--r--sys-fs/lvm2/lvm2-2.02.116.ebuild4
-rw-r--r--sys-fs/lvm2/lvm2-2.02.184-r3.ebuild269
5 files changed, 438 insertions, 3 deletions
diff --git a/sys-fs/lvm2/Manifest b/sys-fs/lvm2/Manifest
index 6742102f5ebb..3b11a5d3232f 100644
--- a/sys-fs/lvm2/Manifest
+++ b/sys-fs/lvm2/Manifest
@@ -4,11 +4,13 @@ AUX dmeventd.initd-2.02.184-r2 595 BLAKE2B fe87c9a034f9a9924c4c6e31365619cf5809a
AUX dmeventd.initd-2.02.67-r1 565 BLAKE2B ca1f5d205191076114d4a89717b304df04a520a22630ed84e78550e83b9364e049457bacfcadcc8ca1328a78c97412a445fcf153871266355379eab423c38138 SHA512 c0f5317ab0cba700eab3b643fd134d8a23fe4b332c47fd94728e43dfdf97250561f60ecb47808d2c65e55cdec65cccbd51f264540c0d973b2df7ded4ec129c34
AUX dmtab 319 BLAKE2B 5753b72e44325e467c0e4ea1bbce8faafe1c5e2509d2e02a5ad428b39e531c655014a3b151f7bc57513aae74983a60cfe3034432ffd21d39716fc6893ec7da8f SHA512 a8cc69ff832eafd64d7e45854df3380a9c5f9648297e2606c5b9b47e0015c93c7da6ef3dfd35800f36a3371635fa1906605c524be82d6740fd435c7f6bf2807b
AUX lvm-monitoring.initd-2.02.105-r2 963 BLAKE2B 2a193578c642e05a2a492fb025bdacd2594953405a58517bf6a93a04db29be03e16a33b2c5cd57c463f55f30fd47a4fb7766f52b149a298db4dcefed4ed30012 SHA512 dc13304e8d644a55f0490c84acc36b95f43fc0e86c4b44f85f54f6ed3213ad665454e7432b3621f307b3468af0c33525c24705f4a2783e35a26e02ff1c828779
+AUX lvm.confd-2.02.184-r3 282 BLAKE2B dcc65a1e9634becb8a79d74fbadc5fa9880a1e497546817418f0df7668454d8cad1f52c9516f251833874ca5bac1a530970b8a94860057b05361c736935047ce SHA512 05818e09fc6d8fe8287283b832fa73b4d3ef539837f956b9bfa394d206c1e379a3227148040934ac690d77524f3f7b16ba0d262a11de268914b1d11afe3a3c97
AUX lvm.confd-2.02.28-r2 173 BLAKE2B 4b9d115ed31b3777bd3c925b75bd0ebb186bace92b6d294e6a1ff7cdb7c206374a06738a73edc401a5547016a08721013fe3ad66b52d8cf08de75d030813ab2d SHA512 67b153cbc5c2327c15f042b3b5590c1d8fdf9823efb19c80192ac4dcf98e530efea8ecae0aaaa4a54b0e3e4907565aa21455b364df1dbe8f2e7dffa1c5d355d0
AUX lvm.rc-2.02.105-r2 2960 BLAKE2B 40cdd0e6c3a717367fe6854524b5f355e952f2640823242e5fd18374e3a161e97fff6ce9ec7c052d25ea04f60e75cc2d89e2c48b0e218b62d917916e110c0461 SHA512 8d8ccac694110e3538aeb246244b1b129d960f35d54eb583d77e9d54bed243248b121262557fc0c69bc734a04ca35c0485428e65b1a4d06c438828a239053fae
AUX lvm.rc-2.02.116-r6 3783 BLAKE2B 5150d5c15db03d65b43fd29a23043c2dbb16805a00f79fbec398980f93f9c490474a03b6b7d0d2748ac9a39619b81ac04f6aaa14e700322b09c3e1372f843cd2 SHA512 f819faf7844c3b946b437aee8eb5dd52bfdbb9b820a2024ad42166895e72e194898b16a34c44c69786539d19e5458c12a333f99db02c26589567bb6aabb23639
AUX lvm.rc-2.02.172 4269 BLAKE2B a53fb5302293f7afb800400a0bb1e4f60ad8c3f7951c0872ecc3940016613faa1d141ab040beb66b3bb0b89ffe0db6be69d9924be071f57263b1c9a54eeaaa85 SHA512 1c2a246959420ab0e05e537a29b3c99c6be4a92c329cfc1c2955f0025333c2a1a48abaf864fde5b552e9c03aa31ca204c3ea49b69112f66f4df5fea7148f1953
AUX lvm.rc-2.02.183 4363 BLAKE2B b80351d20a87937f331b34c2007b2ccd27543273b672d002607b02f56d5a15fb142111c5f0939fcc40c52b3123b3b3fc15aa39424139bd00692158f20784489b SHA512 7cd6aa621d022190cd45c44e39ac48445f244643e5c537adbe61e4fbc2d688ce450bfddece92853cc324b0bb2c52c32c4169fc251914eda429de418a0ffe8aba
+AUX lvm.rc-2.02.184-r3 4474 BLAKE2B c08e1c338b8b788927d05f87eb83b2f3a95d35dad9b86e5f9be8809b2883bac56c973c9c2dc8f7775c6e05c3c2ea66dd5268699af3dba47e9a842262e659a121 SHA512 ca7fef98fd074018223be65f6aa20a0abfbb78afbf3d8ff50e1f2656a1cbb7a54570381c9a5328f3766774dce819c1f48e4433c0e7bec69f6bf70747a3375699
AUX lvm2-2.02.106-pthread-pkgconfig.patch 860 BLAKE2B 73c23ba460787dccc1412a8fdba9cdf60172fecab9a732b154af7e7bc4c927a751fbd1107c86cd997221b963748644885a4f525eae351aa2857c4d7e1498f755 SHA512 ae073936ee15fdeabde4d3948a65f6a435b82e62aa0ddadbad399b69bd5c9bfc181d5e0be1beae9f6e899a6e8b9d7c21add13f7a1606cb5ed4762ed5aa5aa223
AUX lvm2-2.02.108-example.conf.in.patch 1681 BLAKE2B 3b7f1fcd005687aa3b4469d88a6fea71c6d5745df0b8ec76dbc6e4e6ad11828785f705503a992a25bae9fc77772fca03f023dbf515bc34e498dd718ed97aaa63 SHA512 b4e983892b7ff47e5e7617376197daa62cfd063cf398235dc4a436fd9025ec4b1e263d7418e2c2943d53be494cba4209e9d4230d54a78762b0ca526f92e9746c
AUX lvm2-2.02.108-static-pkgconfig-libs.patch 3302 BLAKE2B c44b0602e010c7e774d87de808d739987b0bed6e1c963b6a6005b42933edbcaf43dabfbcb26a668c6ba4f0b1e3ddcb2f727f7b57d1c5b8e0c41b201d974a15ac SHA512 246f1029f9346d6bc57c2062c8a223535d0b832fa6bd86947b8b91b094dbc388706a9914f9ca0531666f77e73544612e2819335435b7576b4e91cdb1b0e4f041
@@ -39,10 +41,11 @@ DIST LVM2.2.02.116.tgz 1538340 BLAKE2B 718261b60626f2eca5ba13011646bf551523ed8e5
DIST LVM2.2.02.145.tgz 1986370 BLAKE2B 0c9e5efae17f26ff86152cecbf0b11a74e85007b2fa9491f44dec03ac8c11375bacf6685213b4be19037c8fbf70e13549516716ecf8fa262919a44625e6aab34 SHA512 84e28b3efc940837ea9da70fce620744aea0945ba29383b76ad7bcd4b5259b897c714162a8e8b7cfe26ae736a3ad2eca633a3e0df4d6280a32b28bd4cf472d27
DIST LVM2.2.02.183.tgz 2380574 BLAKE2B b1fe71b6cdb8ee20dd53d0ad3399c553487baafa12657ec81a794c84ad161988afdb8693ac247877a2645d693a0740c74c8b991047ed2ba4adc9ec75f1c261a9 SHA512 3947523c6b0862ada40677ed171ed0cf95e070119e377296fc5ccb153e9c4212d34c0b16a887dbd68ccf265525345dabfed2aa59fb3604555429a7e2ecfff4d7
DIST LVM2.2.02.184.tgz 2383698 BLAKE2B b6e308d76d541b9461dfcc6e82db256a175ccdabfae9c9d57d84eabd0d5ea50e3e09954b34741903e027412c2c26f72a5005fe934261576337a810738139deb8 SHA512 9db74f675e7c58f663a39afb79b6f33a33ad2cfbda63e9783ef5027f33977b4a1262a2e6754aa67c586eed083ee119a2e837c32a7746dcc53f13877c9d65c390
-EBUILD lvm2-2.02.116.ebuild 8431 BLAKE2B 5b17d1ff4ee12c1e8ed040711eb2501a42ff72c371901ca4b9e4ec24a7eab71c8b71bcf52b27e5aeb2548d4aa6cfcab4278d92f5259e22c98190038b019948f6 SHA512 5e8655e7d70566a2b06ef50baa62339b1f26d20385b8a9fc261188bc0012af8d4ed4ab451305e4df5289a44bafe3e2a1252f6264439d6539ab1ae54cda1373f7
+EBUILD lvm2-2.02.116.ebuild 8437 BLAKE2B 2d1c58c95a9d3c3aa1ec5b13d23c04be0b6c194fc4e8767fedecf2ef6edeb0e85b36447ab00afb03d5f243eb73e19453cad203e1e6a72537750eca6a3b7c0fa3 SHA512 7eccc5d981cafe6d2c8a97fd0eb96983f044ecd7ee6be84f61b76c755ed0b1aaeb8dc3a653c5b7e5cb152e84b53cd88bbf3978e8de02cd96703282f0c985ff89
EBUILD lvm2-2.02.145-r2.ebuild 8627 BLAKE2B 63c09b396d802d131aaaa94442a26c4be8b75fc12f1bf097f07a0e52aeba28e4f3b406706ca0ef62a77d0557fc88d3f9d60963dc816026910ff6e90f2bd6439f SHA512 c4553842441409458c5bb339f5e22fa05f9b4bd34c865b907ed6b2396ff8c6fddbb78be1f480f7e189662e87141d7385a933e8f33850a7c6dcae7d611a7f37e9
EBUILD lvm2-2.02.183.ebuild 8761 BLAKE2B cdc1958b9af3fae4f19813a18316ce6166a17f1bca1442a926d672ef38c281c470354574609723290d1d28dc800763b2a8d760a5e9b43d13464195e56c05c38a SHA512 2ee5704d440ab63721dc2c330181f36b7e17303dea829415e9465d6bd4ed4c24e0c6c4dc5c1deb639f65c15b0413238e1d10eeb604b723abfb88dd0177f52ee8
EBUILD lvm2-2.02.184-r1.ebuild 8955 BLAKE2B caa7021e7703bf50529b42425a36c1662943504dff7fe8d857996f226a02119db2f6bad377a80f1fb7fb808f82962fadbd52a5b561f571c5592ceb4524efa825 SHA512 4b337fac136367fe009993e65b84f66e26c3fc6c5517ef6415734843b793ece2dd8411c639771e11a680a092965dc30b589fb26350b490fff28b190559b7e836
EBUILD lvm2-2.02.184-r2.ebuild 9014 BLAKE2B e016e38f56610bff72529ea22e7ad9de1c71cef034c028efe0d8641255d802c504c756899a1c319050cf780656f87e509fb50614adca39c3e14468d3ce503e55 SHA512 15567897f0448bb34980833b107b2e93d416b67df33c57d77269fa52b8fc0d2d6ffbeb19f7c9dccaa2845857dc8a9778d733f22792112fca74720df3f42e5f03
+EBUILD lvm2-2.02.184-r3.ebuild 9217 BLAKE2B 214b1fd2f96fb14910dcc9ef709f20127433a18d6b0e109ba35b5ae6f3474787d6d0b95dd59fe25ab63459c576678aadbaddcabe1fb022b86ed27d4cecba2451 SHA512 76fb52a849217d733a98eed8ab3e71071b5bb237c2886e3929fda2492973bc9f20999bbf830269a67a0db12d9eb9b996d723cb1af2104ec22b43032bf4b2de3f
EBUILD lvm2-2.02.184.ebuild 8769 BLAKE2B 8ff55443aee773e87a78842021820822e8ba2283b61b510dee16423b1e3eb6f48a7ca0badd7776a266c14a8e3a458da889bd548685cc9adcc72a31bbbc25ddd1 SHA512 8fb5b8587580b59869b784434662d771e78378158233633c650e0a445f7c808fa06ab37f744182a25c1fd293f6e9fcf24653a160f59f56b6696249c22d8f2ea0
MISC metadata.xml 1146 BLAKE2B 7a4bbf38d2e752523c2909c240a2c90ada04aee8efe96c62c5989887f4997e00a4ed7312dd9803d8ddcae02e8bbc3ba8f0fa9e5da0f484bc9768e0ed99ab8be3 SHA512 24240ba35d93d9f9171f2b164d949846a5ea2126eceed4b4454dd0b4efb9b1132f9f6717d2c7364f20820b792bbaf26dc274f7c10767993b35a565a76e042f4f
diff --git a/sys-fs/lvm2/files/lvm.confd-2.02.184-r3 b/sys-fs/lvm2/files/lvm.confd-2.02.184-r3
new file mode 100644
index 000000000000..b29e1702b35d
--- /dev/null
+++ b/sys-fs/lvm2/files/lvm.confd-2.02.184-r3
@@ -0,0 +1,9 @@
+# If LVM is built with udev, you must ensure udev is running first!
+# Otherwise it will hang
+rc_need="udev"
+
+# LVM should normally only be started after mdraid is available
+# this is because LVM physical volumes are very often MD devices.
+rc_after="mdraid"
+
+# vim: ft=gentoo-conf-d
diff --git a/sys-fs/lvm2/files/lvm.rc-2.02.184-r3 b/sys-fs/lvm2/files/lvm.rc-2.02.184-r3
new file mode 100644
index 000000000000..b48efb0c99a8
--- /dev/null
+++ b/sys-fs/lvm2/files/lvm.rc-2.02.184-r3
@@ -0,0 +1,154 @@
+#!/sbin/openrc-run
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+_get_lvm_path() {
+ local lvm_path=
+ for lvm_path in /bin/lvm /sbin/lvm ; do
+ [ -x "$lvm_path" ] && break
+ done
+ echo "${lvm_path}"
+}
+
+_need_lvmetad()
+{
+ local lvm_path="$(_get_lvm_path)"
+ [ ! -x "${lvm_path}" ] && return 1
+ ${lvm_path} dumpconfig global 2>/dev/null | grep -q 'use_lvmetad=1'
+}
+
+_need_lvmlockd()
+{
+ local lvm_path="$(_get_lvm_path)"
+ [ ! -x "${lvm_path}" ] && return 1
+ ${lvm_path} dumpconfig global 2>/dev/null | grep -q 'use_lvmlockd=1'
+}
+
+depend() {
+ before checkfs fsck
+ after modules device-mapper
+ # We may use lvmetad based on the configuration. If we added lvmetad
+ # support while lvm2 is running then we aren't dependent on it. For the
+ # more common case, if its disabled in the config we aren't dependent
+ # on it.
+ config /etc/lvm/lvm.conf
+ local _need=
+ if service_started; then
+ _need=$(service_get_value need)
+ else
+ if _need_lvmetad; then
+ _need="${_need} lvmetad"
+ fi
+ if _need_lvmlockd; then
+ _need="${_need} lvmlockd"
+ fi
+ fi
+ # Make sure you review /etc/conf.d/lvm as well!
+ # Depending on your system, it might also introduce udev & mdraid
+ need sysfs ${_need}
+}
+
+config='global { locking_dir = "/run/lock/lvm" }'
+
+dm_in_proc() {
+ local retval=0
+ for x in devices misc ; do
+ grep -qs 'device-mapper' /proc/${x}
+ retval=$((${retval} + $?))
+ done
+ return ${retval}
+}
+
+start() {
+ # LVM support for /usr, /home, /opt ....
+ # This should be done *before* checking local
+ # volumes, or they never get checked.
+
+ # NOTE: Add needed modules for LVM or RAID, etc
+ # to /etc/modules.autoload if needed
+ lvm_path="$(_get_lvm_path)"
+ for lvm_path in /bin/lvm /sbin/lvm ; do
+ [ -x "$lvm_path" ] && break
+ done
+ if [ ! -x "$lvm_path" ]; then
+ eerror "Cannot find lvm binary in /sbin or /bin!"
+ return 1
+ fi
+ if [ -z "${CDBOOT}" ] ; then
+ if [ -e /proc/modules ] && ! dm_in_proc ; then
+ modprobe dm-mod 2>/dev/null
+ fi
+ if [ -d /proc/lvm ] || dm_in_proc ; then
+ ebegin "Setting up the Logical Volume Manager"
+ #still echo stderr for debugging
+ lvm_commands="#!${lvm_path}\n"
+ # Extra PV find pass because some devices might not have been available until very recently
+ lvm_commands="${lvm_commands}pvscan --config '${config}'\n"
+ # Now make the nodes
+ lvm_commands="${lvm_commands}vgscan --config '${config}' --mknodes\n"
+ # And turn them on!
+ lvm_commands="${lvm_commands}vgchange --config '${config}' --sysinit -a ly\n"
+ if _need_lvmlockd; then
+ # Start lockd VGs as required
+ lvm_commands="${lvm_commands}vgchange --config '${config}' --lock-start --lock-opt auto\n"
+ fi
+ # Order of this is important, have to work around dash and LVM readline
+ printf "%b\n" "${lvm_commands}" | $lvm_path /proc/self/fd/0 >/dev/null
+ eend $? "Failed to setup the LVM"
+ fi
+ fi
+}
+
+start_post()
+{
+ # Save if we needed lvmetad
+ if _need_lvmetad; then
+ service_set_value need lvmetad
+ fi
+}
+
+stop() {
+ for lvm_path in /bin/lvm /sbin/lvm ; do
+ [ -x "$lvm_path" ] && break
+ done
+ if [ ! -x "$lvm_path" ]; then
+ eerror "Cannot find lvm binary in /sbin or /bin!"
+ return 1
+ fi
+
+ # Stop LVM2
+ if [ -x /sbin/vgs ] && \
+ [ -x /sbin/vgchange ] && \
+ [ -x /sbin/lvchange ] && \
+ [ -f /etc/lvmtab -o -d /etc/lvm ] && \
+ [ -d /proc/lvm -o "`grep device-mapper /proc/misc 2>/dev/null`" ]
+ then
+ einfo "Shutting down the Logical Volume Manager"
+
+ VGS=$($lvm_path vgs --config "${config}" -o vg_name --noheadings --nosuffix --rows 2> /dev/null)
+
+ if [ "$VGS" ]
+ then
+ local _ending="eend"
+ [ "$RC_RUNLEVEL" = shutdown ] && _ending="ewend"
+ ebegin " Shutting Down LVs & VGs"
+ #still echo stderr for debugging
+ lvm_commands="#!${lvm_path}\n"
+ # Extra PV find pass because some devices might not have been available until very recently
+ lvm_commands="${lvm_commands}lvchange --config '${config}' --sysinit -a ln ${VGS}\n"
+ # Now make the nodes
+ lvm_commands="${lvm_commands}vgchange --config '${config}' --sysinit -a ln ${VGS}\n"
+ # Order of this is important, have to work around dash and LVM readline
+ printf "%b\n" "${lvm_commands}" | $lvm_path /proc/self/fd/0 --config "${config}" >/dev/null
+ rc=$?
+ msg="Failed (possibly some LVs still needed for /usr or root)"
+ [ "$RC_RUNLEVEL" = shutdown ] && msg="${msg} [rc=$rc]" && rc=0
+ ${_ending} $rc "${msg}"
+ fi
+
+ einfo "Finished shutting down the Logical Volume Manager"
+ return 0
+ fi
+}
+
+# vim:ts=4
diff --git a/sys-fs/lvm2/lvm2-2.02.116.ebuild b/sys-fs/lvm2/lvm2-2.02.116.ebuild
index 60b6cfda5775..25f00eb6d517 100644
--- a/sys-fs/lvm2/lvm2-2.02.116.ebuild
+++ b/sys-fs/lvm2/lvm2-2.02.116.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2016 Gentoo Foundation
+# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=5
@@ -15,7 +15,7 @@ KEYWORDS="alpha amd64 arm arm64 hppa ia64 ~mips ppc ppc64 s390 sh sparc x86 ~amd
IUSE="readline static static-libs systemd lvm1 lvm2create_initrd selinux +udev +thin device-mapper-only"
REQUIRED_USE="device-mapper-only? ( !lvm1 !lvm2create_initrd !thin )
systemd? ( udev )
- static? ( !udev )" #520450
+ static? ( !udev !systemd )" #520450
DEPEND_COMMON="
readline? ( sys-libs/readline:0= )
diff --git a/sys-fs/lvm2/lvm2-2.02.184-r3.ebuild b/sys-fs/lvm2/lvm2-2.02.184-r3.ebuild
new file mode 100644
index 000000000000..7c49fed05952
--- /dev/null
+++ b/sys-fs/lvm2/lvm2-2.02.184-r3.ebuild
@@ -0,0 +1,269 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit autotools linux-info multilib systemd toolchain-funcs udev flag-o-matic
+
+DESCRIPTION="User-land utilities for LVM2 (device-mapper) software"
+HOMEPAGE="https://sourceware.org/lvm2/"
+SRC_URI="ftp://sourceware.org/pub/lvm2/${PN/lvm/LVM}.${PV}.tgz
+ ftp://sourceware.org/pub/lvm2/old/${PN/lvm/LVM}.${PV}.tgz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~x86-linux"
+IUSE="readline static static-libs systemd lvm2create_initrd sanlock selinux +udev +thin device-mapper-only"
+REQUIRED_USE="device-mapper-only? ( !lvm2create_initrd !sanlock !thin )
+ systemd? ( udev )"
+
+DEPEND_COMMON="
+ dev-libs/libaio[static-libs?]
+ static? ( dev-libs/libaio[static-libs] )
+ !static? ( dev-libs/libaio[static-libs?] )
+ readline? ( sys-libs/readline:0= )
+ sanlock? ( sys-cluster/sanlock )
+ systemd? ( >=sys-apps/systemd-205:0= )
+ udev? ( >=virtual/libudev-208:=[static-libs?] )"
+# /run is now required for locking during early boot. /var cannot be assumed to
+# be available -- thus, pull in recent enough baselayout for /run.
+# This version of LVM is incompatible with cryptsetup <1.1.2.
+RDEPEND="${DEPEND_COMMON}
+ >=sys-apps/baselayout-2.2
+ !<sys-apps/openrc-0.11
+ !<sys-fs/cryptsetup-1.1.2
+ !!sys-fs/lvm-user
+ >=sys-apps/util-linux-2.16
+ lvm2create_initrd? ( sys-apps/makedev )
+ thin? ( >=sys-block/thin-provisioning-tools-0.3.0 )"
+# note: thin- 0.3.0 is required to avoid --disable-thin_check_needs_check
+# USE 'static' currently only works with eudev, bug 520450
+DEPEND="${DEPEND_COMMON}
+ virtual/pkgconfig
+ >=sys-devel/binutils-2.20.1-r1
+ sys-devel/autoconf-archive
+ static? (
+ selinux? ( sys-libs/libselinux[static-libs] )
+ udev? ( >=sys-fs/eudev-3.1.2[static-libs] )
+ >=sys-apps/util-linux-2.16[static-libs]
+ )"
+
+S=${WORKDIR}/${PN/lvm/LVM}.${PV}
+
+PATCHES=(
+ # Gentoo specific modification(s):
+ "${FILESDIR}"/${PN}-2.02.178-example.conf.in.patch
+
+ # For upstream -- review and forward:
+ "${FILESDIR}"/${PN}-2.02.63-always-make-static-libdm.patch
+ "${FILESDIR}"/${PN}-2.02.56-lvm2create_initrd.patch
+ "${FILESDIR}"/${PN}-2.02.67-createinitrd.patch #301331
+ "${FILESDIR}"/${PN}-2.02.99-locale-muck.patch #330373
+ "${FILESDIR}"/${PN}-2.02.178-asneeded.patch # -Wl,--as-needed
+ "${FILESDIR}"/${PN}-2.02.178-dynamic-static-ldflags.patch #332905
+ "${FILESDIR}"/${PN}-2.02.178-static-pkgconfig-libs.patch #370217, #439414 + blkid
+ "${FILESDIR}"/${PN}-2.02.176-pthread-pkgconfig.patch #492450
+ "${FILESDIR}"/${PN}-2.02.171-static-libm.patch #617756
+ "${FILESDIR}"/${PN}-2.02.166-HPPA-no-O_DIRECT.patch #657446
+ #"${FILESDIR}"/${PN}-2.02.145-mkdev.patch #580062 # Merged upstream
+ "${FILESDIR}"/${PN}-2.02.184-dmeventd-no-idle-exit.patch
+)
+
+pkg_setup() {
+ local CONFIG_CHECK="~SYSVIPC"
+
+ if use udev; then
+ local WARNING_SYSVIPC="CONFIG_SYSVIPC:\tis not set (required for udev sync)\n"
+ if linux_config_exists; then
+ local uevent_helper_path=$(linux_chkconfig_string UEVENT_HELPER_PATH)
+ if [ -n "${uevent_helper_path}" ] && [ "${uevent_helper_path}" != '""' ]; then
+ ewarn "It's recommended to set an empty value to the following kernel config option:"
+ ewarn "CONFIG_UEVENT_HELPER_PATH=${uevent_helper_path}"
+ fi
+ fi
+ fi
+
+ check_extra_config
+
+ # 1. Genkernel no longer copies /sbin/lvm blindly.
+ if use static; then
+ elog "Warning, we no longer overwrite /sbin/lvm and /sbin/dmsetup with"
+ elog "their static versions. If you need the static binaries,"
+ elog "you must append .static to the filename!"
+ fi
+}
+
+src_prepare() {
+ default
+
+ sed -i \
+ -e "1iAR = $(tc-getAR)" \
+ -e "s:CC ?= @CC@:CC = $(tc-getCC):" \
+ make.tmpl.in || die #444082
+
+ sed -i -e '/FLAG/s:-O2::' configure{.ac,} || die #480212
+
+ if use udev && ! use device-mapper-only; then
+ sed -i -e '/use_lvmetad =/s:0:1:' conf/example.conf.in || die #514196
+ elog "Notice that \"use_lvmetad\" setting is enabled with USE=\"udev\" in"
+ elog "/etc/lvm/lvm.conf, which will require restart of udev, lvm, and lvmetad"
+ elog "if it was previously disabled."
+ fi
+
+ sed -i -e "s:/usr/bin/true:$(type -P true):" scripts/blk_availability_systemd_red_hat.service.in || die #517514
+
+ # Without thin-privision-tools, there is nothing to install for target install_man7:
+ if ! use thin ; then
+ sed -i -e '/^install_lvm2/s:install_man7::' man/Makefile.in || die
+ fi
+
+ eautoreconf
+}
+
+src_configure() {
+ filter-flags -flto
+ local myeconfargs=()
+
+ # Most of this package does weird stuff.
+ # The build options are tristate, and --without is NOT supported
+ # options: 'none', 'internal', 'shared'
+ myeconfargs+=(
+ $(use_enable !device-mapper-only dmfilemapd)
+ $(use_enable !device-mapper-only dmeventd)
+ $(use_enable !device-mapper-only cmdlib)
+ $(use_enable !device-mapper-only applib)
+ $(use_enable !device-mapper-only fsadm)
+ $(use_enable !device-mapper-only lvmetad)
+ $(use_enable !device-mapper-only lvmpolld)
+ $(usex device-mapper-only --disable-udev-systemd-background-jobs '')
+
+ # This only causes the .static versions to become available
+ $(usex static --enable-static_link '')
+
+ # dmeventd requires mirrors to be internal, and snapshot available
+ # so we cannot disable them
+ --with-mirrors="$(usex device-mapper-only none internal)"
+ --with-snapshots="$(usex device-mapper-only none internal)"
+
+ # disable O_DIRECT support on hppa, breaks pv detection (#99532)
+ $(usex hppa --disable-o_direct '')
+ )
+
+ if use thin; then
+ myeconfargs+=( --with-thin=internal --with-cache=internal )
+ local texec
+ for texec in check dump repair restore; do
+ myeconfargs+=( --with-thin-${texec}="${EPREFIX}"/sbin/thin_${texec} )
+ myeconfargs+=( --with-cache-${texec}="${EPREFIX}"/sbin/cache_${texec} )
+ done
+ else
+ myeconfargs+=( --with-thin=none --with-cache=none )
+ fi
+
+ myeconfargs+=( --with-clvmd=none --with-cluster=none )
+
+ myeconfargs+=(
+ $(use_enable readline)
+ $(use_enable selinux)
+ --enable-pkgconfig
+ --with-confdir="${EPREFIX}"/etc
+ --exec-prefix="${EPREFIX}"
+ --sbindir="${EPREFIX}/sbin"
+ --with-staticdir="${EPREFIX}"/sbin
+ --libdir="${EPREFIX}/$(get_libdir)"
+ --with-usrlibdir="${EPREFIX}/usr/$(get_libdir)"
+ --with-default-dm-run-dir=/run
+ --with-default-run-dir=/run/lvm
+ --with-default-locking-dir=/run/lock/lvm
+ --with-default-pid-dir=/run
+ $(use_enable udev udev_rules)
+ $(use_enable udev udev_sync)
+ $(use_with udev udevdir "$(get_udevdir)"/rules.d)
+ $(use_enable sanlock lvmlockd-sanlock)
+ $(use_enable systemd udev-systemd-background-jobs)
+ $(use_enable systemd notify-dbus)
+ --with-systemdsystemunitdir="$(systemd_get_systemunitdir)"
+ CLDFLAGS="${LDFLAGS}"
+ )
+ econf "${myeconfargs[@]}"
+}
+
+src_compile() {
+ pushd include >/dev/null
+ emake
+ popd >/dev/null
+
+ if use device-mapper-only ; then
+ emake device-mapper
+ else
+ emake
+ emake CC="$(tc-getCC)" -C scripts lvm2_activation_generator_systemd_red_hat
+ fi
+}
+
+src_install() {
+ local inst INSTALL_TARGETS
+ INSTALL_TARGETS=( install install_tmpfiles_configuration )
+ # install systemd related files only when requested, bug #522430
+ use systemd && INSTALL_TARGETS+=( install_systemd_units install_systemd_generators )
+ use device-mapper-only && INSTALL_TARGETS=( install_device-mapper )
+ for inst in ${INSTALL_TARGETS[@]}; do
+ emake DESTDIR="${D}" ${inst}
+ done
+
+ newinitd "${FILESDIR}"/device-mapper.rc-2.02.105-r2 device-mapper
+ newconfd "${FILESDIR}"/device-mapper.conf-1.02.22-r3 device-mapper
+
+ if use !device-mapper-only ; then
+ newinitd "${FILESDIR}"/dmeventd.initd-2.02.184-r2 dmeventd
+ newinitd "${FILESDIR}"/lvm.rc-2.02.184-r3 lvm
+ newconfd "${FILESDIR}"/lvm.confd-2.02.184-r3 lvm
+ if ! use udev ; then
+ # We keep the variable but remove udev from it.
+ sed -r -i \
+ -e '/^rc_need=/s/\<udev\>//g' \
+ "${ED}/etc/conf.d/lvm" || die "Could not drop udev from rc_need"
+ fi
+
+ newinitd "${FILESDIR}"/lvm-monitoring.initd-2.02.105-r2 lvm-monitoring
+ newinitd "${FILESDIR}"/lvmetad.initd-2.02.116-r3 lvmetad
+ newinitd "${FILESDIR}"/lvmpolld.initd-2.02.183 lvmpolld
+ fi
+
+ if use sanlock; then
+ newinitd "${FILESDIR}"/lvmlockd.initd-2.02.166-r1 lvmlockd
+ fi
+
+ if use static-libs; then
+ dolib.a libdm/ioctl/libdevmapper.a
+ dolib.a libdaemon/client/libdaemonclient.a #462908
+ #gen_usr_ldscript libdevmapper.so
+ dolib.a daemons/dmeventd/libdevmapper-event.a
+ #gen_usr_ldscript libdevmapper-event.so
+ else
+ rm -f "${ED%/}"/usr/$(get_libdir)/{libdevmapper-event,liblvm2cmd,liblvm2app,libdevmapper}.a
+ fi
+
+ if use lvm2create_initrd; then
+ dosbin scripts/lvm2create_initrd/lvm2create_initrd
+ doman scripts/lvm2create_initrd/lvm2create_initrd.8
+ newdoc scripts/lvm2create_initrd/README README.lvm2create_initrd
+ fi
+
+ insinto /etc
+ doins "${FILESDIR}"/dmtab
+
+ dodoc README VERSION* WHATS_NEW WHATS_NEW_DM doc/*.{c,txt} conf/*.conf
+}
+
+pkg_postinst() {
+ ewarn "Make sure the \"lvm\" init script is in the runlevels:"
+ ewarn "# rc-update add lvm boot"
+ ewarn
+ ewarn "Make sure to enable lvmetad in /etc/lvm/lvm.conf if you want"
+ ewarn "to enable lvm autoactivation and metadata caching."
+}
+
+src_test() {
+ einfo "Tests are disabled because of device-node mucking, if you want to"
+ einfo "run tests, compile the package and see ${S}/tests"
+}