diff --git a/test/vm.install b/test/vm.install index cc38769c..6a1f26e8 100755 --- a/test/vm.install +++ b/test/vm.install @@ -35,12 +35,15 @@ if ! rpm -q qemu-kvm; then yum install -y qemu-kvm fi -# Grow root partition to make room for images. This only works on Fedora right now. -parted --script /dev/vda resizepart 2 100% -partprobe -pvs --noheadings -opv_name | xargs pvresize -rootlv=$(findmnt --noheadings -oSOURCE /) -lvresize $rootlv -l+100%FREE -r +# Grow root partition on LVM test images to make room for built images +PVS=$(pvs --noheadings -opv_name) +if [ -n "$PVS" ]; then + echo ", +" | sfdisk -N 2 -f /dev/vda + partprobe + echo "$PVS" | xargs pvresize + rootlv=$(findmnt --noheadings -oSOURCE /) + lvresize $rootlv -l+100%FREE -r +fi rm -rf build-results su builder -c "/usr/bin/mock --no-clean --resultdir build-results --rebuild $SRPM"