From 245592c60e831cc7a6843b8da84333a3d265e7e3 Mon Sep 17 00:00:00 2001 From: "Martin, Chen" Date: Wed, 2 Jan 2019 14:06:57 +0800 Subject: [PATCH] rebase shim patch to CentOS 7.6 version Test: Pass build and multi-node deploy test Depends-On: https://review.openstack.org/627922 Story: 2004522 Task: 28438 Change-Id: I838e71c0334515ad2e34cbad968188b81f908d6a Signed-off-by: Martin, Chen --- .../meta_patches/0001-Ti-version-string.patch | 2 +- .../0002-Add-Ti-certificate.patch | 21 +++--- .../0001-Use-Titanium-certificate.patch | 66 ++++++++++--------- security/shim-unsigned/centos/srpm_path | 2 +- 4 files changed, 49 insertions(+), 42 deletions(-) diff --git a/security/shim-unsigned/centos/meta_patches/0001-Ti-version-string.patch b/security/shim-unsigned/centos/meta_patches/0001-Ti-version-string.patch index 840528f8b..b38f191c2 100644 --- a/security/shim-unsigned/centos/meta_patches/0001-Ti-version-string.patch +++ b/security/shim-unsigned/centos/meta_patches/0001-Ti-version-string.patch @@ -16,7 +16,7 @@ index afd533b..de216b6 +++ b/SPECS/shim.spec @@ -1,6 +1,6 @@ Name: shim - Version: 12 + Version: 15 -Release: 1%{?dist} +Release: 1.el7%{?_tis_dist}.%{tis_patch_ver} Summary: First-stage UEFI bootloader diff --git a/security/shim-unsigned/centos/meta_patches/0002-Add-Ti-certificate.patch b/security/shim-unsigned/centos/meta_patches/0002-Add-Ti-certificate.patch index 4b52100ef..825552e3a 100644 --- a/security/shim-unsigned/centos/meta_patches/0002-Add-Ti-certificate.patch +++ b/security/shim-unsigned/centos/meta_patches/0002-Add-Ti-certificate.patch @@ -4,8 +4,8 @@ Date: Mon, 15 Jan 2018 13:22:09 -0500 Subject: [PATCH 2/2] Add Ti certificate --- - SPECS/shim.spec | 5 +++++ - 1 file changed, 5 insertions(+) + SPECS/shim.spec | 4 ++++ + 1 file changed, 4 insertions(+) mode change 100644 => 100755 SPECS/shim.spec diff --git a/SPECS/shim.spec b/SPECS/shim.spec @@ -14,17 +14,18 @@ new mode 100755 index de216b6..83da6cd --- a/SPECS/shim.spec +++ b/SPECS/shim.spec -@@ -11,6 +11,9 @@ Source1: centos.crt - #Source2: dbx-x64.esl - #Source3: dbx-aa64.esl - Source4: shim-find-debuginfo.sh +@@ -14,8 +14,10 @@ Source0: https://github.com/mjg59/shim/releases/download/%{version}/shim- + #Source3: dbx-aa64.esl + Source4: shim-find-debuginfo.sh + Source5: centos.esl +Source1000: tis-shim.crt -+ -+Patch1000: 0001-Use-Titanium-certificate.patch + + Patch0: 0001-Add-vendor-esl.patch ++Patch1000: 0001-Use-Titanium-certificate.patch BuildRequires: git openssl-devel openssl BuildRequires: pesign >= 0.106-1 -@@ -101,6 +104,7 @@ git commit -a -q -m "%{version} baseline." +@@ -106,6 +108,7 @@ git commit -a -q -m "%{version} baseline." git am --ignore-whitespace %{patches} $@ - hexdump -v -e '1/1 "0x%02x, "' $< >> $@ + echo "static UINT8 shim_cert[] __attribute__((__unused__)) = {" > $@ + $(HEXDUMP) -v -e '1/1 "0x%02x, "' $< >> $@ echo "};" >> $@ -@@ -121,10 +131,10 @@ version.c : version.c.in - -e "s,@@COMMIT@@,$(COMMITID)," \ - < version.c.in > version.c +@@ -70,10 +74,10 @@ version.c : $(TOPDIR)/version.c.in + -e "s,@@COMMIT@@,$(COMMIT_ID)," \ + < $< > $@ -certdb/secmod.db: shim.crt +certdb/secmod.db: $(INTERNAL_CERT).crt -mkdir certdb -- pk12util -d certdb/ -i shim.p12 -W "" -K "" -- certutil -d certdb/ -A -i shim.crt -n shim -t u -+ pk12util -d certdb/ -i $(INTERNAL_CERT).p12 -W "" -K "" -+ certutil -d certdb/ -A -i $(INTERNAL_CERT).crt -n shim -t u +- $(PK12UTIL) -d certdb/ -i shim.p12 -W "" -K "" +- $(CERTUTIL) -d certdb/ -A -i shim.crt -n shim -t u ++ $(PK12UTIL) -d certdb/ -i $(INTERNAL_CERT).p12 -W "" -K "" ++ $(CERTUTIL) -d certdb/ -A -i $(INTERNAL_CERT).crt -n shim -t u - shim.o: $(SOURCES) shim_cert.h - shim.o: $(wildcard *.h) + shim.o: $(SOURCES) + ifneq ($(origin ENABLE_SHIM_CERT),undefined) -- 1.8.3.1 diff --git a/security/shim-unsigned/centos/srpm_path b/security/shim-unsigned/centos/srpm_path index 19f9a3f9e..eb27711fa 100644 --- a/security/shim-unsigned/centos/srpm_path +++ b/security/shim-unsigned/centos/srpm_path @@ -1 +1 @@ -mirror:Source/shim-12-1.el7.centos.src.rpm +mirror:Source/shim-15-1.el7.centos.src.rpm