From 78eae686f4b55452d7dac8e246f98fc9caaea2e1 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Wed, 6 Jan 2016 11:09:08 +0100 Subject: [PATCH] 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 --- deployment.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/deployment.sh b/deployment.sh index 31fe53c..db0c696 100755 --- a/deployment.sh +++ b/deployment.sh @@ -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}."