From 1ba8bdadbc758be4449cf00e692b622f178bcdcf Mon Sep 17 00:00:00 2001 From: Yaakov Selkowitz Date: Wed, 1 Nov 2023 10:26:33 -0400 Subject: [PATCH] Add grub2-efi-x64-modules dependency and scriplet This is based on c9s changes: https://gitlab.com/redhat/centos-stream/rpms/tboot/-/commit/26f7e15a839997e9daf0c2a85393fdfa12a7650b https://gitlab.com/redhat/centos-stream/rpms/tboot/-/commit/0891de6e6c3d6cd6479478f64b1b2182e1f9d033 --- tboot.spec | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/tboot.spec b/tboot.spec index 4f6c326..b677fd1 100644 --- a/tboot.spec +++ b/tboot.spec @@ -1,7 +1,7 @@ Summary: Performs a verified launch using Intel TXT Name: tboot Version: 1.11.1 -Release: 3%{?dist} +Release: 4%{?dist} Epoch: 1 License: BSD-3-Clause @@ -13,6 +13,7 @@ BuildRequires: gcc BuildRequires: perl BuildRequires: openssl-devel BuildRequires: zlib-devel +Requires: grub2-efi-x64-modules ExclusiveArch: %{ix86} x86_64 %description @@ -24,11 +25,27 @@ and verified launch of an OS kernel/VMM. %autosetup -p1 -n %{name}-%{version} %build -CFLAGS="$RPM_OPT_FLAGS"; export CFLAGS -make debug=y %{?_smp_mflags} +%make_build debug=y %install -make debug=y DISTDIR=$RPM_BUILD_ROOT install +%make_install debug=y + +%post +# create the tboot grub entry +grub2-mkconfig -o /boot/grub2/grub.cfg + +# For EFI based machines ... +if [ -d /sys/firmware/efi ]; then + echo "EFI detected .." + [ -d /boot/grub2/x86_64-efi ] || mkdir -pv /boot/grub2/x86_64-efi + cp -vf /usr/lib/grub/x86_64-efi/relocator.mod /boot/grub2/x86_64-efi/ + cp -vf /usr/lib/grub/x86_64-efi/multiboot2.mod /boot/grub2/x86_64-efi/ +fi + +%postun +# Remove residual grub efi modules. +[ -d /boot/grub2/x86_64-efi ] && rm -rf /boot/grub2/x86_64-efi +grub2-mkconfig -o /etc/grub2.cfg %files @@ -56,6 +73,9 @@ make debug=y DISTDIR=$RPM_BUILD_ROOT install /boot/tboot-syms %changelog +* Wed Nov 01 2023 Yaakov Selkowitz - 1:1.11.1-4 +- Add grub2-efi-x64-modules dependency and scriplet + * Fri Sep 22 2023 David Cantrell - 1:1.11.1-3 - Use %%license for the COPYING file in the %%files section - Convert the License tag to an SPDX expression