1
0
mirror of https://git.yoctoproject.org/poky synced 2026-07-16 03:47:03 +00:00

meta/lib/oe/package.py: fix path to kernel sources in save_debugsources_info

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) <joaomarcos.costa@bootlin.com>
Co-authored-by: Benjamin Robin (Schneider Electric) <benjamin.robin@bootlin.com>
Signed-off-by: Jeremy Rosen <jeremy.rosen@smile.fr>
Signed-off-by: Paul Barker <paul@pbarker.dev>
This commit is contained in:
João Marcos Costa (Schneider Electric)
2026-05-22 12:46:44 +02:00
committed by Paul Barker
parent 7842ddc5b2
commit 70ed6f6772
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -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')
+2 -2
View File
@@ -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 ("<internal>", "<built-in>")) and not src.endswith("/")
]