Blame SOURCES/0011-kernel-building-hack.patch

4bf471
From 0b9048cbcc1cfc2afd9cbf781732882736cbe965 Mon Sep 17 00:00:00 2001
4bf471
From: Peter Jones <pjones@redhat.com>
4bf471
Date: Tue, 14 Jul 2020 16:42:39 -0400
4bf471
Subject: [PATCH 11/11] kernel building hack
4bf471
4bf471
Signed-off-by: Peter Jones <pjones@redhat.com>
4bf471
---
4bf471
 src/pesign-rpmbuild-helper.in | 17 +++++++++++++++++
4bf471
 1 file changed, 17 insertions(+)
4bf471
4bf471
diff --git a/src/pesign-rpmbuild-helper.in b/src/pesign-rpmbuild-helper.in
4bf471
index c5287c27e0c..27b8261bc17 100644
4bf471
--- a/src/pesign-rpmbuild-helper.in
4bf471
+++ b/src/pesign-rpmbuild-helper.in
4bf471
@@ -202,6 +202,23 @@ main() {
4bf471
 	    "${input[@]}" "${output[@]}"
4bf471
 	rm -rf "${sattrs}" "${sattrs}.sig" "${nssdir}"
4bf471
     elif [[ -n "${socket}" ]] ; then
4bf471
+	### welcome haaaaack city
4bf471
+	if [[ "${client_token[1]}" = "OpenSC Card (Fedora Signer)" ]] ; then
4bf471
+	    if [[ "${input[1]}" =~ (/|^)vmlinuz($|[_.-]) ]] \
4bf471
+	       || [[ "${input[1]}" =~ (/|^)bzImage($|[_.-]) ]] ; then
4bf471
+		if [[ "${rhelcertfile}" =~ redhatsecureboot501.* ]] \
4bf471
+		   || [[ "${rhelcertfile}" =~ redhatsecureboot401.* ]] \
4bf471
+		   || [[ "${rhelcertfile}" =~ centossecureboot201.* ]] ; then
4bf471
+		    client_cert[1]=kernel-signer
4bf471
+		elif [[ "${rhelcertfile}" =~ redhatsecureboot502.* ]] \
4bf471
+		   || [[ "${rhelcertfile}" =~ centossecureboot202.* ]] ; then
4bf471
+		    client_cert[1]=grub2-signer
4bf471
+		elif [[ "${rhelcertfile}" =~ redhatsecureboot503.* ]] \
4bf471
+		   || [[ "${rhelcertfile}" =~ centossecureboot203.* ]] ; then
4bf471
+		    client_cert[1]=fwupd-signer
4bf471
+		fi
4bf471
+	    fi
4bf471
+	fi
4bf471
 	"${client}" "${client_token[@]}" "${client_cert[@]}"    \
4bf471
 	    "${sattrout[@]}" "${certout[@]}"	\
4bf471
 	    ${sign} "${input[@]}" "${output[@]}"
4bf471
-- 
4bf471
2.26.2
4bf471