summaryrefslogtreecommitdiff
path: root/modules.d/90lvm/module-setup.sh
diff options
context:
space:
mode:
Diffstat (limited to 'modules.d/90lvm/module-setup.sh')
-rwxr-xr-xmodules.d/90lvm/module-setup.sh19
1 files changed, 13 insertions, 6 deletions
diff --git a/modules.d/90lvm/module-setup.sh b/modules.d/90lvm/module-setup.sh
index 00eb66dc..4b774c9c 100755
--- a/modules.d/90lvm/module-setup.sh
+++ b/modules.d/90lvm/module-setup.sh
@@ -29,15 +29,12 @@ install() {
inst lvm
check_lvm() {
- local DM_VG_NAME DM_LV_NAME DM_UDEV_DISABLE_DISK_RULES_FLAG
+ local DM_VG_NAME DM_LV_NAME
- eval $(udevadm info --query=property --name=$1 | egrep '(DM_VG_NAME|DM_LV_NAME|DM_UDEV_DISABLE_DISK_RULES_FLAG)=')
- [[ "$DM_UDEV_DISABLE_DISK_RULES_FLAG" = "1" ]] && return 1
+ eval $(/usr/sbin/dmsetup splitname --nameprefixes --noheadings --rows $1 2>/dev/null)
[[ ${DM_VG_NAME} ]] && [[ ${DM_LV_NAME} ]] || return 1
if ! [[ " ${_activated[*]} " == *\ ${DM_VG_NAME}/${DM_LV_NAME}\ * ]]; then
- if ! [[ $kernel_only ]]; then
- echo " rd.lvm.lv=${DM_VG_NAME}/${DM_LV_NAME} " >> "${initdir}/etc/cmdline.d/90lvm.conf"
- fi
+ echo " rd.lvm.lv=${DM_VG_NAME}/${DM_LV_NAME} " >> "${initdir}/etc/cmdline.d/90lvm.conf"
push _activated "${DM_VG_NAME}/${DM_LV_NAME}"
fi
if ! [[ $_needthin ]]; then
@@ -61,6 +58,16 @@ install() {
fi
fi
+ if ! [[ -e ${initdir}/etc/lvm/lvm.conf ]]; then
+ mkdir -p "${initdir}/etc/lvm"
+ {
+ echo 'global {'
+ echo 'locking_type = 4'
+ echo 'use_lvmetad = 0'
+ echo '}'
+ } > "${initdir}/etc/lvm/lvm.conf"
+ fi
+
inst_rules 11-dm-lvm.rules
# Gentoo ebuild for LVM2 prior to 2.02.63-r1 doesn't install above rules
# files, but provides the one below: