From 6a1f1a89ff195b031eb59e87714d6c9ec56c2dad Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Mon, 7 Dec 2020 11:04:58 -0500 Subject: [PATCH] spec: Use 'find' to locate a host kernel Using 'rpm' doesn't work in mock roots if rpm db defaults are different Signed-off-by: Cole Robinson --- edk2.spec | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/edk2.spec b/edk2.spec index 103bfa5..f936473 100644 --- a/edk2.spec +++ b/edk2.spec @@ -122,6 +122,7 @@ BuildRequires: genisoimage BuildRequires: bc BuildRequires: sed BuildRequires: perl +BuildRequires: findutils # These are for QOSB BuildRequires: python3-requests @@ -390,6 +391,7 @@ dd of="arm/vars-template-pflash.raw" if="/dev/zero" bs=1M count=64 %if 0%{?build_ovmf_x64:1} %if 0%{?qosb_testing} %if !%{skip_enroll} +KERNELPATH="$(find /lib/modules -name vmlinuz | head -1)" python3 qemu-ovmf-secureboot-%{qosb_version}/ovmf-vars-generator \ --qemu-binary /usr/bin/qemu-system-x86_64 \ --ovmf-binary ovmf/OVMF_CODE.secboot.fd \ @@ -398,7 +400,7 @@ python3 qemu-ovmf-secureboot-%{qosb_version}/ovmf-vars-generator \ --skip-enrollment \ --print-output \ --no-download \ - --kernel-path `rpm -ql kernel-core | grep "\/vmlinuz$" -m 1` \ + --kernel-path "$KERNELPATH" \ ovmf/OVMF_VARS.secboot.fd %endif %endif