Package: efivar / 30-2

0001-Check-for-the-NVMe-EUI-in-the-base-sysfs-dir-for-the.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
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.7.4