summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Hesse2015-06-29 19:27:05 +0200
committerChristian Hesse2015-06-29 19:27:05 +0200
commit30d9ea948ea6d85295a9636ce15f890bad09aad0 (patch)
tree2ec54441949e6a7a79625bafe0b6322b27b470fb
downloadaur-lvm2-git.tar.gz
initial import of lvm2-git 2.02.120.r33.g43224f2-1
-rw-r--r--.SRCINFO48
-rw-r--r--11-dm-initramfs.rules3
-rw-r--r--PKGBUILD113
-rw-r--r--lvm2-make-sockets-static.patch20
-rw-r--r--lvm2.install25
-rw-r--r--lvm2_hook12
-rw-r--r--lvm2_install34
-rw-r--r--sd-lvm2_install32
8 files changed, 287 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..da527631245
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,48 @@
+pkgbase = lvm2-git
+ pkgver = 2.02.120.r33.g43224f2
+ pkgrel = 1
+ url = http://sourceware.org/lvm2/
+ arch = i686
+ arch = x86_64
+ groups = base
+ license = GPL2
+ license = LGPL2.1
+ makedepends = git
+ makedepends = systemd
+ makedepends = thin-provisioning-tools
+ source = git://git.fedorahosted.org/git/lvm2.git
+ source = lvm2_install
+ source = lvm2_hook
+ source = sd-lvm2_install
+ source = 11-dm-initramfs.rules
+ source = lvm2-make-sockets-static.patch
+ sha1sums = SKIP
+ sha1sums = 40ef991650555b904e73bcc3f344d736722e27ca
+ sha1sums = ff0fdf0a3005a41acd4b36865056109effc3474b
+ sha1sums = 86c18852409dc03f38bdd734ac3e7b54bed9c4ce
+ sha1sums = f6a554eea9557c3c236df2943bb6e7e723945c41
+ sha1sums = b084512af42f2e16cdccd8b7ee4de27b574d1f94
+
+pkgname = lvm2-git
+ pkgdesc = Logical Volume Manager 2 utilities - git checkout
+ install = lvm2.install
+ depends = bash
+ depends = device-mapper-git>=2.02.120.r33.g43224f2
+ depends = systemd
+ depends = readline
+ depends = thin-provisioning-tools
+ provides = lvm2=2.02.120.r33.g43224f2
+ conflicts = lvm
+ conflicts = mkinitcpio<0.7
+ conflicts = lvm2
+ options = !makeflags
+ backup = etc/lvm/lvm.conf
+
+pkgname = device-mapper-git
+ pkgdesc = Device mapper userspace library and tools - git checkout
+ url = http://sourceware.org/dm/
+ depends = glibc
+ depends = systemd
+ provides = device-mapper=2.02.120.r33.g43224f2
+ conflicts = device-mapper
+
diff --git a/11-dm-initramfs.rules b/11-dm-initramfs.rules
new file mode 100644
index 00000000000..d2c16732452
--- /dev/null
+++ b/11-dm-initramfs.rules
@@ -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"
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..5f4e5a3f88d
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,113 @@
+# Maintainer: Christian Hesse <mail@eworm.de>
+# Maintainer: Eric Bélanger <eric@archlinux.org> ([core] package)
+# Maintainer: Thomas Bächler <thomas@archlinux.org> ([core] package)
+
+pkgbase=lvm2-git
+pkgname=('lvm2-git' 'device-mapper-git')
+pkgver=2.02.120.r33.g43224f2
+pkgrel=1
+arch=('i686' 'x86_64')
+url="http://sourceware.org/lvm2/"
+license=('GPL2' 'LGPL2.1')
+makedepends=('git' 'systemd' 'thin-provisioning-tools')
+groups=('base')
+validpgpkeys=('88437EF5C077BD113D3B7224228191C1567E2C17')
+source=('git://git.fedorahosted.org/git/lvm2.git'
+ lvm2_install
+ lvm2_hook
+ sd-lvm2_install
+ 11-dm-initramfs.rules
+ lvm2-make-sockets-static.patch)
+sha1sums=('SKIP'
+ '40ef991650555b904e73bcc3f344d736722e27ca'
+ 'ff0fdf0a3005a41acd4b36865056109effc3474b'
+ '86c18852409dc03f38bdd734ac3e7b54bed9c4ce'
+ 'f6a554eea9557c3c236df2943bb6e7e723945c41'
+ 'b084512af42f2e16cdccd8b7ee4de27b574d1f94')
+
+pkgver() {
+ cd lvm2/
+
+ if GITTAG="$(git describe --abbrev=0 --tags 2>/dev/null)"; then
+ echo "$(sed -e "s/^${pkgname%%-git}//" -e 's/^[-_/a-zA-Z]\+//' -e 's/[-_+]/./g' <<< ${GITTAG}).r$(git rev-list --count ${GITTAG}..).g$(git log -1 --format="%h")"
+ else
+ echo "0.r$(git rev-list --count master).g$(git log -1 --format="%h")"
+ fi
+}
+
+prepare() {
+ cd lvm2/
+ # 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"
+}
+
+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 lvm2-initramfs
+
+ cd lvm2
+
+ ./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-git() {
+ pkgdesc="Device mapper userspace library and tools - git checkout"
+ url="http://sourceware.org/dm/"
+ depends=('glibc' 'systemd')
+ conflicts=('device-mapper')
+ provides=("device-mapper=${pkgver}")
+
+ cd lvm2/
+ 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-git() {
+ pkgdesc="Logical Volume Manager 2 utilities - git checkout"
+ depends=('bash' "device-mapper-git>=${pkgver}" 'systemd' 'readline' 'thin-provisioning-tools')
+ conflicts=('lvm' 'mkinitcpio<0.7' 'lvm2')
+ provides=("lvm2=${pkgver}")
+ backup=('etc/lvm/lvm.conf')
+ options=('!makeflags')
+ install=lvm2.install
+
+ cd lvm2/
+ 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
+}
diff --git a/lvm2-make-sockets-static.patch b/lvm2-make-sockets-static.patch
new file mode 100644
index 00000000000..009ef57028a
--- /dev/null
+++ b/lvm2-make-sockets-static.patch
@@ -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
diff --git a/lvm2.install b/lvm2.install
new file mode 100644
index 00000000000..e11834d44c9
--- /dev/null
+++ b/lvm2.install
@@ -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:
diff --git a/lvm2_hook b/lvm2_hook
new file mode 100644
index 00000000000..65de7bd2fdd
--- /dev/null
+++ b/lvm2_hook
@@ -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:
diff --git a/lvm2_install b/lvm2_install
new file mode 100644
index 00000000000..2079247d84b
--- /dev/null
+++ b/lvm2_install
@@ -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:
diff --git a/sd-lvm2_install b/sd-lvm2_install
new file mode 100644
index 00000000000..e35e40cb6a2
--- /dev/null
+++ b/sd-lvm2_install
@@ -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: