diff --git a/debian/changelog b/debian/changelog index bdfced4c..56ac459b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +livecd-rootfs (2.440) UNRELEASED; urgency=medium + + * Support passing IMAGE_FLAVORS 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. + + -- Steve Langasek Mon, 06 Feb 2017 22:09:17 -0800 + livecd-rootfs (2.439) zesty; urgency=medium * Fix the manifest generation in OVA files so that ovf files don't have diff --git a/live-build/auto/config b/live-build/auto/config index 8a5e64b9..0dbc1e3a 100755 --- a/live-build/auto/config +++ b/live-build/auto/config @@ -618,6 +618,9 @@ lb config noauto \ echo "LB_CHROOT_HOOKS=\"$CHROOT_HOOKS\"" >> config/chroot echo "LB_BINARY_HOOKS=\"$BINARY_HOOKS\"" >> config/binary echo "BUILDSTAMP=\"$NOW\"" >> config/binary +if [ -n "$IMAGE_FLAVORS" ]; then + echo "LB_IMAGE_FLAVORS="$IMAGE_FLAVORS" >> config/binary +fi case $ARCH+$SUBARCH in armhf+raspi2) diff --git a/live-build/ubuntu-cpc/hooks/040-qcow2-image.binary b/live-build/ubuntu-cpc/hooks/040-qcow2-image.binary index 39c41066..5bcc6472 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 $LB_IMAGE_FLAVORS 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..cb986c64 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 $LB_IMAGE_FLAVORS 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 3b50a268..97a0f2cc 100755 --- a/live-build/ubuntu-cpc/hooks/041-vmdk-ova-image.binary +++ b/live-build/ubuntu-cpc/hooks/041-vmdk-ova-image.binary @@ -14,6 +14,16 @@ case $ARCH in *) echo "OVA images are not supported for $ARCH yet."; exit 0;; esac + +case $LB_IMAGE_FLAVORS in + ""|*ova*) + ;; + *) + 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 aa524a09..9300683a 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 $LB_IMAGE_FLAVORS in + ""|*vagrant*) + ;; + *) + echo "Skipping Vagrant image build" + exit 0 + ;; +esac + cur_d=${PWD} my_d=$(dirname $(readlink -f ${0}))