Browse Source

build/image: warn if missing qemu-img for VDI/VMDK

Currently `qemu-img` is used to convert raw x86 images to VDI and VMDK
images, used for virtual machines.

Having `qemu-img` in tree requires us to maintain an ancient version of
`qemu-utils`, which recently required extra work to compile with newer
compiler version.

This commit prints a warning message in case `qemu-img` is missing.

As a next step the in-tree version of `qemu-img` can be removed.

Signed-off-by: Paul Spooren <[email protected]>
Paul Spooren 4 years ago
parent
commit
ca289e322d
1 changed files with 6 additions and 2 deletions
  1. 6 2
      include/image-commands.mk

+ 6 - 2
include/image-commands.mk

@@ -291,8 +291,12 @@ endef
 # Convert a raw image into a $1 type image.
 # E.g. | qemu-image vdi
 define Build/qemu-image
-	qemu-img convert -f raw -O $1 $@ [email protected]
-	@mv [email protected] $@
+	if command -v qemu-img; then \
+		qemu-img convert -f raw -O $1 $@ [email protected]; \
+		mv [email protected] $@; \
+	else \
+		echo "WARNING: Install qemu-img to create VDI/VMDK images" >&2; exit 1; \
+	fi
 endef
 
 define Build/qsdk-ipq-factory-nand