Harald Hoyer 2016-07-22 13:26:10 +02:00
parent b7c7b16d4e
commit 20171c7519
1 changed files with 10 additions and 7 deletions

View File

@ -60,13 +60,16 @@ install() {
inst_rules "$moddir/64-lvm.rules" inst_rules "$moddir/64-lvm.rules"


if [[ $hostonly ]] || [[ $lvmconf = "yes" ]]; then if [[ $hostonly ]] || [[ $lvmconf = "yes" ]]; then
if [ -f /etc/lvm/lvm.conf ]; then for f in /etc/lvm/lvm.conf /etc/lvm/lvm_*.conf; do
inst_simple /etc/lvm/lvm.conf [ -e "$f" ] || continue
# FIXME: near-term hack to establish read-only locking; inst_simple "$f"
# use command-line lvm.conf editor once it is available if [ -f "${initdir}/$f" ]; then
sed -i -e 's/\(^[[:space:]]*\)locking_type[[:space:]]*=[[:space:]]*[[:digit:]]/\1locking_type = 4/' ${initdir}/etc/lvm/lvm.conf # FIXME: near-term hack to establish read-only locking;
sed -i -e 's/\(^[[:space:]]*\)use_lvmetad[[:space:]]*=[[:space:]]*[[:digit:]]/\1use_lvmetad = 0/' ${initdir}/etc/lvm/lvm.conf # use command-line lvm.conf editor once it is available
fi sed -i -e 's/\(^[[:space:]]*\)locking_type[[:space:]]*=[[:space:]]*[[:digit:]]/\1locking_type = 4/' "${initdir}/$f"
sed -i -e 's/\(^[[:space:]]*\)use_lvmetad[[:space:]]*=[[:space:]]*[[:digit:]]/\1use_lvmetad = 0/' "${initdir}/$f"
fi
done
fi fi


if ! [[ -e ${initdir}/etc/lvm/lvm.conf ]]; then if ! [[ -e ${initdir}/etc/lvm/lvm.conf ]]; then