From 848da2f632f22fa4934d74838c731ed9352a1816 Mon Sep 17 00:00:00 2001 From: Niko Mauno Date: Mon, 12 May 2025 15:52:28 +0000 Subject: [PATCH] cve-check.bbclass: Fix symlink handling also for text files While backporting commit 7543e4e24a8b ("cve-check.bbclass: Mitigate symlink related error") I failed to address the fact that in Scarthgap this bbclass still generates also the text CVE file, in addition to the JSON file. In order to avoid the error that occurred with JSON files from occurring now with CVE files: ERROR: core-image-base-1.0-r0 do_image_complete: Recipe core-image-base is trying to install files into a shared area when those files already exist. The files and the manifests listing them are: /home/poky/build/tmp/deploy/images/qemux86-64/.cve (matched in manifest-qemux86_64-core-image-minimal.image_complete) Please adjust the recipes so only one recipe provides a given file. update the symlink handling for the text file variant too. (From OE-Core rev: 81e702c85c62782dbedd5ca2a5e6569e6339dd60) Signed-off-by: Niko Mauno Signed-off-by: Steve Sakoman --- meta/classes/cve-check.bbclass | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/meta/classes/cve-check.bbclass b/meta/classes/cve-check.bbclass index badfee550c..6b8376bf17 100644 --- a/meta/classes/cve-check.bbclass +++ b/meta/classes/cve-check.bbclass @@ -270,13 +270,14 @@ python cve_check_write_rootfs_manifest () { d.setVar("PN", save_pn) if enable_text: - link_path = os.path.join(deploy_dir, "%s.cve" % link_name) manifest_name = d.getVar("CVE_CHECK_MANIFEST") with open(manifest_name, "w") as f: f.write(text_data) - update_symlinks(manifest_name, link_path) + if link_name: + link_path = os.path.join(deploy_dir, "%s.cve" % link_name) + update_symlinks(manifest_name, link_path) bb.plain("Image CVE report stored in: %s" % manifest_name) if enable_json: