lvm2: fixed root on LVM. Bump revision.

--HG--
extra : convert_revision : 16248a8cc2d1a31eb220ccdfa1abc1695ab577e5
This commit is contained in:
Juan RP 2009-10-06 18:02:51 +02:00
parent 4cb99e3647
commit 285a4df5d6
3 changed files with 14 additions and 63 deletions

View file

@ -15,52 +15,14 @@ prereqs)
;;
esac
activate_vg()
{
local dev="$1"
[ ! -e /sbin/lvm ] && exit 0
[ ! -e /dev/urandom ] && mknod /dev/urandom c 1 9
# 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
modprobe -q dm-mod >/dev/null 2>&1
if [ -e /sys/class/misc/device-mapper ]; then
echo "Scanning for Logical Volumes..."
eval /sbin/lvm vgscan --ignorelockingfailure
echo "Activating Logical Volumes..."
eval /sbin/lvm vgchange --ignorelockingfailure -ay
fi
modprobe -q dm-mod
activate_vg "$ROOT"
activate_vg "$resume"
exit 0
exit $?

View file

@ -2,24 +2,12 @@
#
# OpenRC service for LVM.
name="LVM service"
depend()
{
need devfs
before checkfs fsck
after *
}
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

View file

@ -1,11 +1,12 @@
# Template file for 'lvm2'
pkgname=lvm2
version=2.02.53
revision=1
wrksrc=LVM2.${version}
distfiles="ftp://sources.redhat.com/pub/lvm2/LVM2.${version}.tgz"
build_style=gnu_configure
configure_args="--disable-selinux --enable-readline --with-udev-prefix=
--enable-pkgconfig --enable-udev_rules --enable-fsadm"
configure_args="--disable-selinux --enable-readline --enable-pkgconfig
--enable-pkgconfig --enable-fsadm"
make_install_target="DESTDIR=$XBPS_DESTDIR/$pkgname-$version
sbindir=$XBPS_DESTDIR/$pkgname-$version/sbin
libdir=$XBPS_DESTDIR/$pkgname-$version/lib
@ -25,7 +26,7 @@ disable_parallel_build=yes
subpackages="device-mapper"
conf_files="/etc/lvm/lvm.conf"
triggers="initramfs-tools"
openrc_services="lvm2 sysinit"
openrc_services="lvm2 shutdown"
Add_dependency full glibc
Add_dependency full bash