Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 549506 | Differences between
and this patch

Collapse All | Expand All

(-)a/sys-fs/lvm2/Manifest (+30 lines)
Line 0 Link Here
1
AUX clvmd.confd-2.02.39 213 SHA256 68442d5c9da81bad79fa6b1beaede290f24ea6a4e4415f3d9f4e37ccca6c524a SHA512 9614c4188c9a5bcf398d1f521b52d7e2281fcdf76265fdaca4acda22be282d8468e82b54a2661d5753f4b9a442ebe93a60daf87c846db4e275a283f71c9fd8e2 WHIRLPOOL b429d06a5200d37f46e72190060bc2fe866575ba441b5f92d12d939bdc5d411ef37e895a7369bbaaf733b1a0d0305a05d499c7ae6c7360fe8767e902d2a3bfc4
2
AUX clvmd.rc-2.02.39 3684 SHA256 476289b24539eeff4ff94c34c129da755d8cff11f1e950b40f9fad212ca5c05d SHA512 18879fa7925d6181b9ebfd7a6379ee4f25c9c83474ba69684e63811867754b1c52dd6568324aafd9fe391fd2fd4aadf931870cefc21b72d2f81f9e04ef123f41 WHIRLPOOL 095a313a6c66f0dec1d42233dd1853879ade6334c474ac747c2cd87c24b433381547a6fdecedf784db060549ece8dc24870d4981bcf590bf39e57dd7bad92120
3
AUX device-mapper.conf-1.02.22-r3 15 SHA256 57777904f12a35617e5a4193c964ebb32396452487fd02353e71e16e7b46bc22 SHA512 1846e0ca1be7170d4c0beb694a23aea4d19b24b99a248bb0f4e034286a6beede0a8efc474b0c237e33ee72c86c93b6238f2d5ea23e224765acba99c90633261e WHIRLPOOL a0de185e849cd4d1aab9f145a6330f267ca547ba4ec7720be6f33e2c3c4c182b8674ea220b894f0fc806fe6637ba7bcabd739ca57b53b3efa5fad0cf1e57ba2e
4
AUX device-mapper.rc-2.02.105-r2 3828 SHA256 036b6de05e6cbd921a667d6fc6b01d30c8f9b720e1a0d0e2453ecd62d32573fb SHA512 aa5c73a91a85069782384ab9ecec299d9f036ed8c069ebef66bbedfa9d9ce7c63baa70692148cf4f1b06d6b4e53fc1916ae576ecc005323154a25a686bef33fd WHIRLPOOL bebba4faf498d400c68b8e79a64c90f0b71a3df350895ea4b78efb802600f4179ec0b7507be7ca61bd7444ca8d5c8f8156112a2fa3083e51a6fe8f552db583ba
5
AUX device-mapper.rc-2.02.95-r2 2765 SHA256 e0bff689040746480e2479d1ad57adb5ab23cc0415ab9a8356503aed7a14c658 SHA512 f6e653c6af92debe543bcb48ee36c2bfa0f1ad08d2dfe40455cf9d3b104a1f825a295b43de2a5fa64367c6c2eadb2b36004c7cf51fd3b15191ea6be21d0c5a4f WHIRLPOOL 298548daebf413ea8739c979c23b9ea7cfbcf12437debb8ce7d570b6a8269fbcd4d7b27816734f3728e2d591ef9658a4f4bb0c43299dbf408aeac10ef87e5bf0
6
AUX dmeventd.initd-2.02.67-r1 683 SHA256 0c051388991ba69afbf2f6baf36ba227d7c26fc8f0d7588d8de76d9a74886d79 SHA512 523b54d63592c500394243632f4ed60838d04a8c386a85bb2a0fda6f756607467ec025c1490104d8c73035e37646eeea55dcafd3f05eab85e035bbedcebf0406 WHIRLPOOL 5dcf777e9c736eb4101649e5b0bbb43016c3b7ece77c1bb8afdda63b23b15a37257cdd29c05f82b0ae4f98405067c85a9a6ee8a35d98c4b5fb647ed015c11da7
7
AUX dmtab 416 SHA256 e2e22bbe13fb97ec9a68659daa275b1d22fd0a3fd21e76b1f4bfba504a8bd7b5 SHA512 392b4bd85745bc774245195a1c416ae68efbe5f7b2498f6bfc40021cd2c9f6372fd1c3d346198c7749635b5d9b3f66ba1b963a2e144b4f522d87016ab4777de2 WHIRLPOOL f48c0fda382c7d57bad2ad4a8155189735236d13f24f39b3969736c3ad54d28f92c82174cae5c6775f8bc58506f19025f2cba6433f389c84505552fc8b4d3ed4
8
AUX lvm-monitoring.initd-2.02.105-r2 1088 SHA256 d7655cadd3a3a9d3683a540413365310ca9503c38fd21a9bfccec40630ca72f1 SHA512 3c3f7ec1868e3634be3bb82689d30065dbe0fac3e2dfa22a14acb76c82b102022c280f995f82a1f7c91c905c0ba961bbb2707ddf60ad5fa9d717acdf942855d5 WHIRLPOOL 92e7eedf6add5cba645f74281912713928f694f18155db222352ba8e4a70ac89696f9db3cc2c9fc79fb9ff0f98cb176da8aedb1c5b7b47eecd4ee36360df41f0
9
AUX lvm-monitoring.initd-2.02.67-r2 1183 SHA256 b89971a4f163e1a91df2416ff442cae7209f8343e6c8612eb3174ed8f5c5c788 SHA512 e99d8e0ed2f22e8f3f1e36581ce92bc2196dbebdeb7c301070c5f2e78079804de3ac782c732929e23a3a01536a270236513c849ec1574ff4c72045b8f69c98ed WHIRLPOOL 71eb7d1203bc2b6be22ebb0eb20e3d2e0786036bea9f0beda91c517f47b99374b52ca4c7d5cd76ae6338ddab187b68a7a371a437e5501996454e125e12e998a8
10
AUX lvm.confd-2.02.28-r2 173 SHA256 28370c089c39c248d7ded0960b8d8a9256bada44d44c22ce3cec87d512ef6844 SHA512 67b153cbc5c2327c15f042b3b5590c1d8fdf9823efb19c80192ac4dcf98e530efea8ecae0aaaa4a54b0e3e4907565aa21455b364df1dbe8f2e7dffa1c5d355d0 WHIRLPOOL 06467b28ad2acf36984eef1b7b7e3d88277505760f848a808d85820cd1cccf6bb7397c00624d36961d9bdbb994e55de03444a7cfc97ecefd9bd3b785a3c6fdbf
11
AUX lvm.rc-2.02.105-r2 3071 SHA256 a5754ffa0a05a0c29a9f6b5acf1b21dd313581fd6156c1ef722dc620e0114676 SHA512 9dd321b6d76628376b324de1ff47c4a37b98d3bf406abbf1b1755e20d957a9f1d77ff2e50a99b0c77ca8200800cd6071da5ab83c2f5afb9ff97f31e75671a617 WHIRLPOOL 6ba25a5152bf6f5052481e6ad2b1dc3ea65a818d11bff49e9688f537245c471f5446d4b8d381dba69ab8ece8f16340220f4c8173be096c7cb3d7c4c7fd10cebd
12
AUX lvm.rc-2.02.95-r2 3001 SHA256 66844a70cedf61b2cd3373cdbd8f8c1afa817bde0764fdf5cf488857532d4553 SHA512 e5d34447db2fc050256222eff427703341b839a80c833c8ca2a814663b790bdffad967fa41bda8c182d5217dda629057a571520cb0a2e4cb06d5a8a241746ea3 WHIRLPOOL 102baf82bd5573ce90bdb19307ccf71026b6e03fd9e471a123f17072e0ac3785ecf017bb2cd81adf7a5332f33b42330e7c484c8804ed57d4ad6fb1cdd4c119f7
13
AUX lvm2-2.02.100-selinux_and_udev_static.patch 3223 SHA256 15c20b1e16443932c560164ad9546ab01279601b0f0dd7fdc54f9cf3cd3ffee3 SHA512 232dc2908073254e23878098734cc65449c7be0707f7f0f7e73561e7b204bf71cf75ff5ee143b0f9f301ddabac1595c59cb0ec80c665464e8fe3f1b65a3eb0c2 WHIRLPOOL fdd908aa01cc3790be4ff8e7b2180cd526065c826657924edfccdc53f5c2266a12911c1ebface9de649b1974ff77401e94a64de507b5c72415614e5726dd4a2a
14
AUX lvm2-2.02.106-pthread-pkgconfig.patch 860 SHA256 aaf04bdb140cbedebe731a04846cbb7459cdd002ee4616a3d0725136edb5ef02 SHA512 ae073936ee15fdeabde4d3948a65f6a435b82e62aa0ddadbad399b69bd5c9bfc181d5e0be1beae9f6e899a6e8b9d7c21add13f7a1606cb5ed4762ed5aa5aa223 WHIRLPOOL 9e822f0f1c7c67b5443fb9e62547a1893d8c91f91d63f03c9f4b3d9a20cd24c377f5697f2fe24028f10949550af6f2a05d95db6d5e29700dfaa05f1c3d615773
15
AUX lvm2-2.02.107-static-pkgconfig-libs.patch 3607 SHA256 b3efe76e670fd45e363c62bc8a9965eff4bb1c12e98b6eebdf3b8690de24ddca SHA512 6cd6bbe2ff2dbbe012c20043f3b31e42cacc3379838358c58891ec8ce9593ced29a14fbb9e96b9c76e1b245c5aec2e38a26d3a599c78ff18c3d920e89f1d2f72 WHIRLPOOL 4acf0777694df20886b4e6bf06c91a86041f6e4d888c49dc26f582cd6220504550f54ea5d94c220a3a16b4768933e45e901f274dfaf616083db741aab81b612b
16
AUX lvm2-2.02.108-example.conf.in.patch 1681 SHA256 c9e0b46965f68c25495e21ca9504699031ed88dbb69407a08d53569ddc88ae4c SHA512 b4e983892b7ff47e5e7617376197daa62cfd063cf398235dc4a436fd9025ec4b1e263d7418e2c2943d53be494cba4209e9d4230d54a78762b0ca526f92e9746c WHIRLPOOL 0fc73d8e6f47596fa1789118aefebf931fb217342259da838d701bdeb96f21d7de59f29ac81c3c0f4a00db711e86b9fac6b4c889cf05ffc90ad8fd5a9ef77cd1
17
AUX lvm2-2.02.108-static-pkgconfig-libs.patch 3302 SHA256 5cbdb4c4db1a77767a8cf3a89490eb0e21a2d4cc7729a8ffb099e4d0746e2775 SHA512 246f1029f9346d6bc57c2062c8a223535d0b832fa6bd86947b8b91b094dbc388706a9914f9ca0531666f77e73544612e2819335435b7576b4e91cdb1b0e4f041 WHIRLPOOL 53e723bdcfe07f668abf6fe9e6093ae38d81b01bd10ade0b40a037d44c367a6945ed86d14d70c2af8af6e7063763fd3620591b5c7384bd255b98cceb7ee192f3
18
AUX lvm2-2.02.56-lvm2create_initrd.patch 2032 SHA256 b892d0544e05350e78ea400c16e6fd3657671d9bdf50bfae70505fd79bdda081 SHA512 b2a1705fa6b962027ebc5047583547489afe8ef8d8977c6284a28d0a8b0e05e20e6c48bd6c02a8bb02de9cfb40ac2d6e2a4b8ed8ef8c4ae7b6ea9a29bc4194de WHIRLPOOL cb533df528be0aae4bf50966285ef7a238f810d955ee86d5b446f43944d093732eff6ef8178d1654c4a2c075049ffc11994a99de6291bab1140cb8812be8b8a0
19
AUX lvm2-2.02.63-always-make-static-libdm.patch 1420 SHA256 1c498b5efce77ed16bbbfcd9e0ec6da404a9c70c7ad0959ed7b60733adfcfc21 SHA512 67735af9e51369d5b3b400cab4f9ffa25f8dea1c1ec3d01855cb3c5aeade5c39a35eeed43f3a665204fe6bbba4ca43baecd845330bf26d023064b94ca3d1317c WHIRLPOOL f273c893acedfd658e7947abb5f4b528f15de9808ae3862ec8a9189ba7de4ea6998dc67dbc7af642ca3a27bba2ef8eabfd48337f532145f88500988f564313b1
20
AUX lvm2-2.02.67-createinitrd.patch 660 SHA256 d59f5642fff9d9575227bfd0b3d103d928a6f7b08b417d6c458704171f11da39 SHA512 17fbba5d34ece5c1c25ef35fa3bbc3d6fcd20b44bd766c049bbc120853a8d60c9544db5790645a7814db5c272fd12d383699a8a9be6f4e9c56a7c0a1bb29ade2 WHIRLPOOL b358a31a9ee669a4fccf42280da5342c214932bfd83deee92d41351eb37dc6c0b2e5dc7419f2304128b5d285fed92db5b2e1634a71bbf1310d36b54d1a353bb0
21
AUX lvm2-2.02.70-asneeded.patch 326 SHA256 b0f84dadc213a9daaa97ae7815f624f0bcdc883d627659c7fcf8b7131538b43e SHA512 e38d8ef5d13c8861f7d1ca5c16271b3da138e8747ba01442de3f55aab45265fdaf42513e596f5af1d024fa2cf0c959bd3e47da52bbe8b13c75e665dd95f81279 WHIRLPOOL 77143f2dafeca221f8b3cda4df1669111de44a4ae4916d9aa2228aa76d94b4d1c556cf90a6f90cae2f1938f7474fb678ec6eab1b4e57f7fd20eab473de667cda
22
AUX lvm2-2.02.92-dynamic-static-ldflags.patch 3031 SHA256 90b880572186d4d1abf049d39e5f11e4cfedb3707c29eeb9740ceccdb3b62468 SHA512 edb78081d12bebaccd31c2474cb531563b729f1ad966afaff7892556177ee7a68217cc699c65383318066139ba62183adc8334f46f8f8933d62b6b5dcd11a023 WHIRLPOOL 6880a29dfb6747f167c41506e1472c0d48ef7af3a545238c733949f85f3f8f36110fb6908c6f626260f7ed975e56a4e8ccf42ece4d758fa3570154cbe970f2a3
23
AUX lvm2-2.02.99-example.conf.in.patch 1489 SHA256 55273a2bc6df33057f4efdd947b75f0282a7993acd5e57f0019f8ca57ca7df38 SHA512 0c92a0e454505219653500d4fb2ee57626bb30375782be941bda17d7b841cb05eeebb87bfc4f7aa397b26fb4908bcbd0f69d2c07e63bf4f070756a1894851869 WHIRLPOOL 3f6c94dd63fcf5e2d1406aa074aee27997fa6d58da3db9d22281b3080ec36277bc5225c3b62f042b38f5d0870fb1e3e19433f218f01e03323c7ad1210d45d4b3
24
AUX lvm2-2.02.99-locale-muck.patch 395 SHA256 14e7c65fd9aa71b7f09cc1aecfaccb3048dbb09dd4eb4c342556708aa6adba77 SHA512 4014abbaeb1106dbaa360e2573340651adc0cccc6c0c05cc57695e74e7a3d0b5a73e2b72242bab0d0a10c2506a7c30c2a4de0275c0f81a14dfb068ec91492497 WHIRLPOOL 3383e94ca4dbaefd2c628d3a95b17a14602481c98425caf48f490185289eb3f1af2ef234ff5b5c431ea4624edd8e48764252bdf5b7159ab3bbbad699c3f936ab
25
AUX lvm2-fix-stdio-usage.patch 3666 SHA256 79c5379cbf660f8dabd45359463c77a40b5a83153b54c67ce36049260dac9071 SHA512 c4d55b366a60926baadf431dd382012eb808490c0bb514e01503d526cfd7ae573efa2d60a92bd5f6f451b54b11fb5cf827f45cec35cfcdee6aa291674cc776dd WHIRLPOOL 48be6a1205c2293fda51bb8b103db0eebe4b28794a6983c910e5761bb50712da4552eb339a485258f0f79032e10aa7589f65411de282f83ab910881c52a356ed
26
AUX lvm2-musl-fixes.patch 1537 SHA256 6516f64faeccaf87641f7c29823344baea0f3af9ac14701e98fa768cbccb703d SHA512 87bd64a0c7525cbf5d49f1fbdd4a86f23bade065362580a1f2ef3b73b5e76e865e620800c922aa6819ace78daf3d4e2ce96b7990c63dcdbf504d03e636d26c00 WHIRLPOOL 9aeabec1f8b0e3487cad583e359c729b5c45ecbc426b48c19260d1f3a8e377fe5e8f09297d893dc2588b9ee11537148558a372c029ac84c02282011cc07440fe
27
AUX lvmetad.initd-2.02.105-r2 405 SHA256 60accb4b6114753232f2db0adf3fc3f46d4459bfedf79b888801a13c55d79fa9 SHA512 d9c6f6c68a83b8f391ded7ebe900009a61ff06e92eb68ccb3dcdc8f41e61bbcdf47246e523ea8cfd6e71790376b316b219d4afaf66cf11477e2b54d526b74998 WHIRLPOOL d959d8c8b5f4ef84c26f8e585fe1761ef9bfd37f590e783e937679a863982e7cc4a4e320c3e2e3bd635dbd3486c15baf7c24e1a21325521f4320e643a57fb0e7
28
DIST LVM2.2.02.110.tgz 1487448 SHA256 3dad1aa04a71b8420b15f44c53f041001436539d3f8073490c2d0c52f6fecd11 SHA512 5b4dfa5ed877d34efa5b109dc712e8fa9154b4954b267b0243f1925f9d2fa8c67f4ce8da36a85f3bba6c117f6153fdbf150e3753587ab90584a86d2654dc0812 WHIRLPOOL ea221ed3e9d3f79009d7c341a7a75b52eacc5be79e28f2498e7cdc0f4a97c2bebff405b032eb8086d3b5b5aaf79da2f281c5734562355bddbe6004058e114ced
29
EBUILD lvm2-2.02.110-r99.ebuild 9477 SHA256 0005f0d2e3c85c7d00648fd7c56526564fc6cabcfd17fbfe495035a2de0024cf SHA512 e170af6ee4b8b9b1ac31ae67abe04736e36d1e0550f4f4689665fa895b77879d5ec23621e9afdc3c9e74d3ac691ca999968f2379744694c8ada021d67bae935c WHIRLPOOL 58549bf7414360770fff8050ce777c1af382333be2700f8206eb9bec0a413750579d7815c7e8bd15cc0306106eb17105d5230c4423ee6a413d6beb7aaeddeaaf
30
MISC metadata.xml 995 SHA256 a2be36b695dab8ef65772af8d808cdc7a5c5855e2c9104060e7232e21b984216 SHA512 642abe2a196ffeaf3a67530befa8dc123f1e3e1238bf55d38c0affea82ab5b2f9e56da6b303410845c625494a59323ac8570f40e0f8a406db76295059958361a WHIRLPOOL cba3a6dd12fafc4719050082ee740d03ef0ed68e074b556a0c1f15f4a7b328d9b826d2b7ab3d3f19546de92e907a3fd466792db67423cb8630d5313154d5b6f2
(-)a/sys-fs/lvm2/files/clvmd.confd-2.02.39 (+9 lines)
Line 0 Link Here
1
# CLVMD_CLUSTER_TIMEOUT -- amount of time to wait for cluster quorum.
2
3
CLVMD_CLUSTER_TIMEOUT=30
4
5
6
# CLVMD_NODES_TIMEOUT -- amount of time to wait for the other nodes to
7
# join the cluster.
8
9
CLVMD_NODES_TIMEOUT=60
(-)a/sys-fs/lvm2/files/clvmd.rc-2.02.39 (+146 lines)
Line 0 Link Here
1
#!/sbin/runscript
2
# Copyright 1999-2013 Gentoo Foundation
3
# Distributed under the terms of the GNU General Public License v2
4
# $Header: /var/cvsroot/gentoo-x86/sys-fs/lvm2/files/clvmd.rc-2.02.39,v 1.3 2013/04/09 11:00:26 ssuominen Exp $
5
6
[ -x /usr/sbin/clvmd ] && CLVMD_BIN="/usr/sbin/clvmd" || CLVMD_BIN="/sbin/clvmd"
7
8
[ -z "$CLVMD_CLUSTER_TIMEOUT" ] && CLVMD_CLUSTER_TIMEOUT=30
9
[ -n "$CLVMD_NODES_TIMEOUT" ] || CLVMD_NODES_TIMEOUT=60
10
11
VGCHANGE="/sbin/vgchange"
12
VGSCAN="/sbin/vgscan"
13
VGDISPLAY="/sbin/vgdisplay"
14
CLVMD_PIDFILE="/var/run/clvmd.pid"
15
16
depend() {
17
	use net dns logger dmeventd
18
	need cman
19
}
20
21
load_modules() {
22
	local module modules
23
	modules=$1
24
	
25
	for module in ${modules}; do
26
		ebegin "Loading ${module} kernel module"
27
		modprobe ${module}
28
		eend $? "Failed to load ${module} kernel module"
29
	done
30
}
31
32
unload_modules() {
33
	local module modules
34
	modules=$1
35
	
36
	for module in ${modules}; do
37
		ebegin "Unloading ${module} kernel module"
38
		modprobe -r ${module}
39
		eend $? "Failed to unload ${module} kernel module"
40
	done
41
}
42
43
umount_gfs_filesystems() {
44
	local sig retry
45
	local remaining="$(awk '$3 == "gfs" { print $2 }' /proc/mounts | sort -r)"
46
47
	if [ -n "${remaining}" ]
48
	then
49
	        sig=
50
	        retry=3
51
	        while [ -n "${remaining}" -a "${retry}" -gt 0 ]
52
	        do
53
	                if [ "${retry}" -lt 3 ]
54
			then
55
	                        ebegin "Unmounting GFS filesystems (retry)"
56
	                        umount ${remaining} &>/dev/null
57
	                        eend $? "Failed to unmount GFS filesystems this retry"
58
	                else
59
	                        ebegin "Unmounting GFS filesystems"
60
	                        umount ${remaining} &>/dev/null
61
	                        eend $? "Failed to unmount GFS filesystems"
62
	                fi
63
	                remaining="$(awk '$3 == "gfs" { print $2 }' /proc/mounts | sort -r)"
64
	                [ -z "${remaining}" ] && break
65
	                /bin/fuser -k -m ${sig} ${remaining} &>/dev/null
66
	                sleep 5
67
	                retry=$((${retry} -1))
68
	                sig=-9
69
	        done
70
	fi
71
}
72
73
74
start_volumes() {
75
	ebegin "Scanning LVM volumes"
76
	$VGSCAN > /dev/null 2>&1
77
	eend $?
78
79
	ret=$?
80
	if [ "$ret" -eq 5 ]
81
	then
82
		einfo "  Waiting for other nodes to join the cluster ($CLVMD_NODES_TIMEOUT seconds)"
83
	fi
84
85
	clustervgs=`$VGDISPLAY 2> /dev/null | awk 'BEGIN {RS="VG Name"} {if (/Clustered/) print $1;}'`
86
	for vg in $clustervgs; do
87
		ebegin "  Activating Clustered VG: ${vg} "
88
89
		wait=0
90
		while [ -n "$($VGCHANGE -a y ${vg} 2>&1 |grep "clvmd not running")" ]; do
91
			if [ $wait -lt $CLVMD_NODES_TIMEOUT ]; then
92
				sleep 3
93
				wait=$(($wait + 3))
94
			else
95
				eend 1
96
			fi
97
		done
98
		eend 0
99
	done
100
}
101
102
stop_volumes() {
103
	# Deactivate only clustered volumes
104
	clustervgs=`$VGDISPLAY 2> /dev/null | awk 'BEGIN {RS="VG Name"} {if (/Clustered/) print $1;}'`
105
	for vg in $clustervgs; do
106
		ebegin "  Shutting Down Clustered VG: ${vg} "
107
		$VGCHANGE -anl ${vg} >/dev/null
108
		eend $?
109
	done
110
}
111
112
113
start() {
114
	local module=$(awk '$1 == "dm_mod" { print $1 }' /proc/{modules,devices})
115
116
	if [ -z "${module}" ]; then
117
		load_modules "dm-mod"
118
		sleep 1s
119
	fi
120
121
	ebegin "Starting clvmd ($CLVMD_CLUSTER_TIMEOUT seconds)"
122
123
	start-stop-daemon --start --quiet --exec ${CLVMD_BIN} -- -T ${CLVMD_CLUSTER_TIMEOUT}
124
	eend $?
125
126
	start_volumes
127
}
128
129
stop() {
130
131
	# umount GFS filesystems
132
	umount_gfs_filesystems
133
134
	#stop_volumes
135
136
	ebegin "Stopping clvmd"
137
	#start-stop-daemon --stop -s TERM --quiet --exec ${CLVMD_BIN} --name clvmd
138
	killall -TERM ${CLVMD_BIN} >/dev/null
139
	eend $?
140
141
        #local module=$(awk '$1 == "dm_mod" { print $1 }' /proc/modules)
142
143
	#if [[ "$?" -eq 0 && ! -z "${module}" ]]; then
144
        #        unload_modules "dm-mod"
145
        #fi
146
}
(-)a/sys-fs/lvm2/files/device-mapper.conf-1.02.22-r3 (+1 lines)
Line 0 Link Here
1
RC_AFTER="lvm"
(-)a/sys-fs/lvm2/files/device-mapper.rc-2.02.105-r2 (+147 lines)
Line 0 Link Here
1
#!/sbin/runscript
2
# Copyright 1999-2014 Gentoo Foundation
3
# Distributed under the terms of the GNU General Public License v2
4
# $Header: /var/cvsroot/gentoo-x86/sys-fs/lvm2/files/device-mapper.rc-2.02.105-r2,v 1.1 2014/02/02 19:52:34 robbat2 Exp $
5
6
depend() {
7
	# As of .67-r1, we call ALL lvm start/stop scripts with --sysinit, that
8
	# means dmeventd is NOT notified, as it cannot be safely running
9
	before dmeventd checkfs fsck
10
	after modules
11
}
12
13
dm_in_proc() {
14
	local retval=0
15
	for x in devices misc ; do
16
		grep -qs 'device-mapper' /proc/${x}
17
		retval=$((${retval} + $?))
18
	done
19
	return ${retval}
20
}
21
22
# char **build_dmsetup_command(volume)
23
#
24
# Returns complete dmsetup command given single volume name
25
build_dmsetup_command() {
26
	local count dmsetup_cmd
27
	
28
	# Number of lines mentioning volume name
29
	count=$(grep -v -e '^[[:space:]]*\(#\|$\)' /etc/dmtab | grep -c ${1})
30
	
31
	# If there's just one line:
32
	if [ ${count} -eq 1 ] ; then
33
		echo "echo $(grep -v -e '^[[:space:]]*\(#\|$\)' /etc/dmtab | \
34
			  grep ${1} | awk '{$1=""; print $0}') | /sbin/dmsetup create ${1}"
