public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/grub2] rawhide: spec: Include CentOS/RHEL signing macros and parameters
@ 2026-10-16 17:05 Leo Sandoval
  0 siblings, 0 replies; only message in thread
From: Leo Sandoval @ 2026-10-16 17:05 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : rpms/grub2
            Branch : rawhide
            Commit : 42994005837b8c1aaf14304beb9a11708420de5b
            Author : Leo Sandoval <lsandova@redhat.com>
            Date   : 2026-10-16T10:19:14-06:00
            Stats  : +43/-6 in 2 file(s)
            URL    : https://src.fedoraproject.org/rpms/grub2/c/42994005837b8c1aaf14304beb9a11708420de5b?branch=rawhide

            Log:
            spec: Include CentOS/RHEL signing macros and parameters

Spec needs to be prepared for RHEL/CentOS signing process, so include
the proper macros/parameters/guards. Nothing changes on Fedora/ELN
signing, only the environmemnt is prepared for the other distros.

Resolves: #2536244

Signed-off-by: Leo Sandoval <lsandova@redhat.com>

---
diff --git a/grub.macros b/grub.macros
index 5acf96d..a75ca70 100644
--- a/grub.macros
+++ b/grub.macros
@@ -619,7 +619,7 @@ fi								\
 GRUB_MODULES+=%{grub_modules}					\
 GRUB_MODULES+=%{efi_modules}					\
 GRUB_MODULES+=%{platform_modules}				\
-%{expand:%%{efi_mkimage %{1} %{2} %{3} %{4}}}			\
+%{expand:%%{efi_mkimage %{1} %{2} %{3} %{4} %%{5} %%{6} %%{7}}}			\
 %{nil}
 
 %define do_ieee1275_build_images()			\
@@ -634,7 +634,7 @@ cd ..							\
 cd grub-%{1}-%{tarversion}					\
 %{expand:%%do_efi_configure %%{4} %%{5} %%{6}}			\
 %do_efi_build_all						\
-%{expand:%%do_efi_build_images %{grub_target_name} %{2} %{3} ./ } \
+%{expand:%%do_efi_build_images %{grub_target_name} %{2} %{3} ./ %%{7} %%{8} %%{9}} \
 cd ..								\
 %{nil}
 
@@ -643,7 +643,7 @@ cd grub-%{1}-%{tarversion}					\
 %{expand:%%do_efi_configure %%{4} %%{5} %%{6}}			\
 %do_efi_build_modules						\
 %{expand:%%do_efi_link_utils %{grubefiarch}}			\
-%{expand:%%do_efi_build_images %{alt_grub_target_name} %{2} %{3} ../grub-%{grubefiarch}-%{tarversion}/ } \
+%{expand:%%do_efi_build_images %{alt_grub_target_name} %{2} %{3} ../grub-%{grubefiarch}-%{tarversion}/ %%{7} %%{8} %%{9}} \
 cd ..								\
 %{nil}
 

diff --git a/grub2.spec b/grub2.spec
index 404edaf..6f1f868 100644
--- a/grub2.spec
+++ b/grub2.spec
@@ -17,7 +17,7 @@
 Name:		grub2
 Epoch:		1
 Version:	2.12
-Release:	86%{?dist}
+Release:	87%{?dist}
 Summary:	Bootloader with support for Linux, Multiboot and more
 License:	GPL-3.0-or-later
 URL:		http://www.gnu.org/software/grub/
@@ -40,6 +40,34 @@ Source14:	95-set-boot-entry.install
 
 %include %{SOURCE1}
 
+# ELN uses Fedora signing process, so just define valid values for RHEL/CentOS
+%if 0%{?rhel}%{?centos} && !0%{?eln}
+%ifarch x86_64 aarch64
+%define sb_ca	%{_datadir}/pki/sb-certs/secureboot-ca-%{_arch}.cer
+%define sb_cer	%{_datadir}/pki/sb-certs/secureboot-grub2-%{_arch}.cer
+%endif
+%ifarch ppc64le
+%define sb_ca	%{_datadir}/pki/sb-certs/secureboot-ca-%{_arch}.cer
+%define sb_cer	%{_datadir}/pki/sb-certs/secureboot-kernel-%{_arch}.cer
+%endif
+%if 0%{?centos}
+%ifarch x86_64 aarch64 ppc64le
+%define sb_key	centossecureboot802
+%endif
+%else
+%ifarch x86_64 aarch64
+%define sb_key	redhatsecureboot802
+%endif
+%ifarch ppc64le
+%define sb_key	redhatsecureboot702
+%endif
+%endif
+%else
+%define sb_ca	 %{nil}
+%define sb_cer	 %{nil}
+%define sb_key	 %{nil}
+%endif
+
 BuildRequires:	autoconf
 BuildRequires:	automake
 BuildRequires:	binutils
@@ -75,6 +103,11 @@ BuildRequires:	pesign >= 0.99-8
 BuildRequires:	ccache
 %endif
 
+# ELN uses Fedora signing process, so exclude
+%if 0%{?rhel}%{?centos} && !0%{?eln}
+BuildRequires:	system-sb-certs
+%endif
+
 ExcludeArch:	s390 s390x %{ix86}
 Obsoletes:	grub2 <= %{evr}
 
@@ -241,10 +274,10 @@ git commit -m "After making subdirs"
 
 %build
 %if 0%{with_efi_arch}
-%{expand:%do_primary_efi_build %%{grubefiarch} %%{grubefiname} %%{grubeficdname} %%{_target_platform} %%{efi_target_cflags} %%{efi_host_cflags}}
+%{expand:%do_primary_efi_build %%{grubefiarch} %%{grubefiname} %%{grubeficdname} %%{_target_platform} %%{efi_target_cflags} %%{efi_host_cflags} %{sb_ca} %{sb_cer} %{sb_key}}
 %endif
 %if 0%{with_alt_efi_arch}
-%{expand:%do_alt_efi_build %%{grubaltefiarch} %%{grubaltefiname} %%{grubalteficdname} %%{_alt_target_platform} %%{alt_efi_target_cflags} %%{alt_efi_host_cflags}}
+%{expand:%do_alt_efi_build %%{grubaltefiarch} %%{grubaltefiname} %%{grubalteficdname} %%{_alt_target_platform} %%{alt_efi_target_cflags} %%{alt_efi_host_cflags} %{sb_ca} %{sb_cer} %{sb_key}}
 %endif
 %if 0%{with_legacy_arch}
 %{expand:%do_legacy_build %%{grublegacyarch}}
@@ -686,6 +719,10 @@ fi
 %endif
 
 %changelog
+* Wed Oct 14 2026 Leo Sandoval <lsandova@redhat.com> - 2.12-87
+- spec: Include CentOS/RHEL signing macros and parameters
+- Resolves: #2536244
+
 * Tue Oct 13 2026 Dennis Gilmore <dennis@ausil.us> - 2.12-86
 - Add patch to try try allocating in the lower 4GB first
 - Resolves: #2459477

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

only message in thread, other threads:[~2026-10-16 17:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-16 17:05 [rpms/grub2] rawhide: spec: Include CentOS/RHEL signing macros and parameters Leo Sandoval

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