Browse Source

lvm: Only activate a given vg+lv once.

Due to the way the main loop runs to detect partions, the same one
might be included twice (albeit via different symlinks.

This code simply prevents the same combo being activated twice.

A better fix might simply be to not include duplicate (after
resolving symlinks) entries in the host_fs_types variable.
master
Colin Guthrie 13 years ago committed by Harald Hoyer
parent
commit
0330b91987
  1. 7
      modules.d/90lvm/module-setup.sh

7
modules.d/90lvm/module-setup.sh

@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
# ex: ts=8 sw=4 sts=4 et filetype=sh

check() {
local _rootdev
local _rootdev _activated
# No point trying to support lvm if the binaries are missing
type -P lvm >/dev/null || return 1

@ -15,7 +15,10 @@ check() { @@ -15,7 +15,10 @@ check() {
unset DM_LV_NAME
eval $(udevadm info --query=property --name=$1|egrep '(DM_VG_NAME|DM_LV_NAME)=')
[[ ${DM_VG_NAME} ]] && [[ ${DM_LV_NAME} ]] || return
echo " rd.lvm.lv=${DM_VG_NAME}/${DM_LV_NAME} " >> "${initdir}/etc/cmdline.d/90lvm.conf"
if ! strstr " ${_activated[*]} " " ${DM_VG_NAME}/${DM_LV_NAME} "; then
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
}

[[ $hostonly ]] || [[ $mount_needs ]] && {

Loading…
Cancel
Save