From 14a0817bd9d91827bfde7614b695ca2d41c8689a Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Mon, 2 Jun 2014 18:18:35 +0200 Subject: [PATCH] MT#7267 Support installation with older lvm tools We've lvm2 version 2.02.88-2 (using Grml 2012.05) on builder.mgm when booting via PXE. --- deployment.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/deployment.sh b/deployment.sh index 93e5e37..8285532 100755 --- a/deployment.sh +++ b/deployment.sh @@ -801,6 +801,16 @@ else 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 + logit "Installed lvm2 version ${lvm_version} doesn't need the '--yes' workaround." + else + logit "Enabling '--yes' workaround for lvm2 version ${lvm_version}." + lv_create_opts='lvcreateopts="--yes"' + fi + cat > /tmp/partition_setup.txt << EOF disk_config ${DISK} disklabel:${TABLE} bootable:1 primary - 4096- - - @@ -808,7 +818,7 @@ primary - 4096- - - disk_config lvm vg ngcp ${DISK}1 ngcp-root / -95% ext3 rw -ngcp-swap swap RAM:50% swap sw lvcreateopts="--yes" +ngcp-swap swap RAM:50% swap sw $lv_create_opts EOF # make sure setup-storage doesn't fail if LVM is already present