From 421269a732d7e5c2b2b50e64802fa5bd98631d8d Mon Sep 17 00:00:00 2001 From: Ben Howard Date: Mon, 7 Dec 2015 11:47:18 -0700 Subject: [PATCH] ubuntu-cpc: clean up qcow2 image builds - use convert_to_qcow2 to create the qcow2 - remove assumption of disk1.img existing --- live-build/ubuntu-cpc/hooks/040-qcow2-image.binary | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/live-build/ubuntu-cpc/hooks/040-qcow2-image.binary b/live-build/ubuntu-cpc/hooks/040-qcow2-image.binary index b90aabd0..e8b9fbd5 100755 --- a/live-build/ubuntu-cpc/hooks/040-qcow2-image.binary +++ b/live-build/ubuntu-cpc/hooks/040-qcow2-image.binary @@ -2,15 +2,12 @@ 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" -} +. /build/config/functions -convert_image binary/boot/disk.ext4 livecd.ubuntu-cpc.disk1.img +if [ -f binary/boot/disk.ext4 ]; then + convert_to_qcow2 binary/boot/disk.ext4 livecd.ubuntu-cpc.disk1.img +fi if [ -f binary/boot/disk-uefi.ext4 ]; then - convert_image binary/boot/disk-uefi.ext4 livecd.ubuntu-cpc.uefi1.img + convert_to_qcow2 binary/boot/disk-uefi.ext4 livecd.ubuntu-cpc.uefi1.img fi