--- lvm2-2.02.98.ebuild 2013-01-18 04:01:30.000000000 +0000 +++ lvm2-2.02.98-r3.ebuild 2013-04-16 17:02:35.933473913 +0100 @@ -3,7 +3,7 @@ # $Header: /var/cvsroot/gentoo-x86/sys-fs/lvm2/lvm2-2.02.98.ebuild,v 1.3 2013/01/18 03:39:06 ssuominen Exp $ EAPI=5 -inherit eutils multilib toolchain-funcs autotools linux-info udev +inherit eutils multilib toolchain-funcs autotools linux-info systemd udev DESCRIPTION="User-land utilities for LVM2 (device-mapper) software." HOMEPAGE="http://sources.redhat.com/lvm2/" @@ -110,6 +110,10 @@ tools/Makefile.in || die "sed failed" fi + # gentoo has lvm installed in /sbin + sed -i 's:/usr/sbin/lvm:/sbin/lvm:' \ + scripts/lvm2_activation_generator_systemd_red_hat.c || die "sed failed" + eautoreconf } @@ -177,6 +181,11 @@ myconf="${myconf} --with-clvmd=none --with-cluster=none" fi + # better to just force the unit dir + myconf="${myconf} --with-systemdsystemunitdir=$(systemd_get_unitdir)" + # and also change the default pid directory to /run instead of /var/run + myconf="${myconf} --with-default-pid-dir=/run" + local udevdir="${EPREFIX}/lib/udev/rules.d" use udev && udevdir="${EPREFIX}/$(udev_get_udevdir)/rules.d" @@ -207,11 +216,21 @@ einfo "Starting main build" emake AR="$(tc-getAR)" || die "compile fail" + + # when using systemd with lvmetad disabled + # a generator is needed for systemd to create /dev nodes + # note: this should be already build, but I am not sure + # if this is always, or just sometimes, better to force + emake -C scripts lvm2_activation_generator_systemd_red_hat } src_install() { emake DESTDIR="${D}" install + # install systemd files + emake DESTDIR="${D}" install_systemd_generators + emake DESTDIR="${D}" install_systemd_units + dodoc README VERSION* WHATS_NEW WHATS_NEW_DM doc/*.{conf,c,txt} newinitd "${FILESDIR}"/lvm.rc-2.02.95-r2 lvm newinitd "${FILESDIR}"/lvm-monitoring.initd-2.02.67-r2 lvm-monitoring @@ -270,6 +289,10 @@ elog "baselayout-2 users. If you are using baselayout-2, be sure to" elog "run: # rc-update add lvm boot" elog "Do NOT add it if you are still using baselayout-1." + + ewarn "Be sure to enabled use_lvmetad in /etc/lvm/lvm.conf" + ewarn "if you want to enable lvm autoactivation and metadata caching" + ewarn "More info can be found in lvmetad and lvm.conf man pages" } src_test() {