+define Image/Build/iso
+ $(INSTALL_DIR) $(KDIR)/root.grub/boot/grub
+ $(CP) \
+ $(KDIR)/stage2_eltorito \
+ $(KDIR)/root.grub/boot/grub/
+ sed \
+ -e 's#@SERIAL_CONFIG@#$(strip $(GRUB_SERIAL_CONFIG))#g' \
+ -e 's#@TERMINAL_CONFIG@#$(strip $(GRUB_TERMINAL_CONFIG))#g' \
+ -e 's#@CMDLINE@#$(strip $(call Image/cmdline/$(1)) $(BOOTOPTS) $(GRUB_CONSOLE_CMDLINE))#g' \
+ -e 's#(hd0,0)#(cd)#g' \
+ ./menu.lst > $(KDIR)/root.grub/boot/grub/menu.lst
+ $(CP) $(KDIR)/bzImage $(KDIR)/root.grub/boot/vmlinuz
+ mkisofs -R -b boot/grub/stage2_eltorito -no-emul-boot -boot-load-size 4 -boot-info-table \
+ -o $(KDIR)/root.iso $(KDIR)/root.grub
+endef
+
+ifneq ($(CONFIG_X86_VDI_IMAGES),)
+ define Image/Build/vdi
+ # left here because the image builder doesnt need these
+ ifeq ($(1),ext4)
+ rm $(BIN_DIR)/$(IMG_PREFIX)-combined-$(1).vdi || true
+ qemu-img convert -f raw -O vdi \
+ $(BIN_DIR)/$(IMG_PREFIX)-combined-$(1).img \
+ $(BIN_DIR)/$(IMG_PREFIX)-combined-$(1).vdi
+ # XXX: VBoxManage insists on setting perms to 0600
+ chmod 0644 $(BIN_DIR)/$(IMG_PREFIX)-combined-$(1).vdi
+ endif
+ endef
+endif
+
+ifneq ($(CONFIG_X86_VMDK_IMAGES),)
+ define Image/Build/vmdk
+ # left here because the image builder doesnt need these
+ ifeq ($(1),ext4)
+ rm $(BIN_DIR)/$(IMG_PREFIX)-combined-$(1).vmdk || true
+ qemu-img convert -f raw -O vmdk \
+ $(BIN_DIR)/$(IMG_PREFIX)-combined-$(1).img \
+ $(BIN_DIR)/$(IMG_PREFIX)-combined-$(1).vmdk
+ endif
+ endef
+endif
+