aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/image-commands.mk7
-rw-r--r--target/linux/x86/image/Makefile14
2 files changed, 9 insertions, 12 deletions
diff --git a/include/image-commands.mk b/include/image-commands.mk
index 37cb083bbf..2ec1922044 100644
--- a/include/image-commands.mk
+++ b/include/image-commands.mk
@@ -414,3 +414,10 @@ define Build/kernel2minor
kernel2minor -k $@ -r $@.new $(1)
mv $@.new $@
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 $@ $@.new
+ @mv $@.new $@
+endef
diff --git a/target/linux/x86/image/Makefile b/target/linux/x86/image/Makefile
index 494a190b86..dfa1742d5a 100644
--- a/target/linux/x86/image/Makefile
+++ b/target/linux/x86/image/Makefile
@@ -92,23 +92,13 @@ define Build/iso
-o $@ $@.boot $(TARGET_DIR)
endef
-define Build/vdi
- qemu-img convert -f raw -O vdi $@ $@.new
- @mv $@.new $@
-endef
-
-define Build/vmdk
- qemu-img convert -f raw -O vmdk $@ $@.new
- @mv $@.new $@
-endef
-
DEVICE_VARS += GRUB2_VARIANT
define Device/Default
ARTIFACT/image.iso := grub-config iso | iso
IMAGES := combined.img.gz
IMAGE/combined.img.gz := append-rootfs | pad-extra 128k | grub-config pc | combined | grub-install | gzip
- IMAGE/combined.vdi := append-rootfs | pad-extra 128k | grub-config pc | combined | grub-install | vdi
- IMAGE/combined.vmdk := append-rootfs | pad-extra 128k | grub-config pc | combined | grub-install | vmdk
+ IMAGE/combined.vdi := append-rootfs | pad-extra 128k | grub-config pc | combined | grub-install | qemu-image vdi
+ IMAGE/combined.vmdk := append-rootfs | pad-extra 128k | grub-config pc | combined | grub-install | qemu-image vmdk
KERNEL := kernel-bin
KERNEL_INSTALL := 1
KERNEL_NAME := bzImage