lvm2: install lvmetad; add systemd services from dmeventd, lvmetad and lvm on crypt (via Arch).

This commit is contained in:
Juan RP 2013-01-12 12:15:30 +01:00
parent 0c5e30c021
commit 58f46b6bf6
12 changed files with 112 additions and 26 deletions

View File

@ -2,10 +2,7 @@
# #
noarch=yes noarch=yes
depends="readline-devel ncurses-devel device-mapper-${version}_${revision}" depends="readline-devel ncurses-devel device-mapper-${version}_${revision}"
short_desc="${sourcepkg} development files" short_desc="Device Mapper userspace library -- development files"
long_desc="
This package contains the development files for the kernel device-mapper
library, libdevmapper."
do_install() { do_install() {
vmove usr/include usr vmove usr/include usr

View File

@ -1,10 +1,6 @@
# Template file for 'device-mapper' # Template file for 'device-mapper'
# #
short_desc="Device Mapper userspace library and tools" short_desc="Device Mapper userspace library and tools"
long_desc="
This package contains the supporting userspace utility, dmsetup,
for the kernel device-mapper and its required library, libdevmapper."
replaces="lvm2<2.02.95_3" replaces="lvm2<2.02.95_3"
do_install() { do_install() {
@ -16,4 +12,9 @@ do_install() {
for f in 10-dm 13-dm-disk 95-dm-notify; do for f in 10-dm 13-dm-disk 95-dm-notify; do
vmove usr/lib/udev/rules.d/${f}.rules usr/lib/udev/rules.d vmove usr/lib/udev/rules.d/${f}.rules usr/lib/udev/rules.d
done done
vmkdir usr/lib/systemd/system/sockets.target.wants
vinstall ${FILESDIR}/dmeventd.service 644 usr/lib/systemd/system
vinstall ${FILESDIR}/dmeventd.socket 644 usr/lib/systemd/system
ln -sf /usr/lib/systemd/system/dmeventd.socket \
${DESTDIR}/usr/lib/systemd/system/sockets.target.wants/dmeventd.socket
} }

View File

@ -0,0 +1,14 @@
[Unit]
Description=Device-mapper event daemon
Documentation=man:dmeventd(8)
Requires=dmeventd.socket
After=dmeventd.socket
DefaultDependencies=no
[Service]
Type=forking
ExecStart=/usr/sbin/dmeventd
ExecReload=/usr/sbin/dmeventd -R
Environment=SD_ACTIVATION=1
PIDFile=/run/dmeventd.pid
OOMScoreAdjust=-1000

View File

@ -0,0 +1,11 @@
[Unit]
Description=Device-mapper event daemon FIFOs
Documentation=man:dmeventd(8)
Before=sockets.target
DefaultDependencies=no
Conflicts=shutdown.target
[Socket]
ListenFIFO=/run/dmeventd-server
ListenFIFO=/run/dmeventd-client
SocketMode=0600

View File

@ -0,0 +1,18 @@
[Unit]
Description=Monitoring of LVM2 mirrors, snapshots etc. using dmeventd or progress polling
Documentation=man:dmeventd(8) man:lvcreate(8) man:lvchange(8) man:vgchange(8)
Requires=dmeventd.socket
After=dmeventd.socket lvmetad.socket lvmetad.service dmeventd.service
Before=local-fs-pre.target
DefaultDependencies=no
Conflicts=shutdown.target
[Service]
Type=oneshot
Environment=LVM_SUPPRESS_LOCKING_FAILURE_MESSAGES=1
ExecStart=/usr/sbin/lvm vgchange --monitor y
ExecStop=/usr/sbin/lvm vgchange --monitor n
RemainAfterExit=yes
[Install]
WantedBy=sysinit.target

View File

@ -0,0 +1,16 @@
[Unit]
Description=LVM activation of encrypted devices
DefaultDependencies=no
Requires=systemd-udev-settle.service
After=systemd-udev-settle.service cryptsetup.target
Before=shutdown.target
Conflicts=shutdown.target
[Service]
ExecStart=/sbin/vgchange --sysinit --available y
Type=oneshot
TimeoutSec=0
RemainAfterExit=yes
[Install]
WantedBy=basic.target

View File

@ -0,0 +1,2 @@
d /run/lock/lvm 0755 root root -
d /run/lvm 0755 root root -

View File

@ -0,0 +1,16 @@
[Unit]
Description=LVM2 metadata daemon
Documentation=man:lvmetad(8)
Requires=lvmetad.socket
After=lvmetad.socket
DefaultDependencies=no
Conflicts=shutdown.target
[Service]
Type=forking
NonBlocking=true
ExecStart=/usr/sbin/lvmetad
ExecReload=/usr/sbin/lvmetad -R
Environment=SD_ACTIVATION=1
Restart=on-abort
PIDFile=/run/lvmetad.pid

View File

@ -0,0 +1,10 @@
[Unit]
Description=LVM2 metadata daemon socket
Documentation=man:lvmetad(8)
Before=sockets.target systemd-udev-trigger.service
DefaultDependencies=no
Conflicts=shutdown.target
[Socket]
ListenStream=/run/lvm/lvmetad.socket
SocketMode=0600

View File

@ -4,9 +4,6 @@ noarch=yes
depends="device-mapper-devel-${version}_${revision} depends="device-mapper-devel-${version}_${revision}
liblvm2app-${version}_${revision}" liblvm2app-${version}_${revision}"
short_desc="LVM2 application library - development files" short_desc="LVM2 application library - development files"
long_desc="
This package contains files needed to develop applications that use the
lvm2app library."
do_install() { do_install() {
vmove usr/include/lvm2app.h usr/include vmove usr/include/lvm2app.h usr/include

View File

@ -1,11 +1,6 @@
# Template file for 'liblvm2app' # Template file for 'liblvm2app'
# #
short_desc="LVM2 application library" short_desc="LVM2 application library"
long_desc="
This package contains the lvm2app shared library. It allows easier access
to the basic LVM objects and provides functions to enumerate, create or
modify them."
do_install() { do_install() {
vmove "usr/lib/liblvm2app.so*" usr/lib vmove "usr/lib/liblvm2app.so*" usr/lib

View File

@ -1,14 +1,17 @@
# Template file for 'lvm2' # Template file for 'lvm2'
pkgname=lvm2 pkgname=lvm2
version=2.02.98 version=2.02.98
revision=1 revision=2
wrksrc=LVM2.${version} wrksrc=LVM2.${version}
build_style=gnu-configure build_style=gnu-configure
configure_args="--disable-selinux --enable-readline --enable-pkgconfig configure_args="--disable-selinux --enable-readline --enable-pkgconfig
--enable-fsadm --enable-applib --sbindir=/usr/sbin --libdir=/usr/lib --enable-fsadm --enable-applib --sbindir=/usr/sbin --libdir=/usr/lib
--enable-dmeventd --enable-cmdlib --enable-udev_sync --enable-udev_rules --enable-dmeventd --enable-cmdlib --enable-udev_sync --enable-udev_rules
--with-udevdir=/usr/lib/udev/rules.d" --with-udevdir=/usr/lib/udev/rules.d
makedepends="pkg-config readline-devel libudev-devel>=183" --with-systemdsystemunitdir=/usr/lib/systemd/system --with-default-pid-dir=/run
--with-default-dm-run-dir=/run --with-default-run-dir=/run/lvm
--with-default-locking-dir=/run/lock/lvm --enable-lvmetad"
makedepends="pkg-config readline-devel libudev-devel>=183 systemd-devel"
subpackages="liblvm2app liblvm2app-devel device-mapper device-mapper-devel" subpackages="liblvm2app liblvm2app-devel device-mapper device-mapper-devel"
conf_files="/etc/lvm/lvm.conf" conf_files="/etc/lvm/lvm.conf"
short_desc="Logical Volume Manager 2 utilities" short_desc="Logical Volume Manager 2 utilities"
@ -17,14 +20,20 @@ homepage="http://sourceware.org/lvm2/"
license="GPL-2, LGPL-2.1" license="GPL-2, LGPL-2.1"
distfiles="ftp://sources.redhat.com/pub/lvm2/LVM2.${version}.tgz" distfiles="ftp://sources.redhat.com/pub/lvm2/LVM2.${version}.tgz"
checksum=71030a58fef7e00d82ca4144334548e46aad24551a3cfbe7c3059b1bd137d864 checksum=71030a58fef7e00d82ca4144334548e46aad24551a3cfbe7c3059b1bd137d864
long_desc="
LVM2 includes all of the support for handling read/write operations on
physical volumes (hard disks, RAID-Systems, magneto optical, etc.,
multiple devices (MD), see mdadd(8) or even loop devices, see
losetup(8)), creating volume groups (kind of virtual disks) from one
or more physical volumes and creating one or more logical volumes
(kind of logical partitions) in volume groups."
make_dirs=" make_dirs="
/etc/lvm/archive 0755 root root /etc/lvm/archive 0755 root root
/etc/lvm/backup 0755 root root" /etc/lvm/backup 0755 root root"
post_install() {
vinstall ${FILESDIR}/lvm2.tmpfiles 644 usr/lib/tmpfiles.d lvm2.conf
vinstall ${FILESDIR}/lvm-monitoring.service 644 usr/lib/systemd/system
vinstall ${FILESDIR}/lvmetad.service 644 usr/lib/systemd/system
vinstall ${FILESDIR}/lvmetad.socket 644 usr/lib/systemd/system
vinstall ${FILESDIR}/lvm-on-crypt.service 644 usr/lib/systemd/system
vmkdir usr/lib/systemd/system/sockets.target.wants
ln -sf /usr/lib/systemd/system/lvmetad.socket \
${DESTDIR}/usr/lib/systemd/system/sockets.target.wants/lvmetad.socket
# enable lvmetad
sed 's|use_lvmetad = 0|use_lvmetad = 1|' -i ${DESTDIR}/etc/lvm/lvm.conf
}