1 |
commit: db137f8ae8978cefd4f00fc1829b8b21a44b62ef |
2 |
Author: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Apr 8 19:11:42 2019 +0000 |
4 |
Commit: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Apr 8 19:11:42 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=db137f8a |
7 |
|
8 |
sys-fs/lvm2: add dmfilemapd and lvmpolld |
9 |
|
10 |
Package-Manager: Portage-2.3.62, Repoman-2.3.12 |
11 |
Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org> |
12 |
|
13 |
sys-fs/lvm2/files/lvmpolld.initd-2.02.183 | 17 ++ |
14 |
sys-fs/lvm2/lvm2-2.02.184-r1.ebuild | 262 ++++++++++++++++++++++++++++++ |
15 |
2 files changed, 279 insertions(+) |
16 |
|
17 |
diff --git a/sys-fs/lvm2/files/lvmpolld.initd-2.02.183 b/sys-fs/lvm2/files/lvmpolld.initd-2.02.183 |
18 |
new file mode 100644 |
19 |
index 00000000000..6b260109a66 |
20 |
--- /dev/null |
21 |
+++ b/sys-fs/lvm2/files/lvmpolld.initd-2.02.183 |
22 |
@@ -0,0 +1,17 @@ |
23 |
+#!/sbin/openrc-run |
24 |
+# Copyright 1999-2019 Gentoo Authors |
25 |
+# Distributed under the terms of the GNU General Public License v2 |
26 |
+ |
27 |
+pidfile="/run/lvmpolld.pid" |
28 |
+command="/sbin/lvmpolld" |
29 |
+command_args="${LVMPOLLD_OPTS:=-p ${pidfile}}" |
30 |
+start_stop_daemon_args="--pidfile ${pidfile}" |
31 |
+ |
32 |
+depend() { |
33 |
+ : |
34 |
+} |
35 |
+ |
36 |
+start_pre() |
37 |
+{ |
38 |
+ checkpath --directory /run/lvm || return 1 |
39 |
+} |
40 |
|
41 |
diff --git a/sys-fs/lvm2/lvm2-2.02.184-r1.ebuild b/sys-fs/lvm2/lvm2-2.02.184-r1.ebuild |
42 |
new file mode 100644 |
43 |
index 00000000000..dcbcd854bf3 |
44 |
--- /dev/null |
45 |
+++ b/sys-fs/lvm2/lvm2-2.02.184-r1.ebuild |
46 |
@@ -0,0 +1,262 @@ |
47 |
+# Copyright 1999-2019 Gentoo Authors |
48 |
+# Distributed under the terms of the GNU General Public License v2 |
49 |
+ |
50 |
+EAPI=6 |
51 |
+inherit autotools linux-info multilib systemd toolchain-funcs udev flag-o-matic |
52 |
+ |
53 |
+DESCRIPTION="User-land utilities for LVM2 (device-mapper) software" |
54 |
+HOMEPAGE="https://sourceware.org/lvm2/" |
55 |
+SRC_URI="ftp://sourceware.org/pub/lvm2/${PN/lvm/LVM}.${PV}.tgz |
56 |
+ ftp://sourceware.org/pub/lvm2/old/${PN/lvm/LVM}.${PV}.tgz" |
57 |
+ |
58 |
+LICENSE="GPL-2" |
59 |
+SLOT="0" |
60 |
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~x86-linux" |
61 |
+IUSE="readline static static-libs systemd lvm2create_initrd sanlock selinux +udev +thin device-mapper-only" |
62 |
+REQUIRED_USE="device-mapper-only? ( !lvm2create_initrd !sanlock !thin ) |
63 |
+ systemd? ( udev )" |
64 |
+ |
65 |
+DEPEND_COMMON=" |
66 |
+ dev-libs/libaio[static-libs?] |
67 |
+ static? ( dev-libs/libaio[static-libs] ) |
68 |
+ !static? ( dev-libs/libaio[static-libs?] ) |
69 |
+ readline? ( sys-libs/readline:0= ) |
70 |
+ sanlock? ( sys-cluster/sanlock ) |
71 |
+ systemd? ( >=sys-apps/systemd-205:0= ) |
72 |
+ udev? ( >=virtual/libudev-208:=[static-libs?] )" |
73 |
+# /run is now required for locking during early boot. /var cannot be assumed to |
74 |
+# be available -- thus, pull in recent enough baselayout for /run. |
75 |
+# This version of LVM is incompatible with cryptsetup <1.1.2. |
76 |
+RDEPEND="${DEPEND_COMMON} |
77 |
+ >=sys-apps/baselayout-2.2 |
78 |
+ !<sys-apps/openrc-0.11 |
79 |
+ !<sys-fs/cryptsetup-1.1.2 |
80 |
+ !!sys-fs/lvm-user |
81 |
+ >=sys-apps/util-linux-2.16 |
82 |
+ lvm2create_initrd? ( sys-apps/makedev ) |
83 |
+ thin? ( >=sys-block/thin-provisioning-tools-0.3.0 )" |
84 |
+# note: thin- 0.3.0 is required to avoid --disable-thin_check_needs_check |
85 |
+# USE 'static' currently only works with eudev, bug 520450 |
86 |
+DEPEND="${DEPEND_COMMON} |
87 |
+ virtual/pkgconfig |
88 |
+ >=sys-devel/binutils-2.20.1-r1 |
89 |
+ sys-devel/autoconf-archive |
90 |
+ static? ( |
91 |
+ selinux? ( sys-libs/libselinux[static-libs] ) |
92 |
+ udev? ( >=sys-fs/eudev-3.1.2[static-libs] ) |
93 |
+ >=sys-apps/util-linux-2.16[static-libs] |
94 |
+ )" |
95 |
+ |
96 |
+S=${WORKDIR}/${PN/lvm/LVM}.${PV} |
97 |
+ |
98 |
+PATCHES=( |
99 |
+ # Gentoo specific modification(s): |
100 |
+ "${FILESDIR}"/${PN}-2.02.178-example.conf.in.patch |
101 |
+ |
102 |
+ # For upstream -- review and forward: |
103 |
+ "${FILESDIR}"/${PN}-2.02.63-always-make-static-libdm.patch |
104 |
+ "${FILESDIR}"/${PN}-2.02.56-lvm2create_initrd.patch |
105 |
+ "${FILESDIR}"/${PN}-2.02.67-createinitrd.patch #301331 |
106 |
+ "${FILESDIR}"/${PN}-2.02.99-locale-muck.patch #330373 |
107 |
+ "${FILESDIR}"/${PN}-2.02.178-asneeded.patch # -Wl,--as-needed |
108 |
+ "${FILESDIR}"/${PN}-2.02.178-dynamic-static-ldflags.patch #332905 |
109 |
+ "${FILESDIR}"/${PN}-2.02.178-static-pkgconfig-libs.patch #370217, #439414 + blkid |
110 |
+ "${FILESDIR}"/${PN}-2.02.176-pthread-pkgconfig.patch #492450 |
111 |
+ "${FILESDIR}"/${PN}-2.02.171-static-libm.patch #617756 |
112 |
+ "${FILESDIR}"/${PN}-2.02.166-HPPA-no-O_DIRECT.patch #657446 |
113 |
+ #"${FILESDIR}"/${PN}-2.02.145-mkdev.patch #580062 # Merged upstream |
114 |
+) |
115 |
+ |
116 |
+pkg_setup() { |
117 |
+ local CONFIG_CHECK="~SYSVIPC" |
118 |
+ |
119 |
+ if use udev; then |
120 |
+ local WARNING_SYSVIPC="CONFIG_SYSVIPC:\tis not set (required for udev sync)\n" |
121 |
+ if linux_config_exists; then |
122 |
+ local uevent_helper_path=$(linux_chkconfig_string UEVENT_HELPER_PATH) |
123 |
+ if [ -n "${uevent_helper_path}" ] && [ "${uevent_helper_path}" != '""' ]; then |
124 |
+ ewarn "It's recommended to set an empty value to the following kernel config option:" |
125 |
+ ewarn "CONFIG_UEVENT_HELPER_PATH=${uevent_helper_path}" |
126 |
+ fi |
127 |
+ fi |
128 |
+ fi |
129 |
+ |
130 |
+ check_extra_config |
131 |
+ |
132 |
+ # 1. Genkernel no longer copies /sbin/lvm blindly. |
133 |
+ if use static; then |
134 |
+ elog "Warning, we no longer overwrite /sbin/lvm and /sbin/dmsetup with" |
135 |
+ elog "their static versions. If you need the static binaries," |
136 |
+ elog "you must append .static to the filename!" |
137 |
+ fi |
138 |
+} |
139 |
+ |
140 |
+src_prepare() { |
141 |
+ default |
142 |
+ |
143 |
+ sed -i \ |
144 |
+ -e "1iAR = $(tc-getAR)" \ |
145 |
+ -e "s:CC ?= @CC@:CC = $(tc-getCC):" \ |
146 |
+ make.tmpl.in || die #444082 |
147 |
+ |
148 |
+ sed -i -e '/FLAG/s:-O2::' configure{.ac,} || die #480212 |
149 |
+ |
150 |
+ if use udev && ! use device-mapper-only; then |
151 |
+ sed -i -e '/use_lvmetad =/s:0:1:' conf/example.conf.in || die #514196 |
152 |
+ elog "Notice that \"use_lvmetad\" setting is enabled with USE=\"udev\" in" |
153 |
+ elog "/etc/lvm/lvm.conf, which will require restart of udev, lvm, and lvmetad" |
154 |
+ elog "if it was previously disabled." |
155 |
+ fi |
156 |
+ |
157 |
+ sed -i -e "s:/usr/bin/true:$(type -P true):" scripts/blk_availability_systemd_red_hat.service.in || die #517514 |
158 |
+ |
159 |
+ # Without thin-privision-tools, there is nothing to install for target install_man7: |
160 |
+ if ! use thin ; then |
161 |
+ sed -i -e '/^install_lvm2/s:install_man7::' man/Makefile.in || die |
162 |
+ fi |
163 |
+ |
164 |
+ eautoreconf |
165 |
+} |
166 |
+ |
167 |
+src_configure() { |
168 |
+ filter-flags -flto |
169 |
+ local myeconfargs=() |
170 |
+ |
171 |
+ # Most of this package does weird stuff. |
172 |
+ # The build options are tristate, and --without is NOT supported |
173 |
+ # options: 'none', 'internal', 'shared' |
174 |
+ myeconfargs+=( |
175 |
+ $(use_enable !device-mapper-only dmfilemapd) |
176 |
+ $(use_enable !device-mapper-only dmeventd) |
177 |
+ $(use_enable !device-mapper-only cmdlib) |
178 |
+ $(use_enable !device-mapper-only applib) |
179 |
+ $(use_enable !device-mapper-only fsadm) |
180 |
+ $(use_enable !device-mapper-only lvmetad) |
181 |
+ $(use_enable !device-mapper-only lvmpolld) |
182 |
+ $(usex device-mapper-only --disable-udev-systemd-background-jobs '') |
183 |
+ |
184 |
+ # This only causes the .static versions to become available |
185 |
+ $(usex static --enable-static_link '') |
186 |
+ |
187 |
+ # dmeventd requires mirrors to be internal, and snapshot available |
188 |
+ # so we cannot disable them |
189 |
+ --with-mirrors="$(usex device-mapper-only none internal)" |
190 |
+ --with-snapshots="$(usex device-mapper-only none internal)" |
191 |
+ |
192 |
+ # disable O_DIRECT support on hppa, breaks pv detection (#99532) |
193 |
+ $(usex hppa --disable-o_direct '') |
194 |
+ ) |
195 |
+ |
196 |
+ if use thin; then |
197 |
+ myeconfargs+=( --with-thin=internal --with-cache=internal ) |
198 |
+ local texec |
199 |
+ for texec in check dump repair restore; do |
200 |
+ myeconfargs+=( --with-thin-${texec}="${EPREFIX}"/sbin/thin_${texec} ) |
201 |
+ myeconfargs+=( --with-cache-${texec}="${EPREFIX}"/sbin/cache_${texec} ) |
202 |
+ done |
203 |
+ else |
204 |
+ myeconfargs+=( --with-thin=none --with-cache=none ) |
205 |
+ fi |
206 |
+ |
207 |
+ myeconfargs+=( --with-clvmd=none --with-cluster=none ) |
208 |
+ |
209 |
+ myeconfargs+=( |
210 |
+ $(use_enable readline) |
211 |
+ $(use_enable selinux) |
212 |
+ --enable-pkgconfig |
213 |
+ --with-confdir="${EPREFIX}"/etc |
214 |
+ --exec-prefix="${EPREFIX}" |
215 |
+ --sbindir="${EPREFIX}/sbin" |
216 |
+ --with-staticdir="${EPREFIX}"/sbin |
217 |
+ --libdir="${EPREFIX}/$(get_libdir)" |
218 |
+ --with-usrlibdir="${EPREFIX}/usr/$(get_libdir)" |
219 |
+ --with-default-dm-run-dir=/run |
220 |
+ --with-default-run-dir=/run/lvm |
221 |
+ --with-default-locking-dir=/run/lock/lvm |
222 |
+ --with-default-pid-dir=/run |
223 |
+ $(use_enable udev udev_rules) |
224 |
+ $(use_enable udev udev_sync) |
225 |
+ $(use_with udev udevdir "$(get_udevdir)"/rules.d) |
226 |
+ $(use_enable sanlock lvmlockd-sanlock) |
227 |
+ $(use_enable systemd udev-systemd-background-jobs) |
228 |
+ $(use_enable systemd notify-dbus) |
229 |
+ --with-systemdsystemunitdir="$(systemd_get_systemunitdir)" |
230 |
+ CLDFLAGS="${LDFLAGS}" |
231 |
+ ) |
232 |
+ econf "${myeconfargs[@]}" |
233 |
+} |
234 |
+ |
235 |
+src_compile() { |
236 |
+ pushd include >/dev/null |
237 |
+ emake |
238 |
+ popd >/dev/null |
239 |
+ |
240 |
+ if use device-mapper-only ; then |
241 |
+ emake device-mapper |
242 |
+ else |
243 |
+ emake |
244 |
+ emake CC="$(tc-getCC)" -C scripts lvm2_activation_generator_systemd_red_hat |
245 |
+ fi |
246 |
+} |
247 |
+ |
248 |
+src_install() { |
249 |
+ local inst INSTALL_TARGETS |
250 |
+ INSTALL_TARGETS=( install install_tmpfiles_configuration ) |
251 |
+ # install systemd related files only when requested, bug #522430 |
252 |
+ use systemd && INSTALL_TARGETS+=( install_systemd_units install_systemd_generators ) |
253 |
+ use device-mapper-only && INSTALL_TARGETS=( install_device-mapper ) |
254 |
+ for inst in ${INSTALL_TARGETS[@]}; do |
255 |
+ emake DESTDIR="${D}" ${inst} |
256 |
+ done |
257 |
+ |
258 |
+ newinitd "${FILESDIR}"/device-mapper.rc-2.02.105-r2 device-mapper |
259 |
+ newconfd "${FILESDIR}"/device-mapper.conf-1.02.22-r3 device-mapper |
260 |
+ |
261 |
+ if use !device-mapper-only ; then |
262 |
+ newinitd "${FILESDIR}"/dmeventd.initd-2.02.67-r1 dmeventd |
263 |
+ newinitd "${FILESDIR}"/lvm.rc-2.02.172 lvm |
264 |
+ newconfd "${FILESDIR}"/lvm.confd-2.02.28-r2 lvm |
265 |
+ |
266 |
+ newinitd "${FILESDIR}"/lvm-monitoring.initd-2.02.105-r2 lvm-monitoring |
267 |
+ newinitd "${FILESDIR}"/lvmetad.initd-2.02.116-r3 lvmetad |
268 |
+ newinitd "${FILESDIR}"/lvmpolld.initd-2.02.183 lvmpolld |
269 |
+ fi |
270 |
+ |
271 |
+ if use sanlock; then |
272 |
+ newinitd "${FILESDIR}"/lvmlockd.initd-2.02.166-r1 lvmlockd |
273 |
+ fi |
274 |
+ |
275 |
+ if use static-libs; then |
276 |
+ dolib.a libdm/ioctl/libdevmapper.a |
277 |
+ dolib.a libdaemon/client/libdaemonclient.a #462908 |
278 |
+ #gen_usr_ldscript libdevmapper.so |
279 |
+ dolib.a daemons/dmeventd/libdevmapper-event.a |
280 |
+ #gen_usr_ldscript libdevmapper-event.so |
281 |
+ else |
282 |
+ rm -f "${ED%/}"/usr/$(get_libdir)/{libdevmapper-event,liblvm2cmd,liblvm2app,libdevmapper}.a |
283 |
+ fi |
284 |
+ |
285 |
+ if use lvm2create_initrd; then |
286 |
+ dosbin scripts/lvm2create_initrd/lvm2create_initrd |
287 |
+ doman scripts/lvm2create_initrd/lvm2create_initrd.8 |
288 |
+ newdoc scripts/lvm2create_initrd/README README.lvm2create_initrd |
289 |
+ fi |
290 |
+ |
291 |
+ insinto /etc |
292 |
+ doins "${FILESDIR}"/dmtab |
293 |
+ |
294 |
+ dodoc README VERSION* WHATS_NEW WHATS_NEW_DM doc/*.{c,txt} conf/*.conf |
295 |
+} |
296 |
+ |
297 |
+pkg_postinst() { |
298 |
+ ewarn "Make sure the \"lvm\" init script is in the runlevels:" |
299 |
+ ewarn "# rc-update add lvm boot" |
300 |
+ ewarn |
301 |
+ ewarn "Make sure to enable lvmetad in /etc/lvm/lvm.conf if you want" |
302 |
+ ewarn "to enable lvm autoactivation and metadata caching." |
303 |
+} |
304 |
+ |
305 |
+src_test() { |
306 |
+ einfo "Tests are disabled because of device-node mucking, if you want to" |
307 |
+ einfo "run tests, compile the package and see ${S}/tests" |
308 |
+} |