From: Nowa Ammerlaan <andrewammerlaan@gentoo.org>
To: gentoo-dev@lists.gentoo.org
Cc: Nowa Ammerlaan <andrewammerlaan@gentoo.org>
Subject: [gentoo-dev] [PATCH] kernel-build.eclass: install x509.genkey and everything else in certs/
Date: Fri, 8 Nov 2024 12:59:53 +0100 [thread overview]
Message-ID: <20241108115953.1095247-1-andrewammerlaan@gentoo.org> (raw)
Users setting up kernel module signing are instructed by our and upstream
documentation to use the kernels x509.genkey config file. This ensures that
a supported key is generated.
However, in the current situation users will first have to emerge
gentoo-sources or similar to actually get this genkey file. This is inconvenient
so lets just install the genkey config file in our dist-kernels.
There are also some other tools, scripts, and lists that may be useful, so while
we are changing this anyway lets just install all of those as well and in the
process simplify the code.
Signed-off-by: Nowa Ammerlaan <andrewammerlaan@gentoo.org>
---
eclass/kernel-build.eclass | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)
diff --git a/eclass/kernel-build.eclass b/eclass/kernel-build.eclass
index 4a2af9845ad4..9d33aef92691 100644
--- a/eclass/kernel-build.eclass
+++ b/eclass/kernel-build.eclass
@@ -397,7 +397,7 @@ kernel-build_src_install() {
fi
dodir "${kernel_dir}/arch/${kern_arch}"
- mv include scripts "${ED}${kernel_dir}/" || die
+ mv certs include scripts "${ED}${kernel_dir}/" || die
mv "arch/${kern_arch}/include" \
"${ED}${kernel_dir}/arch/${kern_arch}/" || die
# some arches need module.lds linker script to build external modules
@@ -438,13 +438,8 @@ kernel-build_src_install() {
local image=${ED}${kernel_dir}/${image_path}
cp -p "build/${image_path}" "${image}" || die
- # If a key was generated, copy it so external modules can be signed
- local suffix
- for suffix in pem x509; do
- if [[ -f "build/certs/signing_key.${suffix}" ]]; then
- cp -p "build/certs/signing_key.${suffix}" "${ED}${kernel_dir}/certs" || die
- fi
- done
+ # Copy built key/certificate files
+ cp -p build/certs/* "${ED}${kernel_dir}/certs/" || die
# building modules fails with 'vmlinux has no symtab?' if stripped
use ppc64 && dostrip -x "${kernel_dir}/${image_path}"
--
2.47.0
reply other threads:[~2024-11-08 12:00 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20241108115953.1095247-1-andrewammerlaan@gentoo.org \
--to=andrewammerlaan@gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/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