[PATCH] imagetypes_vm: Use IMAGE_FULLNAME for OVA image filenames

25 views
Skip to first unread message

Badrikesh Prusty

unread,
May 21, 2025, 7:26:20 AM5/21/25
to isar-...@googlegroups.com, Badrikesh Prusty
Obsering build failures for virtualbox/vmware images when OVA_NAME is set in
local.conf instead of the default IMAGE_FULLNAME. The ownership of the .ova file,
generated during the do_image_ova task, is updated with ${IMAGE_FULLNAME}.ova
instead of ${OVA_NAME}.ova
Logs:
| pxe-boot-server-ipc-bookworm.ovf
| pxe-boot-server-ipc-bookworm.mf
| pxe-boot-server-industrial-virtualbox-disk001.vmdk
| Removing /etc/schroot/isar-builder-88786470-74dc-4172-8907-531a0306c699-2655
| Removing /etc/schroot/chroot.d/isar-builder-88786470-74dc-4172-8907-531a0306c699-2655
| chown: cannot access '/build/tmp-pxe-boot-server-virtualbox/deploy/images/virtualbox-ipc/pxe-boot-server-industrial-virtualbox.ova': No such file or directory
ERROR: Task (mc:pxe-boot-server:/build/../work/meta-isar-pxeboot/recipes-core/images/pxe-boot-server.bb:do_image_ova) failed with exit code '1'
NOTE: Tasks Summary: Attempted 449 tasks of which 448 didn't need to be rerun and 1 failed.

To resolve this, VM images (.ova, .ovf, and .mf files) will now be generated
using IMAGE_FULLNAME.

Since OVA_NAME is embedded within the VirtualBox/VMware VM description files,
the imported image will retain the name set by OVA_NAME, regardless of the VM
image filenames.

Signed-off-by: Badrikesh Prusty <badrikes...@siemens.com>
---
meta/classes/imagetypes_vm.bbclass | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/meta/classes/imagetypes_vm.bbclass b/meta/classes/imagetypes_vm.bbclass
index b20a8e04..4057361e 100644
--- a/meta/classes/imagetypes_vm.bbclass
+++ b/meta/classes/imagetypes_vm.bbclass
@@ -70,9 +70,9 @@ IMAGE_CMD:ova() {
if [ ! ${VIRTUAL_MACHINE_IMAGE_TYPE} = "vmdk" ]; then
exit 0
fi
- rm -f '${DEPLOY_DIR_IMAGE}/${OVA_NAME}.ova'
- rm -f '${DEPLOY_DIR_IMAGE}/${OVA_NAME}.ovf'
- rm -f '${DEPLOY_DIR_IMAGE}/${OVA_NAME}.mf'
+ rm -f '${DEPLOY_DIR_IMAGE}/${IMAGE_FULLNAME}.ova'
+ rm -f '${DEPLOY_DIR_IMAGE}/${IMAGE_FULLNAME}.ovf'
+ rm -f '${DEPLOY_DIR_IMAGE}/${IMAGE_FULLNAME}.mf'

export PRIMARY_MAC=$(macgen)
export LAST_CHANGE=$(date -u "+%Y-%m-%dT%H:%M:%SZ")
@@ -85,16 +85,16 @@ IMAGE_CMD:ova() {
export DISK_UUID=$(uuidgen)
export VM_UUID=$(uuidgen)
# create ovf
- cat ${PP_WORK}/${OVF_TEMPLATE_STAGE2} | envsubst > ${PP_DEPLOY}/${OVA_NAME}.ovf
- tar -cvf ${PP_DEPLOY}/${OVA_NAME}.ova -C ${PP_DEPLOY} ${OVA_NAME}.ovf
+ cat ${PP_WORK}/${OVF_TEMPLATE_STAGE2} | envsubst > ${PP_DEPLOY}/${IMAGE_FULLNAME}.ovf
+ tar -cvf ${PP_DEPLOY}/${IMAGE_FULLNAME}.ova -C ${PP_DEPLOY} ${IMAGE_FULLNAME}.ovf

# VirtualBox needs here a manifest file. VMware does accept that format.
if [ "${VMDK_SUBFORMAT}" = "monolithicSparse" ]; then
- echo "SHA${OVA_SHA_ALG}(${VIRTUAL_MACHINE_IMAGE_FILE})=$(sha${OVA_SHA_ALG}sum ${PP_DEPLOY}/${VIRTUAL_MACHINE_IMAGE_FILE} | cut -d' ' -f1)" >> ${PP_DEPLOY}/${OVA_NAME}.mf
- echo "SHA${OVA_SHA_ALG}(${OVA_NAME}.ovf)=$(sha${OVA_SHA_ALG}sum ${PP_DEPLOY}/${OVA_NAME}.ovf | cut -d' ' -f1)" >> ${PP_DEPLOY}/${OVA_NAME}.mf
- tar -uvf ${PP_DEPLOY}/${OVA_NAME}.ova -C ${PP_DEPLOY} ${OVA_NAME}.mf
+ echo "SHA${OVA_SHA_ALG}(${VIRTUAL_MACHINE_IMAGE_FILE})=$(sha${OVA_SHA_ALG}sum ${PP_DEPLOY}/${VIRTUAL_MACHINE_IMAGE_FILE} | cut -d' ' -f1)" >> ${PP_DEPLOY}/${IMAGE_FULLNAME}.mf
+ echo "SHA${OVA_SHA_ALG}(${IMAGE_FULLNAME}.ovf)=$(sha${OVA_SHA_ALG}sum ${PP_DEPLOY}/${IMAGE_FULLNAME}.ovf | cut -d' ' -f1)" >> ${PP_DEPLOY}/${IMAGE_FULLNAME}.mf
+ tar -uvf ${PP_DEPLOY}/${IMAGE_FULLNAME}.ova -C ${PP_DEPLOY} ${IMAGE_FULLNAME}.mf
fi
- tar -uvf ${PP_DEPLOY}/${OVA_NAME}.ova -C ${PP_DEPLOY} ${VIRTUAL_MACHINE_IMAGE_FILE}
+ tar -uvf ${PP_DEPLOY}/${IMAGE_FULLNAME}.ova -C ${PP_DEPLOY} ${VIRTUAL_MACHINE_IMAGE_FILE}
EOIMAGER
}
IMAGE_CMD:ova[depends] = "${PN}:do_transform_template"
--
2.39.5

cedric.h...@siemens.com

unread,
May 21, 2025, 12:38:28 PM5/21/25
to Prusty, Badrikesh, isar-...@googlegroups.com
On Wed, 2025-05-21 at 16:56 +0530, 'Badrikesh Prusty' via isar-users
wrote:
> Obsering build failures for virtualbox/vmware images when OVA_NAME is

Typo: Observing but I should also note that the imperative should be
used in git commit logs. For instance:

Fix ownership update in do_image_ova task for custom OVA names

Fix build failures for virtualbox/vmware images when OVA_NAME
is set in local.conf instead of default IMAGE_FULLNAME. Update
ownership handling to use ${OVA_NAME}.ova instead of
${IMAGE_FULLNAME}.ova

I however fear that it may not be an accurate description of the
changes. IIUC, Isar would use IMAGE_FULLNAME for the image files
regardless of the OVA_NAME setting hence any operations on the
generated files should really use IMAGE_FULLNAME and OVA_NAME is
really for the description embedded in the generated files (meta-data
files in particular)
--
Cedric Hombourger
Siemens AG
www.siemens.com

Prusty, Badrikesh

unread,
May 21, 2025, 3:59:03 PM5/21/25
to cedric.h...@siemens.com, isar-...@googlegroups.com
Hi Cedric,

Thank you for the inputs, I'll update the commit description and send v2 of the patch.

Badrikesh Prusty

unread,
May 21, 2025, 4:01:58 PM5/21/25
to isar-...@googlegroups.com, Badrikesh Prusty
Fix ownership update in do_image_ova task for custom OVA names. The do_image_ova
task uses ${IMAGE_FULLNAME}.ova for ownership updates instead of ${OVA_NAME}.ova,
leading to build failures in virtualbox/VMware images.

Failure logs: (Here, OVA_NAME = "isar-image-base-test")
| isar-image-base-test.ovf
| isar-image-base-test.mf
| isar-image-base-debian-bookworm-virtualbox-disk001.vmdk
| Removing /etc/schroot/isar-builder-88786470-74dc-4172-8907-531a0306c699-2655
| Removing /etc/schroot/chroot.d/isar-builder-88786470-74dc-4172-8907-531a0306c699-2655
| chown: cannot access '/build/tmp/deploy/images/virtualbox/isar-image-base-debian-bookworm-virtualbox.ova': No such file or directory

Fix VM image filenames: Use IMAGE_FULLNAME for VM images (.ova, .ovf, .mf)

OVA_NAME is embedded in the VM's description (metadata), so the imported image
retains that name, independent of the filenames.

Baurzhan Ismagulov

unread,
Jun 24, 2025, 8:59:30 AM6/24/25
to isar-...@googlegroups.com
On 2025-05-22 01:31, 'Badrikesh Prusty' via isar-users wrote:
> Fix ownership update in do_image_ova task for custom OVA names. The do_image_ova
> task uses ${IMAGE_FULLNAME}.ova for ownership updates instead of ${OVA_NAME}.ova,
> leading to build failures in virtualbox/VMware images.

Applied to next, thanks.

With kind regards,
Baurzhan
Reply all
Reply to author
Forward
0 new messages