[kernel/f18] Sign kernels with pesign if we're build with signmodules.

Peter Jones pjones at fedoraproject.org
Tue Aug 14 19:57:08 UTC 2012


commit d3182f8335eb649867e9b4e9b86acbd53d611529
Author: Peter Jones <pjones at redhat.com>
Date:   Tue Aug 14 15:40:18 2012 -0400

    Sign kernels with pesign if we're build with signmodules.
    
    This is jwb's patch modified to work with %pesign .

 kernel.spec |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/kernel.spec b/kernel.spec
index cd8aba2..ba810aa 100644
--- a/kernel.spec
+++ b/kernel.spec
@@ -552,6 +552,7 @@ BuildRequires: rpm-build >= 4.9.0-1, elfutils >= elfutils-0.153-1
 
 %if %{signmodules}
 BuildRequires: gnupg
+BuildRequires: pesign >= 0.10-3
 %endif
 
 Source0: ftp://ftp.kernel.org/pub/linux/kernel/v3.0/linux-%{kversion}.tar.xz
@@ -1590,6 +1591,11 @@ BuildKernel() {
     if [ -f arch/$Arch/boot/zImage.stub ]; then
       cp arch/$Arch/boot/zImage.stub $RPM_BUILD_ROOT/%{image_install_path}/zImage.stub-$KernelVer || :
     fi
+    %if %{signmodules}
+    # Sign the image if we're using EFI
+    %pesign -s -i $KernelImage -o vmlinuz.signed
+    mv vmlinuz.signed $KernelImage
+    %endif
     $CopyKernel $KernelImage \
     		$RPM_BUILD_ROOT/%{image_install_path}/$InstallName-$KernelVer
     chmod 755 $RPM_BUILD_ROOT/%{image_install_path}/$InstallName-$KernelVer


More information about the scm-commits mailing list