MT#17215 Skip LVM workaround if FAI's setup-storage >=5.0 is present

The "--yes" workaround for LVM2 is needed for LVM versions
newer than >=2.02.106 to avoid a hanging prompt during
partition setup. Starting with FAI 5.0 the workaround
for this is included in FAI's setup-storage and therefore
we don't need our workaround any longer, see
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=750212

So ensure that fai-setup-storage is new enough, and only
if not then check the lvm2 package version and apply the
workaround as needed.

Fixes:

| Executing: lvcreate --yes --yes -n swap -L 1002.755859375 vg0
| (STDERR) Option -y/--yes may not be repeated.

Change-Id: Ic4445e0add5aab8da0ef87b77b08e23fc0d1c9ab
changes/27/4027/1
Michael Prokop 9 years ago
parent a2a384774e
commit 78eae686f4

@ -1103,8 +1103,12 @@ fi
if "$LVM" ; then
# make sure lvcreate understands the --yes option
lv_create_opts=''
lvm_version=$(dpkg-query -W -f='${Version}\n' lvm2)
if dpkg --compare-versions "$lvm_version" lt 2.02.106 ; then
lvm_version=$(dpkg-query -W -f='${Version}\n' lvm2) || die "Unknown package lvm2"
setupstorage_version=$(dpkg-query --show --showformat='${Version}' fai-setup-storage) || die "Unknown package fai-setup-storage"
if dpkg --compare-versions "$setupstorage_version" ge 5.0 ; then
logit "Installed fai-setup-storage version ${setupstorage_version} doesn't need the LVM '--yes' workaround."
elif dpkg --compare-versions "$lvm_version" lt 2.02.106 ; then
logit "Installed lvm2 version ${lvm_version} doesn't need the '--yes' workaround."
else
logit "Enabling '--yes' workaround for lvm2 version ${lvm_version}."

Loading…
Cancel
Save