summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew McDermott <andrew.mcdermott@linaro.org>2014-12-01 18:49:56 +0000
committerAndrew McDermott <andrew.mcdermott@linaro.org>2014-12-01 18:49:56 +0000
commit4803e54c715ccd8ef3b9acb4d410ae62940348a1 (patch)
treed6ffc2aa9f765765837e596ad8a50d36e53e17c2
parent5ab83a2369cc89e37b67039c8106e0f3b5656523 (diff)
foo
-rw-r--r--expand-image.yaml35
1 files changed, 35 insertions, 0 deletions
diff --git a/expand-image.yaml b/expand-image.yaml
new file mode 100644
index 0000000..c6733dd
--- /dev/null
+++ b/expand-image.yaml
@@ -0,0 +1,35 @@
+metadata:
+ name: build-bigger-cloudimg
+ maintainer:
+ - Andrew McDermott <andrew.mcdermott@linaro.org>
+ format: "Lava-Test-Shell Test Definition 1.0"
+ version: 1.0
+ description: "Expand UEC image"
+ devices:
+ - kvm
+ environment:
+ - lava-test-shell
+
+run:
+ steps:
+ - "set -x"
+ - "id"
+ - 'DEBIAN_FRONTEND=noninteractive apt-get update -o Dpkg::Options::="--force-confnew" --force-yes'
+ - 'DEBIAN_FRONTEND=noninteractive apt-get install --yes wget libguestfs-tools coreutils eatmydata'
+ - 'for i in /usr/bin/apt*; do ln -s /usr/bin/eatmydata /usr/local/bin/$(basename $i); done'
+ - "image=$(basename $LAVA_CLOUD_IMG_URL)"
+ - "new_image=new.img"
+ - "rm -f ${image}*"
+ - "wget --progress=dot -e dotbytes=10M $LAVA_CLOUD_IMG_URL"
+ - "mv $image ${image}.dist"
+ - "qemu-img convert -O qcow2 ${image}.dist ${image}"
+ - "rm -f ${new_image}"
+ - "truncate -s 3G ${new_image}"
+ - "virt-resize --expand /dev/sda1 ${image} ${new_image}"
+ - "qemu-img convert -c -f raw -O qcow2 ${new_image} ${image}"
+ - "mv $image $(basename $image .img)-3G.img"
+ - "sleep $LAVA_SLEEP_FOR_ACCESS"
+
+params:
+ LAVA_SLEEP_FOR_ACCESS: 3600
+ LAVA_CLOUD_IMG_URL: 'http://cloud-images.ubuntu.com/trusty/current/trusty-server-cloudimg-arm64-disk1.img'