From 56196afc91587df4c13a7f29e39f65c99eac0970 Mon Sep 17 00:00:00 2001 From: Bertrand Marquis Date: Thu, 2 Apr 2020 18:08:16 +0100 Subject: [PATCH] arm-autonomy: Create xenguest-nodisk-image recipe Create a xenguest-nodisk-image recipe to be used when wanting to create a xenguest image without packing in it a root filesystem generated by Yocto. This recipe can be used to use aio root filesystem from an external tar file and just compile and take the linux kernel coming from Yocto. To achieve this, the variable XENGUEST_IMAGE_SRC_URI_DISK_FILES should be set to a SRC_URI compatible URL to the tar file and then call bitbake xenguest-nodisk-image. Change-Id: I1a8d80b89930f3bb6bcce40a55b4dfce9b5331ef Issue-Id: SCM-767 Signed-off-by: Bertrand Marquis Reviewed-by: Diego Sueiro Signed-off-by: Jon Mason --- .../xenguest/xenguest-nodisk-image.bb | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 meta-arm-autonomy/recipes-extended/xenguest/xenguest-nodisk-image.bb diff --git a/meta-arm-autonomy/recipes-extended/xenguest/xenguest-nodisk-image.bb b/meta-arm-autonomy/recipes-extended/xenguest/xenguest-nodisk-image.bb new file mode 100644 index 00000000..b2dbbe99 --- /dev/null +++ b/meta-arm-autonomy/recipes-extended/xenguest/xenguest-nodisk-image.bb @@ -0,0 +1,38 @@ +# Create a xenguest image with kernel but no rootfs or an external rootfs +DESCRIPTION = "Xenguest No Disk Image" +LICENSE = "MIT" + +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" + +S = "${WORKDIR}" + +inherit deploy xenguest-image + +# Name of the file we create in deploy +XENGUEST_IMAGE_NODISK_DEPLOY = "xenguest-nodisk-image.xenguest" + +# use a local copy to pack all together +XENGUEST_IMAGE_DEPLOY_DIR = "${WORKDIR}/tmp-xenguest" + +do_configure[noexec] = "1" +do_compile[noexec] = "1" +do_install[noexec] = "1" + +do_deploy() { + xenguest_image_clone + + # Add kernel to the image + if [ -n "${XENGUEST_IMAGE_KERNEL}" ]; then + call_xenguest_mkimage partial \ + --xen-kernel=${DEPLOY_DIR_IMAGE}/${XENGUEST_IMAGE_KERNEL} + fi + + # Pack and deploy the final image + rm -f ${DEPLOYDIR}/${XENGUEST_IMAGE_NODISK_DEPLOY} + call_xenguest_mkimage pack ${DEPLOYDIR}/${XENGUEST_IMAGE_NODISK_DEPLOY} +} +do_deploy[depends] += "virtual/kernel:do_deploy" +do_deploy[depends] += "xenguest-base-image:do_deploy" + +addtask deploy before do_build after do_install +