lvm2: update to 2.02.53, convert to subpkgs.

Add initramfs hook and the OpenRC service, seems to work fine so far.

--HG--
extra : convert_revision : bfedf452f27339d9e37ffb251800431a17dbef9b
This commit is contained in:
Juan RP 2009-10-03 10:58:22 +02:00
parent 6dab476f7b
commit 64aea1c5b8
6 changed files with 168 additions and 12 deletions

View File

@ -0,0 +1 @@
lvm2

View File

@ -0,0 +1,19 @@
# Template file for 'lvm2-device-mapper'
short_desc="Device Mapper userspace library and tools"
long_desc="
This package contains the supporting userspace utility, dmsetup,
for the kernel device-mapper and its required library, libdevmapper."
Add_dependency run glibc
Add_dependency run readline
do_install()
{
mkdir -p ${DESTDIR}/sbin ${DESTDIR}/lib \
${DESTDIR}/usr/lib ${DESTDIR}/usr/share/man/man8
mv ${SRCPKGDESTDIR}/sbin/dm* ${DESTDIR}/sbin
mv ${SRCPKGDESTDIR}/lib/libdevmapper* ${DESTDIR}/lib
mv ${SRCPKGDESTDIR}/usr/include ${DESTDIR}/usr
mv ${SRCPKGDESTDIR}/usr/lib/pkgconfig ${DESTDIR}/usr/lib
mv ${SRCPKGDESTDIR}/usr/share/man/man8/dm* ${DESTDIR}/usr/share/man/man8
}

View File

@ -0,0 +1,34 @@
#!/bin/sh
PREREQ=""
prereqs()
{
echo "$PREREQ"
}
case $1 in
prereqs)
prereqs
exit 0
;;
esac
if [ ! -x /sbin/lvm ]; then
exit 0
fi
. /usr/share/initramfs-tools/hook-functions
if [ -e /etc/lvm/lvm.conf ]; then
mkdir -p ${DESTDIR}/etc/lvm
cp /etc/lvm/lvm.conf ${DESTDIR}/etc/lvm/
fi
copy_exec /sbin/dmsetup
copy_exec /sbin/lvm
ln -s lvm ${DESTDIR}/sbin/vgchange
for x in dm_mod dm_snapshot dm_mirror; do
manual_add_modules ${x}
done

View File

@ -0,0 +1,66 @@
#!/bin/sh
PREREQ="mdadm mdrun multipath"
prereqs()
{
echo "$PREREQ"
}
case $1 in
# get pre-requisites
prereqs)
prereqs
exit 0
;;
esac
activate_vg()
{
local dev="$1"
# Make sure that we have a non-empty argument
if [ -z "$dev" ]; then
return 1
fi
# Take care of lilo boot arg, risky activating of all vg
case "$dev" in
fe[0-9]*)
lvm vgchange -aly --ignorelockingfailure
exit 0
;;
# FIXME: check major
/dev/root)
lvm vgchange -aly --ignorelockingfailure
exit 0
;;
esac
# Make sure that we have a d-m path
dev="${dev#/dev/mapper/}"
if [ "$dev" = "$1" ]; then
return 1
fi
eval $(dmsetup splitname --nameprefixes --noheadings --rows "$dev")
if [ "$DM_VG_NAME" ] && [ "$DM_LV_NAME" ]; then
lvm lvchange -aly --ignorelockingfailure "$DM_VG_NAME/$DM_LV_NAME"
rc=$?
if [ $rc = 5 ]; then
echo "Unable to find LVM volume $DM_VG_NAME/$DM_LV_NAME"
fi
fi
}
if [ ! -e /sbin/lvm ]; then
exit 0
fi
modprobe -q dm-mod
activate_vg "$ROOT"
activate_vg "$resume"
exit 0

View File

