diff --git a/srcpkgs/lvm2/device-mapper-devel.template b/srcpkgs/lvm2/device-mapper-devel.template index b0f98667224..511acf5aebb 100644 --- a/srcpkgs/lvm2/device-mapper-devel.template +++ b/srcpkgs/lvm2/device-mapper-devel.template @@ -2,10 +2,7 @@ # noarch=yes depends="readline-devel ncurses-devel device-mapper-${version}_${revision}" -short_desc="${sourcepkg} development files" -long_desc=" - This package contains the development files for the kernel device-mapper - library, libdevmapper." +short_desc="Device Mapper userspace library -- development files" do_install() { vmove usr/include usr diff --git a/srcpkgs/lvm2/device-mapper.template b/srcpkgs/lvm2/device-mapper.template index ccb75eb1bfc..adfdd3e3957 100644 --- a/srcpkgs/lvm2/device-mapper.template +++ b/srcpkgs/lvm2/device-mapper.template @@ -1,10 +1,6 @@ # Template file for 'device-mapper' # 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" do_install() { @@ -16,4 +12,9 @@ do_install() { 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 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 } diff --git a/srcpkgs/lvm2/files/dmeventd.service b/srcpkgs/lvm2/files/dmeventd.service new file mode 100644 index 00000000000..15ca21c0bf8 --- /dev/null +++ b/srcpkgs/lvm2/files/dmeventd.service @@ -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 diff --git a/srcpkgs/lvm2/files/dmeventd.socket b/srcpkgs/lvm2/files/dmeventd.socket new file mode 100644 index 00000000000..726d11236a5 --- /dev/null +++ b/srcpkgs/lvm2/files/dmeventd.socket @@ -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 diff --git a/srcpkgs/lvm2/files/lvm-monitoring.service b/srcpkgs/lvm2/files/lvm-monitoring.service new file mode 100644 index 00000000000..8f5247b002b --- /dev/null +++ b/srcpkgs/lvm2/files/lvm-monitoring.service @@ -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 diff --git a/srcpkgs/lvm2/files/lvm-on-crypt.service b/srcpkgs/lvm2/files/lvm-on-crypt.service new file mode 100644 index 00000000000..4ade6c5b0df --- /dev/null +++ b/srcpkgs/lvm2/files/lvm-on-crypt.service @@ -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 diff --git a/srcpkgs/lvm2/files/lvm2.tmpfiles b/srcpkgs/lvm2/files/lvm2.tmpfiles new file mode 100644 index 00000000000..129824552ca --- /dev/null +++ b/srcpkgs/lvm2/files/lvm2.tmpfiles @@ -0,0 +1,2 @@ +d /run/lock/lvm 0755 root root - +d /run/lvm 0755 root root - diff --git a/srcpkgs/lvm2/files/lvmetad.service b/srcpkgs/lvm2/files/lvmetad.service new file mode 100644 index 00000000000..64168f46508 --- /dev/null +++ b/srcpkgs/lvm2/files/lvmetad.service @@ -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 diff --git a/srcpkgs/lvm2/files/lvmetad.socket b/srcpkgs/lvm2/files/lvmetad.socket new file mode 100644 index 00000000000..9c0ffa5b4f7 --- /dev/null +++ b/srcpkgs/lvm2/files/lvmetad.socket @@ -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 diff --git a/srcpkgs/lvm2/liblvm2app-devel.template b/srcpkgs/lvm2/liblvm2app-devel.template index 7c3586c07ee..f46432004e5 100644 --- a/srcpkgs/lvm2/liblvm2app-devel.template +++ b/srcpkgs/lvm2/liblvm2app-devel.template @@ -4,9 +4,6 @@ noarch=yes depends="device-mapper-devel-${version}_${revision} liblvm2app-${version}_${revision}" short_desc="LVM2 application library - development files" -long_desc=" - This package contains files needed to develop applications that use the - lvm2app library." do_install() { vmove usr/include/lvm2app.h usr/include diff --git a/srcpkgs/lvm2/liblvm2app.template b/srcpkgs/lvm2/liblvm2app.template index 1a9be7aa939..51d69706a8c 100644 --- a/srcpkgs/lvm2/liblvm2app.template +++ b/srcpkgs/lvm2/liblvm2app.template @@ -1,11 +1,6 @@ # Template file for 'liblvm2app' # 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() { vmove "usr/lib/liblvm2app.so*" usr/lib diff --git a/srcpkgs/lvm2/template b/srcpkgs/lvm2/template index 46106c0aafb..73e617ee303 100644 --- a/srcpkgs/lvm2/template +++ b/srcpkgs/lvm2/template @@ -1,14 +1,17 @@ # Template file for 'lvm2' pkgname=lvm2 version=2.02.98 -revision=1 +revision=2 wrksrc=LVM2.${version} build_style=gnu-configure configure_args="--disable-selinux --enable-readline --enable-pkgconfig --enable-fsadm --enable-applib --sbindir=/usr/sbin --libdir=/usr/lib --enable-dmeventd --enable-cmdlib --enable-udev_sync --enable-udev_rules - --with-udevdir=/usr/lib/udev/rules.d" -makedepends="pkg-config readline-devel libudev-devel>=183" + --with-udevdir=/usr/lib/udev/rules.d + --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" conf_files="/etc/lvm/lvm.conf" short_desc="Logical Volume Manager 2 utilities" @@ -17,14 +20,20 @@ homepage="http://sourceware.org/lvm2/" license="GPL-2, LGPL-2.1" distfiles="ftp://sources.redhat.com/pub/lvm2/LVM2.${version}.tgz" 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=" /etc/lvm/archive 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 +}