summaryrefslogtreecommitdiff
path: root/sys-fs/lvm2
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2019-04-28 09:54:45 +0100
committerV3n3RiX <venerix@redcorelinux.org>2019-04-28 09:54:45 +0100
commitb7ebc951da8800f711142f69d9d958bde67a112d (patch)
treee318514216845acb8f2e49fff7a5cba4027e9d91 /sys-fs/lvm2
parentdc7cbdfa65fd814b3b9aa3c56257da201109e807 (diff)
gentoo resync : 28.04.2019
Diffstat (limited to 'sys-fs/lvm2')
-rw-r--r--sys-fs/lvm2/Manifest10
-rw-r--r--sys-fs/lvm2/files/dmeventd.initd-2.02.184-r221
-rw-r--r--sys-fs/lvm2/files/lvm.rc-2.02.183152
-rw-r--r--sys-fs/lvm2/files/lvm2-2.02.184-dmeventd-no-idle-exit.patch68
-rw-r--r--sys-fs/lvm2/files/lvmpolld.initd-2.02.18317
-rw-r--r--sys-fs/lvm2/lvm2-2.02.183.ebuild2
-rw-r--r--sys-fs/lvm2/lvm2-2.02.184-r1.ebuild262
-rw-r--r--sys-fs/lvm2/lvm2-2.02.184-r2.ebuild263
-rw-r--r--sys-fs/lvm2/lvm2-2.02.184.ebuild258
9 files changed, 1051 insertions, 2 deletions
diff --git a/sys-fs/lvm2/Manifest b/sys-fs/lvm2/Manifest
index d534ba5b27f6..a1c38ed29ff8 100644
--- a/sys-fs/lvm2/Manifest
+++ b/sys-fs/lvm2/Manifest
@@ -1,5 +1,6 @@
AUX device-mapper.conf-1.02.22-r3 15 BLAKE2B c8954f4cad3090e95c8ab985f7f93b65add66b9014351aab82d270c371c3b7571a73b37b2002664b50c21bb7dd494c7196857de75b41ca534cb15e0127f080ae SHA512 1846e0ca1be7170d4c0beb694a23aea4d19b24b99a248bb0f4e034286a6beede0a8efc474b0c237e33ee72c86c93b6238f2d5ea23e224765acba99c90633261e
AUX device-mapper.rc-2.02.105-r2 3707 BLAKE2B 1f1f38fd377e77e082985146de8a32fb88f794e4db28d6790cccbc6a87b63b0d28617e5fa7eb4974e2dcf8a80265accf8b69ff0719fa3de1c6788e7d5a1bd705 SHA512 9940b1154a8c07cf2f2c975e209bfb1e78913d3ea77ac6334684a9b38c4f4bd34b349b71c078c9ad5700f554046771ee05e17f07b75dc4e7d839f1df2305cc4f
+AUX dmeventd.initd-2.02.184-r2 595 BLAKE2B fe87c9a034f9a9924c4c6e31365619cf5809a9756112925ca50233198ab052139f8151a81ee8db69fa6a7eda8e3aacaa128faa30e5d99a52d15f5a07a9da4179 SHA512 f46fa3d0a0a0047801c0d3a3817f9d7c5dbe0daa2237c2537f5a3faef3dd2d7030780471bb1ba19746c26ce6035092477c06806156718a7526e5222339fa01ec
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
@@ -7,6 +8,7 @@ AUX lvm.confd-2.02.28-r2 173 BLAKE2B 4b9d115ed31b3777bd3c925b75bd0ebb186bace92b6
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 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
@@ -22,6 +24,7 @@ AUX lvm2-2.02.178-asneeded.patch 452 BLAKE2B 6d7013e7a0e1aae933e22b2c30b85cf744f
AUX lvm2-2.02.178-dynamic-static-ldflags.patch 2279 BLAKE2B 526104c96dbef36568a11898193c5d0a7d69a63df2011e1f1a778a4317248a683470e331ddbf8b07fe8654abca5a96e9a53d0b13715c860f8c1e8b33b8e95384 SHA512 83f253ca629e90380164edc74f3900f6e40fcd0002d357dbcaecf4a75c2a2213c55cce1291a27afd2e07c72838e46fe7438217f8a103c20233ffa2621cf02cb1
AUX lvm2-2.02.178-example.conf.in.patch 1650 BLAKE2B f5e04bb7524cffb5ee3f6f819541eba0681e8a32f884be4c78537a38848fdbe03d3028b90568e03810df86012cfb497c9050fb949c6c8b1d4460174a6794205b SHA512 fe30018b3f0ebd6f99e63a5d8b423365b8f2c5d5b17b19810ca1bea52f49a5c07e059cfcb1851be752024ba5acad6fbb736f20264b83bdf385f845c3b68d5b5b
AUX lvm2-2.02.178-static-pkgconfig-libs.patch 3495 BLAKE2B 85869e4f46b001c4a8d43692ae7e3d73731deb9bc6094b4cdb3059058dfb819ecf507f5c5a5b47d4be4db18e6d0765c652f5b0e18ea17ecb55112fc70f7033bd SHA512 9a8b3d2296e4966d7209bdef3cd4c40f65a81ab5c2220d6b8ea06fd35ebad272a09a39b7f4e352eff32ad82babfbbec6c4f108d200193b3f84b225f739e0afc6
+AUX lvm2-2.02.184-dmeventd-no-idle-exit.patch 2468 BLAKE2B e59873c7da99a8e62f71c78b1e93d54c342258949719fabdf2b08b0fcbf00ddcd3c8eb2a937416c646a948dda91474d2ad2187fcb880152986c7f6936bbee1ee SHA512 02a82cde3affd8e84b9800ad06c0c2ec9562f9412157e4f9ba96ef502a22d7870ece3d867684cf90c32ebc77bad8ae3beef5a3fe606ef7c30ad1b2b73e81de1a
AUX lvm2-2.02.56-lvm2create_initrd.patch 2032 BLAKE2B 5533ceb7a601d58995e7a90b1355508907edb30d14704b397a8c8ba0d66dbcd3d6b02ace1cadef1dfbb1d927449403f76f0f38e5d034344b3232deb512507cb6 SHA512 b2a1705fa6b962027ebc5047583547489afe8ef8d8977c6284a28d0a8b0e05e20e6c48bd6c02a8bb02de9cfb40ac2d6e2a4b8ed8ef8c4ae7b6ea9a29bc4194de
AUX lvm2-2.02.63-always-make-static-libdm.patch 1420 BLAKE2B baf7010b5965f5c2b9a32ec812cb259cb3ceccea0d56e48d75e9f8e872634913f160fcfff0c2c77854ddfeaafb3b48bbca16d569041ab6f45aecb950f8e5bf4a SHA512 67735af9e51369d5b3b400cab4f9ffa25f8dea1c1ec3d01855cb3c5aeade5c39a35eeed43f3a665204fe6bbba4ca43baecd845330bf26d023064b94ca3d1317c
AUX lvm2-2.02.67-createinitrd.patch 660 BLAKE2B 23e784e6769bc1f47fa57d690e6bebdf16d784d775a06af1c8eb7c54dd63a12abb0edd8331c8d033d7a0dda058252453a46dd35bd820fd47ba1407e9568b3858 SHA512 17fbba5d34ece5c1c25ef35fa3bbc3d6fcd20b44bd766c049bbc120853a8d60c9544db5790645a7814db5c272fd12d383699a8a9be6f4e9c56a7c0a1bb29ade2
@@ -31,10 +34,15 @@ AUX lvm2-2.02.99-locale-muck.patch 405 BLAKE2B 07ac7c7f54d06dbdeae1c6bf0959fd0c2
AUX lvmetad.initd-2.02.105-r2 287 BLAKE2B 613baa6c794a971257ea25061d51ce2923475e919c6753e99e8fd2f7e8542ac48b1207f851c3c200b7a4113a62ef5bc2dc5507bcd5ad6c47bec8c9a3abc1ad63 SHA512 5fe1a47a1c54546af70c64fc001db3111e519cb81d8672761b64f50b4c552d0fa79bd0770fb4f4f3e0e0ac584b1e13ea91ac1a33cea1cc1f484cff0dde1a3b0b
AUX lvmetad.initd-2.02.116-r3 348 BLAKE2B 6ad8f51dc6498703840a0917cdbcb5d1f179e2f8f0b2bc06f08e1c65e0dce2e63da3ca7295a8fcfc01019724bc9468d9d1338f3c2d879b4446980b5aa3e10441 SHA512 19aafd07aa6ebe3f05e321048480f746a9aafd1ad4e0323486db5c54035430f607e171d2246e91bbbf8a2a7e15278d793ad13d84e824df7af65345070483a696
AUX lvmlockd.initd-2.02.166-r1 393 BLAKE2B 83eb337aa1069e66d7746b23141da24717303552016497d29d4df304bb174b2c380cc7c09df7b3529e355cf172150c7cf254afb984a6561e1fa3459aeed43421 SHA512 11d6f186799d8628220eccb4823e5bd251bc3c447e6c3f8a63c025dc4e08e0a7638a8439967ea2ee8a717264887597be4992afca59571ebaa651441782288081
+AUX lvmpolld.initd-2.02.183 348 BLAKE2B cba0419add6591320dc60ef7616b66706e042b566284a4ec42002fbb5331a7173fc8b4b39be7198426fe4bbdcd3ad94b69fc3d8950705b6331c5f3f4cda4ad66 SHA512 b9b8376cbc8b6703868afab18e5baa4ef5354569e57f0596d38a8005fa725299f6858ac86b39fcca10e5a0f1adbd3a4cfa6cc6b62405e78916cc1287d8b36d0d
DIST LVM2.2.02.116.tgz 1538340 BLAKE2B 718261b60626f2eca5ba13011646bf551523ed8e59aaceceb9097221c000268b7533ac43151ff1d9229911d87e764fbdb29ffa1d305f2aae99220a68e301559a SHA512 992541339637d597257850b4ff7f5348fb7cdcccf806ac8d986a3be1ad1edc5f6bfaedeed5128690c541d1a485cdc75742e90a766363c39867901003518fb84d
DIST LVM2.2.02.145.tgz 1986370 BLAKE2B 0c9e5efae17f26ff86152cecbf0b11a74e85007b2fa9491f44dec03ac8c11375bacf6685213b4be19037c8fbf70e13549516716ecf8fa262919a44625e6aab34 SHA512 84e28b3efc940837ea9da70fce620744aea0945ba29383b76ad7bcd4b5259b897c714162a8e8b7cfe26ae736a3ad2eca633a3e0df4d6280a32b28bd4cf472d27
DIST LVM2.2.02.183.tgz 2380574 BLAKE2B b1fe71b6cdb8ee20dd53d0ad3399c553487baafa12657ec81a794c84ad161988afdb8693ac247877a2645d693a0740c74c8b991047ed2ba4adc9ec75f1c261a9 SHA512 3947523c6b0862ada40677ed171ed0cf95e070119e377296fc5ccb153e9c4212d34c0b16a887dbd68ccf265525345dabfed2aa59fb3604555429a7e2ecfff4d7
+DIST LVM2.2.02.184.tgz 2383698 BLAKE2B b6e308d76d541b9461dfcc6e82db256a175ccdabfae9c9d57d84eabd0d5ea50e3e09954b34741903e027412c2c26f72a5005fe934261576337a810738139deb8 SHA512 9db74f675e7c58f663a39afb79b6f33a33ad2cfbda63e9783ef5027f33977b4a1262a2e6754aa67c586eed083ee119a2e837c32a7746dcc53f13877c9d65c390
EBUILD lvm2-2.02.116.ebuild 8431 BLAKE2B 5b17d1ff4ee12c1e8ed040711eb2501a42ff72c371901ca4b9e4ec24a7eab71c8b71bcf52b27e5aeb2548d4aa6cfcab4278d92f5259e22c98190038b019948f6 SHA512 5e8655e7d70566a2b06ef50baa62339b1f26d20385b8a9fc261188bc0012af8d4ed4ab451305e4df5289a44bafe3e2a1252f6264439d6539ab1ae54cda1373f7
EBUILD lvm2-2.02.145-r2.ebuild 8627 BLAKE2B 63c09b396d802d131aaaa94442a26c4be8b75fc12f1bf097f07a0e52aeba28e4f3b406706ca0ef62a77d0557fc88d3f9d60963dc816026910ff6e90f2bd6439f SHA512 c4553842441409458c5bb339f5e22fa05f9b4bd34c865b907ed6b2396ff8c6fddbb78be1f480f7e189662e87141d7385a933e8f33850a7c6dcae7d611a7f37e9
-EBUILD lvm2-2.02.183.ebuild 8767 BLAKE2B 215e7c5e61420b610281fab0ca0fb37bcc54dd2a15876e3256132c002ce3fc0de27906e395029b2e403ffc4919625a0c54efee5020e48a2f1c7c64483a04e6af SHA512 e6b9dc0fe0b67ac02431bcd379f376908b24be175b7dccbbe4e70ff1708dc8c541cc5dffd0ea968813bdec876037951425a838264227e1ea4d8ccc94e674ab2b
+EBUILD lvm2-2.02.183.ebuild 8763 BLAKE2B 2885ee3d360cae58fc9dd6117a92209c26ffaa5305540496a476cfff7d129b2fc2c5a24a9858745a5abbee6e64c072bbbe62ded5410b90c63ad05cd5ed31792c SHA512 0e1682dad9834ea32a2351b9a4e71e8a27ce65cc0bfb1e0cb175d2098d8bfc4114f14a8eb8d3fba72fc7e5b87db4d0d1f12a35debec59f931ad256a1f0812d5c
+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.ebuild 8769 BLAKE2B 8ff55443aee773e87a78842021820822e8ba2283b61b510dee16423b1e3eb6f48a7ca0badd7776a266c14a8e3a458da889bd548685cc9adcc72a31bbbc25ddd1 SHA512 8fb5b8587580b59869b784434662d771e78378158233633c650e0a445f7c808fa06ab37f744182a25c1fd293f6e9fcf24653a160f59f56b6696249c22d8f2ea0
MISC metadata.xml 1146 BLAKE2B 7a4bbf38d2e752523c2909c240a2c90ada04aee8efe96c62c5989887f4997e00a4ed7312dd9803d8ddcae02e8bbc3ba8f0fa9e5da0f484bc9768e0ed99ab8be3 SHA512 24240ba35d93d9f9171f2b164d949846a5ea2126eceed4b4454dd0b4efb9b1132f9f6717d2c7364f20820b792bbaf26dc274f7c10767993b35a565a76e042f4f
diff --git a/sys-fs/lvm2/files/dmeventd.initd-2.02.184-r2 b/sys-fs/lvm2/files/dmeventd.initd-2.02.184-r2
new file mode 100644
index 000000000000..bc08c0a94f41
--- /dev/null
+++ b/sys-fs/lvm2/files/dmeventd.initd-2.02.184-r2
@@ -0,0 +1,21 @@
+#!/sbin/openrc-run
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+command=/sbin/dmeventd
+command_args_foreground='-f'
+extra_started_commands=reload
+pidfile=/run/dmeventd.pid
+# Control idle exit behavior of daemon
+export DMEVENTD_IDLE_EXIT_TIMEOUT=${DMEVENTD_IDLE_EXIT_TIMEOUT:=-1}
+
+depend() {
+ # As of .67-r1, we call ALL lvm start/stop scripts with --sysinit, that
+ # means dmeventd is NOT notified, as it cannot be safely running
+ after lvm device-mapper
+}
+
+reload() {
+ # TODO: this is not supported under supervisors
+ ${command} -R
+}
diff --git a/sys-fs/lvm2/files/lvm.rc-2.02.183 b/sys-fs/lvm2/files/lvm.rc-2.02.183
new file mode 100644
index 000000000000..ce499a6dd21b
--- /dev/null
+++ b/sys-fs/lvm2/files/lvm.rc-2.02.183
@@ -0,0 +1,152 @@
+#!/sbin/openrc-run
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+_get_lvm_path() {
+ local lvm_path=
+ for lvm_path in /bin/lvm /sbin/lvm ; do
+ [ -x "$lvm_path" ] && break
+ done
+ echo "${lvm_path}"
+}
+
+_need_lvmetad()
+{
+ local lvm_path="$(_get_lvm_path)"
+ [ ! -x "${lvm_path}" ] && return 1
+ ${lvm_path} dumpconfig global 2>/dev/null | grep -q 'use_lvmetad=1'
+}
+
+_need_lvmlockd()
+{
+ local lvm_path="$(_get_lvm_path)"
+ [ ! -x "${lvm_path}" ] && return 1
+ ${lvm_path} dumpconfig global 2>/dev/null | grep -q 'use_lvmlockd=1'
+}
+
+depend() {
+ before checkfs fsck
+ after modules device-mapper
+ # We may use lvmetad based on the configuration. If we added lvmetad
+ # support while lvm2 is running then we aren't dependent on it. For the
+ # more common case, if its disabled in the config we aren't dependent
+ # on it.
+ config /etc/lvm/lvm.conf
+ local _need=
+ if service_started; then
+ _need=$(service_get_value need)
+ else
+ if _need_lvmetad; then
+ _need="${_need} lvmetad"
+ fi
+ if _need_lvmlockd; then
+ _need="${_need} lvmlockd"
+ fi
+ fi
+ need sysfs udev ${_need}
+}
+
+config='global { locking_dir = "/run/lock/lvm" }'
+
+dm_in_proc() {
+ local retval=0
+ for x in devices misc ; do
+ grep -qs 'device-mapper' /proc/${x}
+ retval=$((${retval} + $?))
+ done
+ return ${retval}
+}
+
+start() {
+ # LVM support for /usr, /home, /opt ....
+ # This should be done *before* checking local
+ # volumes, or they never get checked.
+
+ # NOTE: Add needed modules for LVM or RAID, etc
+ # to /etc/modules.autoload if needed
+ lvm_path="$(_get_lvm_path)"
+ for lvm_path in /bin/lvm /sbin/lvm ; do
+ [ -x "$lvm_path" ] && break
+ done
+ if [ ! -x "$lvm_path" ]; then
+ eerror "Cannot find lvm binary in /sbin or /bin!"
+ return 1
+ fi
+ if [ -z "${CDBOOT}" ] ; then
+ if [ -e /proc/modules ] && ! dm_in_proc ; then
+ modprobe dm-mod 2>/dev/null
+ fi
+ if [ -d /proc/lvm ] || dm_in_proc ; then
+ ebegin "Setting up the Logical Volume Manager"
+ #still echo stderr for debugging
+ lvm_commands="#!${lvm_path}\n"
+ # Extra PV find pass because some devices might not have been available until very recently
+ lvm_commands="${lvm_commands}pvscan --config '${config}'\n"
+ # Now make the nodes
+ lvm_commands="${lvm_commands}vgscan --config '${config}' --mknodes\n"
+ # And turn them on!
+ lvm_commands="${lvm_commands}vgchange --config '${config}' --sysinit -a ly\n"
+ if _need_lvmlockd; then
+ # Start lockd VGs as required
+ lvm_commands="${lvm_commands}vgchange --config '${config}' --lock-start --lock-opt auto\n"
+ fi
+ # Order of this is important, have to work around dash and LVM readline
+ printf "%b\n" "${lvm_commands}" | $lvm_path /proc/self/fd/0 >/dev/null
+ eend $? "Failed to setup the LVM"
+ fi
+ fi
+}
+
+start_post()
+{
+ # Save if we needed lvmetad
+ if _need_lvmetad; then
+ service_set_value need lvmetad
+ fi
+}
+
+stop() {
+ for lvm_path in /bin/lvm /sbin/lvm ; do
+ [ -x "$lvm_path" ] && break
+ done
+ if [ ! -x "$lvm_path" ]; then
+ eerror "Cannot find lvm binary in /sbin or /bin!"
+ return 1
+ fi
+
+ # Stop LVM2
+ if [ -x /sbin/vgs ] && \
+ [ -x /sbin/vgchange ] && \
+ [ -x /sbin/lvchange ] && \
+ [ -f /etc/lvmtab -o -d /etc/lvm ] && \
+ [ -d /proc/lvm -o "`grep device-mapper /proc/misc 2>/dev/null`" ]
+ then
+ einfo "Shutting down the Logical Volume Manager"
+
+ VGS=$($lvm_path vgs --config "${config}" -o vg_name --noheadings --nosuffix --rows 2> /dev/null)
+
+ if [ "$VGS" ]
+ then
+ local _ending="eend"
+ [ "$RC_RUNLEVEL" = shutdown ] && _ending="ewend"
+ ebegin " Shutting Down LVs & VGs"
+ #still echo stderr for debugging
+ lvm_commands="#!${lvm_path}\n"
+ # Extra PV find pass because some devices might not have been available until very recently
+ lvm_commands="${lvm_commands}lvchange --config '${config}' --sysinit -a ln ${VGS}\n"
+ # Now make the nodes
+ lvm_commands="${lvm_commands}vgchange --config '${config}' --sysinit -a ln ${VGS}\n"
+ # Order of this is important, have to work around dash and LVM readline
+ printf "%b\n" "${lvm_commands}" | $lvm_path /proc/self/fd/0 --config "${config}" >/dev/null
+ rc=$?
+ msg="Failed (possibly some LVs still needed for /usr or root)"
+ [ "$RC_RUNLEVEL" = shutdown ] && msg="${msg} [rc=$rc]" && rc=0
+ ${_ending} $rc "${msg}"
+ fi
+
+ einfo "Finished shutting down the Logical Volume Manager"
+ return 0
+ fi
+}
+
+# vim:ts=4
diff --git a/sys-fs/lvm2/files/lvm2-2.02.184-dmeventd-no-idle-exit.patch b/sys-fs/lvm2/files/lvm2-2.02.184-dmeventd-no-idle-exit.patch
new file mode 100644
index 000000000000..c80bd2ba2bec
--- /dev/null
+++ b/sys-fs/lvm2/files/lvm2-2.02.184-dmeventd-no-idle-exit.patch
@@ -0,0 +1,68 @@
+From: "Robin H. Johnson" <robbat2@gentoo.org>
+Date: Wed, 17 Apr 2019 06:54:27 +0000
+Subject: [PATCH] dmeventd configurable idle exit time
+
+dmeventd nominally exits after 1 hour of idle time. There are use cases for
+this, esp. with socket activation, but also cases where users don't expect
+dmeventd to exit.
+
+Provide a tuning knob via environment variable, DMEVENTD_IDLE_EXIT_TIMEOUT,
+that can be -1 to not exit, or a configurable time for different idle exit.
+
+Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
+Fixes: https://bugs.gentoo.org/682556
+
+diff -Nuar LVM2.2.02.184.orig/daemons/dmeventd/dmeventd.c LVM2.2.02.184/daemons/dmeventd/dmeventd.c
+--- LVM2.2.02.184.orig/daemons/dmeventd/dmeventd.c 2019-03-22 03:14:59.000000000 -0700
++++ LVM2.2.02.184/daemons/dmeventd/dmeventd.c 2019-04-17 00:18:23.535029906 -0700
+@@ -2158,6 +2158,18 @@
+ .server_path = DM_EVENT_FIFO_SERVER
+ };
+ time_t now, idle_exit_timeout = DMEVENTD_IDLE_EXIT_TIMEOUT;
++
++ /* Provide a basic way to config the idle timeout */
++ char* idle_exit_timeout_env = getenv("DMEVENTD_IDLE_EXIT_TIMEOUT") ? : NULL;
++ if(NULL != idle_exit_timeout_env) {
++ char* endptr;
++ idle_exit_timeout = strtol(idle_exit_timeout_env, &endptr, 10);
++ if (errno == ERANGE || *endptr != '\0') {
++ fprintf(stderr, "DMEVENTD_IDLE_EXIT_TIMEOUT: bad time input\n");
++ exit(EXIT_FAILURE);
++ }
++ }
++
+ opterr = 0;
+ optind = 0;
+
+@@ -2253,7 +2265,7 @@
+ _process_initial_registrations();
+
+ for (;;) {
+- if (_idle_since) {
++ if (_idle_since || _exit_now) {
+ if (_exit_now) {
+ if (_exit_now == DM_SCHEDULED_EXIT)
+ break; /* Only prints shutdown message */
+@@ -2262,7 +2274,7 @@
+ (long) (time(NULL) - _idle_since));
+ break;
+ }
+- if (idle_exit_timeout) {
++ if (idle_exit_timeout && idle_exit_timeout > 0) {
+ now = time(NULL);
+ if (now < _idle_since)
+ _idle_since = now; /* clock change? */
+diff -Nuar LVM2.2.02.184.orig/man/dmeventd.8_main LVM2.2.02.184/man/dmeventd.8_main
+--- LVM2.2.02.184.orig/man/dmeventd.8_main 2019-03-22 03:15:00.000000000 -0700
++++ LVM2.2.02.184/man/dmeventd.8_main 2019-04-17 00:17:46.076023638 -0700
+@@ -143,6 +143,10 @@
+ Variable is set by thin plugin to prohibit recursive interation
+ with dmeventd by any executed lvm2 command from
+ a thin_command environment.
++.TP
++.B DMEVENTD_IDLE_EXIT_TIMEOUT
++Configure the dmeventd idle exit timeout behavior, value in seconds. Default
++is 3600 (1 hour). -1 means do not exit.
+ .
+ .SH SEE ALSO
+ .
diff --git a/sys-fs/lvm2/files/lvmpolld.initd-2.02.183 b/sys-fs/lvm2/files/lvmpolld.initd-2.02.183
new file mode 100644
index 000000000000..6b260109a668
--- /dev/null
+++ b/sys-fs/lvm2/files/lvmpolld.initd-2.02.183
@@ -0,0 +1,17 @@
+#!/sbin/openrc-run
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+pidfile="/run/lvmpolld.pid"
+command="/sbin/lvmpolld"
+command_args="${LVMPOLLD_OPTS:=-p ${pidfile}}"
+start_stop_daemon_args="--pidfile ${pidfile}"
+
+depend() {
+ :
+}
+
+start_pre()
+{
+ checkpath --directory /run/lvm || return 1
+}
diff --git a/sys-fs/lvm2/lvm2-2.02.183.ebuild b/sys-fs/lvm2/lvm2-2.02.183.ebuild
index 6da7f66176f9..eab4e163331f 100644
--- a/sys-fs/lvm2/lvm2-2.02.183.ebuild
+++ b/sys-fs/lvm2/lvm2-2.02.183.ebuild
@@ -11,7 +11,7 @@ SRC_URI="ftp://sourceware.org/pub/lvm2/${PN/lvm/LVM}.${PV}.tgz
LICENSE="GPL-2"
SLOT="0"
-KEYWORDS="~alpha amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc x86 ~amd64-linux ~x86-linux"
+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 )"
diff --git a/sys-fs/lvm2/lvm2-2.02.184-r1.ebuild b/sys-fs/lvm2/lvm2-2.02.184-r1.ebuild
new file mode 100644
index 000000000000..dcbcd854bf32
--- /dev/null
+++ b/sys-fs/lvm2/lvm2-2.02.184-r1.ebuild
@@ -0,0 +1,262 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit autotools linux-info multilib systemd toolchain-funcs udev flag-o-matic
+
+DESCRIPTION="User-land utilities for LVM2 (device-mapper) software"
+HOMEPAGE="https://sourceware.org/lvm2/"
+SRC_URI="ftp://sourceware.org/pub/lvm2/${PN/lvm/LVM}.${PV}.tgz
+ ftp://sourceware.org/pub/lvm2/old/${PN/lvm/LVM}.${PV}.tgz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~x86-linux"
+IUSE="readline static static-libs systemd lvm2create_initrd sanlock selinux +udev +thin device-mapper-only"
+REQUIRED_USE="device-mapper-only? ( !lvm2create_initrd !sanlock !thin )
+ systemd? ( udev )"
+
+DEPEND_COMMON="
+ dev-libs/libaio[static-libs?]
+ static? ( dev-libs/libaio[static-libs] )
+ !static? ( dev-libs/libaio[static-libs?] )
+ readline? ( sys-libs/readline:0= )
+ sanlock? ( sys-cluster/sanlock )
+ systemd? ( >=sys-apps/systemd-205:0= )
+ udev? ( >=virtual/libudev-208:=[static-libs?] )"
+# /run is now required for locking during early boot. /var cannot be assumed to
+# be available -- thus, pull in recent enough baselayout for /run.
+# This version of LVM is incompatible with cryptsetup <1.1.2.
+RDEPEND="${DEPEND_COMMON}
+ >=sys-apps/baselayout-2.2
+ !<sys-apps/openrc-0.11
+ !<sys-fs/cryptsetup-1.1.2
+ !!sys-fs/lvm-user
+ >=sys-apps/util-linux-2.16
+ lvm2create_initrd? ( sys-apps/makedev )
+ thin? ( >=sys-block/thin-provisioning-tools-0.3.0 )"
+# note: thin- 0.3.0 is required to avoid --disable-thin_check_needs_check
+# USE 'static' currently only works with eudev, bug 520450
+DEPEND="${DEPEND_COMMON}
+ virtual/pkgconfig
+ >=sys-devel/binutils-2.20.1-r1
+ sys-devel/autoconf-archive
+ static? (
+ selinux? ( sys-libs/libselinux[static-libs] )
+ udev? ( >=sys-fs/eudev-3.1.2[static-libs] )
+ >=sys-apps/util-linux-2.16[static-libs]
+ )"
+
+S=${WORKDIR}/${PN/lvm/LVM}.${PV}
+
+PATCHES=(
+ # Gentoo specific modification(s):
+ "${FILESDIR}"/${PN}-2.02.178-example.conf.in.patch
+
+ # For upstream -- review and forward:
+ "${FILESDIR}"/${PN}-2.02.63-always-make-static-libdm.patch
+ "${FILESDIR}"/${PN}-2.02.56-lvm2create_initrd.patch
+ "${FILESDIR}"/${PN}-2.02.67-createinitrd.patch #301331
+ "${FILESDIR}"/${PN}-2.02.99-locale-muck.patch #330373
+ "${FILESDIR}"/${PN}-2.02.178-asneeded.patch # -Wl,--as-needed
+ "${FILESDIR}"/${PN}-2.02.178-dynamic-static-ldflags.patch #332905
+ "${FILESDIR}"/${PN}-2.02.178-static-pkgconfig-libs.patch #370217, #439414 + blkid
+ "${FILESDIR}"/${PN}-2.02.176-pthread-pkgconfig.patch #492450
+ "${FILESDIR}"/${PN}-2.02.171-static-libm.patch #617756
+ "${FILESDIR}"/${PN}-2.02.166-HPPA-no-O_DIRECT.patch #657446
+ #"${FILESDIR}"/${PN}-2.02.145-mkdev.patch #580062 # Merged upstream
+)
+
+pkg_setup() {
+ local CONFIG_CHECK="~SYSVIPC"
+
+ if use udev; then
+ local WARNING_SYSVIPC="CONFIG_SYSVIPC:\tis not set (required for udev sync)\n"
+ if linux_config_exists; then
+ local uevent_helper_path=$(linux_chkconfig_string UEVENT_HELPER_PATH)
+ if [ -n "${uevent_helper_path}" ] && [ "${uevent_helper_path}" != '""' ]; then
+ ewarn "It's recommended to set an empty value to the following kernel config option:"
+ ewarn "CONFIG_UEVENT_HELPER_PATH=${uevent_helper_path}"
+ fi
+ fi
+ fi
+
+ check_extra_config
+
+ # 1. Genkernel no longer copies /sbin/lvm blindly.
+ if use static; then
+ elog "Warning, we no longer overwrite /sbin/lvm and /sbin/dmsetup with"
+ elog "their static versions. If you need the static binaries,"
+ elog "you must append .static to the filename!"
+ fi
+}
+
+src_prepare() {
+ default
+
+ sed -i \
+ -e "1iAR = $(tc-getAR)" \
+ -e "s:CC ?= @CC@:CC = $(tc-getCC):" \
+ make.tmpl.in || die #444082
+
+ sed -i -e '/FLAG/s:-O2::' configure{.ac,} || die #480212
+
+ if use udev && ! use device-mapper-only; then
+ sed -i -e '/use_lvmetad =/s:0:1:' conf/example.conf.in || die #514196
+ elog "Notice that \"use_lvmetad\" setting is enabled with USE=\"udev\" in"
+ elog "/etc/lvm/lvm.conf, which will require restart of udev, lvm, and lvmetad"
+ elog "if it was previously disabled."
+ fi
+
+ sed -i -e "s:/usr/bin/true:$(type -P true):" scripts/blk_availability_systemd_red_hat.service.in || die #517514
+
+ # Without thin-privision-tools, there is nothing to install for target install_man7:
+ if ! use thin ; then
+ sed -i -e '/^install_lvm2/s:install_man7::' man/Makefile.in || die
+ fi
+
+ eautoreconf
+}
+
+src_configure() {
+ filter-flags -flto
+ local myeconfargs=()
+
+ # Most of this package does weird stuff.
+ # The build options are tristate, and --without is NOT supported
+ # options: 'none', 'internal', 'shared'
+ myeconfargs+=(
+ $(use_enable !device-mapper-only dmfilemapd)
+ $(use_enable !device-mapper-only dmeventd)
+ $(use_enable !device-mapper-only cmdlib)
+ $(use_enable !device-mapper-only applib)
+ $(use_enable !device-mapper-only fsadm)
+ $(use_enable !device-mapper-only lvmetad)
+ $(use_enable !device-mapper-only lvmpolld)
+ $(usex device-mapper-only --disable-udev-systemd-background-jobs '')
+
+ # This only causes the .static versions to become available
+ $(usex static --enable-static_link '')
+
+ # dmeventd requires mirrors to be internal, and snapshot available
+ # so we cannot disable them
+ --with-mirrors="$(usex device-mapper-only none internal)"
+ --with-snapshots="$(usex device-mapper-only none internal)"
+
+ # disable O_DIRECT support on hppa, breaks pv detection (#99532)
+ $(usex hppa --disable-o_direct '')
+ )
+
+ if use thin; then
+ myeconfargs+=( --with-thin=internal --with-cache=internal )
+ local texec
+ for texec in check dump repair restore; do
+ myeconfargs+=( --with-thin-${texec}="${EPREFIX}"/sbin/thin_${texec} )
+ myeconfargs+=( --with-cache-${texec}="${EPREFIX}"/sbin/cache_${texec} )
+ done
+ else
+ myeconfargs+=( --with-thin=none --with-cache=none )
+ fi
+
+ myeconfargs+=( --with-clvmd=none --with-cluster=none )
+
+ myeconfargs+=(
+ $(use_enable readline)
+ $(use_enable selinux)
+ --enable-pkgconfig
+ --with-confdir="${EPREFIX}"/etc
+ --exec-prefix="${EPREFIX}"
+ --sbindir="${EPREFIX}/sbin"
+ --with-staticdir="${EPREFIX}"/sbin
+ --libdir="${EPREFIX}/$(get_libdir)"
+ --with-usrlibdir="${EPREFIX}/usr/$(get_libdir)"
+ --with-default-dm-run-dir=/run
+ --with-default-run-dir=/run/lvm
+ --with-default-locking-dir=/run/lock/lvm
+ --with-default-pid-dir=/run
+ $(use_enable udev udev_rules)
+ $(use_enable udev udev_sync)
+ $(use_with udev udevdir "$(get_udevdir)"/rules.d)
+ $(use_enable sanlock lvmlockd-sanlock)
+ $(use_enable systemd udev-systemd-background-jobs)
+ $(use_enable systemd notify-dbus)
+ --with-systemdsystemunitdir="$(systemd_get_systemunitdir)"
+ CLDFLAGS="${LDFLAGS}"
+ )
+ econf "${myeconfargs[@]}"
+}
+
+src_compile() {
+ pushd include >/dev/null
+ emake
+ popd >/dev/null
+
+ if use device-mapper-only ; then
+ emake device-mapper
+ else
+ emake
+ emake CC="$(tc-getCC)" -C scripts lvm2_activation_generator_systemd_red_hat
+ fi
+}
+
+src_install() {
+ local inst INSTALL_TARGETS
+ INSTALL_TARGETS=( install install_tmpfiles_configuration )
+ # install systemd related files only when requested, bug #522430
+ use systemd && INSTALL_TARGETS+=( install_systemd_units install_systemd_generators )
+ use device-mapper-only && INSTALL_TARGETS=( install_device-mapper )
+ for inst in ${INSTALL_TARGETS[@]}; do
+ emake DESTDIR="${D}" ${inst}
+ done
+
+ newinitd "${FILESDIR}"/device-mapper.rc-2.02.105-r2 device-mapper
+ newconfd "${FILESDIR}"/device-mapper.conf-1.02.22-r3 device-mapper
+
+ if use !device-mapper-only ; then
+ newinitd "${FILESDIR}"/dmeventd.initd-2.02.67-r1 dmeventd
+ newinitd "${FILESDIR}"/lvm.rc-2.02.172 lvm
+ newconfd "${FILESDIR}"/lvm.confd-2.02.28-r2 lvm
+
+ newinitd "${FILESDIR}"/lvm-monitoring.initd-2.02.105-r2 lvm-monitoring
+ newinitd "${FILESDIR}"/lvmetad.initd-2.02.116-r3 lvmetad
+ 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"
+}
diff --git a/sys-fs/lvm2/lvm2-2.02.184-r2.ebuild b/sys-fs/lvm2/lvm2-2.02.184-r2.ebuild
new file mode 100644
index 000000000000..8ff1308f5846
--- /dev/null
+++ b/sys-fs/lvm2/lvm2-2.02.184-r2.ebuild
@@ -0,0 +1,263 @@
+# 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.183 lvm
+ newconfd "${FILESDIR}"/lvm.confd-2.02.28-r2 lvm
+
+ newinitd "${FILESDIR}"/lvm-monitoring.initd-2.02.105-r2 lvm-monitoring
+ newinitd "${FILESDIR}"/lvmetad.initd-2.02.116-r3 lvmetad
+ newinitd "${FILESDIR}"/lvmpolld.initd-2.02.183 lvmpolld
+ fi
+
+ if use sanlock; then
+ newinitd "${FILESDIR}"/lvmlockd.initd-2.02.166-r1 lvmlockd
+ fi
+
+ if use static-libs; then
+ dolib.a libdm/ioctl/libdevmapper.a
+ dolib.a libdaemon/client/libdaemonclient.a #462908
+ #gen_usr_ldscript libdevmapper.so
+ dolib.a daemons/dmeventd/libdevmapper-event.a
+ #gen_usr_ldscript libdevmapper-event.so
+ else
+ rm -f "${ED%/}"/usr/$(get_libdir)/{libdevmapper-event,liblvm2cmd,liblvm2app,libdevmapper}.a
+ fi
+
+ if use lvm2create_initrd; then
+ dosbin scripts/lvm2create_initrd/lvm2create_initrd
+ doman scripts/lvm2create_initrd/lvm2create_initrd.8
+ newdoc scripts/lvm2create_initrd/README README.lvm2create_initrd
+ fi
+
+ insinto /etc
+ doins "${FILESDIR}"/dmtab
+
+ dodoc README VERSION* WHATS_NEW WHATS_NEW_DM doc/*.{c,txt} conf/*.conf
+}
+
+pkg_postinst() {
+ ewarn "Make sure the \"lvm\" init script is in the runlevels:"
+ ewarn "# rc-update add lvm boot"
+ ewarn
+ ewarn "Make sure to enable lvmetad in /etc/lvm/lvm.conf if you want"
+ ewarn "to enable lvm autoactivation and metadata caching."
+}
+
+src_test() {
+ einfo "Tests are disabled because of device-node mucking, if you want to"
+ einfo "run tests, compile the package and see ${S}/tests"
+}
diff --git a/sys-fs/lvm2/lvm2-2.02.184.ebuild b/sys-fs/lvm2/lvm2-2.02.184.ebuild
new file mode 100644
index 000000000000..19b3acffaf85
--- /dev/null
+++ b/sys-fs/lvm2/lvm2-2.02.184.ebuild
@@ -0,0 +1,258 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit autotools linux-info multilib systemd toolchain-funcs udev flag-o-matic
+
+DESCRIPTION="User-land utilities for LVM2 (device-mapper) software"
+HOMEPAGE="https://sourceware.org/lvm2/"
+SRC_URI="ftp://sourceware.org/pub/lvm2/${PN/lvm/LVM}.${PV}.tgz
+ ftp://sourceware.org/pub/lvm2/old/${PN/lvm/LVM}.${PV}.tgz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~x86-linux"
+IUSE="readline static static-libs systemd lvm2create_initrd sanlock selinux +udev +thin device-mapper-only"
+REQUIRED_USE="device-mapper-only? ( !lvm2create_initrd !sanlock !thin )
+ systemd? ( udev )"
+
+DEPEND_COMMON="
+ dev-libs/libaio[static-libs?]
+ static? ( dev-libs/libaio[static-libs] )
+ !static? ( dev-libs/libaio[static-libs?] )
+ readline? ( sys-libs/readline:0= )
+ sanlock? ( sys-cluster/sanlock )
+ systemd? ( >=sys-apps/systemd-205:0= )
+ udev? ( >=virtual/libudev-208:=[static-libs?] )"
+# /run is now required for locking during early boot. /var cannot be assumed to
+# be available -- thus, pull in recent enough baselayout for /run.
+# This version of LVM is incompatible with cryptsetup <1.1.2.
+RDEPEND="${DEPEND_COMMON}
+ >=sys-apps/baselayout-2.2
+ !<sys-apps/openrc-0.11
+ !<sys-fs/cryptsetup-1.1.2
+ !!sys-fs/lvm-user
+ >=sys-apps/util-linux-2.16
+ lvm2create_initrd? ( sys-apps/makedev )
+ thin? ( >=sys-block/thin-provisioning-tools-0.3.0 )"
+# note: thin- 0.3.0 is required to avoid --disable-thin_check_needs_check
+# USE 'static' currently only works with eudev, bug 520450
+DEPEND="${DEPEND_COMMON}
+ virtual/pkgconfig
+ >=sys-devel/binutils-2.20.1-r1
+ sys-devel/autoconf-archive
+ static? (
+ selinux? ( sys-libs/libselinux[static-libs] )
+ udev? ( >=sys-fs/eudev-3.1.2[static-libs] )
+ >=sys-apps/util-linux-2.16[static-libs]
+ )"
+
+S=${WORKDIR}/${PN/lvm/LVM}.${PV}
+
+PATCHES=(
+ # Gentoo specific modification(s):
+ "${FILESDIR}"/${PN}-2.02.178-example.conf.in.patch
+
+ # For upstream -- review and forward:
+ "${FILESDIR}"/${PN}-2.02.63-always-make-static-libdm.patch
+ "${FILESDIR}"/${PN}-2.02.56-lvm2create_initrd.patch
+ "${FILESDIR}"/${PN}-2.02.67-createinitrd.patch #301331
+ "${FILESDIR}"/${PN}-2.02.99-locale-muck.patch #330373
+ "${FILESDIR}"/${PN}-2.02.178-asneeded.patch # -Wl,--as-needed
+ "${FILESDIR}"/${PN}-2.02.178-dynamic-static-ldflags.patch #332905
+ "${FILESDIR}"/${PN}-2.02.178-static-pkgconfig-libs.patch #370217, #439414 + blkid
+ "${FILESDIR}"/${PN}-2.02.176-pthread-pkgconfig.patch #492450
+ "${FILESDIR}"/${PN}-2.02.171-static-libm.patch #617756
+ "${FILESDIR}"/${PN}-2.02.166-HPPA-no-O_DIRECT.patch #657446
+ #"${FILESDIR}"/${PN}-2.02.145-mkdev.patch #580062 # Merged upstream
+)
+
+pkg_setup() {
+ local CONFIG_CHECK="~SYSVIPC"
+
+ if use udev; then
+ local WARNING_SYSVIPC="CONFIG_SYSVIPC:\tis not set (required for udev sync)\n"
+ if linux_config_exists; then
+ local uevent_helper_path=$(linux_chkconfig_string UEVENT_HELPER_PATH)
+ if [ -n "${uevent_helper_path}" ] && [ "${uevent_helper_path}" != '""' ]; then
+ ewarn "It's recommended to set an empty value to the following kernel config option:"
+ ewarn "CONFIG_UEVENT_HELPER_PATH=${uevent_helper_path}"
+ fi
+ fi
+ fi
+
+ check_extra_config
+
+ # 1. Genkernel no longer copies /sbin/lvm blindly.
+ if use static; then
+ elog "Warning, we no longer overwrite /sbin/lvm and /sbin/dmsetup with"
+ elog "their static versions. If you need the static binaries,"
+ elog "you must append .static to the filename!"
+ fi
+}
+
+src_prepare() {
+ default
+
+ sed -i \
+ -e "1iAR = $(tc-getAR)" \
+ -e "s:CC ?= @CC@:CC = $(tc-getCC):" \
+ make.tmpl.in || die #444082
+
+ sed -i -e '/FLAG/s:-O2::' configure{.ac,} || die #480212
+
+ if use udev && ! use device-mapper-only; then
+ sed -i -e '/use_lvmetad =/s:0:1:' conf/example.conf.in || die #514196
+ elog "Notice that \"use_lvmetad\" setting is enabled with USE=\"udev\" in"
+ elog "/etc/lvm/lvm.conf, which will require restart of udev, lvm, and lvmetad"
+ elog "if it was previously disabled."
+ fi
+
+ sed -i -e "s:/usr/bin/true:$(type -P true):" scripts/blk_availability_systemd_red_hat.service.in || die #517514
+
+ # Without thin-privision-tools, there is nothing to install for target install_man7:
+ if ! use thin ; then
+ sed -i -e '/^install_lvm2/s:install_man7::' man/Makefile.in || die
+ fi
+
+ eautoreconf
+}
+
+src_configure() {
+ filter-flags -flto
+ local myeconfargs=()
+
+ # Most of this package does weird stuff.
+ # The build options are tristate, and --without is NOT supported
+ # options: 'none', 'internal', 'shared'
+ myeconfargs+=(
+ $(use_enable !device-mapper-only dmeventd)
+ $(use_enable !device-mapper-only cmdlib)
+ $(use_enable !device-mapper-only applib)
+ $(use_enable !device-mapper-only fsadm)
+ $(use_enable !device-mapper-only lvmetad)
+ $(usex device-mapper-only --disable-udev-systemd-background-jobs '')
+
+ # This only causes the .static versions to become available
+ $(usex static --enable-static_link '')
+
+ # dmeventd requires mirrors to be internal, and snapshot available
+ # so we cannot disable them
+ --with-mirrors="$(usex device-mapper-only none internal)"
+ --with-snapshots="$(usex device-mapper-only none internal)"
+
+ # disable O_DIRECT support on hppa, breaks pv detection (#99532)
+ $(usex hppa --disable-o_direct '')
+ )
+
+ if use thin; then
+ myeconfargs+=( --with-thin=internal --with-cache=internal )
+ local texec
+ for texec in check dump repair restore; do
+ myeconfargs+=( --with-thin-${texec}="${EPREFIX}"/sbin/thin_${texec} )
+ myeconfargs+=( --with-cache-${texec}="${EPREFIX}"/sbin/cache_${texec} )
+ done
+ else
+ myeconfargs+=( --with-thin=none --with-cache=none )
+ fi
+
+ myeconfargs+=( --with-clvmd=none --with-cluster=none )
+
+ myeconfargs+=(
+ $(use_enable readline)
+ $(use_enable selinux)
+ --enable-pkgconfig
+ --with-confdir="${EPREFIX}"/etc
+ --exec-prefix="${EPREFIX}"
+ --sbindir="${EPREFIX}/sbin"
+ --with-staticdir="${EPREFIX}"/sbin
+ --libdir="${EPREFIX}/$(get_libdir)"
+ --with-usrlibdir="${EPREFIX}/usr/$(get_libdir)"
+ --with-default-dm-run-dir=/run
+ --with-default-run-dir=/run/lvm
+ --with-default-locking-dir=/run/lock/lvm
+ --with-default-pid-dir=/run
+ $(use_enable udev udev_rules)
+ $(use_enable udev udev_sync)
+ $(use_with udev udevdir "$(get_udevdir)"/rules.d)
+ $(use_enable sanlock lvmlockd-sanlock)
+ $(use_enable systemd udev-systemd-background-jobs)
+ --with-systemdsystemunitdir="$(systemd_get_systemunitdir)"
+ CLDFLAGS="${LDFLAGS}"
+ )
+ econf "${myeconfargs[@]}"
+}
+
+src_compile() {
+ pushd include >/dev/null
+ emake
+ popd >/dev/null
+
+ if use device-mapper-only ; then
+ emake device-mapper
+ else
+ emake
+ emake CC="$(tc-getCC)" -C scripts lvm2_activation_generator_systemd_red_hat
+ fi
+}
+
+src_install() {
+ local inst INSTALL_TARGETS
+ INSTALL_TARGETS=( install install_tmpfiles_configuration )
+ # install systemd related files only when requested, bug #522430
+ use systemd && INSTALL_TARGETS+=( install_systemd_units install_systemd_generators )
+ use device-mapper-only && INSTALL_TARGETS=( install_device-mapper )
+ for inst in ${INSTALL_TARGETS[@]}; do
+ emake DESTDIR="${D}" ${inst}
+ done
+
+ newinitd "${FILESDIR}"/device-mapper.rc-2.02.105-r2 device-mapper
+ newconfd "${FILESDIR}"/device-mapper.conf-1.02.22-r3 device-mapper
+
+ if use !device-mapper-only ; then
+ newinitd "${FILESDIR}"/dmeventd.initd-2.02.67-r1 dmeventd
+ newinitd "${FILESDIR}"/lvm.rc-2.02.172 lvm
+ newconfd "${FILESDIR}"/lvm.confd-2.02.28-r2 lvm
+
+ newinitd "${FILESDIR}"/lvm-monitoring.initd-2.02.105-r2 lvm-monitoring
+ newinitd "${FILESDIR}"/lvmetad.initd-2.02.116-r3 lvmetad
+ fi
+
+ if use sanlock; then
+ newinitd "${FILESDIR}"/lvmlockd.initd-2.02.166-r1 lvmlockd
+ fi
+
+ if use static-libs; then
+ dolib.a libdm/ioctl/libdevmapper.a
+ dolib.a libdaemon/client/libdaemonclient.a #462908
+ #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"
+}