Date: Thursday, September 28, 2017 @ 20:23:11 Author: eworm Revision: 306455
archrelease: copy trunk to testing-i686, testing-x86_64 Added: lvm2/repos/testing-i686/ lvm2/repos/testing-i686/0001-lvm2-make-sockets-static.patch (from rev 306454, lvm2/trunk/0001-lvm2-make-sockets-static.patch) lvm2/repos/testing-i686/0002-toollib_fix_parentheses_in_assignment_comparison.patch (from rev 306454, lvm2/trunk/0002-toollib_fix_parentheses_in_assignment_comparison.patch) lvm2/repos/testing-i686/11-dm-initramfs.rules (from rev 306454, lvm2/trunk/11-dm-initramfs.rules) lvm2/repos/testing-i686/PKGBUILD (from rev 306454, lvm2/trunk/PKGBUILD) lvm2/repos/testing-i686/lvm2.install (from rev 306454, lvm2/trunk/lvm2.install) lvm2/repos/testing-i686/lvm2_hook (from rev 306454, lvm2/trunk/lvm2_hook) lvm2/repos/testing-i686/lvm2_install (from rev 306454, lvm2/trunk/lvm2_install) lvm2/repos/testing-i686/sd-lvm2_install (from rev 306454, lvm2/trunk/sd-lvm2_install) lvm2/repos/testing-x86_64/ lvm2/repos/testing-x86_64/0001-lvm2-make-sockets-static.patch (from rev 306454, lvm2/trunk/0001-lvm2-make-sockets-static.patch) lvm2/repos/testing-x86_64/0002-toollib_fix_parentheses_in_assignment_comparison.patch (from rev 306454, lvm2/trunk/0002-toollib_fix_parentheses_in_assignment_comparison.patch) lvm2/repos/testing-x86_64/11-dm-initramfs.rules (from rev 306454, lvm2/trunk/11-dm-initramfs.rules) lvm2/repos/testing-x86_64/PKGBUILD (from rev 306454, lvm2/trunk/PKGBUILD) lvm2/repos/testing-x86_64/lvm2.install (from rev 306454, lvm2/trunk/lvm2.install) lvm2/repos/testing-x86_64/lvm2_hook (from rev 306454, lvm2/trunk/lvm2_hook) lvm2/repos/testing-x86_64/lvm2_install (from rev 306454, lvm2/trunk/lvm2_install) lvm2/repos/testing-x86_64/sd-lvm2_install (from rev 306454, lvm2/trunk/sd-lvm2_install) ----------------------------------------------------------------------------+ testing-i686/0001-lvm2-make-sockets-static.patch | 20 + testing-i686/0002-toollib_fix_parentheses_in_assignment_comparison.patch | 19 + testing-i686/11-dm-initramfs.rules | 3 testing-i686/PKGBUILD | 109 ++++++++++ testing-i686/lvm2.install | 25 ++ testing-i686/lvm2_hook | 25 ++ testing-i686/lvm2_install | 41 +++ testing-i686/sd-lvm2_install | 44 ++++ testing-x86_64/0001-lvm2-make-sockets-static.patch | 20 + testing-x86_64/0002-toollib_fix_parentheses_in_assignment_comparison.patch | 19 + testing-x86_64/11-dm-initramfs.rules | 3 testing-x86_64/PKGBUILD | 109 ++++++++++ testing-x86_64/lvm2.install | 25 ++ testing-x86_64/lvm2_hook | 25 ++ testing-x86_64/lvm2_install | 41 +++ testing-x86_64/sd-lvm2_install | 44 ++++ 16 files changed, 572 insertions(+) Copied: lvm2/repos/testing-i686/0001-lvm2-make-sockets-static.patch (from rev 306454, lvm2/trunk/0001-lvm2-make-sockets-static.patch) =================================================================== --- testing-i686/0001-lvm2-make-sockets-static.patch (rev 0) +++ testing-i686/0001-lvm2-make-sockets-static.patch 2017-09-28 20:23:11 UTC (rev 306455) @@ -0,0 +1,20 @@ +diff -Nur LVM2.2.02.106.orig/scripts/dm_event_systemd_red_hat.socket.in LVM2.2.02.106/scripts/dm_event_systemd_red_hat.socket.in +--- LVM2.2.02.106.orig/scripts/dm_event_systemd_red_hat.socket.in 2014-04-10 17:38:46.000000000 +0200 ++++ LVM2.2.02.106/scripts/dm_event_systemd_red_hat.socket.in 2014-04-26 14:21:10.097269315 +0200 +@@ -8,6 +8,3 @@ + ListenFIFO=@DEFAULT_DM_RUN_DIR@/dmeventd-client + SocketMode=0600 + RemoveOnStop=true +- +-[Install] +-WantedBy=sockets.target +diff -Nur LVM2.2.02.106.orig/scripts/lvm2_lvmetad_systemd_red_hat.socket.in LVM2.2.02.106/scripts/lvm2_lvmetad_systemd_red_hat.socket.in +--- LVM2.2.02.106.orig/scripts/lvm2_lvmetad_systemd_red_hat.socket.in 2014-04-10 17:38:46.000000000 +0200 ++++ LVM2.2.02.106/scripts/lvm2_lvmetad_systemd_red_hat.socket.in 2014-04-26 14:21:15.287156152 +0200 +@@ -7,6 +7,3 @@ + ListenStream=@DEFAULT_RUN_DIR@/lvmetad.socket + SocketMode=0600 + RemoveOnStop=true +- +-[Install] +-WantedBy=sysinit.target Copied: lvm2/repos/testing-i686/0002-toollib_fix_parentheses_in_assignment_comparison.patch (from rev 306454, lvm2/trunk/0002-toollib_fix_parentheses_in_assignment_comparison.patch) =================================================================== --- testing-i686/0002-toollib_fix_parentheses_in_assignment_comparison.patch (rev 0) +++ testing-i686/0002-toollib_fix_parentheses_in_assignment_comparison.patch 2017-09-28 20:23:11 UTC (rev 306455) @@ -0,0 +1,19 @@ +commit 5407327bc6fff77dabb6dd55150832373ba163a7 +Author: David Teigland <teigl...@redhat.com> +Date: Tue Sep 19 09:19:24 2017 -0500 + + toollib: fix parentheses in assignment + comparison + +diff --git a/tools/toollib.c b/tools/toollib.c +index 1799bc91c..bf3e9d643 100644 +--- a/tools/toollib.c ++++ b/tools/toollib.c +@@ -4464,7 +4464,7 @@ int process_each_pv(struct cmd_context *cmd, + * from all VGs are processed first, removing them from all_devices. Then + * any devs remaining in all_devices are processed. + */ +- if ((ret = _get_all_devices(cmd, &all_devices) != ECMD_PROCESSED)) { ++ if ((ret = _get_all_devices(cmd, &all_devices)) != ECMD_PROCESSED) { + ret_max = ret; + goto_out; + } Copied: lvm2/repos/testing-i686/11-dm-initramfs.rules (from rev 306454, lvm2/trunk/11-dm-initramfs.rules) =================================================================== --- testing-i686/11-dm-initramfs.rules (rev 0) +++ testing-i686/11-dm-initramfs.rules 2017-09-28 20:23:11 UTC (rev 306455) @@ -0,0 +1,3 @@ +# needed with new udev/mkinitcpio and as implemented in dracut: +# <http://git.kernel.org/?p=boot/dracut/dracut.git;a=commitdiff;h=12b9736228f2b34c15a9cb63be79cf7b6e865b54> +SUBSYSTEM=="block", KERNEL=="dm-[0-9]*", ACTION=="add|change", OPTIONS="db_persist" Copied: lvm2/repos/testing-i686/PKGBUILD (from rev 306454, lvm2/trunk/PKGBUILD) =================================================================== --- testing-i686/PKGBUILD (rev 0) +++ testing-i686/PKGBUILD 2017-09-28 20:23:11 UTC (rev 306455) @@ -0,0 +1,109 @@ +# $Id$ +# Maintainer: Eric Bélanger <e...@archlinux.org> +# Maintainer: Thomas Bächler <tho...@archlinux.org> + +pkgbase=lvm2 +pkgname=('lvm2' 'device-mapper') +pkgver=2.02.174 +pkgrel=2 +arch=('i686' 'x86_64') +url="http://sourceware.org/lvm2/" +license=('GPL2' 'LGPL2.1') +makedepends=('systemd' 'thin-provisioning-tools') +groups=('base') +validpgpkeys=('88437EF5C077BD113D3B7224228191C1567E2C17') # Alasdair G Kergon <a...@redhat.com> +source=(https://mirrors.kernel.org/sourceware/lvm2/releases/LVM2.${pkgver}.tgz{,.asc} + lvm2_install + lvm2_hook + sd-lvm2_install + 11-dm-initramfs.rules + 0001-lvm2-make-sockets-static.patch + 0002-toollib_fix_parentheses_in_assignment_comparison.patch) +sha256sums=('fb6ecec0408cb14ac4923c87cb0a356481122d7d0ae3fee6e94d2edb9d170a8b' + 'SKIP' + 'd3097296bdfd9912dbef6ac78b908f7017b0a668a5347f0811f1c3aaacdca0cf' + '97d7c92e4954bc0108e7cd183b2eb5fe7ecc97e6f56369669e6537cb6ed45d80' + 'ca25d7d827823ed88c5ed662d561ad9de0123ca6e8e5b568fe9eec3c89918614' + 'e10f24b57582d6e2da71f7c80732a62e0ee2e3b867fe84591ccdb53e80fa92e0' + 'ff2c21d8f1c01c5e889a61109a152dcbd15da017bb942cf598c82e2e18ad22fa' + '9883be237acb9fc49f229621d0c025fd9c29a4d0f43bfbe87ab6eb76bf389338') + +prepare() { + cd LVM2.${pkgver} + + # enable lvmetad + sed -i 's|use_lvmetad = 0|use_lvmetad = 1|' conf/example.conf.in + + # make systemd sockets static + patch -p1 -i "${srcdir}/0001-lvm2-make-sockets-static.patch" + + # toollib: fix parentheses in assignment + comparison + patch -p1 -i "${srcdir}/0002-toollib_fix_parentheses_in_assignment_comparison.patch" +} + +build() { + CONFIGUREOPTS="--prefix=/usr --sysconfdir=/etc --localstatedir=/var --sbindir=/usr/bin \ + --with-udev-prefix=/usr --with-systemdsystemunitdir=/usr/lib/systemd/system \ + --with-default-pid-dir=/run --with-default-dm-run-dir=/run --with-default-run-dir=/run/lvm \ + --enable-pkgconfig --enable-readline --enable-dmeventd --enable-cmdlib --enable-applib \ + --enable-udev_sync --enable-udev_rules --with-default-locking-dir=/run/lock/lvm \ + --enable-lvmetad --with-thin=internal --with-cache=internal" + + cp -a LVM2.${pkgver} LVM2-initramfs + + cd LVM2.${pkgver} + + ./configure $CONFIGUREOPTS --enable-udev-systemd-background-jobs + make + + # Build legacy udev rule for initramfs + cd ../LVM2-initramfs + ./configure $CONFIGUREOPTS --enable-udev-systemd-background-jobs=no + cd udev + make 69-dm-lvm-metad.rules +} + +package_device-mapper() { + pkgdesc="Device mapper userspace library and tools" + url="http://sourceware.org/dm/" + depends=('glibc' 'libsystemd') + + cd LVM2.${pkgver} + make DESTDIR="${pkgdir}" install_device-mapper + # extra udev rule for device-mapper in initramfs + install -D -m644 "${srcdir}/11-dm-initramfs.rules" "${pkgdir}/usr/lib/initcpio/udev/11-dm-initramfs.rules" + # Install dmeventd socket and service + make DESTDIR="${pkgdir}" install_systemd_units + rm -f "${pkgdir}/usr/lib/systemd/system/"{blk-availability.service,lvm2-*} + install -d -m755 "${pkgdir}/usr/lib/systemd/system/sockets.target.wants" + ln -sf ../dm-event.socket "${pkgdir}/usr/lib/systemd/system/sockets.target.wants/dm-event.socket" +} + +package_lvm2() { + pkgdesc="Logical Volume Manager 2 utilities" + depends=('bash' "device-mapper>=${pkgver}" 'libsystemd' 'readline' 'thin-provisioning-tools') + conflicts=('lvm' 'mkinitcpio<0.7') + backup=('etc/lvm/lvm.conf' + 'etc/lvm/lvmlocal.conf') + options=('!makeflags') + install=lvm2.install + + cd LVM2.${pkgver} + make DESTDIR="${pkgdir}" install_lvm2 + # install applib + make -C liblvm DESTDIR="${pkgdir}" install + # /etc directories + install -d "${pkgdir}"/etc/lvm/{archive,backup} + # mkinitcpio hook + install -D -m644 "${srcdir}/lvm2_hook" "${pkgdir}/usr/lib/initcpio/hooks/lvm2" + install -D -m644 "${srcdir}/lvm2_install" "${pkgdir}/usr/lib/initcpio/install/lvm2" + install -D -m644 "${srcdir}/sd-lvm2_install" "${pkgdir}/usr/lib/initcpio/install/sd-lvm2" + # extra udev rule for lvmetad in non-systemd initramfs + install -D -m644 "${srcdir}/LVM2-initramfs/udev/69-dm-lvm-metad.rules" "${pkgdir}/usr/lib/initcpio/udev/69-dm-lvm-metad.rules" + # systemd support + make DESTDIR="${pkgdir}" install_systemd_units + rm -f "${pkgdir}/usr/lib/systemd/system/"dm-* + install -d -m755 "${pkgdir}/usr/lib/systemd/system/sysinit.target.wants" + ln -sf ../lvm2-lvmetad.socket "${pkgdir}/usr/lib/systemd/system/sysinit.target.wants/lvm2-lvmetad.socket" + make DESTDIR="${pkgdir}" install_systemd_generators +} Copied: lvm2/repos/testing-i686/lvm2.install (from rev 306454, lvm2/trunk/lvm2.install) =================================================================== --- testing-i686/lvm2.install (rev 0) +++ testing-i686/lvm2.install 2017-09-28 20:23:11 UTC (rev 306455) @@ -0,0 +1,25 @@ +post_upgrade() { + if [ $(vercmp $2 2.02.98-2) -lt 0 ]; then + echo "Changes to the lvm2 package:" + echo " + Activating lvm in mkinitcpio now requires both the 'udev' and 'lvm2' hooks." + echo " + LVM volumes are automatically activated by udev (full hotplug support)." + echo " + You MUST have use_lvmetad = 1 in /etc/lvm/lvm.conf (the default)." + echo " + If you uncomment auto_activation_volume_list in /etc/lvm/lvm.conf, only the" + echo " volumes listed there will be activated (default: it is commented out)." + if [ -f /etc/lvm/lvm.conf.pacnew ]; then + echo "WARNING: /etc/lvm/lvm.conf.pacnew exists. You MUST merge the required changes" + echo " into /etc/lvm/lvm.conf or LVM will fail to work." + fi + fi + + if [ $(vercmp $2 2.02.106-2) -lt 0 ]; then + if [ -L /etc/systemd/system/sysinit.target.wants/lvm-monitoring.service ]; then + echo "rm /etc/systemd/system/sysinit.target.wants/lvm-monitoring.service" + rm /etc/systemd/system/sysinit.target.wants/lvm-monitoring.service + echo "ln -s /usr/lib/systemd/system/lvm2-monitor.service /etc/systemd/system/sysinit.target.wants/lvm2-monitor.service" + ln -s /usr/lib/systemd/system/lvm2-monitor.service /etc/systemd/system/sysinit.target.wants/lvm2-monitor.service + fi + fi +} + +# vim:set ts=2 sw=2 et: Copied: lvm2/repos/testing-i686/lvm2_hook (from rev 306454, lvm2/trunk/lvm2_hook) =================================================================== --- testing-i686/lvm2_hook (rev 0) +++ testing-i686/lvm2_hook 2017-09-28 20:23:11 UTC (rev 306455) @@ -0,0 +1,25 @@ +#!/usr/bin/ash + +run_earlyhook() { + mkdir /run/lvm + lvmetad +} + +# We are suffering a race condition in non-systemd initramfs: If lvmetad is +# killed before pvscan processes finish we have stale processes and +# uninitialized physical volumes. So wait for pvscan processes to finish. +# Break after 10 seconds (50*0.2s) to avaid infinite loop. +run_latehook() { + local i=50 + + while pgrep -f pvscan >/dev/null 2>/dev/null && [ $i -gt 0 ]; do + sleep 0.2 + i=$((i - 1)) + done +} + +run_cleanuphook() { + kill $(cat /run/lvmetad.pid) +} + +# vim: set ft=sh ts=4 sw=4 et: Copied: lvm2/repos/testing-i686/lvm2_install (from rev 306454, lvm2/trunk/lvm2_install) =================================================================== --- testing-i686/lvm2_install (rev 0) +++ testing-i686/lvm2_install 2017-09-28 20:23:11 UTC (rev 306455) @@ -0,0 +1,41 @@ +#!/usr/bin/bash + +build() { + local mod + local symlink + + for mod in dm-mod dm-snapshot dm-mirror dm-cache dm-cache-smq dm-thin-pool; do + add_module "$mod" + done + + # from lvm2 + add_binary "/usr/bin/lvm" + add_binary "/usr/bin/lvmetad" + + # from device-mapper + add_binary "/usr/bin/dmsetup" + + # from thin-provisioning-tools + add_binary "/usr/bin/pdata_tools" + for symlink in cache_{check,dump,metadata_size,repair,restore} thin_{check,delta,dump,ls,metadata_size,repair,restore,rmap,trim}; do + add_symlink "/usr/bin/${symlink}" "pdata_tools" + done + + add_file "/usr/lib/udev/rules.d/10-dm.rules" + add_file "/usr/lib/udev/rules.d/13-dm-disk.rules" + add_file "/usr/lib/udev/rules.d/95-dm-notify.rules" + add_file "/usr/lib/udev/rules.d/11-dm-lvm.rules" + add_file "/usr/lib/initcpio/udev/69-dm-lvm-metad.rules" "/usr/lib/udev/rules.d/69-dm-lvm-metad.rules" + add_file "/usr/lib/initcpio/udev/11-dm-initramfs.rules" "/usr/lib/udev/rules.d/11-dm-initramfs.rules" + add_file "/etc/lvm/lvm.conf" + + add_runscript +} + +help() { + cat <<HELPEOF +This hook enables LVM2 volumes in initramfs. +HELPEOF +} + +# vim: set ft=sh ts=4 sw=4 et: Copied: lvm2/repos/testing-i686/sd-lvm2_install (from rev 306454, lvm2/trunk/sd-lvm2_install) =================================================================== --- testing-i686/sd-lvm2_install (rev 0) +++ testing-i686/sd-lvm2_install 2017-09-28 20:23:11 UTC (rev 306455) @@ -0,0 +1,44 @@ +#!/usr/bin/bash + +build() { + local mod + local symlink + + for mod in dm-mod dm-snapshot dm-mirror dm-cache dm-cache-smq dm-thin-pool; do + add_module "$mod" + done + + # from lvm2 + add_binary "/usr/bin/lvm" + add_binary "/usr/bin/lvmetad" + + # from device-mapper + add_binary "/usr/bin/dmsetup" + + # from thin-provisioning-tools + add_binary "/usr/bin/pdata_tools" + for symlink in cache_{check,dump,metadata_size,repair,restore} thin_{check,delta,dump,ls,metadata_size,repair,restore,rmap,trim}; do + add_symlink "/usr/bin/${symlink}" "pdata_tools" + done + + add_file "/usr/lib/udev/rules.d/10-dm.rules" + add_file "/usr/lib/udev/rules.d/13-dm-disk.rules" + add_file "/usr/lib/udev/rules.d/95-dm-notify.rules" + add_file "/usr/lib/udev/rules.d/11-dm-lvm.rules" + add_file "/usr/lib/udev/rules.d/69-dm-lvm-metad.rules" + add_file "/usr/lib/initcpio/udev/11-dm-initramfs.rules" "/usr/lib/udev/rules.d/11-dm-initramfs.rules" + add_file "/etc/lvm/lvm.conf" + + add_file "/usr/lib/systemd/system/lvm2-lvmetad.service" + add_file "/usr/lib/systemd/system/lvm2-lvmetad.socket" + add_file "/usr/lib/systemd/system/lvm2-pvscan@.service" + add_symlink "/usr/lib/systemd/system/sysinit.target.wants/lvm2-lvmetad.socket" +} + +help() { + cat <<HELPEOF +This hook enables LVM2 volumes in systemd-based initramfs. +HELPEOF +} + +# vim: set ft=sh ts=4 sw=4 et: Copied: lvm2/repos/testing-x86_64/0001-lvm2-make-sockets-static.patch (from rev 306454, lvm2/trunk/0001-lvm2-make-sockets-static.patch) =================================================================== --- testing-x86_64/0001-lvm2-make-sockets-static.patch (rev 0) +++ testing-x86_64/0001-lvm2-make-sockets-static.patch 2017-09-28 20:23:11 UTC (rev 306455) @@ -0,0 +1,20 @@ +diff -Nur LVM2.2.02.106.orig/scripts/dm_event_systemd_red_hat.socket.in LVM2.2.02.106/scripts/dm_event_systemd_red_hat.socket.in +--- LVM2.2.02.106.orig/scripts/dm_event_systemd_red_hat.socket.in 2014-04-10 17:38:46.000000000 +0200 ++++ LVM2.2.02.106/scripts/dm_event_systemd_red_hat.socket.in 2014-04-26 14:21:10.097269315 +0200 +@@ -8,6 +8,3 @@ + ListenFIFO=@DEFAULT_DM_RUN_DIR@/dmeventd-client + SocketMode=0600 + RemoveOnStop=true +- +-[Install] +-WantedBy=sockets.target +diff -Nur LVM2.2.02.106.orig/scripts/lvm2_lvmetad_systemd_red_hat.socket.in LVM2.2.02.106/scripts/lvm2_lvmetad_systemd_red_hat.socket.in +--- LVM2.2.02.106.orig/scripts/lvm2_lvmetad_systemd_red_hat.socket.in 2014-04-10 17:38:46.000000000 +0200 ++++ LVM2.2.02.106/scripts/lvm2_lvmetad_systemd_red_hat.socket.in 2014-04-26 14:21:15.287156152 +0200 +@@ -7,6 +7,3 @@ + ListenStream=@DEFAULT_RUN_DIR@/lvmetad.socket + SocketMode=0600 + RemoveOnStop=true +- +-[Install] +-WantedBy=sysinit.target Copied: lvm2/repos/testing-x86_64/0002-toollib_fix_parentheses_in_assignment_comparison.patch (from rev 306454, lvm2/trunk/0002-toollib_fix_parentheses_in_assignment_comparison.patch) =================================================================== --- testing-x86_64/0002-toollib_fix_parentheses_in_assignment_comparison.patch (rev 0) +++ testing-x86_64/0002-toollib_fix_parentheses_in_assignment_comparison.patch 2017-09-28 20:23:11 UTC (rev 306455) @@ -0,0 +1,19 @@ +commit 5407327bc6fff77dabb6dd55150832373ba163a7 +Author: David Teigland <teigl...@redhat.com> +Date: Tue Sep 19 09:19:24 2017 -0500 + + toollib: fix parentheses in assignment + comparison + +diff --git a/tools/toollib.c b/tools/toollib.c +index 1799bc91c..bf3e9d643 100644 +--- a/tools/toollib.c ++++ b/tools/toollib.c +@@ -4464,7 +4464,7 @@ int process_each_pv(struct cmd_context *cmd, + * from all VGs are processed first, removing them from all_devices. Then + * any devs remaining in all_devices are processed. + */ +- if ((ret = _get_all_devices(cmd, &all_devices) != ECMD_PROCESSED)) { ++ if ((ret = _get_all_devices(cmd, &all_devices)) != ECMD_PROCESSED) { + ret_max = ret; + goto_out; + } Copied: lvm2/repos/testing-x86_64/11-dm-initramfs.rules (from rev 306454, lvm2/trunk/11-dm-initramfs.rules) =================================================================== --- testing-x86_64/11-dm-initramfs.rules (rev 0) +++ testing-x86_64/11-dm-initramfs.rules 2017-09-28 20:23:11 UTC (rev 306455) @@ -0,0 +1,3 @@ +# needed with new udev/mkinitcpio and as implemented in dracut: +# <http://git.kernel.org/?p=boot/dracut/dracut.git;a=commitdiff;h=12b9736228f2b34c15a9cb63be79cf7b6e865b54> +SUBSYSTEM=="block", KERNEL=="dm-[0-9]*", ACTION=="add|change", OPTIONS="db_persist" Copied: lvm2/repos/testing-x86_64/PKGBUILD (from rev 306454, lvm2/trunk/PKGBUILD) =================================================================== --- testing-x86_64/PKGBUILD (rev 0) +++ testing-x86_64/PKGBUILD 2017-09-28 20:23:11 UTC (rev 306455) @@ -0,0 +1,109 @@ +# $Id$ +# Maintainer: Eric Bélanger <e...@archlinux.org> +# Maintainer: Thomas Bächler <tho...@archlinux.org> + +pkgbase=lvm2 +pkgname=('lvm2' 'device-mapper') +pkgver=2.02.174 +pkgrel=2 +arch=('i686' 'x86_64') +url="http://sourceware.org/lvm2/" +license=('GPL2' 'LGPL2.1') +makedepends=('systemd' 'thin-provisioning-tools') +groups=('base') +validpgpkeys=('88437EF5C077BD113D3B7224228191C1567E2C17') # Alasdair G Kergon <a...@redhat.com> +source=(https://mirrors.kernel.org/sourceware/lvm2/releases/LVM2.${pkgver}.tgz{,.asc} + lvm2_install + lvm2_hook + sd-lvm2_install + 11-dm-initramfs.rules + 0001-lvm2-make-sockets-static.patch + 0002-toollib_fix_parentheses_in_assignment_comparison.patch) +sha256sums=('fb6ecec0408cb14ac4923c87cb0a356481122d7d0ae3fee6e94d2edb9d170a8b' + 'SKIP' + 'd3097296bdfd9912dbef6ac78b908f7017b0a668a5347f0811f1c3aaacdca0cf' + '97d7c92e4954bc0108e7cd183b2eb5fe7ecc97e6f56369669e6537cb6ed45d80' + 'ca25d7d827823ed88c5ed662d561ad9de0123ca6e8e5b568fe9eec3c89918614' + 'e10f24b57582d6e2da71f7c80732a62e0ee2e3b867fe84591ccdb53e80fa92e0' + 'ff2c21d8f1c01c5e889a61109a152dcbd15da017bb942cf598c82e2e18ad22fa' + '9883be237acb9fc49f229621d0c025fd9c29a4d0f43bfbe87ab6eb76bf389338') + +prepare() { + cd LVM2.${pkgver} + + # enable lvmetad + sed -i 's|use_lvmetad = 0|use_lvmetad = 1|' conf/example.conf.in + + # make systemd sockets static + patch -p1 -i "${srcdir}/0001-lvm2-make-sockets-static.patch" + + # toollib: fix parentheses in assignment + comparison + patch -p1 -i "${srcdir}/0002-toollib_fix_parentheses_in_assignment_comparison.patch" +} + +build() { + CONFIGUREOPTS="--prefix=/usr --sysconfdir=/etc --localstatedir=/var --sbindir=/usr/bin \ + --with-udev-prefix=/usr --with-systemdsystemunitdir=/usr/lib/systemd/system \ + --with-default-pid-dir=/run --with-default-dm-run-dir=/run --with-default-run-dir=/run/lvm \ + --enable-pkgconfig --enable-readline --enable-dmeventd --enable-cmdlib --enable-applib \ + --enable-udev_sync --enable-udev_rules --with-default-locking-dir=/run/lock/lvm \ + --enable-lvmetad --with-thin=internal --with-cache=internal" + + cp -a LVM2.${pkgver} LVM2-initramfs + + cd LVM2.${pkgver} + + ./configure $CONFIGUREOPTS --enable-udev-systemd-background-jobs + make + + # Build legacy udev rule for initramfs + cd ../LVM2-initramfs + ./configure $CONFIGUREOPTS --enable-udev-systemd-background-jobs=no + cd udev + make 69-dm-lvm-metad.rules +} + +package_device-mapper() { + pkgdesc="Device mapper userspace library and tools" + url="http://sourceware.org/dm/" + depends=('glibc' 'libsystemd') + + cd LVM2.${pkgver} + make DESTDIR="${pkgdir}" install_device-mapper + # extra udev rule for device-mapper in initramfs + install -D -m644 "${srcdir}/11-dm-initramfs.rules" "${pkgdir}/usr/lib/initcpio/udev/11-dm-initramfs.rules" + # Install dmeventd socket and service + make DESTDIR="${pkgdir}" install_systemd_units + rm -f "${pkgdir}/usr/lib/systemd/system/"{blk-availability.service,lvm2-*} + install -d -m755 "${pkgdir}/usr/lib/systemd/system/sockets.target.wants" + ln -sf ../dm-event.socket "${pkgdir}/usr/lib/systemd/system/sockets.target.wants/dm-event.socket" +} + +package_lvm2() { + pkgdesc="Logical Volume Manager 2 utilities" + depends=('bash' "device-mapper>=${pkgver}" 'libsystemd' 'readline' 'thin-provisioning-tools') + conflicts=('lvm' 'mkinitcpio<0.7') + backup=('etc/lvm/lvm.conf' + 'etc/lvm/lvmlocal.conf') + options=('!makeflags') + install=lvm2.install + + cd LVM2.${pkgver} + make DESTDIR="${pkgdir}" install_lvm2 + # install applib + make -C liblvm DESTDIR="${pkgdir}" install + # /etc directories + install -d "${pkgdir}"/etc/lvm/{archive,backup} + # mkinitcpio hook + install -D -m644 "${srcdir}/lvm2_hook" "${pkgdir}/usr/lib/initcpio/hooks/lvm2" + install -D -m644 "${srcdir}/lvm2_install" "${pkgdir}/usr/lib/initcpio/install/lvm2" + install -D -m644 "${srcdir}/sd-lvm2_install" "${pkgdir}/usr/lib/initcpio/install/sd-lvm2" + # extra udev rule for lvmetad in non-systemd initramfs + install -D -m644 "${srcdir}/LVM2-initramfs/udev/69-dm-lvm-metad.rules" "${pkgdir}/usr/lib/initcpio/udev/69-dm-lvm-metad.rules" + # systemd support + make DESTDIR="${pkgdir}" install_systemd_units + rm -f "${pkgdir}/usr/lib/systemd/system/"dm-* + install -d -m755 "${pkgdir}/usr/lib/systemd/system/sysinit.target.wants" + ln -sf ../lvm2-lvmetad.socket "${pkgdir}/usr/lib/systemd/system/sysinit.target.wants/lvm2-lvmetad.socket" + make DESTDIR="${pkgdir}" install_systemd_generators +} Copied: lvm2/repos/testing-x86_64/lvm2.install (from rev 306454, lvm2/trunk/lvm2.install) =================================================================== --- testing-x86_64/lvm2.install (rev 0) +++ testing-x86_64/lvm2.install 2017-09-28 20:23:11 UTC (rev 306455) @@ -0,0 +1,25 @@ +post_upgrade() { + if [ $(vercmp $2 2.02.98-2) -lt 0 ]; then + echo "Changes to the lvm2 package:" + echo " + Activating lvm in mkinitcpio now requires both the 'udev' and 'lvm2' hooks." + echo " + LVM volumes are automatically activated by udev (full hotplug support)." + echo " + You MUST have use_lvmetad = 1 in /etc/lvm/lvm.conf (the default)." + echo " + If you uncomment auto_activation_volume_list in /etc/lvm/lvm.conf, only the" + echo " volumes listed there will be activated (default: it is commented out)." + if [ -f /etc/lvm/lvm.conf.pacnew ]; then + echo "WARNING: /etc/lvm/lvm.conf.pacnew exists. You MUST merge the required changes" + echo " into /etc/lvm/lvm.conf or LVM will fail to work." + fi + fi + + if [ $(vercmp $2 2.02.106-2) -lt 0 ]; then + if [ -L /etc/systemd/system/sysinit.target.wants/lvm-monitoring.service ]; then + echo "rm /etc/systemd/system/sysinit.target.wants/lvm-monitoring.service" + rm /etc/systemd/system/sysinit.target.wants/lvm-monitoring.service + echo "ln -s /usr/lib/systemd/system/lvm2-monitor.service /etc/systemd/system/sysinit.target.wants/lvm2-monitor.service" + ln -s /usr/lib/systemd/system/lvm2-monitor.service /etc/systemd/system/sysinit.target.wants/lvm2-monitor.service + fi + fi +} + +# vim:set ts=2 sw=2 et: Copied: lvm2/repos/testing-x86_64/lvm2_hook (from rev 306454, lvm2/trunk/lvm2_hook) =================================================================== --- testing-x86_64/lvm2_hook (rev 0) +++ testing-x86_64/lvm2_hook 2017-09-28 20:23:11 UTC (rev 306455) @@ -0,0 +1,25 @@ +#!/usr/bin/ash + +run_earlyhook() { + mkdir /run/lvm + lvmetad +} + +# We are suffering a race condition in non-systemd initramfs: If lvmetad is +# killed before pvscan processes finish we have stale processes and +# uninitialized physical volumes. So wait for pvscan processes to finish. +# Break after 10 seconds (50*0.2s) to avaid infinite loop. +run_latehook() { + local i=50 + + while pgrep -f pvscan >/dev/null 2>/dev/null && [ $i -gt 0 ]; do + sleep 0.2 + i=$((i - 1)) + done +} + +run_cleanuphook() { + kill $(cat /run/lvmetad.pid) +} + +# vim: set ft=sh ts=4 sw=4 et: Copied: lvm2/repos/testing-x86_64/lvm2_install (from rev 306454, lvm2/trunk/lvm2_install) =================================================================== --- testing-x86_64/lvm2_install (rev 0) +++ testing-x86_64/lvm2_install 2017-09-28 20:23:11 UTC (rev 306455) @@ -0,0 +1,41 @@ +#!/usr/bin/bash + +build() { + local mod + local symlink + + for mod in dm-mod dm-snapshot dm-mirror dm-cache dm-cache-smq dm-thin-pool; do + add_module "$mod" + done + + # from lvm2 + add_binary "/usr/bin/lvm" + add_binary "/usr/bin/lvmetad" + + # from device-mapper + add_binary "/usr/bin/dmsetup" + + # from thin-provisioning-tools + add_binary "/usr/bin/pdata_tools" + for symlink in cache_{check,dump,metadata_size,repair,restore} thin_{check,delta,dump,ls,metadata_size,repair,restore,rmap,trim}; do + add_symlink "/usr/bin/${symlink}" "pdata_tools" + done + + add_file "/usr/lib/udev/rules.d/10-dm.rules" + add_file "/usr/lib/udev/rules.d/13-dm-disk.rules" + add_file "/usr/lib/udev/rules.d/95-dm-notify.rules" + add_file "/usr/lib/udev/rules.d/11-dm-lvm.rules" + add_file "/usr/lib/initcpio/udev/69-dm-lvm-metad.rules" "/usr/lib/udev/rules.d/69-dm-lvm-metad.rules" + add_file "/usr/lib/initcpio/udev/11-dm-initramfs.rules" "/usr/lib/udev/rules.d/11-dm-initramfs.rules" + add_file "/etc/lvm/lvm.conf" + + add_runscript +} + +help() { + cat <<HELPEOF +This hook enables LVM2 volumes in initramfs. +HELPEOF +} + +# vim: set ft=sh ts=4 sw=4 et: Copied: lvm2/repos/testing-x86_64/sd-lvm2_install (from rev 306454, lvm2/trunk/sd-lvm2_install) =================================================================== --- testing-x86_64/sd-lvm2_install (rev 0) +++ testing-x86_64/sd-lvm2_install 2017-09-28 20:23:11 UTC (rev 306455) @@ -0,0 +1,44 @@ +#!/usr/bin/bash + +build() { + local mod + local symlink + + for mod in dm-mod dm-snapshot dm-mirror dm-cache dm-cache-smq dm-thin-pool; do + add_module "$mod" + done + + # from lvm2 + add_binary "/usr/bin/lvm" + add_binary "/usr/bin/lvmetad" + + # from device-mapper + add_binary "/usr/bin/dmsetup" + + # from thin-provisioning-tools + add_binary "/usr/bin/pdata_tools" + for symlink in cache_{check,dump,metadata_size,repair,restore} thin_{check,delta,dump,ls,metadata_size,repair,restore,rmap,trim}; do + add_symlink "/usr/bin/${symlink}" "pdata_tools" + done + + add_file "/usr/lib/udev/rules.d/10-dm.rules" + add_file "/usr/lib/udev/rules.d/13-dm-disk.rules" + add_file "/usr/lib/udev/rules.d/95-dm-notify.rules" + add_file "/usr/lib/udev/rules.d/11-dm-lvm.rules" + add_file "/usr/lib/udev/rules.d/69-dm-lvm-metad.rules" + add_file "/usr/lib/initcpio/udev/11-dm-initramfs.rules" "/usr/lib/udev/rules.d/11-dm-initramfs.rules" + add_file "/etc/lvm/lvm.conf" + + add_file "/usr/lib/systemd/system/lvm2-lvmetad.service" + add_file "/usr/lib/systemd/system/lvm2-lvmetad.socket" + add_file "/usr/lib/systemd/system/lvm2-pvscan@.service" + add_symlink "/usr/lib/systemd/system/sysinit.target.wants/lvm2-lvmetad.socket" +} + +help() { + cat <<HELPEOF +This hook enables LVM2 volumes in systemd-based initramfs. +HELPEOF +} + +# vim: set ft=sh ts=4 sw=4 et: