public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] [PATCH] kernel-build.eclass: install x509.genkey and everything else in certs/
@ 2024-11-08 11:59 Nowa Ammerlaan
  0 siblings, 0 replies; only message in thread
From: Nowa Ammerlaan @ 2024-11-08 11:59 UTC (permalink / raw
  To: gentoo-dev; +Cc: Nowa Ammerlaan

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



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2024-11-08 12:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-08 11:59 [gentoo-dev] [PATCH] kernel-build.eclass: install x509.genkey and everything else in certs/ Nowa Ammerlaan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox