aboutsummaryrefslogtreecommitdiff
path: root/leg-cloud-image
diff options
context:
space:
mode:
authorFathi Boudra <fathi.boudra@linaro.org>2016-11-25 12:26:32 +0200
committerFathi Boudra <fathi.boudra@linaro.org>2016-11-25 11:12:20 +0000
commitf2f0e52aed1e1274431b1ff95653d50119f3c3d5 (patch)
tree553c2d22d5a2b69517cca9ef7022ac43a2ab14d8 /leg-cloud-image
parent80032a819565d2b9e0250a8db834753187257152 (diff)
downloadconfigs-f2f0e52aed1e1274431b1ff95653d50119f3c3d5.tar.gz
leg-cloud-image: reduce the delta between jobs using libvirt
* use virsh vol-delete to clean up the image * add a comment to explain why we don't use virsh vol-download * use --disk=pool=default consistently Change-Id: Iaf7b88a2438d4b6c5643e263d2469547a31efb9c Signed-off-by: Fathi Boudra <fathi.boudra@linaro.org>
Diffstat (limited to 'leg-cloud-image')
-rwxr-xr-xleg-cloud-image/centos/builders.sh4
-rwxr-xr-xleg-cloud-image/debian/builders.sh6
2 files changed, 7 insertions, 3 deletions
diff --git a/leg-cloud-image/centos/builders.sh b/leg-cloud-image/centos/builders.sh
index 1b3f06456..b4374a684 100755
--- a/leg-cloud-image/centos/builders.sh
+++ b/leg-cloud-image/centos/builders.sh
@@ -21,9 +21,10 @@ trap cleanup_exit INT TERM EXIT
cleanup_exit()
{
cd ${WORKSPACE}
+ sudo virsh vol-delete --pool default ${image_name}.qcow2 || true
sudo virsh destroy ${image_name} || true
sudo virsh undefine ${image_name} || true
- sudo rm -f /var/lib/libvirt/images/${image_name}.qcow2 ${image_name}.qcow2
+ sudo rm -f ${image_name}.qcow2
}
wget -q https://git.linaro.org/ci/job/configs.git/blob_plain/HEAD:/leg-cloud-image/centos/centos7-aarch64.ks -O centos7-aarch64.ks
@@ -51,6 +52,7 @@ sudo virsh net-list --all
mkdir out
mv centos7-aarch64.ks out/
+# virsh vol-download is slow - copy from a mounted volume
sudo cp -a /var/lib/libvirt/images/${image_name}.qcow2 .
sudo qemu-img convert -c -O qcow2 ${image_name}.qcow2 out/${image_name}.qcow2
# extract kernel and initramfs from image
diff --git a/leg-cloud-image/debian/builders.sh b/leg-cloud-image/debian/builders.sh
index 1392b73d9..9efacd136 100755
--- a/leg-cloud-image/debian/builders.sh
+++ b/leg-cloud-image/debian/builders.sh
@@ -21,9 +21,10 @@ trap cleanup_exit INT TERM EXIT
cleanup_exit()
{
cd ${WORKSPACE}
+ sudo virsh vol-delete --pool default ${image_name}.qcow2 || true
sudo virsh destroy ${image_name} || true
sudo virsh undefine ${image_name} || true
- sudo rm -f /var/lib/libvirt/images/${image_name}.qcow2 ${image_name}.qcow2
+ sudo rm -f ${image_name}.qcow2
}
wget -q https://git.linaro.org/ci/job/configs.git/blob_plain/HEAD:/leg-cloud-image/debian/preseed.cfg -O preseed.cfg
@@ -32,7 +33,7 @@ sudo virt-install \
--name ${image_name} \
--initrd-inject preseed.cfg \
--extra-args "interface=auto noshell auto=true DEBIAN_FRONTEND=text" \
- --disk=pool=default,size=10,format=qcow2,bus=virtio \
+ --disk=pool=default,bus=virtio,size=10,format=qcow2 \
--memory 2048 \
--location http://ftp.debian.org/debian/dists/stable/main/installer-arm64/ \
--noreboot
@@ -51,6 +52,7 @@ sudo virsh net-list --all
mkdir out
mv preseed.cfg out/debian-jessie-arm64-preseed.cfg
+# virsh vol-download is slow - copy from a mounted volume
sudo cp -a /var/lib/libvirt/images/${image_name}.qcow2 .
sudo qemu-img convert -c -O qcow2 ${image_name}.qcow2 out/${image_name}.qcow2
# extract kernel and initramfs from image