From: <daniel.turull@ericsson.com>
To: <openembedded-core@lists.openembedded.org>
Cc: <rybczynska@gmail.com>, <steve@sakoman.com>,
<Peter.Marko@siemens.com>, <ross.burton@arm.com>,
<skandigraun@gmail.com>,
Daniel Turull <daniel.turull@ericsson.com>,
Peter Marko <peter.marko@siemens.com>
Subject: [PATCH v2 3/6] kernel: add support to extract compiled files
Date: Mon, 28 Apr 2025 15:42:02 +0200 [thread overview]
Message-ID: <20250428134205.900354-4-daniel.turull@ericsson.com> (raw)
In-Reply-To: <20250428134205.900354-1-daniel.turull@ericsson.com>
From: Daniel Turull <daniel.turull@ericsson.com>
Use gen_compile_commands.py to extract files used during compilation
for the used kernel configuration.
CC: Peter Marko <peter.marko@siemens.com>
Signed-off-by: Daniel Turull <daniel.turull@ericsson.com>
---
meta/classes-recipe/kernel.bbclass | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/meta/classes-recipe/kernel.bbclass b/meta/classes-recipe/kernel.bbclass
index 36ce659762..56060f2c91 100644
--- a/meta/classes-recipe/kernel.bbclass
+++ b/meta/classes-recipe/kernel.bbclass
@@ -867,3 +867,14 @@ EXPORT_FUNCTIONS do_deploy
# Add using Device Tree support
inherit kernel-devicetree
+
+KERNEL_FILES_DIR ?= "${LOG_DIR}/cve/kernel_files"
+KERNEL_SRC_FILES ?= "${KERNEL_FILES_DIR}/compile_commands.json"
+
+do_save_compiled_files() {
+ bbdebug 1 "Saving compiled files in ${KERNEL_SRC_FILES}"
+ mkdir -p ${KERNEL_FILES_DIR}
+ ${S}/scripts/clang-tools/gen_compile_commands.py -o ${KERNEL_SRC_FILES} -d ${B}
+}
+
+addtask do_save_compiled_files after do_compile do_compile_kernelmodules
next prev parent reply other threads:[~2025-04-28 13:42 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-28 13:41 [PATCH v2 0/6] Check compiled files to filter kernel CVEs daniel.turull
2025-04-28 13:42 ` [PATCH v2 1/6] linux-vulns: fetch kernel.org CNA info daniel.turull
2025-04-28 13:42 ` [PATCH v2 2/6] cve-check: fix debug message daniel.turull
2025-04-28 13:42 ` daniel.turull [this message]
2025-04-28 14:24 ` [OE-core] [PATCH v2 3/6] kernel: add support to extract compiled files Bruce Ashfield
2025-04-28 14:28 ` Daniel Turull
2025-04-28 13:42 ` [PATCH v2 4/6] cve-check: move message outsite check_cves and sort daniel.turull
2025-04-28 13:42 ` [PATCH v2 5/6] cve-check, vex, spdx: use metadata from linux-vulns to enhance CVE reporting daniel.turull
2025-04-28 13:42 ` [PATCH v2 6/6] spdx: add option to include only compiled kernel files daniel.turull
2025-04-28 13:57 ` Joshua Watt
2025-04-28 13:59 ` Marko, Peter
2025-04-28 14:12 ` Daniel Turull
2025-04-28 14:44 ` Joshua Watt
2025-04-28 14:25 ` Daniel Turull
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250428134205.900354-4-daniel.turull@ericsson.com \
--to=daniel.turull@ericsson.com \
--cc=Peter.Marko@siemens.com \
--cc=openembedded-core@lists.openembedded.org \
--cc=ross.burton@arm.com \
--cc=rybczynska@gmail.com \
--cc=skandigraun@gmail.com \
--cc=steve@sakoman.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).