diff --git a/templates/lvm2/files/lvm2.initramfs-local-top b/templates/lvm2/files/lvm2.initramfs-local-top index 8fdd1f8ab4c..eaa267b5625 100644 --- a/templates/lvm2/files/lvm2.initramfs-local-top +++ b/templates/lvm2/files/lvm2.initramfs-local-top @@ -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 $? diff --git a/templates/lvm2/files/lvm2.rc b/templates/lvm2/files/lvm2.rc index fed407e531e..c15809fdabb 100644 --- a/templates/lvm2/files/lvm2.rc +++ b/templates/lvm2/files/lvm2.rc @@ -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 diff --git a/templates/lvm2/template b/templates/lvm2/template index 7059d5c6486..31d09ebefeb 100644 --- a/templates/lvm2/template +++ b/templates/lvm2/template @@ -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