35
			  
36
	# For all cases with more lines:
37
	elif [ ${count} -gt 1 ] ; then
38
		for c in $( seq 1 ${count} ) ; do
39
			if [ ${c} -eq 1 ] ; then
40
				# Heavy escaping in awk-statement because we cannot use apostrophes
41
				dmsetup_cmd="echo -e $(grep -v -e '^[[:space:]]*\(#\|$\)' /etc/dmtab | \
42
							 grep ${1} | awk NR==${c}\ \{\$1=\"\"\;\ print\ \$0\})"
43
			else
44
				# Append starting with newline
45
				dmsetup_cmd="${dmsetup_cmd}\\\\n \
46
							 $(grep -v -e '^[[:space:]]*\(#\|$\)' /etc/dmtab | \
47
							 grep ${1} | awk NR==${c}\ \{\$1=\"\"\;\ print\ \$0\})"
48
			fi
49
		done
50
		echo "${dmsetup_cmd} | /sbin/dmsetup create ${1}"
51
	fi
52
53
	return 0
54
}
55
56
# char **get_new_dm_volumes(void)
57
#
58
#   Return unique volumes from /etc/dmtab
59
get_new_dm_volumes() {
60
	local volume
61
62
	# Filter comments and blank lines
63
	grep -v -e '^[[:space:]]*\(#\|$\)' /etc/dmtab | \
64
	awk '{ print $1 }' | \
65
	uniq | \
66
	while read volume ; do
67
		# If it exists, skip it
68
		dmvolume_exists "${volume%:}" && continue
69
70
		echo "${volume%:}"
71
	done
72
73
	return 0
74
}
75
76
# int dmvolume_exists(volume)
77
#
78
#   Return true if volume exists in DM table
79
dmvolume_exists() {
80
	local x line volume=$1
81
82
	[ -z "${volume}" ] && return 1
83
84
	/sbin/dmsetup ls 2>/dev/null | \
85
	while read line ; do
86
		for x in ${line} ; do
87
			# the following conditonal return only breaks out
88
			# of the while loop, as it is running in a pipe.
89
			[ "${x}" = "${volume}" ] && return 1
90
			# We only want to check the volume name
91
			break
92
		done
93
	done
94
95
	# if 1 was returned from the above loop, then indicate that
96
	# volume exists
97
	[ $? = 1 ] && return 0
98
99
	# otherwise the loop exited normally and the volume does not
100
	# exist
101
	return 1
102
}
103
104
# int is_empty_dm_volume(volume)
105
#
106
#   Return true if the volume exists in DM table, but is empty/non-valid
107
is_empty_dm_volume() {
108
	local table volume=$1
109
110
	set -- $(/sbin/dmsetup table 2>/dev/null | grep -e "^${volume}:")
111
	[ "${volume}" = "$1" -a -z "$2" ]
112
}
113
114
115
start() {
116
	if [ -e /proc/modules ] && ! dm_in_proc ; then
117
		modprobe dm-mod 2>/dev/null
118
	fi
119
	# Ensure the dirs exist for locking and running
120
	checkpath -q -d -m 0700 -o root:root /run/lvm /run/lock/lvm
121
122
	local x volume
123
	
124
	if [ -x /sbin/dmsetup -a -c /dev/mapper/control -a -f /etc/dmtab ] ; then
125
		[ -n "$(get_new_dm_volumes)" ] && \
126
			einfo " Setting up device-mapper volumes:"
127
		
128
		get_new_dm_volumes | \
129
		while read x ; do
130
			[ -n "${x}" ] || continue
131
			
132
			volume="${x##* }"
133
			
134
			ebegin "  Creating volume: ${volume}"
135
			if ! eval $(build_dmsetup_command ${volume}) >/dev/null 2>/dev/null ; then
136
				eend 1 "  Error creating volume: ${volume}"
137
				# dmsetup still adds an empty volume in some cases,
138
				#  so lets remove it
139
				is_empty_dm_volume "${volume}" && \
140
					/sbin/dmsetup remove "${volume}" 2>/dev/null
141
			else
142
				eend 0
143
			fi
144
		done
145
	fi
146
}
147
(-)a/sys-fs/lvm2/files/device-mapper.rc-2.02.95-r2 (+111 lines)
Line 0 Link Here
1
#!/sbin/runscript
2
# Copyright 1999-2013 Gentoo Foundation
3
# Distributed under the terms of the GNU General Public License v2
4
# $Header: /var/cvsroot/gentoo-x86/sys-fs/lvm2/files/device-mapper.rc-2.02.95-r2,v 1.2 2013/04/09 11:00:26 ssuominen Exp $
5
6
depend() {
7
	# As of .67-r1, we call ALL lvm start/stop scripts with --sysinit, that
8
	# means dmeventd is NOT notified, as it cannot be safely running
9
	before dmeventd checkfs fsck
10
	after modules
11
}
12
13
dm_in_proc() {
14
	local retval=0
15
	for x in devices misc ; do
16
		grep -qs 'device-mapper' /proc/${x}
17
		retval=$((${retval} + $?))
18
	done
19
	return ${retval}
20
}
21
22
# char **get_new_dm_volumes(void)
23
#
24
#   Return dmsetup commands to setup volumes
25
get_new_dm_volumes() {
26
	local volume params
27
28
	# Filter comments and blank lines
29
	grep -v -e '^[[:space:]]*\(#\|$\)' /etc/dmtab | \
30
	while read volume params ; do
31
		# If it exists, skip it
32
		dmvolume_exists "${volume%:}" && continue
33
		# Assemble the command to run to create volume
34
		echo "echo ${params} | /sbin/dmsetup create ${volume%:}"
35
	done
36
37
	return 0
38
}
39
40
# int dmvolume_exists(volume)
41
#
42
#   Return true if volume exists in DM table
43
dmvolume_exists() {
44
	local x line volume=$1
45
46
	[ -z "${volume}" ] && return 1
47
48
	/sbin/dmsetup ls 2>/dev/null | \
49
	while read line ; do
50
		for x in ${line} ; do
51
			# the following conditonal return only breaks out
52
			# of the while loop, as it is running in a pipe.
53
			[ "${x}" = "${volume}" ] && return 1
54
			# We only want to check the volume name
55
			break
56
		done
57
	done
58
59
	# if 1 was returned from the above loop, then indicate that
60
	# volume exists
61
	[ $? = 1 ] && return 0
62
63
	# otherwise the loop exited normally and the volume does not
64
	# exist
65
	return 1
66
}
67
68
# int is_empty_dm_volume(volume)
69
#
70
#   Return true if the volume exists in DM table, but is empty/non-valid
71
is_empty_dm_volume() {
72
	local table volume=$1
73
74
	set -- $(/sbin/dmsetup table 2>/dev/null | grep -e "^${volume}:")
75
	[ "${volume}" = "$1" -a -z "$2" ]
76
}
77
78
79
start() {
80
	if [ -e /proc/modules ] && ! dm_in_proc ; then
81
		modprobe dm-mod 2>/dev/null
82
	fi
83
	# Ensure the dirs exist for locking and running
84
	checkpath -q -d -m 0700 -o root:root /run/lvm /run/lock/lvm
85
86
	local x volume
87
	
88
	if [ -x /sbin/dmsetup -a -c /dev/mapper/control -a -f /etc/dmtab ] ; then
89
		[ -n "$(get_new_dm_volumes)" ] && \
90
			einfo " Setting up device-mapper volumes:"
91
	
92
		get_new_dm_volumes | \
93
		while read x ; do
94
			[ -n "${x}" ] || continue
95
	
96
			volume="${x##* }"
97
	
98
			ebegin "  Creating volume: ${volume}"
99
			if ! eval "${x}" >/dev/null 2>/dev/null ; then
100
				eend 1 "  Error creating volume: ${volume}"
101
				# dmsetup still adds an empty volume in some cases,
102
				#  so lets remove it
103
				is_empty_dm_volume "${volume}" && \
104
					/sbin/dmsetup remove "${volume}" 2>/dev/null
105
			else
106
				eend 0
107
			fi
108
		done
109
	fi
110
}
111
(-)a/sys-fs/lvm2/files/dmeventd.initd-2.02.67-r1 (+26 lines)
Line 0 Link Here
1
#!/sbin/runscript
2
# Copyright 1999-2014 Gentoo Foundation
3
# Distributed under the terms of the GNU General Public License v2
4
# $Header: /var/cvsroot/gentoo-x86/sys-fs/lvm2/files/dmeventd.initd-2.02.67-r1,v 1.3 2014/02/08 21:17:46 robbat2 Exp $
5
6
PIDFILE=/run/dmeventd.pid
7
BIN=/sbin/dmeventd
8
9
depend() {
10
	# As of .67-r1, we call ALL lvm start/stop scripts with --sysinit, that
11
	# means dmeventd is NOT notified, as it cannot be safely running
12
	after lvm device-mapper
13
}
14
15
start() {
16
	ebegin "Starting dmeventd"
17
	start-stop-daemon --start --exec $BIN --pidfile $PIDFILE
18
	eend $?
19
}
20
21
stop() {
22
	ebegin "Stopping dmeventd"
23
	start-stop-daemon --stop --exec $BIN --pidfile $PIDFILE
24
	eend $?
25
}
26
(-)a/sys-fs/lvm2/files/dmtab (+12 lines)
Line 0 Link Here
1
#/etc/dmraid: config file for adding device-mapper volumes at boot
2
# $Header: /var/cvsroot/gentoo-x86/sys-fs/lvm2/files/dmtab,v 1.1 2009/04/09 23:00:10 caleb Exp $
3
4
# Format: <volume name>: <table>
5
# Example: isw0: 0 312602976 striped 2 128 /dev/sda 0 /dev/sdb 0
6
#
7
# Alternatively you can create all your volumes the first time, and just run:
8
#
9
#   dmsetup table >> /etc/dmtab
10
#
11
# and verify that they are correct.
12
(-)a/sys-fs/lvm2/files/lvm-monitoring.initd-2.02.105-r2 (+39 lines)
Line 0 Link Here
1
#!/sbin/runscript
2
# Copyright 1999-2014 Gentoo Foundation
3
# Distributed under the terms of the GNU General Public License v2
4
# $Header: /var/cvsroot/gentoo-x86/sys-fs/lvm2/files/lvm-monitoring.initd-2.02.105-r2,v 1.1 2014/02/02 19:52:34 robbat2 Exp $
5
6
# This script is based on upstream file
7
# LVM2.2.02.67/scripts/lvm2_monitoring_init_red_hat.in
8
9
depend() {
10
	# As of .67-r1, we call ALL lvm start/stop scripts with --sysinit, that
11
	# means dmeventd is NOT notified, as it cannot be safely running
12
	need lvm dmeventd
13
}
14
15
VGCHANGE=/sbin/vgchange
16
VGS=/sbin/vgs
17
18
start() {
19
	ret=0
20
	# TODO do we want to separate out already active groups only?
21
	VGSLIST=`$VGS --noheadings -o name --rows 2> /dev/null`
22
	ebegin "Starting LVM monitoring for VGs ${VGSLIST}:"
23
	$VGCHANGE --monitor y --poll y  ${VGSLIST}
24
	ret=$?
25
	eend $ret
26
	return $ret
27
28
}
29
30
stop() {
31
	ret=0
32
	# TODO do we want to separate out already active groups only?
33
	VGSLIST=`$VGS --noheadings -o name --rows 2> /dev/null`
34
	ebegin "Stopping LVM monitoring for VGs ${VGSLIST}:"
35
	$VGCHANGE --monitor n ${VGSLIST}
36
	ret=$?
37
	eend $ret
38
	return $ret
39
}
(-)a/sys-fs/lvm2/files/lvm-monitoring.initd-2.02.67-r2 (+46 lines)
Line 0 Link Here
1
#!/sbin/runscript
2
# Copyright 1999-2013 Gentoo Foundation
3
# Distributed under the terms of the GNU General Public License v2
4
# $Header: /var/cvsroot/gentoo-x86/sys-fs/lvm2/files/lvm-monitoring.initd-2.02.67-r2,v 1.4 2013/04/09 11:00:26 ssuominen Exp $
5
6
# This script is based on upstream file
7
# LVM2.2.02.67/scripts/lvm2_monitoring_init_red_hat.in
8
9
depend() {
10
	# As of .67-r1, we call ALL lvm start/stop scripts with --sysinit, that
11
	# means dmeventd is NOT notified, as it cannot be safely running
12
	need lvm dmeventd
13
}
14
15
VGCHANGE=/sbin/vgchange
16
VGS=/sbin/vgs
17
18
start() {
19
	ret=0
20
	# TODO do we want to separate out already active groups only?
21
	VGSLIST=`$VGS --noheadings -o name 2> /dev/null`
22
	for vg in $VGSLIST
23
	do
24
	    ebegin "Starting LVM monitoring for VG $vg:"
25
		$VGCHANGE --monitor y --poll y $vg
26
		ret2=$?
27
		eend $ret2
28
		[ $ret2 -ne 0 ] && ret=$ret2
29
	done
30
	return $ret
31
}
32
33
stop() {
34
	ret=0
35
	# TODO do we want to separate out already active groups only?
36
	VGSLIST=`$VGS --noheadings -o name 2> /dev/null`
37
	for vg in $VGSLIST
38
	do
39
	    ebegin "Stopping LVM monitoring for VG $vg:"
40
		$VGCHANGE --monitor n $vg
41
		ret2=$?
42
		eend $ret2
43
		[ $ret2 -ne 0 ] && ret=$ret2
44
	done
45
	return $ret
46
}
(-)a/sys-fs/lvm2/files/lvm.confd-2.02.28-r2 (+5 lines)
Line 0 Link Here
1
# LVM should normally only be started after mdraid is available
2
# this is because LVM physical volumes are very often MD devices.
3
RC_AFTER="mdraid"
4
5
# vim: ft=gentoo-conf-d
(-)a/sys-fs/lvm2/files/lvm.rc-2.02.105-r2 (+97 lines)
Line 0 Link Here
1
#!/sbin/runscript
2
# Copyright 1999-2014 Gentoo Foundation
3
# Distributed under the terms of the GNU General Public License v2
4
# $Header: /var/cvsroot/gentoo-x86/sys-fs/lvm2/files/lvm.rc-2.02.105-r2,v 1.1 2014/02/02 19:52:34 robbat2 Exp $
5
6
depend() {
7
	before checkfs fsck
8
	after modules device-mapper
9
	need lvmetad sysfs
10
}
11
12
config='global { locking_dir = "/run/lock/lvm" }'
13
14
dm_in_proc() {
15
	local retval=0
16
	for x in devices misc ; do
17
		grep -qs 'device-mapper' /proc/${x}
18
		retval=$((${retval} + $?))
19
	done
20
	return ${retval}
21
}
22
23
start() {
24
	# LVM support for /usr, /home, /opt ....
25
	# This should be done *before* checking local
26
	# volumes, or they never get checked.
27
	
28
	# NOTE: Add needed modules for LVM or RAID, etc
29
	#       to /etc/modules.autoload if needed
30
	for lvm_path in /bin/lvm /sbin/lvm ; do
31
		[ -x "$lvm_path" ] && break
32
	done
33
	if [ ! -x "$lvm_path" ]; then
34
		eerror "Cannot find lvm binary in /sbin or /bin!"
35
		return 1
36
	fi
37
	if [ -z "${CDBOOT}" ] ; then
38
		if [ -e /proc/modules ] && ! dm_in_proc ; then
39
			modprobe dm-mod 2>/dev/null
40
		fi
41
		if [ -d /proc/lvm ] || dm_in_proc ; then
42
			ebegin "Setting up the Logical Volume Manager"
43
			#still echo stderr for debugging
44
			lvm_commands="#! ${lvm_path} --config '${config}'\n"
45
			# Extra PV find pass because some devices might not have been available until very recently
46
			lvm_commands="${lvm_commands}pvscan\n"
47
			# Now make the nodes
48
			lvm_commands="${lvm_commands}vgscan --mknodes\n"
49
			# And turn them on!
50
			lvm_commands="${lvm_commands}vgchange --sysinit -a ly\n"
51
			# Order of this is important, have to work around dash and LVM readline
52
			printf "%b\n" "${lvm_commands}" | $lvm_path /proc/self/fd/0 --config "${config}" >/dev/null
53
			eend $? "Failed to setup the LVM"
54
		fi
55
	fi
56
}
57
58
stop() {
59
	for lvm_path in /bin/lvm /sbin/lvm ; do
60
		[ -x "$lvm_path" ] && break
61
	done
62
	if [ ! -x "$lvm_path" ]; then
63
		eerror "Cannot find lvm binary in /sbin or /bin!"
64
		return 1
65
	fi
66
# Stop LVM2
67
if [ -x /sbin/vgs ] && \
68
   [ -x /sbin/vgchange ] && \
69
   [ -x /sbin/lvchange ] && \
70
   [ -f /etc/lvmtab -o -d /etc/lvm ] && \
71
   [ -d /proc/lvm  -o "`grep device-mapper /proc/misc 2>/dev/null`" ]
72
then
73
	einfo "Shutting down the Logical Volume Manager"
74
	
75
76
        VGS=$($lvm_path vgs --config "${config}" -o vg_name --noheadings --nosuffix --rows 2> /dev/null)
77
78
        if [ "$VGS" ]
79
        then
80
            ebegin "  Shutting Down LVs & VGs"
81
			#still echo stderr for debugging
82
			lvm_commands="#! ${lvm_path} --config '${config}'\n"
83
			# Extra PV find pass because some devices might not have been available until very recently
84
			lvm_commands="${lvm_commands}lvchange --sysinit -a ln ${VGS}\n"
85
			# Now make the nodes
86
			lvm_commands="${lvm_commands}vgchange --sysinit -a ln ${VGS}\n"
87
			# Order of this is important, have to work around dash and LVM readline
88
			printf "%b\n" "${lvm_commands}" | $lvm_path /proc/self/fd/0 --config "${config}" >/dev/null
89
			eend $? "Failed (possibly some LVs still needed for /usr or root)"
90
        fi
91
92
	einfo "Finished shutting down the Logical Volume Manager"
93
	return 0
94
fi
95
}
96
97
# vim:ts=4
(-)a/sys-fs/lvm2/files/lvm.rc-2.02.95-r2 (+96 lines)
Line 0 Link Here
1
#!/sbin/runscript
2
# Copyright 1999-2013 Gentoo Foundation
3
# Distributed under the terms of the GNU General Public License v2
4
# $Header: /var/cvsroot/gentoo-x86/sys-fs/lvm2/files/lvm.rc-2.02.95-r2,v 1.2 2013/04/09 11:00:26 ssuominen Exp $
5
6
depend() {
7
	use dmeventd
8
	before checkfs fsck
9
	after dmeventd modules device-mapper
10
}
11
12
config='global { locking_dir = "/run/lock/lvm" }'
13
14
dm_in_proc() {
15
	local retval=0
16
	for x in devices misc ; do
17
		grep -qs 'device-mapper' /proc/${x}
18
		retval=$((${retval} + $?))
19
	done
20
	return ${retval}
21
}
22
23
start() {
24
	# LVM support for /usr, /home, /opt ....
25
	# This should be done *before* checking local
26
	# volumes, or they never get checked.
27
	
28
	# NOTE: Add needed modules for LVM or RAID, etc
29
	#       to /etc/modules.autoload if needed
30
	for lvm_path in /bin/lvm /sbin/lvm ; do
31
		[ -x "$lvm_path" ] && break
32
	done
33
	if [ ! -x "$lvm_path" ]; then
34
		eerror "Cannot find lvm binary in /sbin or /bin!"
35
		return 1
36
	fi
37
	if [ -z "${CDBOOT}" ] ; then
38
		if [ -e /proc/modules ] && ! dm_in_proc ; then
39
			modprobe dm-mod 2>/dev/null
40
		fi
41
		if [ -d /proc/lvm ] || dm_in_proc ; then
42
			ebegin "Setting up the Logical Volume Manager"
43
			#still echo stderr for debugging
44
			lvm_commands="#! ${lvm_path} --config '${config}'\n"
45
			# Extra PV find pass because some devices might not have been available until very recently
46
			lvm_commands="${lvm_commands}pvscan\n"
47
			# Now make the nodes
48
			lvm_commands="${lvm_commands}vgscan --mknodes\n"
49
			# And turn them on!
50
			lvm_commands="${lvm_commands}vgchange --sysinit -a ly\n"
51
			# Order of this is important, have to work around dash and LVM readline
52
			printf "%b\n" "${lvm_commands}" | $lvm_path /proc/self/fd/0 --config "${config}" >/dev/null
53
			eend $? "Failed to setup the LVM"
54
		fi
55
	fi
56
}
57
58
stop() {
59
	for lvm_path in /bin/lvm /sbin/lvm ; do
60
		[ -x "$lvm_path" ] && break
61
	done
62
	if [ ! -x "$lvm_path" ]; then
63
		eerror "Cannot find lvm binary in /sbin or /bin!"
64
		return 1
65
	fi
66
# Stop LVM2
67
if [ -x /sbin/vgs ] && \
68
   [ -x /sbin/vgchange ] && \
69
   [ -x /sbin/lvchange ] && \
70
   [ -f /etc/lvmtab -o -d /etc/lvm ] && \
71
   [ -d /proc/lvm  -o "`grep device-mapper /proc/misc 2>/dev/null`" ]
72
then
73
	einfo "Shutting down the Logical Volume Manager"
74
	
75
76
        VGS=$($lvm_path vgs --config "${config}" -o vg_name --noheadings --nosuffix 2> /dev/null)
77
78
        if [ "$VGS" ]
79
        then
80
            ebegin "  Shutting Down LVs & VGs"
81
			#still echo stderr for debugging
82
			lvm_commands="#! ${lvm_path} --config '${config}'\n"
83
			# Extra PV find pass because some devices might not have been available until very recently
84
			lvm_commands="${lvm_commands}lvchange --sysinit -a ln ${VGS}\n"
85
			# Now make the nodes
86
			lvm_commands="${lvm_commands}vgchange --sysinit -a ln\n"
87
			# Order of this is important, have to work around dash and LVM readline
88
			printf "%b\n" "${lvm_commands}" | $lvm_path /proc/self/fd/0 --config "${config}" >/dev/null
89
			eend $? "Failed"
90
        fi
91
92
	einfo "Finished Shutting down the Logical Volume Manager"
93
fi
94
}
95
96
# vim:ts=4
(-)a/sys-fs/lvm2/files/lvm2-2.02.106-pthread-pkgconfig.patch (+34 lines)
Line 0 Link Here
1
diff -ur LVM2.2.02.100.orig/configure.in LVM2.2.02.100/configure.in
2
--- LVM2.2.02.100.orig/configure.in	2013-08-13 13:44:43.000000000 +0300
Line 0 Link Here
1
Make sure that libdm usage always brings in pthread libraries, both in
2
pkgconfig and during manual build.
3
4
--- tools/Makefile.in
5
+++ tools/Makefile.in
6
@@ -87,6 +87,7 @@
7
   INSTALL_LVM_TARGETS += install_tools_static
8
   INSTALL_DMSETUP_TARGETS += install_dmsetup_static
9
   INSTALL_CMDLIB_TARGETS += install_cmdlib_static
10
+  STATIC_LIBS += @PTHREAD_LIBS@
11
 endif
12
 
13
 LVMLIBS = $(LVMINTERNAL_LIBS)
14
@@ -118,6 +119,10 @@
15
 
16
 include $(top_builddir)/make.tmpl
17
 
18
+ifeq ("@STATIC_LINK@", "yes")
19
+  STATIC_LIBS += @PTHREAD_LIBS@
20
+endif
21
+
22
 device-mapper: $(TARGETS_DM)
23
 
24
 CFLAGS_dmsetup.o += $(UDEV_CFLAGS) $(EXTRA_EXEC_CFLAGS)
25
--- libdm/libdevmapper.pc.in
26
+++ libdm/libdevmapper.pc.in
27
@@ -8,4 +8,5 @@
28
 Version: @DM_LIB_PATCHLEVEL@
29
 Cflags: -I${includedir} 
30
 Libs: -L${libdir} -ldevmapper
31
+Libs.private: -L${libdir} @PTHREAD_LIBS@
32
 Requires.private: @SELINUX_PC@ @UDEV_PC@
(-)a/sys-fs/lvm2/files/lvm2-2.02.108-example.conf.in.patch (+52 lines)
Line 0 Link Here
1
diff -Nuar --exclude '*.orig' --exclude '*.rej' LVM2.2.02.107.orig/configure.in LVM2.2.02.107/configure.in
2
--- LVM2.2.02.107.orig/configure.in	2014-07-15 12:57:55.867439868 -0700
Line 0 Link Here
1
Maintainer note: Forward ported without editing from lvm2-2.02.99-example.conf.in.patch to apply cleanly.
2
3
--- conf/example.conf.in
4
+++ conf/example.conf.in
5
@@ -105,6 +105,10 @@
6
     # By default we accept every block device:
7
     # filter = [ "a/.*/" ]
8
 
9
+    # Gentoo: we exclude /dev/nbd by default, because it makes a lot of kernel
10
+    # noise when you probed while not available.
11
+    filter = [ "r|/dev/nbd.*|", "a/.*/" ]
12
+
13
     # Exclude the cdrom drive
14
     # filter = [ "r|/dev/cdrom|" ]
15
 
16
@@ -522,7 +526,8 @@
17
     # e.g. vgscan.lvm1 and they will stop working after you start using
18
     # the new lvm2 on-disk metadata format.
19
     # The default value is set when the tools are built.
20
-    # fallback_to_lvm1 = 0
21
+    # Gentoo: the LVM tools are a seperate package.
22
+    fallback_to_lvm1 = 0
23
 
24
     # The default metadata format that commands should use - "lvm1" or "lvm2".
25
     # The command line override is -M1 or -M2.
26
@@ -1182,12 +1187,13 @@
27
 
28
 # Metadata settings
29
 #
30
-# metadata {
31
+metadata {
32
     # Default number of copies of metadata to hold on each PV.  0, 1 or 2.
33
     # You might want to override it from the command line with 0 
34
     # when running pvcreate on new PVs which are to be added to large VGs.
35
 
36
-    # pvmetadatacopies = 1
37
+    # Gentoo: enable for data safety, but PV resize is then disabled.
38
+    # pvmetadatacopies = 2
39
 
40
     # Default number of copies of metadata to maintain for each VG.
41
     # If set to a non-zero value, LVM automatically chooses which of
42
@@ -1222,7 +1228,7 @@
43
     # the supplied toolset to make changes (e.g. vgcfgrestore).
44
 
45
     # dirs = [ "/etc/lvm/metadata", "/mnt/disk2/lvm/metadata2" ]
46
-#}
47
+}
48
 
49
 # Event daemon
50
 #
(-)a/sys-fs/lvm2/files/lvm2-2.02.108-static-pkgconfig-libs.patch (+104 lines)
Line 0 Link Here
1
Maintainer note: Forward ported without editing from lvm2-2.02.107-static-pkgconfig-libs.patch to apply cleanly.
2
3
--- configure.in
4
+++ configure.in
5
@@ -1067,6 +1067,7 @@
6
 			   fi])
