From 70ed6f677234d32198371a030178d2f272cf2d94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Marcos=20Costa=20=28Schneider=20Electric=29?= Date: Fri, 22 May 2026 12:46:44 +0200 Subject: [PATCH] meta/lib/oe/package.py: fix path to kernel sources in save_debugsources_info MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is no more than a backport of the current (i.e., from 'master') version of this same chunk in save_debugsources_info(), where BP is used instead of PF to form the path to the kernel sources. This replacement in package.py is followed by a similar change in meta/classes/create-spdx-2.2.bbclass, so that 'BP' is also used in spdx_get_src() and we don't face any regressions in SPDX v2.2. As a matter of fact, SPDX3 also uses 'BP' in get_patched_src() (from spdx_common.py). Overall, this backport ensures a coherence between Scarthgap and master, namely regarding the how the kernel sources are provided by package.py and consumed by SPDX v2.2 and 3.0. (From OE-Core rev: dd74c1388d5bfefd2adcdb6abd622297138e2eb1) Signed-off-by: João Marcos Costa (Schneider Electric) Co-authored-by: Benjamin Robin (Schneider Electric) Signed-off-by: Jeremy Rosen Signed-off-by: Paul Barker --- meta/classes/create-spdx-2.2.bbclass | 2 +- meta/lib/oe/package.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/meta/classes/create-spdx-2.2.bbclass b/meta/classes/create-spdx-2.2.bbclass index 037193bb4b..61bad66ae0 100644 --- a/meta/classes/create-spdx-2.2.bbclass +++ b/meta/classes/create-spdx-2.2.bbclass @@ -933,7 +933,7 @@ def spdx_get_src(d): share_src = d.getVar('WORKDIR') d.setVar('WORKDIR', spdx_workdir) d.setVar('STAGING_DIR_NATIVE', spdx_sysroot_native) - src_dir = spdx_workdir + "/" + d.getVar('PN')+ "-" + d.getVar('PV') + "-" + d.getVar('PR') + src_dir = spdx_workdir + "/" + d.getVar('BP') bb.utils.mkdirhier(src_dir) if bb.data.inherits_class('kernel',d): share_src = d.getVar('STAGING_KERNEL_DIR') diff --git a/meta/lib/oe/package.py b/meta/lib/oe/package.py index ba0d326781..fc5185ced4 100644 --- a/meta/lib/oe/package.py +++ b/meta/lib/oe/package.py @@ -1055,13 +1055,13 @@ def save_debugsources_info(debugsrcdir, sources_raw, d): # we format the sources as expected by spdx by replacing /usr/src/kernel/ # into BP/ kernel_src = d.getVar('KERNEL_SRC_PATH') - pf = d.getVar('PF') + bp = d.getVar('BP') sources_dict = {} for file, src_files in sources_raw: file_clean = file.replace(f"{workdir}/package/","") sources_clean = [ src.replace(f"{debugsrcdir}/{pn}/", "") - if not kernel_src else src.replace(f"{kernel_src}/", f"{pf}/") + if not kernel_src else src.replace(f"{kernel_src}/", f"{bp}/") for src in src_files if not any(keyword in src for keyword in ("", "")) and not src.endswith("/") ]