livecd-rootfs/live-build/ubuntu-cpc/hooks/040-qcow2-image.binary
Michael Hudson-Doyle faa28a6472 Import patches-unapplied version 2.485 to ubuntu/bionic-proposed
Imported using git-ubuntu import.

Changelog parent: 1db37274ff3418f274464e542c7662fba2d6242a

New changelog entries:
  [ Michael Hudson-Doyle ]
  * Automount a partition of fixed UUID for giving subiquity canned answers.
  [ Balint Reczey ]
  * Use default xz compression (-6) for raspi2 image.
    Xz with -0 generated ~35% bigger compressed image. (LP: #1732681)
  * Zero fill space in UEFI partitions, too
  * Set LB_ISO_PREPARER to livecd-rootfs to avoid unbound variable in
    default string
  * Build minimized images in a 1GiB image
2017-12-03 22:18:21 +00:00

28 lines
630 B
Bash
Executable File

#!/bin/bash -ex
case $IMAGE_TARGETS in
""|*qcow2*)
;;
*)
echo "Skipping qcow2 image build"
exit 0
;;
esac
case $ARCH:$SUBARCH in
# Not sure if any other cloud images use subarch for something that
# should take qcow2 format, so only skipping this on raspi2 for now.
armhf:raspi2)
xz -T4 -c binary/boot/disk.ext4 > livecd.ubuntu-cpc.disk1.img.xz
exit 0
;;
esac
. config/functions
if [ -f binary/boot/disk-uefi.ext4 ]; then
convert_to_qcow2 binary/boot/disk-uefi.ext4 livecd.ubuntu-cpc.img
elif [ -f binary/boot/disk.ext4 ]; then
convert_to_qcow2 binary/boot/disk.ext4 livecd.ubuntu-cpc.img
fi