7
 	if test "$BLKID_WIPING" = yes; then
8
 		BLKID_PC="blkid"
9
+		BLKID_STATIC_LIBS=`$PKG_CONFIG --static --libs $BLKID_PC`
10
 		AC_DEFINE([BLKID_WIPING_SUPPORT], 1, [Define to 1 to use libblkid detection of signatures when wiping.])
11
 	fi
12
 fi
13
@@ -1092,6 +1093,7 @@
14
 if test "$UDEV_SYNC" = yes; then
15
 	pkg_config_init
16
 	PKG_CHECK_MODULES(UDEV, libudev >= 143, [UDEV_PC="libudev"])
17
+	UDEV_STATIC_LIBS=`$PKG_CONFIG --static --libs libudev`
18
 	AC_DEFINE([UDEV_SYNC_SUPPORT], 1, [Define to 1 to enable synchronisation with udev processing.])
19
 fi
20
 
21
@@ -1312,19 +1314,32 @@
22
 if test "$SELINUX" = yes; then
23
 	AC_CHECK_LIB([sepol], [sepol_check_context], [
24
 		AC_DEFINE([HAVE_SEPOL], 1, [Define to 1 if sepol_check_context is available.])
25
-		SELINUX_LIBS="-lsepol"])
26
+		SEPOL_LIBS="-lsepol"])
27
+
28
+	dnl -- init pkgconfig if required
29
+	if  test x$PKGCONFIG_INIT != x1; then
30
+		pkg_config_init
31
+	fi
32
+	PKG_CHECK_MODULES(SELINUX, libselinux, [
33
+		SELINUX_PC="libselinux"
34
+		SELINUX_STATIC_LIBS=`$PKG_CONFIG --static --libs libselinux`
35
+		SELINUX_LIBS="$SELINUX_LIBS $SEPOL_LIBS"
36
+		AC_DEFINE([HAVE_SELINUX], 1, [Define to 1 to include support for selinux.])
37
+	],[
38
+		dnl -- old non-pkgconfig method, is buggy with static builds
39
 
40
 	AC_CHECK_LIB([selinux], [is_selinux_enabled], [
41
 		AC_CHECK_HEADERS([selinux/selinux.h],, hard_bailout)
42
 		AC_CHECK_HEADERS([selinux/label.h])
43
 		AC_DEFINE([HAVE_SELINUX], 1, [Define to 1 to include support for selinux.])
44
-		SELINUX_LIBS="-lselinux $SELINUX_LIBS"
45
+		SELINUX_LIBS="-lselinux $SEPOL_LIBS"
46
 		SELINUX_PC="libselinux"
47
 		HAVE_SELINUX=yes ], [
48
 		AC_MSG_WARN(Disabling selinux)
49
 		SELINUX_LIBS=
50
 		SELINUX_PC=
51
 		HAVE_SELINUX=no ])
52
+	])
53
 fi
