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