@ -0,0 +1,27 @@
#!/sbin/runscript
#
# OpenRC service for LVM.
name="LVM service"
depend()
{
need devfs
before checkfs fsck
}
start()
{
ebegin "Activating LVM volumes"
modprobe -q dm-mod 2>/dev/null
lvm vgscan --ignorelockingfailure --mknodes && \
lvm vgchange --ignorelockingfailure -a y >/dev/null
eend $?
}
stop()
{
ebegin "Deactivating LVM volumes"
lvm vgchange --ignorelockingfailure -an 2>&1 >/dev/null
eend $?
}

View File

@ -1,15 +1,18 @@
# Template file for 'lvm2' # Template file for 'lvm2'
pkgname=lvm2 pkgname=lvm2
version=2.02.45 version=2.02.53
wrksrc=LVM2.${version} wrksrc=LVM2.${version}
distfiles="ftp://sources.redhat.com/pub/lvm2/LVM2.${version}.tgz" distfiles="ftp://sources.redhat.com/pub/lvm2/LVM2.${version}.tgz"
build_style=gnu_configure build_style=gnu_configure
configure_args="--exec-prefix= --disable-selinux" configure_args="--disable-selinux --enable-readline --with-udev-prefix=
make_install_args="sbindir=${XBPS_DESTDIR}/$pkgname-$version/sbin --enable-pkgconfig --enable-udev_rules --enable-fsadm"
libdir=$XBPS_DESTDIR/$pkgname-$version/lib" make_install_target="DESTDIR=$XBPS_DESTDIR/$pkgname-$version
short_desc="Userland logical volume management tools" sbindir=$XBPS_DESTDIR/$pkgname-$version/sbin
libdir=$XBPS_DESTDIR/$pkgname-$version/lib
install_device-mapper install_lvm2"
short_desc="Logical Volume Manager 2 utilities"
maintainer="Juan RP <xtraeme@gmail.com>" maintainer="Juan RP <xtraeme@gmail.com>"
checksum=2ad7490f5747ea8547ddfbf89256549fcdcffb990df2f3cbdea84d985887ecb8 checksum=f0f2122e46d7e46dd826b96752485e5ed08fa4b5b252c6f6db0b61a10da5e31e
long_desc=" long_desc="
LVM2 includes all of the support for handling read/write operations on LVM2 includes all of the support for handling read/write operations on
physical volumes (hard disks, RAID-Systems, magneto optical, etc., physical volumes (hard disks, RAID-Systems, magneto optical, etc.,
@ -19,19 +22,25 @@ long_desc="
(kind of logical partitions) in volume groups." (kind of logical partitions) in volume groups."
disable_parallel_build=yes disable_parallel_build=yes
subpackages="device-mapper"
conf_files="/etc/lvm/lvm.conf" conf_files="/etc/lvm/lvm.conf"
triggers="initramfs-tools"
openrc_services="lvm2 sysinit"
Add_dependency full glibc Add_dependency full glibc
Add_dependency full bash Add_dependency full bash
Add_dependency full readline Add_dependency full readline
Add_dependency full device-mapper Add_dependency run lvm2-device-mapper ${version}
post_install() post_install()
{ {
install -d ${DESTDIR}/etc/lvm/archive ${DESTDIR}/etc/lvm/backup local initramfsdir=${DESTDIR}/usr/share/initramfs-tools
# Remove files provided by device-mapper. install -d ${DESTDIR}/etc/lvm/archive ${DESTDIR}/etc/lvm/backup \
rm -rf ${DESTDIR}/usr/include ${DESTDIR}/lib ${DESTDIR}/etc/init.d ${initramfsdir}/scripts/local-top \
rm -f ${DESTDIR}/sbin/dmsetup ${initramfsdir}/hooks
install -m755 ${FILESDIR}/lvm2.initramfs-hook ${initramfsdir}/hooks/lvm2
install -m755 ${FILESDIR}/lvm2.initramfs-local-top \
${initramfsdir}/scripts/local-top/lvm2
install -m755 ${FILESDIR}/lvm2.rc ${DESTDIR}/etc/init.d/lvm2
} }