Update to efivar 31

Work around NVMe EUI sysfs change
Provide some oldish version strings we should have kept.
lots of overflow checking on our pointer math in dp parsing
fix major/minor device number handling in the linux code
Do better formatting checks for MBR partitions
Fixes for gcc 7

Signed-off-by: Peter Jones <pjones@redhat.com>
This commit is contained in:
Peter Jones 2017-02-06 15:41:33 -05:00
parent 2654fad592
commit 8893f31a6e
4 changed files with 12 additions and 101 deletions

View File

@ -1,40 +0,0 @@
From c950dfce4a04b66e5efde770d82540e5d737f458 Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Mon, 17 Oct 2016 10:04:48 -0400
Subject: [PATCH] Check for the NVMe EUI in the base sysfs dir for the device
as well
Kernel commit 779ff75617099f4defe14e20443b95019a4c5ae8 moves the NVMe
attributes from being under nvme0n1/device/* to just being in the
nvme0n1/ directory. So now we get to check for both things. Thanks,
sysfs.
This resolves github issue #65
This resolves https://github.com/rhinstaller/efibootmgr/issues/48
Signed-off-by: Peter Jones <pjones@redhat.com>
---
src/linux.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/linux.c b/src/linux.c
index 30b5cd0..b995887 100644
--- a/src/linux.c
+++ b/src/linux.c
@@ -363,8 +363,13 @@ sysfs_parse_nvme(uint8_t *buf, ssize_t size, ssize_t *off,
* now fish the eui out of sysfs is there is one...
*/
rc = read_sysfs_file(&filebuf,
+ "/sys/class/block/nvme%dn%d/eui",
+ ctrl_id, ns_id);
+ if (rc < 0 && errno == ENOENT) {
+ rc = read_sysfs_file(&filebuf,
"/sys/class/block/nvme%dn%d/device/eui",
ctrl_id, ns_id);
+ }
if (rc >= 0) {
uint8_t eui[8];
if (rc < 23) {
--
2.10.0

View File

@ -1,55 +0,0 @@
From 7ae5c70750d31d7ddce736b5979d15a1a0ccaae2 Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Wed, 28 Sep 2016 09:28:24 -0400
Subject: [PATCH] lib*: provide LIBEFIVAR_1.28 etc.
Signed-off-by: Peter Jones <pjones@redhat.com>
---
src/libefiboot.map.in | 10 ++++++++--
src/libefivar.map.in | 10 ++++++++--
2 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/src/libefiboot.map.in b/src/libefiboot.map.in
index 51822a5..dce38a3 100644
--- a/src/libefiboot.map.in
+++ b/src/libefiboot.map.in
@@ -23,7 +23,13 @@ LIBEFIBOOT_0.0 {
} libefiboot.so.0;
LIBEFIBOOT_0.24 {
-};
+} LIBEFIBOOT_0.0;
+
+LIBEFIBOOT_1.28 {
+} LIBEFIBOOT_0.24;
+
+LIBEFIBOOT_1.29 {
+} LIBEFIBOOT_1.28;
LIBEFIBOOT_1.@@VERSION@@ {
-};
+} LIBEFIBOOT_1.29;
diff --git a/src/libefivar.map.in b/src/libefivar.map.in
index 6b8f996..033eb8d 100644
--- a/src/libefivar.map.in
+++ b/src/libefivar.map.in
@@ -99,8 +99,14 @@ LIBEFIVAR_0.24 {
efi_guid_cmp;
} LIBEFIVAR_0.0;
-LIBEFIVAR_1.@@VERSION@@ {
+LIBEFIVAR_1.28 {
global: efi_error_set;
efi_error_get;
efi_error_clear;
-};
+} LIBEFIVAR_0.24;
+
+LIBEFIVAR_1.29 {
+} LIBEFIVAR_1.28;
+
+LIBEFIVAR_1.@@VERSION@@ {
+} LIBEFIVAR_1.29;
--
2.7.4

View File

@ -1,6 +1,6 @@
Name: efivar
Version: 30
Release: 5%{?dist}
Version: 31
Release: 0.1%{?dist}
Summary: Tools to manage UEFI variables
License: LGPLv2.1
URL: https://github.com/rhinstaller/efivar
@ -9,8 +9,6 @@ ExclusiveArch: %{ix86} x86_64 aarch64
BuildRequires: popt-devel popt-static git glibc-static
Source0: https://github.com/rhinstaller/efivar/releases/download/efivar-%{version}/efivar-%{version}.tar.bz2
Patch0001: 0001-lib-provide-LIBEFIVAR_1.28-etc.patch
Patch0002: 0001-Check-for-the-NVMe-EUI-in-the-base-sysfs-dir-for-the.patch
%description
efivar provides a simple command line interface to the UEFI variable facility.
@ -71,6 +69,15 @@ rm -rf $RPM_BUILD_ROOT
%{_libdir}/*.so.*
%changelog
* Mon Feb 06 2017 Peter Jones <pjones@redhat.com> - 31-0.1
- Update to efivar 31
- Work around NVMe EUI sysfs change
- Provide some oldish version strings we should have kept.
- lots of overflow checking on our pointer math in dp parsing
- fix major/minor device number handling in the linux code
- Do better formatting checks for MBR partitions
- Fixes for gcc 7
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 30-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

View File

@ -1,2 +1 @@
9940b5668b16598df2b3e4ff63899d50 efivar-29.tar.bz2
143f055904fceaad6ed39f8e849ba079 efivar-30.tar.bz2
SHA512 (efivar-31.tar.bz2) = eaa64388c6b0ae7372bbc1d42ea0fe0f4e996c4190bb37863a83cf84df0172898d961eee73f86e47ed96eb7e833be0eece574b6a95526f33f9aadaf95ca58e6a