Skip to content

Commit cb1381d

Browse files
committed
kernel.spec: add conditional to include rhel trusted certificates
JIRA: https://issues.redhat.com/browse/RHEL-78808 Upstream Status: https://gitlab.com/cki-project/kernel-ark.git commit a33e9393045ef6da5326df79af93cfa263fdb194 Author: Eric Chanudet <echanude@redhat.com> Date: Fri Jun 27 17:19:10 2025 -0400 kernel.spec: add conditional to include rhel trusted certificates rhel build flavors add additional certificates (DUP, kpatch, nvidiagpu) to the system trusted keyring by default if the kernel or modules are signed. Condition that inclusion should a build want to, for example, sign modules, but not add said certificates to the kernel system keyring. This configuration is only used by automotive, no change to other artifacts. Signed-off-by: Eric Chanudet <echanude@redhat.com> Signed-off-by: Eric Chanudet <echanude@redhat.com>
1 parent 6210eca commit cb1381d

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

redhat/kernel.spec.template

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,9 @@ Summary: The Linux kernel
111111
# Sign modules on all arches
112112
%global signmodules 1
113113

114+
# Add additional rhel certificates to system trusted keys.
115+
%global rhelkeys 1
116+
114117
# Compress modules only for architectures that build modules
115118
%ifarch noarch
116119
%global zipmodules 0
@@ -454,6 +457,7 @@ Summary: The Linux kernel
454457
%define with_kabidw_base 0
455458
%define signkernel 0
456459
%define signmodules 1
460+
%define rhelkeys 0
457461
%endif
458462

459463

@@ -2018,12 +2022,16 @@ done
20182022
%if %{signkernel}%{signmodules}
20192023

20202024
# Add DUP and kpatch certificates to system trusted keys for RHEL
2025+
truncate -s0 ../certs/rhel.pem
20212026
%if 0%{?rhel}
2027+
%if %{rhelkeys}
20222028
%{log_msg "Add DUP and kpatch certificates to system trusted keys for RHEL"}
20232029
openssl x509 -inform der -in %{SOURCE100} -out rheldup3.pem
20242030
openssl x509 -inform der -in %{SOURCE101} -out rhelkpatch1.pem
20252031
openssl x509 -inform der -in %{SOURCE102} -out nvidiagpuoot001.pem
2026-
cat rheldup3.pem rhelkpatch1.pem nvidiagpuoot001.pem > ../certs/rhel.pem
2032+
cat rheldup3.pem rhelkpatch1.pem nvidiagpuoot001.pem >> ../certs/rhel.pem
2033+
# rhelkeys
2034+
%endif
20272035
%if %{signkernel}
20282036
%ifarch s390x ppc64le
20292037
openssl x509 -inform der -in %{secureboot_ca_0} -out secureboot.pem

0 commit comments

Comments
 (0)