image.in, build-vm: handle qemu-img absence properly

This isn't a warning cause, this is a error cause!
This commit is contained in:
Michael Shigorin 2017-12-04 19:41:17 +03:00
parent a173bbd070
commit 0f2411ec34
2 changed files with 6 additions and 1 deletions

View File

@ -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)"; \

View File

@ -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)" && \