From 42633a3e4c672b6b0b4781efd545ff4dcbcc5d7f Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Mon, 1 Jun 2015 16:15:08 -0400 Subject: [PATCH] Work around device path creation on machines where PcieRoot() paths simply don't work. Signed-off-by: Peter Jones --- ...teDevicePath-not-grokking-PcieRoot-d.patch | 41 +++++++++++++++++++ efivar.spec | 9 +++- 2 files changed, 48 insertions(+), 2 deletions(-) create mode 100644 0001-Work-around-LocateDevicePath-not-grokking-PcieRoot-d.patch diff --git a/0001-Work-around-LocateDevicePath-not-grokking-PcieRoot-d.patch b/0001-Work-around-LocateDevicePath-not-grokking-PcieRoot-d.patch new file mode 100644 index 0000000..0567af5 --- /dev/null +++ b/0001-Work-around-LocateDevicePath-not-grokking-PcieRoot-d.patch @@ -0,0 +1,41 @@ +From 2a29824f84d08a9fa71094c0ab72ec2b5f3fbc79 Mon Sep 17 00:00:00 2001 +From: Peter Jones +Date: Mon, 1 Jun 2015 16:11:58 -0400 +Subject: [PATCH] Work around LocateDevicePath() not grokking PcieRoot() + devices properly. + +Basically: PNP0A03 always has to work, so everybody always uses it, so +nobody tests PNP0A08 working, so it doesn't. + +So you have to lie to the machine about which hardware you want it to +find things on, because if you tell it the truth, it'll lie to you. + +The truth is a lie. + +Signed-off-by: Peter Jones +--- + src/linux.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/src/linux.c b/src/linux.c +index a812b0c..1231ecf 100644 +--- a/src/linux.c ++++ b/src/linux.c +@@ -490,6 +490,14 @@ make_pci_path(uint8_t *buf, ssize_t size, char *pathstr, ssize_t *pathoff) + return -1; + acpi_hid = EFIDP_EFI_PNP_ID(tmp16); + ++ /* Apparently basically nothing can look up a PcieRoot() node, ++ * because they just check _CID. So since _CID for the root pretty ++ * much always has to be PNP0A03 anyway, just use that no matter ++ * what. ++ */ ++ if (acpi_hid == EFIDP_ACPI_PCIE_ROOT_HID) ++ acpi_hid = EFIDP_ACPI_PCI_ROOT_HID; ++ + errno = 0; + fbuf = NULL; + int use_uid_str = 0; +-- +2.4.2 + diff --git a/efivar.spec b/efivar.spec index e39b7e2..8c994f6 100644 --- a/efivar.spec +++ b/efivar.spec @@ -1,14 +1,15 @@ Name: efivar Version: 0.19 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Tools to manage UEFI variables License: LGPLv2.1 URL: https://github.com/rhinstaller/efivar Requires: %{name}-libs = %{version}-%{release} -ExclusiveArch: %{ix86} x86_64 aarch64 +ExclusiveArch: %{ix86} x86_64 aarch64 BuildRequires: popt-devel git Source0: https://github.com/rhinstaller/efivar/releases/download/efivar-%{version}/efivar-%{version}.tar.bz2 +Patch0001: 0001-Work-around-LocateDevicePath-not-grokking-PcieRoot-d.patch %description efivar provides a simple command line interface to the UEFI variable facility. @@ -68,6 +69,10 @@ rm -rf $RPM_BUILD_ROOT %{_libdir}/*.so.* %changelog +* Mon Jun 01 2015 Peter Jones - 0.19-2 +- Work around device path creation on machines where PcieRoot() paths simply + don't work. + * Thu May 28 2015 Peter Jones - 0.19-1 - Update to 0.19 - add API from efibootmgr so fwupdate and other tools can use it.