aboutsummaryrefslogtreecommitdiffstats
path: root/main/lvm2
diff options
context:
space:
mode:
Diffstat (limited to 'main/lvm2')
-rw-r--r--main/lvm2/APKBUILD63
-rw-r--r--main/lvm2/lvm.confd5
-rw-r--r--main/lvm2/lvm.initd38
3 files changed, 106 insertions, 0 deletions
diff --git a/main/lvm2/APKBUILD b/main/lvm2/APKBUILD
new file mode 100644
index 0000000000..04f832c3b9
--- /dev/null
+++ b/main/lvm2/APKBUILD
@@ -0,0 +1,63 @@
+# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
+pkgname=lvm2
+pkgver=2.02.85
+pkgrel=0
+pkgdesc="Logical Volume Manager 2 utilities"
+url="http://sourceware.org/lvm2/"
+arch="all"
+license="GPL"
+depends=
+makedepends="pkgconfig"
+source="ftp://sources.redhat.com/pub/$pkgname/LVM2.$pkgver.tgz
+ lvm.initd
+ lvm.confd
+ "
+subpackages="$pkgname-dev $pkgname-doc device-mapper:dm $pkgname-libs"
+
+build () {
+ cd "$srcdir"/LVM2.$pkgver
+
+ ./configure --prefix=/usr \
+ --sysconfdir=/etc \
+ --libdir=/lib \
+ --sbindir=/sbin \
+ --localstatedir=/var \
+ --disable-nls \
+ --disable-readline \
+ --enable-pkgconfig \
+ --enable-applib \
+ CLDFLAGS="$LDFLAGS" \
+ || return 1
+
+ # TODO: fix parallel builds
+ make -j1 || return 1
+}
+
+package() {
+ cd "$srcdir"/LVM2.$pkgver
+ make -j1 DESTDIR="$pkgdir" \
+ install || return 1
+ #usrlibdir="$pkgdir"/lib \
+ install -d "$pkgdir"/etc/lvm/archive "$pkgdir"/etc/lvm/backup
+ install -Dm755 "$srcdir"/lvm.initd "$pkgdir"/etc/init.d/lvm
+ install -Dm644 "$srcdir"/lvm.confd "$pkgdir"/etc/conf.d/lvm
+ cd "$pkgdir"/lib || return 1
+ ln -s libdevmapper.so.1.02 libdevmapper.so || return 1
+}
+
+dm() {
+ pkgdesc="Device mapper userspace library and tools from LVM2"
+ mkdir -p "$subpkgdir"/sbin "$subpkgdir"/lib
+ mv "$pkgdir"/lib/libdevmapper.so.* "$subpkgdir"/lib/
+ mv "$pkgdir"/sbin/dm* "$subpkgdir"/sbin/
+}
+
+libs() {
+ pkgdesc="LVM2 shared libraries"
+ mkdir -p "$subpkgdir"/lib
+ mv "$pkgdir"/lib/liblvm2*.so.* "$subpkgdir"/lib/
+}
+
+md5sums="91785ca438e5ce679dd3a386b183d552 LVM2.2.02.85.tgz
+6f65f902cf19f144a42b8d6aceadf395 lvm.initd
+ec36d5fe4561220304e406c5c797e71f lvm.confd"
diff --git a/main/lvm2/lvm.confd b/main/lvm2/lvm.confd
new file mode 100644
index 0000000000..9d150f6efc
--- /dev/null
+++ b/main/lvm2/lvm.confd
@@ -0,0 +1,5 @@
+# LVM should normally only be started after mdadm-raid is available
+# this is because LVM physical volumes are very often MD devices.
+
+rc_after="mdadm-raid"
+
diff --git a/main/lvm2/lvm.initd b/main/lvm2/lvm.initd
new file mode 100644
index 0000000000..f077d7f1d9
--- /dev/null
+++ b/main/lvm2/lvm.initd
@@ -0,0 +1,38 @@
+#!/sbin/runscript
+
+depend() {
+ before checkfs fsck
+ after hwdrivers modules device-mapper
+}
+
+dm_in_proc() {
+ local rc=0 i=
+ for i in devices misc; do
+ grep -qs 'device-mapper' /proc/$i
+ rc=$(($rc + $?))
+ done
+ return $rc
+}
+
+start() {
+ local rc=0 msg=
+ ebegin "Setting up the Logical Volume Manager"
+ if [ -e /proc/modules ] && ! dm_in_proc; then
+ modprobe dm-mod 2>/dev/null
+ fi
+ if [ -d /proc/lvm ] || dm_in_proc; then
+ vgscan --mknodes --ignorelockingfailure >/dev/null 2>&1 &&\
+ vgchange --ignorelockingfailure -a y >/dev/null 2>&1
+ rc=$?
+ else
+ rc=1
+ fi
+ eend $rc
+}
+
+stop() {
+ ebegin "Shutting down the Logical Volume Manager"
+ vgchange --ignorelockingfailure -a n >/dev/null 2>&1
+ eend $?
+}
+