#!/bin/bash -ex apt-get install -qqy qemu-utils convert_image() { src="$1" destination="$2" qemu-img convert -c -O qcow2 -o compat=0.10 "$src" "$destination" qemu-img info "$destination" } convert_image binary/boot/disk.ext4 livecd.ubuntu-cpc.disk1.img if [ -f binary/boot/disk-uefi.ext4 ]; then convert_image binary/boot/disk-uefi.ext4 livecd.ubuntu-cpc.uefi1.img fi