From 0f2411ec34e285caf0af34f21deaa1b16bcce186 Mon Sep 17 00:00:00 2001 From: Michael Shigorin Date: Mon, 4 Dec 2017 19:41:17 +0300 Subject: [PATCH] image.in, build-vm: handle qemu-img absence properly This isn't a warning cause, this is a error cause! --- features.in/build-vm/lib/90-build-vm.mk | 3 ++- image.in/Makefile | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/features.in/build-vm/lib/90-build-vm.mk b/features.in/build-vm/lib/90-build-vm.mk index 1021e94f..0210d811 100644 --- a/features.in/build-vm/lib/90-build-vm.mk +++ b/features.in/build-vm/lib/90-build-vm.mk @@ -39,7 +39,8 @@ convert-image: prepare-image *) VM_FORMAT="$(IMAGE_TYPE)"; \ esac; \ if ! type -t qemu-img >&/dev/null; then \ - echo "** warning: qemu-img not available" >&2; \ + echo "** error: qemu-img not available" >&2; \ + exit 1; \ else \ qemu-img convert -O "$$VM_FORMAT" \ "$(VM_RAWDISK)" "$(IMAGE_OUTPATH)"; \ diff --git a/image.in/Makefile b/image.in/Makefile index f62d942d..6c40da62 100644 --- a/image.in/Makefile +++ b/image.in/Makefile @@ -80,6 +80,10 @@ imagedir: postprocess: | $(addprefix postprocess-,$(sort $(POSTPROCESS_TARGETS))) @OUTSIZE="`ls -lh "$(IMAGE_OUTPATH)" | cut -f5 -d' '`"; \ + if [ ! -n "$$OUTSIZE" ]; then \ + echo "** error: $(IMAGE_OUTPATH) missing" >&2; \ + exit 1; \ + fi; \ echo "** image: $(IMAGE_OUTPATH) [$$OUTSIZE]" >&2 && \ echo "IMAGE_OUTPATH = $(IMAGE_OUTPATH)" && \ echo "IMAGE_OUTFILE = $(IMAGE_OUTFILE)" && \