Use the efi_vendor variable from EFI-RPM

This commit is contained in:
Richard Hughes 2022-03-31 16:47:03 +01:00
parent 07d7a27477
commit 72609464c7
2 changed files with 70 additions and 3 deletions

View File

@ -0,0 +1,58 @@
From e74d38bfd3097471fe60dbe843a68c16516a78da Mon Sep 17 00:00:00 2001
From: Richard Hughes <richard@hughsie.com>
Date: Mon, 17 Jan 2022 14:50:47 +0000
Subject: [PATCH] Fix compiling with new versions of efivar
Fixes https://github.com/fwupd/fwupd/issues/4181
---
meson.build | 5 +++++
plugins/uefi-capsule/fu-uefi-common.h | 3 +++
2 files changed, 8 insertions(+)
diff --git a/meson.build b/meson.build
index 833bdbf56..691cc8a58 100644
--- a/meson.build
+++ b/meson.build
@@ -412,6 +412,11 @@ endif
if build_standalone and get_option('plugin_uefi_capsule')
efiboot = dependency('efiboot')
+ efivar = dependency('efivar')
+ if cc.has_header_symbol('efivar/efivar-types.h', 'efi_time_t', dependencies : efivar)
+ conf.set('HAVE_EFI_TIME_T', '1')
+ endif
+
efi_app_location = join_paths(libexecdir, 'fwupd', 'efi')
conf.set_quoted('EFI_APP_LOCATION', efi_app_location)
diff --git a/plugins/uefi-capsule/fu-uefi-common.h b/plugins/uefi-capsule/fu-uefi-common.h
index a21806d6b..1d616c9e0 100644
--- a/plugins/uefi-capsule/fu-uefi-common.h
+++ b/plugins/uefi-capsule/fu-uefi-common.h
@@ -9,6 +9,7 @@
#include <fwupdplugin.h>
+#include <efivar/efivar.h>
#include <glib.h>
#define EFI_CAPSULE_HEADER_FLAGS_PERSIST_ACROSS_RESET 0x00010000
@@ -17,6 +18,7 @@
#define EFI_OS_INDICATIONS_FILE_CAPSULE_DELIVERY_SUPPORTED 0x0000000000000004ULL
+#ifndef HAVE_EFI_TIME_T
typedef struct __attribute__((__packed__)) {
guint16 year;
guint8 month;
@@ -30,6 +32,7 @@ typedef struct __attribute__((__packed__)) {
guint8 daylight;
guint8 pad2;
} efi_time_t;
+#endif
typedef struct __attribute__((__packed__)) {
fwupd_guid_t guid;
--
2.35.1

View File

@ -45,7 +45,7 @@
Summary: Firmware update daemon
Name: fwupd
Version: 1.7.4
Release: 1%{?dist}
Release: 3%{?dist}
License: LGPLv2+
URL: https://github.com/fwupd/fwupd
Source0: http://people.freedesktop.org/~hughsient/releases/%{name}-%{version}.tar.xz
@ -65,6 +65,9 @@ Source301: redhatsecureboot301.cer
Source500: redhatsecurebootca5.cer
Source503: redhatsecureboot503.cer
# Backported from upstream
Patch1: 0001-Fix-compiling-with-new-versions-of-efivar.patch
BuildRequires: gettext
BuildRequires: glib2-devel >= %{glib2_version}
BuildRequires: libxmlb-devel >= %{libxmlb_version}
@ -74,7 +77,6 @@ BuildRequires: libgusb-devel >= %{libgusb_version}
BuildRequires: libcurl-devel >= %{libcurl_version}
BuildRequires: libjcat-devel >= %{libjcat_version}
BuildRequires: polkit-devel >= 0.103
BuildRequires: protobuf-c-devel
BuildRequires: sqlite-devel
BuildRequires: systemd >= %{systemd_version}
BuildRequires: systemd-devel
@ -223,6 +225,7 @@ tar xfvs %{SOURCE2} -C subprojects/fwupd-efi --strip-components=1
%if 0%{?have_uefi}
-Dplugin_uefi_capsule=true \
-Dplugin_uefi_pk=true \
-Defi_os_dir=%{efi_vendor} \
%ifarch x86_64
-Dfwupd-efi:efi_sbat_distro_id="rhel" \
-Dfwupd-efi:efi_sbat_distro_summary="Red Hat Enterprise Linux" \
@ -249,6 +252,7 @@ tar xfvs %{SOURCE2} -C subprojects/fwupd-efi --strip-components=1
%else
-Dplugin_modem_manager=false \
%endif
-Dplugin_logitech_bulkcontroller=false \
-Dman=true \
-Dbluez=false \
-Dplugin_cfu=false \
@ -482,7 +486,6 @@ done
%endif
%{_libdir}/fwupd-plugins-%{fwupdplugin_version}/libfu_plugin_usi_dock.so
%{_libdir}/fwupd-plugins-%{fwupdplugin_version}/libfu_plugin_logind.so
%{_libdir}/fwupd-plugins-%{fwupdplugin_version}/libfu_plugin_logitech_bulkcontroller.so
%{_libdir}/fwupd-plugins-%{fwupdplugin_version}/libfu_plugin_logitech_hidpp.so
%{_libdir}/fwupd-plugins-%{fwupdplugin_version}/libfu_plugin_upower.so
%{_libdir}/fwupd-plugins-%{fwupdplugin_version}/libfu_plugin_vli.so
@ -534,6 +537,12 @@ done
%endif
%changelog
* Wed Apr 06 2022 Richard Hughes <richard@hughsie.com> 1.7.4-3
- Disable the Logitech bulkcontroller plugin to avoid adding a dep to protobuf-c
which lives in AppStream, not BaseOS.
- Use the efi_vendor variable from EFI-RPM
- Resolves: rhbz#2064904
* Thu Jan 13 2022 Richard Hughes <richard@hughsie.com> 1.7.4-1
- New upstream release
- Backport Fedora 34 changes