summaryrefslogtreecommitdiff
path: root/core/lvm2
diff options
context:
space:
mode:
authorParabola <dev@list.parabolagnulinux.org>2011-04-05 14:26:38 +0000
committerParabola <dev@list.parabolagnulinux.org>2011-04-05 14:26:38 +0000
commit415856bdd4f48ab4f2732996f0bae58595092bbe (patch)
treeede2018b591f6dfb477fe9341ba17b9bc000fab9 /core/lvm2
Tue Apr 5 14:26:38 UTC 2011
Diffstat (limited to 'core/lvm2')
-rw-r--r--core/lvm2/PKGBUILD61
-rw-r--r--core/lvm2/lvm2_hook23
-rw-r--r--core/lvm2/lvm2_install29
3 files changed, 113 insertions, 0 deletions
diff --git a/core/lvm2/PKGBUILD b/core/lvm2/PKGBUILD
new file mode 100644
index 000000000..3a946ff04
--- /dev/null
+++ b/core/lvm2/PKGBUILD
@@ -0,0 +1,61 @@
+# $Id: PKGBUILD 109502 2011-02-10 10:44:18Z eric $
+# Maintainer: Eric Bélanger <eric@archlinux.org>
+# Maintainer: Thomas Bächler <thomas@archlinux.org>
+
+pkgbase=lvm2
+pkgname=('lvm2' 'device-mapper')
+pkgver=2.02.84
+_pkgverlvm=${pkgver}
+pkgrel=1
+arch=('i686' 'x86_64')
+url="http://sourceware.org/lvm2/"
+license=('GPL2' 'LGPL2.1')
+groups=('base')
+conflicts=('mkinitcpio<0.5.99')
+source=(ftp://sources.redhat.com/pub/lvm2/LVM2.${_pkgverlvm}.tgz
+ lvm2_install
+ lvm2_hook)
+md5sums=('8b4e0897ee48f02c0dff11940e44e23b' 'e29bc80d636ed17b617d9b384a5f3aa0'\
+ '7103e3fef1180478811ac4e32aec540d')
+sha1sums=('6d92f4474f93c7d3824a0eb3469c7e4f9ef8f1d4' '662fc54ce291fd79bd09701e4c3e10854f325282'\
+ '769767d84c73674cbb68c765460e57c428c314a0')
+
+build() {
+ cd "${srcdir}/LVM2.${_pkgverlvm}"
+ sed -i 's|/usr/bin/tr|/bin/tr|' scripts/lvmdump.sh
+ unset LDFLAGS
+ ./configure --prefix= --sysconfdir=/etc --localstatedir=/var --datarootdir=/usr/share \
+ --includedir=/usr/include --with-usrlibdir=/usr/lib \
+ --enable-pkgconfig --enable-readline --enable-dmeventd --enable-cmdlib --enable-applib \
+ --with-udevdir=/lib/udev/rules.d/ --enable-udev_sync --enable-udev_rules
+ make
+}
+
+package_device-mapper() {
+ pkgdesc="Device mapper userspace library and tools"
+ url="http://sourceware.org/dm/"
+ depends=('glibc' 'udev')
+
+ cd "${srcdir}/LVM2.${_pkgverlvm}"
+ make DESTDIR="${pkgdir}" install_device-mapper
+}
+
+package_lvm2() {
+ pkgdesc="Logical Volume Manager 2 utilities"
+ depends=('bash' "device-mapper>=${pkgver}" 'udev' 'readline')
+ conflicts=('lvm' 'mkinitcpio<0.5.99')
+ backup=('etc/lvm/lvm.conf')
+ options=('!makeflags')
+
+ cd "${srcdir}/LVM2.${_pkgverlvm}"
+ make DESTDIR="${pkgdir}" install_lvm2
+ # install applib
+ cd liblvm
+ make DESTDIR="${pkgdir}" install
+ cd ..
+ # /etc directories
+ install -d "${pkgdir}"/etc/lvm/{archive,backup}
+ # mkinitcpio hook
+ install -D -m644 "${srcdir}/lvm2_hook" "${pkgdir}/lib/initcpio/hooks/lvm2"
+ install -D -m644 "${srcdir}/lvm2_install" "${pkgdir}/lib/initcpio/install/lvm2"
+}
diff --git a/core/lvm2/lvm2_hook b/core/lvm2/lvm2_hook
new file mode 100644
index 000000000..d6d1c1f94
--- /dev/null
+++ b/core/lvm2/lvm2_hook
@@ -0,0 +1,23 @@
+# vim:set ft=sh:
+run_hook ()
+{
+ /sbin/modprobe -q dm-mod >/dev/null 2>&1
+ if [ -e "/sys/class/misc/device-mapper" ]; then
+ if [ ! -e "/dev/mapper/control" ]; then
+ /bin/mknod "/dev/mapper/control" c $(cat /sys/class/misc/device-mapper/dev | sed 's|:| |')
+ fi
+
+ # If the lvmwait= parameter has been specified on the command line
+ # wait for the device(s) before trying to activate the volume group(s)
+ if [ -n "${lvmwait}" ]; then
+ for pvdev in $(echo ${lvmwait} | sed 's|,| |g'); do
+ poll_device ${pvdev} ${rootdelay}
+ done
+ fi
+
+ [ "${quiet}" = "y" ] && LVMQUIET=">/dev/null"
+
+ msg "Activating logical volumes..."
+ eval /sbin/lvm vgchange --sysinit -a y $LVMQUIET
+ fi
+}
diff --git a/core/lvm2/lvm2_install b/core/lvm2/lvm2_install
new file mode 100644
index 000000000..0c01ce69c
--- /dev/null
+++ b/core/lvm2/lvm2_install
@@ -0,0 +1,29 @@
+# vim: set ft=sh:
+
+install ()
+{
+ MODULES=" dm-mod dm-snapshot dm-mirror"
+ BINARIES=""
+ FILES=""
+ SCRIPT="lvm2"
+
+ add_dir "/dev/mapper"
+ add_binary "/sbin/lvm"
+ add_binary "/sbin/dmsetup"
+ add_file "/lib/udev/rules.d/10-dm.rules"
+ add_file "/lib/udev/rules.d/13-dm-disk.rules"
+ add_file "/lib/udev/rules.d/95-dm-notify.rules"
+ add_file "/lib/udev/rules.d/11-dm-lvm.rules"
+}
+
+help ()
+{
+cat<<HELPEOF
+ This hook loads the necessary modules for an LVM2 root device.
+
+ The optional lvmwait= parameter followed by a comma-separated
+ list of device names can be given on the command line.
+ It will cause the hook to wait until all given devices exist
+ before trying to scan and activate any volume groups.
+HELPEOF
+}