54
 
55
 ################################################################################
56
@@ -1626,6 +1641,7 @@
57
 ################################################################################
58
 AC_SUBST(APPLIB)
59
 AC_SUBST(AWK)
60
+AC_SUBST(BLKID_STATIC_LIBS)
61
 AC_SUBST(BLKID_PC)
62
 AC_SUBST(BLKID_WIPING)
63
 AC_SUBST(BUILD_CMIRRORD)
64
@@ -1721,6 +1737,7 @@
65
 AC_SUBST(SALCK_CFLAGS)
66
 AC_SUBST(SALCK_LIBS)
67
 AC_SUBST(SELINUX_LIBS)
68
+AC_SUBST(SELINUX_STATIC_LIBS)
69
 AC_SUBST(SELINUX_PC)
70
 AC_SUBST(SNAPSHOTS)
71
 AC_SUBST(STATICDIR)
72
@@ -1735,6 +1752,7 @@
73
 AC_SUBST(CACHE_DUMP_CMD)
74
 AC_SUBST(CACHE_REPAIR_CMD)
75
 AC_SUBST(CACHE_RESTORE_CMD)
76
+AC_SUBST(UDEV_STATIC_LIBS)
77
 AC_SUBST(UDEV_PC)
78
 AC_SUBST(UDEV_RULES)
79
 AC_SUBST(UDEV_SYNC)
80
--- make.tmpl.in
81
+++ make.tmpl.in
82
@@ -43,7 +43,7 @@
83
 
84
 LIBS = @LIBS@
85
 # Extra libraries always linked with static binaries
86
-STATIC_LIBS = $(SELINUX_LIBS) $(UDEV_LIBS) $(BLKID_LIBS)
87
+STATIC_LIBS = $(SELINUX_STATIC_LIBS) $(UDEV_STATIC_LIBS) $(BLKID_STATIC_LIBS)
88
 DEFS += @DEFS@
89
 # FIXME set this only where it's needed, not globally?
90
 CFLAGS += @CFLAGS@
91
@@ -57,10 +57,13 @@
92
 PTHREAD_LIBS = @PTHREAD_LIBS@
93
 READLINE_LIBS = @READLINE_LIBS@
94
 SELINUX_LIBS = @SELINUX_LIBS@
95
+SELINUX_STATIC_LIBS = @SELINUX_STATIC_LIBS@
96
 UDEV_CFLAGS = @UDEV_CFLAGS@
97
 UDEV_LIBS = @UDEV_LIBS@
98
+UDEV_STATIC_LIBS = @UDEV_STATIC_LIBS@
99
 BLKID_CFLAGS = @BLKID_CFLAGS@
100
 BLKID_LIBS = @BLKID_LIBS@
101
+BLKID_STATIC_LIBS = @BLKID_STATIC_LIBS@
102
 TESTING = @TESTING@
103
 
104
 # Setup directory variables
(-)a/sys-fs/lvm2/files/lvm2-2.02.70-asneeded.patch (+23 lines)
Line 0 Link Here
1
--- LVM2.2.02.56/scripts/lvm2create_initrd/lvm2create_initrd.orig	2006-11-21 22:41:56.000000000 +0000
Line 0 Link Here
1
diff -Nuar --exclude '*~' LVM2.2.02.63.orig/daemons/dmeventd/Makefile.in LVM2.2.02.63/daemons/dmeventd/Makefile.in
2
--- LVM2.2.02.63.orig/daemons/dmeventd/Makefile.in	2010-04-09 14:42:48.000000000 -0700
Line 0 Link Here
1
X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=301331
2
X-Gentoo-Bug: 301331
3
4
diff -Nuar LVM2.2.02.67.orig/scripts/lvm2create_initrd/lvm2create_initrd LVM2.2.02.67/scripts/lvm2create_initrd/lvm2create_initrd
5
--- LVM2.2.02.67.orig/scripts/lvm2create_initrd/lvm2create_initrd	2010-06-07 18:44:34.182980475 +0000
Line 0 Link Here
1
http://bugs.gentoo.org/330255
2
3
liblvm2app.so: undefined reference to `floor'
4
5
--- liblvm/Makefile.in
6
+++ liblvm/Makefile.in
7
@@ -39,7 +39,7 @@
8
 
9
 include $(top_builddir)/make.tmpl
10
 
11
-LIBS += $(LVMINTERNAL_LIBS) -ldevmapper
12
+LIBS += $(LVMINTERNAL_LIBS) -ldevmapper -lm
13
 
14
 ifeq ("@DMEVENTD@", "yes")
15
   LIBS += -ldevmapper-event
(-)a/sys-fs/lvm2/files/lvm2-2.02.99-example.conf.in.patch (+49 lines)
Line 0 Link Here
1
diff -Nuar --exclude '*.rej' --exclude '*.orig' LVM2.2.02.92.orig/configure.in LVM2.2.02.92/configure.in
2
--- LVM2.2.02.92.orig/configure.in	2012-02-20 11:36:27.000000000 -0800
Line 0 Link Here
1
--- conf/example.conf.in
2
+++ conf/example.conf.in
3
@@ -50,7 +50,9 @@
4
 
5
 
6
     # By default we accept every block device:
7
-    filter = [ "a/.*/" ]
8
+    # Gentoo: we exclude /dev/nbd by default, because it makes a lot of kernel
9
+    # noise when you probed while not available.
10
+    filter = [ "r|/dev/nbd.*|", "a/.*/" ]
11
 
12
     # Exclude the cdrom drive
13
     # filter = [ "r|/dev/cdrom|" ]
14
@@ -259,6 +261,8 @@
15
     # the new lvm2 on-disk metadata format.
16
     # The default value is set when the tools are built.
17
     # fallback_to_lvm1 = 0
18
+    # Gentoo: the LVM tools are a seperate package.
19
+    fallback_to_lvm1 = 0
20
 
21
     # The default metadata format that commands should use - "lvm1" or "lvm2".
22
     # The command line override is -M1 or -M2.
23
@@ -449,12 +453,12 @@
24
 
25
 # Metadata settings
26
 #
27
-# metadata {
28
+metadata {
29
     # Default number of copies of metadata to hold on each PV.  0, 1 or 2.
30
     # You might want to override it from the command line with 0 
31
     # when running pvcreate on new PVs which are to be added to large VGs.
32
-
33
-    # pvmetadatacopies = 1
34
+    # Gentoo: enable for data safety, but PV resize is then disabled.
35
+    #pvmetadatacopies = 2
36
 
37
     # Approximate default size of on-disk metadata areas in sectors.
38
     # You should increase this if you have large volume groups or
39
@@ -476,7 +480,7 @@
40
     # the supplied toolset to make changes (e.g. vgcfgrestore).
41
 
42
     # dirs = [ "/etc/lvm/metadata", "/mnt/disk2/lvm/metadata2" ]
43
-#}
44
+}
45
 
46
 # Event daemon
47
 #
(-)a/sys-fs/lvm2/files/lvm2-2.02.99-locale-muck.patch (+11 lines)
Line 0 Link Here
1
--- make.tmpl.in
2
+++ make.tmpl.in
3
@@ -395,7 +395,7 @@
4
 	( cat $(srcdir)/.exported_symbols; \
5
 	  if test x$(EXPORTED_HEADER) != x; then \
6
 		$(CC) -E -P $(INCLUDES) $(DEFS) $(EXPORTED_HEADER) | \
7
-		$(SED) -ne "/^typedef|}/!s/.*[ *]\($(EXPORTED_FN_PREFIX)_[a-z0-9_]*\)(.*/\1/p"; \
8
+		LC_ALL=C $(SED) -ne "/^typedef|}/!s/.*[ *]\($(EXPORTED_FN_PREFIX)_[a-z0-9_]*\)(.*/\1/p"; \
9
 	  fi \
10
 	) > $@
11
 
(-)a/sys-fs/lvm2/files/lvm2-fix-stdio-usage.patch (+111 lines)
Line 0 Link Here
1
--- LVM2.2.02.103.orig/lib/commands/toolcontext.c
2
+++ LVM2.2.02.103/lib/commands/toolcontext.c
3
@@ -1336,7 +1336,10 @@
4
 /*
5
  * Close and reopen stream on file descriptor fd.
6
  */
7
-static int _reopen_stream(FILE *stream, int fd, const char *mode, const char *name, FILE **new_stream)
8
+#ifdef __GLIBC__
9
+#define _reopen_stream(stream, fd, mode, name) __reopen_stream(stream, fd, mode, name, &stream)
10
+
11
+static int __reopen_stream(FILE *stream, int fd, const char *mode, const char *name, FILE **new_stream)
12
 {
13
 	int fd_copy, new_fd;
14
 
15
@@ -1363,6 +1366,9 @@
16
 
17
 	return 1;
18
 }
19
+#else
20
+#define _reopen_stream(stream, fd, mode, name) (freopen(NULL, mode, stream) != NULL)
21
+#endif
22
 
23
 /* Entry point */
24
 struct cmd_context *create_toolcontext(unsigned is_long_lived,
25
@@ -1371,7 +1377,6 @@
26
 				       unsigned threaded)
27
 {
28
 	struct cmd_context *cmd;
29
-	FILE *new_stream;
30
 	int flags;
31
 
32
 #ifdef M_MMAP_MAX
33
@@ -1421,9 +1426,8 @@
34
 		if (is_valid_fd(STDIN_FILENO) &&
35
 		    ((flags = fcntl(STDIN_FILENO, F_GETFL)) > 0) &&
36
 		    (flags & O_ACCMODE) != O_WRONLY) {
37
-			if (!_reopen_stream(stdin, STDIN_FILENO, "r", "stdin", &new_stream))
38
+			if (!_reopen_stream(stdin, STDIN_FILENO, "r", "stdin"))
39
 				goto_out;
40
-			stdin = new_stream;
41
 			if (setvbuf(stdin, cmd->linebuffer, _IOLBF, linebuffer_size)) {
42
 				log_sys_error("setvbuf", "");
43
 				goto out;
44
@@ -1433,9 +1437,8 @@
45
 		if (is_valid_fd(STDOUT_FILENO) &&
46
 		    ((flags = fcntl(STDOUT_FILENO, F_GETFL)) > 0) &&
47
 		    (flags & O_ACCMODE) != O_RDONLY) {
48
-			if (!_reopen_stream(stdout, STDOUT_FILENO, "w", "stdout", &new_stream))
49
+			if (!_reopen_stream(stdout, STDOUT_FILENO, "w", "stdout"))
50
 				goto_out;
51
-			stdout = new_stream;
52
 			if (setvbuf(stdout, cmd->linebuffer + linebuffer_size,
53
 				     _IOLBF, linebuffer_size)) {
54
 				log_sys_error("setvbuf", "");
55
@@ -1715,7 +1718,6 @@
56
 void destroy_toolcontext(struct cmd_context *cmd)
57
 {
58
 	struct dm_config_tree *cft_cmdline;
59
-	FILE *new_stream;
60
 	int flags;
61
 
62
 	if (cmd->dump_filter && cmd->filter && cmd->filter->dump &&
63
@@ -1752,8 +1754,7 @@
64
 		if (is_valid_fd(STDIN_FILENO) &&
65
 		    ((flags = fcntl(STDIN_FILENO, F_GETFL)) > 0) &&
66
 		    (flags & O_ACCMODE) != O_WRONLY) {
67
-			if (_reopen_stream(stdin, STDIN_FILENO, "r", "stdin", &new_stream)) {
68
-				stdin = new_stream;
69
+			if (_reopen_stream(stdin, STDIN_FILENO, "r", "stdin")) {
70
 				setlinebuf(stdin);
71
 			} else
72
 				cmd->linebuffer = NULL;	/* Leave buffer in place (deliberate leak) */
73
@@ -1762,8 +1763,7 @@
74
 		if (is_valid_fd(STDOUT_FILENO) &&
75
 		    ((flags = fcntl(STDOUT_FILENO, F_GETFL)) > 0) &&
76
 		    (flags & O_ACCMODE) != O_RDONLY) {
77
-			if (_reopen_stream(stdout, STDOUT_FILENO, "w", "stdout", &new_stream)) {
78
-				stdout = new_stream;
79
+			if (_reopen_stream(stdout, STDOUT_FILENO, "w", "stdout")) {
80
 				setlinebuf(stdout);
81
 			} else
82
 				cmd->linebuffer = NULL;	/* Leave buffer in place (deliberate leak) */
83
--- LVM2.2.02.103.orig/tools/lvmcmdline.c
84
+++ LVM2.2.02.103/tools/lvmcmdline.c
85
@@ -1252,7 +1252,7 @@
86
 	int err = is_valid_fd(STDERR_FILENO);
87
 
88
 	if (!is_valid_fd(STDIN_FILENO) &&
89
-	    !(stdin = fopen(_PATH_DEVNULL, "r"))) {
90
+	    !freopen(_PATH_DEVNULL, "r", stdin)) {
91
 		if (err)
92
 			perror("stdin stream open");
93
 		else
94
@@ -1262,7 +1262,7 @@
95
 	}
96
 
97
 	if (!is_valid_fd(STDOUT_FILENO) &&
98
-	    !(stdout = fopen(_PATH_DEVNULL, "w"))) {
99
+	    !freopen(_PATH_DEVNULL, "w", stdout)) {
100
 		if (err)
101
 			perror("stdout stream open");
102
 		/* else no stdout */
103
@@ -1270,7 +1270,7 @@
104
 	}
105
 
106
 	if (!is_valid_fd(STDERR_FILENO) &&
107
-	    !(stderr = fopen(_PATH_DEVNULL, "w"))) {
108
+	    !freopen(_PATH_DEVNULL, "w", stderr)) {
109
 		printf("stderr stream open: %s\n",
110
 		       strerror(errno));
111
 		return 0;
(-)a/sys-fs/lvm2/files/lvmetad.initd-2.02.105-r2 (+15 lines)
Line 0 Link Here
1
diff -uar LVM2.2.02.110-old/daemons/lvmetad/lvmetad-core.c LVM2.2.02.110/daemons/lvmetad/lvmetad-core.c
2
--- LVM2.2.02.110-old/daemons/lvmetad/lvmetad-core.c	2015-05-14 21:37:01.226755157 +0000
Line 0 Link Here
1
#!/sbin/runscript
2
# Copyright 1999-2014 Gentoo Foundation
3
# Distributed under the terms of the GNU General Public License v2
4
# $Header: /var/cvsroot/gentoo-x86/sys-fs/lvm2/files/lvmetad.initd-2.02.105-r2,v 1.2 2014/02/08 21:17:46 robbat2 Exp $
5
6
pidfile="/run/lvmetad.pid"
7
command="/sbin/lvmetad"
8
command_args="${LVMETAD_OPTS:=-p ${pidfile}}"
9
start_stop_daemon_args="--pidfile ${pidfile}"
10
11
depend() {
12
	:
13
}
(-)a/sys-fs/lvm2/lvm2-2.02.110-r99.ebuild (+275 lines)
Line 0 Link Here
1
# Copyright 1999-2014 Gentoo Foundation
2
# Distributed under the terms of the GNU General Public License v2
3
# $Header: /var/cvsroot/gentoo-x86/sys-fs/lvm2/lvm2-2.02.110.ebuild,v 1.3 2014/08/29 07:15:02 ssuominen Exp $
4
5
EAPI=5
6
inherit autotools eutils linux-info multilib systemd toolchain-funcs udev flag-o-matic
7
8
DESCRIPTION="User-land utilities for LVM2 (device-mapper) software"
9
HOMEPAGE="http://sources.redhat.com/lvm2/"
10
SRC_URI="ftp://sources.redhat.com/pub/lvm2/${PN/lvm/LVM}.${PV}.tgz
11
	ftp://sources.redhat.com/pub/lvm2/old/${PN/lvm/LVM}.${PV}.tgz"
12
13
LICENSE="GPL-2"
14
SLOT="0"
15
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~x86-linux"
16
IUSE="readline static static-libs systemd clvm cman lvm1 lvm2create_initrd selinux +udev +thin device-mapper-only"
17
REQUIRED_USE="device-mapper-only? ( !clvm !cman !lvm1 !lvm2create_initrd !thin )
18
	systemd? ( udev )
19
	static? ( !udev )" #520450
20
21
DEPEND_COMMON="clvm? ( cman? ( =sys-cluster/cman-3* ) =sys-cluster/libdlm-3* )
22
	readline? ( sys-libs/readline )
23
	udev? ( >=virtual/libudev-208:=[static-libs?] )"
24
# /run is now required for locking during early boot. /var cannot be assumed to
25
# be available -- thus, pull in recent enough baselayout for /run.
26
# This version of LVM is incompatible with cryptsetup <1.1.2.
27
RDEPEND="${DEPEND_COMMON}
28
	>=sys-apps/baselayout-2.2
29
	!<sys-apps/openrc-0.11
30
	!<sys-fs/cryptsetup-1.1.2
31
	!!sys-fs/clvm
32
	!!sys-fs/lvm-user
33
	>=sys-apps/util-linux-2.16
34
	lvm2create_initrd? ( sys-apps/makedev )
35
	thin? ( >=sys-block/thin-provisioning-tools-0.3.0 )"
36
# note: thin- 0.3.0 is required to avoid --disable-thin_check_needs_check
37
DEPEND="${DEPEND_COMMON}
38
	virtual/pkgconfig
39
	>=sys-devel/binutils-2.20.1-r1
40
	static? (
41
		selinux? ( sys-libs/libselinux[static-libs] )
42
		udev? ( >=virtual/libudev-208:=[static-libs] )
43
		>=sys-apps/util-linux-2.16[static-libs]
44
	)"
45
46
S=${WORKDIR}/${PN/lvm/LVM}.${PV}
47
48
pkg_setup() {
49
	local CONFIG_CHECK="~SYSVIPC"
50
51
	if use udev; then
52
		local WARNING_SYSVIPC="CONFIG_SYSVIPC:\tis not set (required for udev sync)\n"
53
		if linux_config_exists; then
54
			local uevent_helper_path=$(linux_chkconfig_string UEVENT_HELPER_PATH)
55
			if [ -n "${uevent_helper_path}" ] && [ "${uevent_helper_path}" != '""' ]; then
56
				ewarn "It's recommended to set an empty value to the following kernel config option:"
57
				ewarn "CONFIG_UEVENT_HELPER_PATH=${uevent_helper_path}"
58
			fi
59
		fi
60
	fi
61
62
	check_extra_config
63
64
	# 1. Genkernel no longer copies /sbin/lvm blindly.
65
	if use static; then
66
		elog "Warning, we no longer overwrite /sbin/lvm and /sbin/dmsetup with"
67
		elog "their static versions. If you need the static binaries,"
68
		elog "you must append .static to the filename!"
69
	fi
70
}
71
72
src_prepare() {
73
	# Gentoo specific modification(s):
74
	epatch "${FILESDIR}"/${PN}-2.02.108-example.conf.in.patch
75
76
	sed -i \
77
		-e "1iAR = $(tc-getAR)" \
78
		-e "s:CC ?= @CC@:CC = $(tc-getCC):" \
79
		make.tmpl.in || die #444082
80
81
	sed -i -e '/FLAG/s:-O2::' configure{.in,} || die #480212
82
83
	if use udev && ! use device-mapper-only; then
84
		sed -i -e '/use_lvmetad =/s:0:1:' conf/example.conf.in || die #514196
85
		elog "Notice that \"use_lvmetad\" setting is enabled with USE=\"udev\" in"
86
		elog "/etc/lvm/lvm.conf, which will require restart of udev, lvm, and lvmetad"
87
		elog "if it was previously disabled."
88
	fi
89
90
	sed -i -e "s:/usr/bin/true:$(type -P true):" scripts/blk_availability_systemd_red_hat.service.in || die #517514
91
92
	# For upstream -- review and forward:
93
	epatch "${FILESDIR}"/${PN}-2.02.63-always-make-static-libdm.patch
94
	epatch "${FILESDIR}"/${PN}-2.02.56-lvm2create_initrd.patch
95
	epatch "${FILESDIR}"/${PN}-2.02.67-createinitrd.patch #301331
96
	epatch "${FILESDIR}"/${PN}-2.02.99-locale-muck.patch #330373
97
	epatch "${FILESDIR}"/${PN}-2.02.70-asneeded.patch # -Wl,--as-needed
98
	epatch "${FILESDIR}"/${PN}-2.02.92-dynamic-static-ldflags.patch #332905
99
	epatch "${FILESDIR}"/${PN}-2.02.108-static-pkgconfig-libs.patch #370217, #439414 + blkid
100
	epatch "${FILESDIR}"/${PN}-2.02.106-pthread-pkgconfig.patch #492450
101
	# Patches for musl
102
	epatch "${FILESDIR}"/${PN}-fix-stdio-usage.patch # Patch from alpine linux
103
	epatch "${FILESDIR}"/${PN}-musl-fixes.patch
104
105
	# Without thin-privision-tools, there is nothing to install for target install_man7:
106
	use thin || { sed -i -e '/^install_lvm2/s:install_man7::' man/Makefile.in || die; }
107
108
	eautoreconf
109
}
110
111
src_configure() {
112
	filter-flags -flto
113
	local myconf
114
	local buildmode
115
116
	myconf="${myconf} $(use_enable !device-mapper-only dmeventd)"
117
	myconf="${myconf} $(use_enable !device-mapper-only cmdlib)"
118
	myconf="${myconf} $(use_enable !device-mapper-only applib)"
119
	myconf="${myconf} $(use_enable !device-mapper-only fsadm)"
120
	myconf="${myconf} $(use_enable !device-mapper-only lvmetad)"
121
	use device-mapper-only && myconf="${myconf} --disable-udev-systemd-background-jobs"
122
123
	# Most of this package does weird stuff.
124
	# The build options are tristate, and --without is NOT supported
125
	# options: 'none', 'internal', 'shared'
126
	if use static; then
127
		buildmode="internal"
128
		# This only causes the .static versions to become available
129
		myconf="${myconf} --enable-static_link"
130
	else
131
		buildmode="shared"
132
	fi
133
	dmbuildmode=$(use !device-mapper-only && echo internal || echo none)
134
135
	# dmeventd requires mirrors to be internal, and snapshot available
136
	# so we cannot disable them
137
	myconf="${myconf} --with-mirrors=${dmbuildmode}"
138
	myconf="${myconf} --with-snapshots=${dmbuildmode}"
139
	if use thin; then
140
		myconf="${myconf} --with-thin=internal --with-cache=internal"
141
		local texec
142
		for texec in check dump repair restore; do
143
			myconf="${myconf} --with-thin-${texec}=${EPREFIX}/sbin/thin_${texec}"
144
			myconf="${myconf} --with-cache-${texec}=${EPREFIX}/sbin/cache_${texec}"
145
		done
146
	else
147
		myconf="${myconf} --with-thin=none --with-cache=none"
148
	fi
149
150
	if use lvm1; then
151
		myconf="${myconf} --with-lvm1=${buildmode}"
152
	else
153
		myconf="${myconf} --with-lvm1=none"
154
	fi
155
156
	# disable O_DIRECT support on hppa, breaks pv detection (#99532)
157
	use hppa && myconf="${myconf} --disable-o_direct"
158
159
	if use clvm; then
160
		myconf="${myconf} --with-cluster=${buildmode}"
161
		# 4-state! Make sure we get it right, per bug 210879
162
		# Valid options are: none, cman, gulm, all
163
		#
164
		# 2009/02:
165
		# gulm is removed now, now dual-state:
166
		# cman, none
167
		# all still exists, but is not needed
168
		#
169
		# 2009/07:
170
		# TODO: add corosync and re-enable ALL
171
		local clvmd=""
172
		use cman && clvmd="cman"
173
		#clvmd="${clvmd/cmangulm/all}"
174
		[ -z "${clvmd}" ] && clvmd="none"
175
		myconf="${myconf} --with-clvmd=${clvmd}"
176
		myconf="${myconf} --with-pool=${buildmode}"
177
	else
178
		myconf="${myconf} --with-clvmd=none --with-cluster=none"
179
	fi
180
181
	econf \
182
		$(use_enable readline) \
183
		$(use_enable selinux) \
184
		--enable-pkgconfig \
185
		--with-confdir="${EPREFIX}"/etc \
186
		--exec-prefix="${EPREFIX}" \
187
		--sbindir="${EPREFIX}/sbin" \
188
		--with-staticdir="${EPREFIX}"/sbin \
189
		--libdir="${EPREFIX}/$(get_libdir)" \
190
		--with-usrlibdir="${EPREFIX}/usr/$(get_libdir)" \
191
		--with-default-dm-run-dir=/run \
192
		--with-default-run-dir=/run/lvm \
193
		--with-default-locking-dir=/run/lock/lvm \
194
		--with-default-pid-dir=/run \
195
		$(use_enable udev udev_rules) \
196
		$(use_enable udev udev_sync) \
197
		$(use_with udev udevdir "$(get_udevdir)"/rules.d) \
198
		$(use_enable systemd udev-systemd-background-jobs) \
199
		"$(systemd_with_unitdir)" \
200
		${myconf} \
201
		CLDFLAGS="${LDFLAGS}"
202
}
203
204
src_compile() {
205
	pushd include >/dev/null
206
	emake
207
	popd >/dev/null
208
209
	if use device-mapper-only ; then
210
		emake device-mapper
211
	else
212
		emake
213
		emake CC="$(tc-getCC)" -C scripts lvm2_activation_generator_systemd_red_hat
214
	fi
215
}
216
217
src_install() {
218
	local inst
219
	INSTALL_TARGETS="install install_systemd_units install_systemd_generators install_tmpfiles_configuration"
220
	use device-mapper-only && INSTALL_TARGETS="install_device-mapper"
221
	for inst in ${INSTALL_TARGETS}; do
222
		emake DESTDIR="${D}" ${inst}
223
	done
224
225
	newinitd "${FILESDIR}"/device-mapper.rc-2.02.105-r2 device-mapper
226
	newconfd "${FILESDIR}"/device-mapper.conf-1.02.22-r3 device-mapper
227
228
	if use !device-mapper-only ; then
229
		newinitd "${FILESDIR}"/dmeventd.initd-2.02.67-r1 dmeventd
230
		newinitd "${FILESDIR}"/lvm.rc-2.02.105-r2 lvm
231
		newconfd "${FILESDIR}"/lvm.confd-2.02.28-r2 lvm
232
233
		newinitd "${FILESDIR}"/lvm-monitoring.initd-2.02.105-r2 lvm-monitoring
234
		newinitd "${FILESDIR}"/lvmetad.initd-2.02.105-r2 lvmetad
235
	fi
236
237
	if use clvm; then
238
		newinitd "${FILESDIR}"/clvmd.rc-2.02.39 clvmd
239
		newconfd "${FILESDIR}"/clvmd.confd-2.02.39 clvmd
240
	fi
241
242
	if use static-libs; then
243
		dolib.a libdm/ioctl/libdevmapper.a
244
		dolib.a libdaemon/client/libdaemonclient.a #462908
245
		#gen_usr_ldscript libdevmapper.so
246
		dolib.a daemons/dmeventd/libdevmapper-event.a
247
		#gen_usr_ldscript libdevmapper-event.so
248
	else
249
		rm -f "${ED}"usr/$(get_libdir)/{libdevmapper-event,liblvm2cmd,liblvm2app,libdevmapper}.a
250
	fi
251
252
	if use lvm2create_initrd; then
253
		dosbin scripts/lvm2create_initrd/lvm2create_initrd
254
		doman scripts/lvm2create_initrd/lvm2create_initrd.8
255
		newdoc scripts/lvm2create_initrd/README README.lvm2create_initrd
256
	fi
257
258
	insinto /etc
259
	doins "${FILESDIR}"/dmtab
260
261
	dodoc README VERSION* WHATS_NEW WHATS_NEW_DM doc/*.{c,txt} conf/*.conf
262
}
263
264
pkg_postinst() {
265
	ewarn "Make sure the \"lvm\" init script is in the runlevels:"
266
	ewarn "# rc-update add lvm boot"
267
	ewarn
268
	ewarn "Make sure to enable lvmetad in /etc/lvm/lvm.conf if you want"
269
	ewarn "to enable lvm autoactivation and metadata caching."
270
}
271
272
src_test() {
273
	einfo "Tests are disabled because of device-node mucking, if you want to"
274
	einfo "run tests, compile the package and see ${S}/tests"
275
}
(-)a/sys-fs/lvm2/metadata.xml (-1 / +24 lines)
Line 0 Link Here
0
- 
1
<?xml version="1.0" encoding="UTF-8"?>
2
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
3
<pkgmetadata>
4
	<maintainer>
5
		<email>robbat2@gentoo.org</email>
6
		<name>Robin H. Johnson</name>
7
	</maintainer>
8
	<maintainer>
9
		<email>agk@redhat.com</email>
10
		<name>Alasdair Kergon</name>
11
		<description>Upstream Maintainer (please CC on bugs)</description>
12
	</maintainer>
13
	<use>
14
		<flag name='clvm'>Allow users to build clustered lvm2</flag>
15
		<flag name='cman'>Cman support for clustered lvm</flag>
16
		<flag name='lvm1'>Allow users to build lvm2 with lvm1 support</flag>
17
		<flag name='lvm2create_initrd'>Install lvm2create_initrd script and pull in <pkg>sys-apps/makedev</pkg> for the /sbin/MAKEDEV command</flag>
18
		<flag name='thin'>Support for thin volumes</flag>
19
		<flag name='device-mapper-only'>Build only device-mapper and not the rest of LVM2 (UNSUPPORTED)</flag>
20
	</use>
21
	<upstream>
22
		<remote-id type="cpe">cpe:/a:heinz_mauelshagen:lvm2</remote-id>
23
	</upstream>
24
</pkgmetadata>

Return to bug 549506