Date: Saturday, November 28, 2015 @ 20:29:11 Author: bpiotrowski Revision: 252032
archrelease: copy trunk to testing-i686, testing-x86_64 Added: lvm2/repos/testing-i686/ lvm2/repos/testing-i686/11-dm-initramfs.rules (from rev 252031, lvm2/trunk/11-dm-initramfs.rules) lvm2/repos/testing-i686/PKGBUILD (from rev 252031, lvm2/trunk/PKGBUILD) lvm2/repos/testing-i686/lvm2-2.02.135-fix-reading-of-old-metadata-with-missing-cache-policy-or-mode.patch (from rev 252031, lvm2/trunk/lvm2-2.02.135-fix-reading-of-old-metadata-with-missing-cache-policy-or-mode.patch) lvm2/repos/testing-i686/lvm2-make-sockets-static.patch (from rev 252031, lvm2/trunk/lvm2-make-sockets-static.patch) lvm2/repos/testing-i686/lvm2.install (from rev 252031, lvm2/trunk/lvm2.install) lvm2/repos/testing-i686/lvm2_hook (from rev 252031, lvm2/trunk/lvm2_hook) lvm2/repos/testing-i686/lvm2_install (from rev 252031, lvm2/trunk/lvm2_install) lvm2/repos/testing-i686/sd-lvm2_install (from rev 252031, lvm2/trunk/sd-lvm2_install) lvm2/repos/testing-x86_64/ lvm2/repos/testing-x86_64/11-dm-initramfs.rules (from rev 252031, lvm2/trunk/11-dm-initramfs.rules) lvm2/repos/testing-x86_64/PKGBUILD (from rev 252031, lvm2/trunk/PKGBUILD) lvm2/repos/testing-x86_64/lvm2-2.02.135-fix-reading-of-old-metadata-with-missing-cache-policy-or-mode.patch (from rev 252031, lvm2/trunk/lvm2-2.02.135-fix-reading-of-old-metadata-with-missing-cache-policy-or-mode.patch) lvm2/repos/testing-x86_64/lvm2-make-sockets-static.patch (from rev 252031, lvm2/trunk/lvm2-make-sockets-static.patch) lvm2/repos/testing-x86_64/lvm2.install (from rev 252031, lvm2/trunk/lvm2.install) lvm2/repos/testing-x86_64/lvm2_hook (from rev 252031, lvm2/trunk/lvm2_hook) lvm2/repos/testing-x86_64/lvm2_install (from rev 252031, lvm2/trunk/lvm2_install) lvm2/repos/testing-x86_64/sd-lvm2_install (from rev 252031, lvm2/trunk/sd-lvm2_install) --------------------------------------------------------------------------------------------------+ testing-i686/11-dm-initramfs.rules | 3 testing-i686/PKGBUILD | 108 +++++++++ testing-i686/lvm2-2.02.135-fix-reading-of-old-metadata-with-missing-cache-policy-or-mode.patch | 116 ++++++++++ testing-i686/lvm2-make-sockets-static.patch | 20 + testing-i686/lvm2.install | 25 ++ testing-i686/lvm2_hook | 12 + testing-i686/lvm2_install | 34 ++ testing-i686/sd-lvm2_install | 32 ++ testing-x86_64/11-dm-initramfs.rules | 3 testing-x86_64/PKGBUILD | 108 +++++++++ testing-x86_64/lvm2-2.02.135-fix-reading-of-old-metadata-with-missing-cache-policy-or-mode.patch | 116 ++++++++++ testing-x86_64/lvm2-make-sockets-static.patch | 20 + testing-x86_64/lvm2.install | 25 ++ testing-x86_64/lvm2_hook | 12 + testing-x86_64/lvm2_install | 34 ++ testing-x86_64/sd-lvm2_install | 32 ++ 16 files changed, 700 insertions(+) Copied: lvm2/repos/testing-i686/11-dm-initramfs.rules (from rev 252031, lvm2/trunk/11-dm-initramfs.rules) =================================================================== --- testing-i686/11-dm-initramfs.rules (rev 0) +++ testing-i686/11-dm-initramfs.rules 2015-11-28 19:29:11 UTC (rev 252032) @@ -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 252031, lvm2/trunk/PKGBUILD) =================================================================== --- testing-i686/PKGBUILD (rev 0) +++ testing-i686/PKGBUILD 2015-11-28 19:29:11 UTC (rev 252032) @@ -0,0 +1,108 @@ +# $Id$ +# Maintainer: Eric Bélanger <e...@archlinux.org> +# Maintainer: Thomas Bächler <tho...@archlinux.org> + +pkgbase=lvm2 +pkgname=('lvm2' 'device-mapper') +pkgver=2.02.134 +pkgrel=2 +arch=('i686' 'x86_64') +url="http://sourceware.org/lvm2/" +license=('GPL2' 'LGPL2.1') +makedepends=('systemd' 'thin-provisioning-tools') +groups=('base') +source=(ftp://sources.redhat.com/pub/lvm2/LVM2.${pkgver}.tgz{,.asc} + lvm2_install + lvm2_hook + sd-lvm2_install + 11-dm-initramfs.rules + lvm2-make-sockets-static.patch + lvm2-2.02.135-fix-reading-of-old-metadata-with-missing-cache-policy-or-mode.patch) +sha1sums=('4180405b7847515a08def649d3140b5d8bd0e258' + 'SKIP' + '40ef991650555b904e73bcc3f344d736722e27ca' + 'ff0fdf0a3005a41acd4b36865056109effc3474b' + '86c18852409dc03f38bdd734ac3e7b54bed9c4ce' + 'f6a554eea9557c3c236df2943bb6e7e723945c41' + 'b084512af42f2e16cdccd8b7ee4de27b574d1f94' + '19c61c9c240cbef44833a1112305f6f7450e8140') +validpgpkeys=('88437EF5C077BD113D3B7224228191C1567E2C17') + +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}/lvm2-make-sockets-static.patch" + + # lvm2 fails to detect cache metadata if cache policy is missing + patch -p1 -i "${srcdir}"/lvm2-2.02.135-fix-reading-of-old-metadata-with-missing-cache-policy-or-mode.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' 'systemd') + + 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}" 'systemd' 'readline' 'thin-provisioning-tools') + conflicts=('lvm' 'mkinitcpio<0.7') + backup=('etc/lvm/lvm.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-2.02.135-fix-reading-of-old-metadata-with-missing-cache-policy-or-mode.patch (from rev 252031, lvm2/trunk/lvm2-2.02.135-fix-reading-of-old-metadata-with-missing-cache-policy-or-mode.patch) =================================================================== --- testing-i686/lvm2-2.02.135-fix-reading-of-old-metadata-with-missing-cache-policy-or-mode.patch (rev 0) +++ testing-i686/lvm2-2.02.135-fix-reading-of-old-metadata-with-missing-cache-policy-or-mode.patch 2015-11-28 19:29:11 UTC (rev 252032) @@ -0,0 +1,116 @@ +commit 265a99e98a81113c2f27f0e4d6c5b73d198ed586 +Author: Peter Rajnoha <prajn...@redhat.com> +Date: Tue Nov 24 11:28:31 2015 +0100 + + Fix reading of old cache metadata. +--- + lib/cache_segtype/cache.c | 34 +++++++++++++++++++++++++++++++++ + test/shell/lvchange-cache-old.sh | 41 ++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 75 insertions(+) + +diff --git a/lib/cache_segtype/cache.c b/lib/cache_segtype/cache.c +index 85cba18..2a7eb96 100644 +--- a/lib/cache_segtype/cache.c ++++ b/lib/cache_segtype/cache.c +@@ -34,6 +34,32 @@ static unsigned _feature_mask; + log_error(t " segment %s of logical volume %s.", ## p, \ + dm_config_parent_name(sn), seg->lv->name), 0; + ++/* ++ * When older metadata are loaded without newer settings, ++ * set then to default settings (the one that could have been ++ * used implicitely at that time). ++ * ++ * Needs both segments cache and cache_pool to be loaded. ++ */ ++static int _fix_missing_defaults(struct lv_segment *cpool_seg) ++{ ++ if (!cpool_seg->policy_name) { ++ cpool_seg->policy_name = "mq"; ++ log_verbose("Cache is missing cache policy, using %s.", ++ cpool_seg->policy_name); ++ } ++ ++ if (!cache_mode_is_set(cpool_seg)) { ++ if (!cache_set_mode(cpool_seg, "writethrough")) { ++ log_error(INTERNAL_ERROR "Failed to writethrough cache mode."); ++ return 0; ++ } ++ log_verbose("Cache is missing cache mode, using %s.", ++ get_cache_mode_name(cpool_seg)); ++ } ++ ++ return 1; ++} + + static int _cache_pool_text_import(struct lv_segment *seg, + const struct dm_config_node *sn, +@@ -115,6 +141,10 @@ static int _cache_pool_text_import(struct lv_segment *seg, + if (!attach_pool_metadata_lv(seg, meta_lv)) + return_0; + ++ if (!dm_list_empty(&seg->lv->segs_using_this_lv) && ++ !_fix_missing_defaults(seg)) ++ return_0; ++ + return 1; + } + +@@ -319,6 +349,10 @@ static int _cache_text_import(struct lv_segment *seg, + if (!attach_pool_lv(seg, pool_lv, NULL, NULL)) + return_0; + ++ if (!dm_list_empty(&pool_lv->segments) && ++ !_fix_missing_defaults(first_seg(pool_lv))) ++ return_0; ++ + return 1; + } + +diff --git a/test/shell/lvchange-cache-old.sh b/test/shell/lvchange-cache-old.sh +new file mode 100644 +index 0000000..0b6ef7c +--- /dev/null ++++ b/test/shell/lvchange-cache-old.sh +@@ -0,0 +1,41 @@ ++#!/bin/sh ++# Copyright (C) 2015 Red Hat, Inc. All rights reserved. ++# ++# This copyrighted material is made available to anyone wishing to use, ++# modify, copy, or redistribute it subject to the terms and conditions ++# of the GNU General Public License v.2. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program; if not, write to the Free Software Foundation, ++# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++ ++# Exercise usage of older metadata which are missing some new settings ++ ++SKIP_WITH_LVMPOLLD=1 ++ ++. lib/inittest ++ ++aux have_cache 1 3 0 || skip ++ ++# FIXME: parallel cache metadata allocator is crashing when used value 8000! ++aux prepare_vg 5 80 ++ ++ ++lvcreate -l 10 --type cache-pool $vg/cpool ++lvcreate -l 20 -H -n $lv1 $vg/cpool ++ ++vgcfgbackup -f backup $vg ++ ++# check metadata without cache policy ++lvchange -an $vg ++grep -v "policy =" backup >backup_1 ++vgcfgrestore -f backup_1 $vg ++lvchange -ay $vg ++ ++# check metadata without cache mode ++lvchange -an $vg ++grep -v "cache_mode =" backup >backup_2 ++vgcfgrestore -f backup_2 $vg ++lvchange -ay $vg ++ ++vgremove -ff $vg Copied: lvm2/repos/testing-i686/lvm2-make-sockets-static.patch (from rev 252031, lvm2/trunk/lvm2-make-sockets-static.patch) =================================================================== --- testing-i686/lvm2-make-sockets-static.patch (rev 0) +++ testing-i686/lvm2-make-sockets-static.patch 2015-11-28 19:29:11 UTC (rev 252032) @@ -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/lvm2.install (from rev 252031, lvm2/trunk/lvm2.install) =================================================================== --- testing-i686/lvm2.install (rev 0) +++ testing-i686/lvm2.install 2015-11-28 19:29:11 UTC (rev 252032) @@ -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 252031, lvm2/trunk/lvm2_hook) =================================================================== --- testing-i686/lvm2_hook (rev 0) +++ testing-i686/lvm2_hook 2015-11-28 19:29:11 UTC (rev 252032) @@ -0,0 +1,12 @@ +#!/usr/bin/ash + +run_earlyhook() { + mkdir /run/lvm + lvmetad +} + +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 252031, lvm2/trunk/lvm2_install) =================================================================== --- testing-i686/lvm2_install (rev 0) +++ testing-i686/lvm2_install 2015-11-28 19:29:11 UTC (rev 252032) @@ -0,0 +1,34 @@ +#!/usr/bin/bash + +build() { + local mod + for mod in dm-mod dm-snapshot dm-mirror dm-cache dm-cache-mq; do + add_module "$mod" + done + + add_binary "/usr/bin/lvm" + add_binary "/usr/bin/lvmetad" + add_binary "/usr/bin/dmsetup" + add_binary "/usr/bin/cache_check" + add_binary "/usr/bin/cache_dump" + add_binary "/usr/bin/cache_metadata_size" + add_binary "/usr/bin/cache_repair" + add_binary "/usr/bin/cache_restore" + 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 252031, lvm2/trunk/sd-lvm2_install) =================================================================== --- testing-i686/sd-lvm2_install (rev 0) +++ testing-i686/sd-lvm2_install 2015-11-28 19:29:11 UTC (rev 252032) @@ -0,0 +1,32 @@ +#!/usr/bin/bash + +build() { + local mod + for mod in dm-mod dm-snapshot dm-mirror; do + add_module "$mod" + done + + add_binary "/usr/bin/lvm" + add_binary "/usr/bin/lvmetad" + add_binary "/usr/bin/dmsetup" + 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/11-dm-initramfs.rules (from rev 252031, lvm2/trunk/11-dm-initramfs.rules) =================================================================== --- testing-x86_64/11-dm-initramfs.rules (rev 0) +++ testing-x86_64/11-dm-initramfs.rules 2015-11-28 19:29:11 UTC (rev 252032) @@ -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 252031, lvm2/trunk/PKGBUILD) =================================================================== --- testing-x86_64/PKGBUILD (rev 0) +++ testing-x86_64/PKGBUILD 2015-11-28 19:29:11 UTC (rev 252032) @@ -0,0 +1,108 @@ +# $Id$ +# Maintainer: Eric Bélanger <e...@archlinux.org> +# Maintainer: Thomas Bächler <tho...@archlinux.org> + +pkgbase=lvm2 +pkgname=('lvm2' 'device-mapper') +pkgver=2.02.134 +pkgrel=2 +arch=('i686' 'x86_64') +url="http://sourceware.org/lvm2/" +license=('GPL2' 'LGPL2.1') +makedepends=('systemd' 'thin-provisioning-tools') +groups=('base') +source=(ftp://sources.redhat.com/pub/lvm2/LVM2.${pkgver}.tgz{,.asc} + lvm2_install + lvm2_hook + sd-lvm2_install + 11-dm-initramfs.rules + lvm2-make-sockets-static.patch + lvm2-2.02.135-fix-reading-of-old-metadata-with-missing-cache-policy-or-mode.patch) +sha1sums=('4180405b7847515a08def649d3140b5d8bd0e258' + 'SKIP' + '40ef991650555b904e73bcc3f344d736722e27ca' + 'ff0fdf0a3005a41acd4b36865056109effc3474b' + '86c18852409dc03f38bdd734ac3e7b54bed9c4ce' + 'f6a554eea9557c3c236df2943bb6e7e723945c41' + 'b084512af42f2e16cdccd8b7ee4de27b574d1f94' + '19c61c9c240cbef44833a1112305f6f7450e8140') +validpgpkeys=('88437EF5C077BD113D3B7224228191C1567E2C17') + +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}/lvm2-make-sockets-static.patch" + + # lvm2 fails to detect cache metadata if cache policy is missing + patch -p1 -i "${srcdir}"/lvm2-2.02.135-fix-reading-of-old-metadata-with-missing-cache-policy-or-mode.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' 'systemd') + + 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}" 'systemd' 'readline' 'thin-provisioning-tools') + conflicts=('lvm' 'mkinitcpio<0.7') + backup=('etc/lvm/lvm.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-2.02.135-fix-reading-of-old-metadata-with-missing-cache-policy-or-mode.patch (from rev 252031, lvm2/trunk/lvm2-2.02.135-fix-reading-of-old-metadata-with-missing-cache-policy-or-mode.patch) =================================================================== --- testing-x86_64/lvm2-2.02.135-fix-reading-of-old-metadata-with-missing-cache-policy-or-mode.patch (rev 0) +++ testing-x86_64/lvm2-2.02.135-fix-reading-of-old-metadata-with-missing-cache-policy-or-mode.patch 2015-11-28 19:29:11 UTC (rev 252032) @@ -0,0 +1,116 @@ +commit 265a99e98a81113c2f27f0e4d6c5b73d198ed586 +Author: Peter Rajnoha <prajn...@redhat.com> +Date: Tue Nov 24 11:28:31 2015 +0100 + + Fix reading of old cache metadata. +--- + lib/cache_segtype/cache.c | 34 +++++++++++++++++++++++++++++++++ + test/shell/lvchange-cache-old.sh | 41 ++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 75 insertions(+) + +diff --git a/lib/cache_segtype/cache.c b/lib/cache_segtype/cache.c +index 85cba18..2a7eb96 100644 +--- a/lib/cache_segtype/cache.c ++++ b/lib/cache_segtype/cache.c +@@ -34,6 +34,32 @@ static unsigned _feature_mask; + log_error(t " segment %s of logical volume %s.", ## p, \ + dm_config_parent_name(sn), seg->lv->name), 0; + ++/* ++ * When older metadata are loaded without newer settings, ++ * set then to default settings (the one that could have been ++ * used implicitely at that time). ++ * ++ * Needs both segments cache and cache_pool to be loaded. ++ */ ++static int _fix_missing_defaults(struct lv_segment *cpool_seg) ++{ ++ if (!cpool_seg->policy_name) { ++ cpool_seg->policy_name = "mq"; ++ log_verbose("Cache is missing cache policy, using %s.", ++ cpool_seg->policy_name); ++ } ++ ++ if (!cache_mode_is_set(cpool_seg)) { ++ if (!cache_set_mode(cpool_seg, "writethrough")) { ++ log_error(INTERNAL_ERROR "Failed to writethrough cache mode."); ++ return 0; ++ } ++ log_verbose("Cache is missing cache mode, using %s.", ++ get_cache_mode_name(cpool_seg)); ++ } ++ ++ return 1; ++} + + static int _cache_pool_text_import(struct lv_segment *seg, + const struct dm_config_node *sn, +@@ -115,6 +141,10 @@ static int _cache_pool_text_import(struct lv_segment *seg, + if (!attach_pool_metadata_lv(seg, meta_lv)) + return_0; + ++ if (!dm_list_empty(&seg->lv->segs_using_this_lv) && ++ !_fix_missing_defaults(seg)) ++ return_0; ++ + return 1; + } + +@@ -319,6 +349,10 @@ static int _cache_text_import(struct lv_segment *seg, + if (!attach_pool_lv(seg, pool_lv, NULL, NULL)) + return_0; + ++ if (!dm_list_empty(&pool_lv->segments) && ++ !_fix_missing_defaults(first_seg(pool_lv))) ++ return_0; ++ + return 1; + } + +diff --git a/test/shell/lvchange-cache-old.sh b/test/shell/lvchange-cache-old.sh +new file mode 100644 +index 0000000..0b6ef7c +--- /dev/null ++++ b/test/shell/lvchange-cache-old.sh +@@ -0,0 +1,41 @@ ++#!/bin/sh ++# Copyright (C) 2015 Red Hat, Inc. All rights reserved. ++# ++# This copyrighted material is made available to anyone wishing to use, ++# modify, copy, or redistribute it subject to the terms and conditions ++# of the GNU General Public License v.2. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program; if not, write to the Free Software Foundation, ++# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++ ++# Exercise usage of older metadata which are missing some new settings ++ ++SKIP_WITH_LVMPOLLD=1 ++ ++. lib/inittest ++ ++aux have_cache 1 3 0 || skip ++ ++# FIXME: parallel cache metadata allocator is crashing when used value 8000! ++aux prepare_vg 5 80 ++ ++ ++lvcreate -l 10 --type cache-pool $vg/cpool ++lvcreate -l 20 -H -n $lv1 $vg/cpool ++ ++vgcfgbackup -f backup $vg ++ ++# check metadata without cache policy ++lvchange -an $vg ++grep -v "policy =" backup >backup_1 ++vgcfgrestore -f backup_1 $vg ++lvchange -ay $vg ++ ++# check metadata without cache mode ++lvchange -an $vg ++grep -v "cache_mode =" backup >backup_2 ++vgcfgrestore -f backup_2 $vg ++lvchange -ay $vg ++ ++vgremove -ff $vg Copied: lvm2/repos/testing-x86_64/lvm2-make-sockets-static.patch (from rev 252031, lvm2/trunk/lvm2-make-sockets-static.patch) =================================================================== --- testing-x86_64/lvm2-make-sockets-static.patch (rev 0) +++ testing-x86_64/lvm2-make-sockets-static.patch 2015-11-28 19:29:11 UTC (rev 252032) @@ -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/lvm2.install (from rev 252031, lvm2/trunk/lvm2.install) =================================================================== --- testing-x86_64/lvm2.install (rev 0) +++ testing-x86_64/lvm2.install 2015-11-28 19:29:11 UTC (rev 252032) @@ -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 252031, lvm2/trunk/lvm2_hook) =================================================================== --- testing-x86_64/lvm2_hook (rev 0) +++ testing-x86_64/lvm2_hook 2015-11-28 19:29:11 UTC (rev 252032) @@ -0,0 +1,12 @@ +#!/usr/bin/ash + +run_earlyhook() { + mkdir /run/lvm + lvmetad +} + +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 252031, lvm2/trunk/lvm2_install) =================================================================== --- testing-x86_64/lvm2_install (rev 0) +++ testing-x86_64/lvm2_install 2015-11-28 19:29:11 UTC (rev 252032) @@ -0,0 +1,34 @@ +#!/usr/bin/bash + +build() { + local mod + for mod in dm-mod dm-snapshot dm-mirror dm-cache dm-cache-mq; do + add_module "$mod" + done + + add_binary "/usr/bin/lvm" + add_binary "/usr/bin/lvmetad" + add_binary "/usr/bin/dmsetup" + add_binary "/usr/bin/cache_check" + add_binary "/usr/bin/cache_dump" + add_binary "/usr/bin/cache_metadata_size" + add_binary "/usr/bin/cache_repair" + add_binary "/usr/bin/cache_restore" + 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 252031, lvm2/trunk/sd-lvm2_install) =================================================================== --- testing-x86_64/sd-lvm2_install (rev 0) +++ testing-x86_64/sd-lvm2_install 2015-11-28 19:29:11 UTC (rev 252032) @@ -0,0 +1,32 @@ +#!/usr/bin/bash + +build() { + local mod + for mod in dm-mod dm-snapshot dm-mirror; do + add_module "$mod" + done + + add_binary "/usr/bin/lvm" + add_binary "/usr/bin/lvmetad" + add_binary "/usr/bin/dmsetup" + 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: