From 366039c7965cbece9d3bf15e6b90fa84fb38c87f Mon Sep 17 00:00:00 2001 From: Thomas Perale Date: Mon, 1 Jun 2026 11:41:57 +0200 Subject: [PATCH] utils/generate-cyclonedx: fix hash_file location The 'show-info' output always the location relative to the Buildroot root directory. When running 'generate-cyclonedx' outside of the Buildroot root directory the hash file locations are not correct. Only using the 'hash_file' variable coming from 'show-info' doesn't guarantee the script to succeed. Use the 'brpath' variable to correctly reference the absolute path. Fixes: 1791b79422 utils/generate-cyclonedx: add hashes from .hash files to externalReferences Signed-off-by: Thomas Perale Signed-off-by: Arnout Vandecappelle (cherry picked from commit 2df4f1d573685234cc59361cde6c624885056c79) Signed-off-by: Thomas Perale --- utils/generate-cyclonedx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/generate-cyclonedx b/utils/generate-cyclonedx index 11edc05d80..bade018cd4 100755 --- a/utils/generate-cyclonedx +++ b/utils/generate-cyclonedx @@ -302,7 +302,7 @@ def cyclonedx_source_hashes(comp, source): hashes = [] for hash_file in comp.get("hashes", []): - with Path(hash_file).open() as f: + with (brpath / hash_file).open() as f: for line in f: line = line.strip() if not line.startswith("#") and line.endswith(f" {source}"):