Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on Lenovo T540p #111

Closed
guido99 opened this issue Jun 19, 2018 · 14 comments
Closed

Error on Lenovo T540p #111

guido99 opened this issue Jun 19, 2018 · 14 comments

Comments

@guido99
Copy link

guido99 commented Jun 19, 2018

On Lenovo T540p, efibootmgr-16 functions as expected with all efivar prior to release 36. The latest release 36, throws error on any attempt to make new NVRAM entry, "Cannot prepare Boot variable: No such file or directory".

@mtvrsh
Copy link

mtvrsh commented Jun 26, 2018

I have similiar issue on Lenovo X230.
Strace shows open("/sys/devices/pci0000:00/firmware_node/uid", O_RDONLY) = -1 ENOENT (No such file or directory) so it maybe related to #83.
Efivar 35 works with efibootmgr 16.

@guido99
Copy link
Author

guido99 commented Jun 26, 2018

On T540p, I do not see "sys/devices/pci0000:00/firmware_node/uid", but I do see "... /hid".

@ssusbauer
Copy link

Check https://bugzilla.opensuse.org/show_bug.cgi?id=1100077
This issue is popping up in VMware as well, there is no /sys/devices/pci0000:00/firmware_node/uid. Older versions seem unaffected despite the missing file.

@lcp
Copy link
Contributor

lcp commented Jul 16, 2018

device_get()(*) in efi_va_generate_file_device_path_from_esp() tried to parse the sysfs node for the creation of device path later. However, the parser may fail in some situation.

For example, some pci firmware didn't provide _UID, so linux-pci failed to read "/sys/devices/pci0000:00/firmware_node/uid".

The qemu emulated NVME may not provide eui, so efivar failed to read "/sys/class/block/nvme0n1/device/eui" or "/sys/class/block/nvme0n1/eui".

I've got another bug report that efibootmgr got "ENOSYS" (Error message: Could not prepare Boot variable: Function not implemented) in an emulated AArch64 machine with a virtio-blk harddrive. There are more to be done in the device parsers to make them more resilient.

(*) https://github.com/rhboot/efivar/blob/36/src/creator.c#L192

lcp added a commit to lcp/efivar that referenced this issue Jul 17, 2018
Even though there is a check to filter ENOENT, "fbuf == NULL" could make
ENOENT a fatal error when reading the acpi uid node. The only fatal
error with the empty read buffer is when read_sysfs_file() returns a
value larger than 0.

Fix issue#111
rhboot#111

Signed-off-by: Gary Lin <glin@suse.com>
@lcp
Copy link
Contributor

lcp commented Jul 17, 2018

I believe my patch fixes the uid parsing error but I don't have the machine to verify it.

@guido99
Copy link
Author

guido99 commented Jul 18, 2018 via email

@lcp
Copy link
Contributor

lcp commented Jul 18, 2018

I can't tell since I'm not the maintainer. I'd appreciate it if anyone can verify the patch in the machine with the uid issue so that we can at least know if the patch works or not.

@guido99
Copy link
Author

guido99 commented Jul 18, 2018 via email

@lcp
Copy link
Contributor

lcp commented Jul 19, 2018

Yes, this should be enough to verify the patch.
The patch probably cannot be applied to 36 directly due to the file change. I can provide a rebased patch if you need.

@guido99
Copy link
Author

guido99 commented Jul 19, 2018 via email

@mtvrsh
Copy link

mtvrsh commented Jul 19, 2018

@guido99 6d97634 is rebased on efivar 36 and fixes the problem on my machine.

@guido99
Copy link
Author

guido99 commented Jul 19, 2018

It now works on Lenovo on T540p.

@lcp
Copy link
Contributor

lcp commented Jul 20, 2018

Thanks for the verification. I'll send the pull request.

@vathpela
Copy link
Contributor

vathpela commented Aug 3, 2018

Should be fixed in the current tree, will be in efivar-37. Thanks!

@vathpela vathpela closed this as completed Aug 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants