diff --git a/debian/changelog b/debian/changelog index 697691ed..8f304886 100644 --- a/debian/changelog +++ b/debian/changelog @@ -7,6 +7,9 @@ livecd-rootfs (2.440) UNRELEASED; urgency=medium * live-build/ubuntu-cpc/functions: umount_partition: don't call umount_settle for each submount; just unmount them one by one and settle at the end. + * Support passing IMAGE_TARGETS in the environment, to limit which images + are output as part of a build; particularly useful for ubuntu-cpc builds + which output multiple image types. [ Nishanth Aravamudan ] * live-build/ubuntu-cpc/hooks/061-open-iscsi.chroot: generate iSCSI diff --git a/live-build/ubuntu-cpc/hooks/032-root-squashfs.binary b/live-build/ubuntu-cpc/hooks/032-root-squashfs.binary index e338a05f..63a00894 100755 --- a/live-build/ubuntu-cpc/hooks/032-root-squashfs.binary +++ b/live-build/ubuntu-cpc/hooks/032-root-squashfs.binary @@ -3,6 +3,15 @@ # # Generate a squashfs root and manifest +case $IMAGE_TARGETS in + ""|*squashfs*) + ;; + *) + echo "Skipping squashfs build" + exit 0 + ;; +esac + if [ -n "$SUBARCH" ]; then echo "Skipping rootfs build for subarch flavor build" exit 0 diff --git a/live-build/ubuntu-cpc/hooks/040-qcow2-image.binary b/live-build/ubuntu-cpc/hooks/040-qcow2-image.binary index 39c41066..f9ab7e62 100755 --- a/live-build/ubuntu-cpc/hooks/040-qcow2-image.binary +++ b/live-build/ubuntu-cpc/hooks/040-qcow2-image.binary @@ -1,5 +1,14 @@ #!/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. diff --git a/live-build/ubuntu-cpc/hooks/040-vmdk-image.binary b/live-build/ubuntu-cpc/hooks/040-vmdk-image.binary index ac4f1c36..9a71f7ff 100755 --- a/live-build/ubuntu-cpc/hooks/040-vmdk-image.binary +++ b/live-build/ubuntu-cpc/hooks/040-vmdk-image.binary @@ -9,6 +9,15 @@ case $ARCH in exit 0;; esac +case ${IMAGE_TARGETS:-} in + ""|*vmdk*) + ;; + *) + echo "Skipping VMDK image build" + exit 0 + ;; +esac + . /build/config/functions if [ -e binary/boot/disk-uefi.ext4 ]; then diff --git a/live-build/ubuntu-cpc/hooks/041-vmdk-ova-image.binary b/live-build/ubuntu-cpc/hooks/041-vmdk-ova-image.binary index 60716f3c..801808c0 100755 --- a/live-build/ubuntu-cpc/hooks/041-vmdk-ova-image.binary +++ b/live-build/ubuntu-cpc/hooks/041-vmdk-ova-image.binary @@ -27,6 +27,15 @@ case $ARCH in exit 0;; esac +case ${IMAGE_TARGETS:-} in + ""|*vmdk*) + ;; + *) + echo "Skipping OVA image build" + exit 0 + ;; +esac + cur_d=${PWD} my_d=$(dirname $(readlink -f ${0})) diff --git a/live-build/ubuntu-cpc/hooks/042-vagrant.binary b/live-build/ubuntu-cpc/hooks/042-vagrant.binary index 0471248d..3f962bd8 100755 --- a/live-build/ubuntu-cpc/hooks/042-vagrant.binary +++ b/live-build/ubuntu-cpc/hooks/042-vagrant.binary @@ -15,6 +15,15 @@ # some packages in it, convert it to a vmdk, and then assemble the vagrant # box. +case $IMAGE_TARGETS in + ""|*vagrant*) + ;; + *) + echo "Skipping Vagrant image build" + exit 0 + ;; +esac + cur_d=${PWD} my_d=$(dirname $(readlink -f ${0}))