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>
* 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) {