[Openembedded-architecture] Wic support for vmdk/qcow2/vdi image types
Ed Bartosh
ed.bartosh at linux.intel.com
Mon Feb 20 11:22:03 UTC 2017
On Fri, Feb 17, 2017 at 01:04:36PM +0100, Patrick Ohly wrote:
> On Fri, 2017-02-17 at 17:13 +0530, Vignesh Raman wrote:
> > Currently wic doesn't support vmdk/qcow2/vdi images.
> >
> > I have taken vmdk as example below to explain how wic support can be added.
> >
> > qemu-img convert is used to create vmdk image in image-vm.bbclass. To
> > create vmdk image, 'vmdk' needs to be added to IMAGE_FSTYPES
> > IMAGE_FSTYPES += "vmdk"
> >
> > vmdk image is created by converting hdddirect image type with qemu-img
> > convert in image-vm.bbclass
> > qemu-img convert -O $type ${IMGDEPLOYDIR}/${IMAGE_LINK_NAME}.hdddirect
> > ${IMGDEPLOYDIR}/${IMAGE_NAME}.$type
> >
> > vmdk images is implemented as main FSTYPES. In order for wic to
> > support vmdk images, current vmdk image generation could be
> > reimplemented as conversion type.
> > If we implement vmdk conversion, then we can use IMAGE_FSTYPES +=
> > 'wic.vmdk' to produce vmdk image from hdddirect images.
> > So hdddirect image is created using the kickstart file (wks) and then
> > the image is converted to wic.vmdk using qemu-img convert.
> >
> > This applies to qcow2 and vdi images as well and it could be
> > reimplemented as conversion types.
> >
> > Can we implement vmdk/qcow2/vdi conversion to add wic support or can
> > this be done in any other way? Thanks for any pointers.
>
> There's a bug open about that:
> https://bugzilla.yoctoproject.org/show_bug.cgi?id=10204
>
> I think it's perfectly doable and will simplify the code, but it'll
> require some testing. The bug is currently assigned to me for "future"
> work; if someone wants to work on it, feel free to take it from me.
>
> Not sure about the timing, though. Cut-off date for 2.3 M3 is Feb. 27,
> 2017.
>
Just out of curiosity I tried to add vmdk conversion type and it worked just fine. With below
patch and IMAGE_FSTYPES = 'vmdk wic.vmdk' line in my local.conf I was
able to generate both vmdk and wic.vmdk images. It also worked with IMAGE_FSTYPES = 'wic.vmdk'
diff --git a/meta/classes/image_types.bbclass
b/meta/classes/image_types.bbclass
index d2eb99d..bad60b4 100644
--- a/meta/classes/image_types.bbclass
+++ b/meta/classes/image_types.bbclass
@@ -251,7 +251,7 @@ IMAGE_TYPES = " \
# CONVERSION_CMD/DEPENDS.
COMPRESSIONTYPES ?= ""
-CONVERSIONTYPES = "gz bz2 lzma xz lz4 lzo zip sum md5sum sha1sum sha224sum sha256sum sha384sum sha512sum bmap ${COMPRESSIONTYPES}"
+CONVERSIONTYPES = "gz bz2 lzma xz lz4 lzo zip sum md5sum sha1sum sha224sum sha256sum sha384sum sha512sum bmap vmdk ${COMPRESSIONTYPES}"
CONVERSION_CMD_lzma = "lzma -k -f -7 ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}"
CONVERSION_CMD_gz = "gzip -f -9 -c ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type} > ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.gz"
CONVERSION_CMD_bz2 = "pbzip2 -f -k ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}"
@@ -268,6 +268,7 @@ CONVERSION_CMD_sha256sum = "sha256sum ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}
CONVERSION_CMD_sha384sum = "sha384sum ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type} > ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.sha384sum"
CONVERSION_CMD_sha512sum = "sha512sum ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type} > ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.sha512sum"
CONVERSION_CMD_bmap = "bmaptool create ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type} -o ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.bmap"
+CONVERSION_CMD_vmdk = "qemu-img convert -O vmdk ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type} ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.vmdk"
CONVERSION_DEPENDS_lzma = "xz-native"
CONVERSION_DEPENDS_gz = "pigz-native"
CONVERSION_DEPENDS_bz2 = "pbzip2-native"
--
Regards,
Ed
More information about the Openembedded-architecture
mailing list