summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorNiko Mauno <niko.mauno@vaisala.com>2025-02-14 14:27:56 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2025-02-18 12:04:03 +0000
commit5eaba2308f13fb1e96e826033bc58d9902a61f84 (patch)
treebd99f7ffa2ae93ac2da0d761a7c4669fa837e414 /meta/classes
parenta75a919592c11c311c62af79034865e69b829511 (diff)
downloadpoky-5eaba2308f13fb1e96e826033bc58d9902a61f84.tar.gz
cve-check.bbclass: Mitigate symlink related error
According to Yocto reference manual, in description of the IMAGE_LINK_NAME variable, it is said that It is possible to set this to "" to disable symlink creation, however, you also need to set :term:`IMAGE_NAME` to still have a reasonable value e.g.:: IMAGE_LINK_NAME = "" IMAGE_NAME = "${IMAGE_BASENAME}${IMAGE_MACHINE_SUFFIX}${IMAGE_VERSION_SUFFIX}" However, when using following additions in local.conf file: INHERIT += "cve-check" IMAGE_LINK_NAME = "" IMAGE_NAME = "${IMAGE_BASENAME}${IMAGE_MACHINE_SUFFIX}${IMAGE_VERSION_SUFFIX}" the implicit symlink creation in cve_check_write_rootfs_manifest leads to following build failure $ bitbake core-image-minimal core-image-base ... 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/.json (matched in manifest-qemux86_64-core-image-minimal.image_complete) Please adjust the recipes so only one recipe provides a given file. Mitigate the issue by creating the symlink only in case IMAGE_LINK_NAME has not been set to empty string. (From OE-Core rev: 64bfec359bd909761ce0a6a716286d938ed162d1) Signed-off-by: Niko Mauno <niko.mauno@vaisala.com> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/cve-check.bbclass6
1 files changed, 4 insertions, 2 deletions
diff --git a/meta/classes/cve-check.bbclass b/meta/classes/cve-check.bbclass
index 90097cfde8..c6a410e2b2 100644
--- a/meta/classes/cve-check.bbclass
+++ b/meta/classes/cve-check.bbclass
@@ -254,13 +254,15 @@ python cve_check_write_rootfs_manifest () {
254 254
255 if enable_json: 255 if enable_json:
256 manifest_name_suffix = d.getVar("CVE_CHECK_MANIFEST_JSON_SUFFIX") 256 manifest_name_suffix = d.getVar("CVE_CHECK_MANIFEST_JSON_SUFFIX")
257 link_path = os.path.join(deploy_dir, "%s.%s" % (link_name, manifest_name_suffix))
258 manifest_name = d.getVar("CVE_CHECK_MANIFEST_JSON") 257 manifest_name = d.getVar("CVE_CHECK_MANIFEST_JSON")
259 258
260 with open(manifest_name, "w") as f: 259 with open(manifest_name, "w") as f:
261 json.dump(json_data, f, indent=2) 260 json.dump(json_data, f, indent=2)
262 261
263 update_symlinks(manifest_name, link_path) 262 if link_name:
263 link_path = os.path.join(deploy_dir, "%s.%s" % (link_name, manifest_name_suffix))
264 update_symlinks(manifest_name, link_path)
265
264 bb.plain("Image CVE JSON report stored in: %s" % manifest_name) 266 bb.plain("Image CVE JSON report stored in: %s" % manifest_name)
265} 267}
266 268