[Bug 2034705] Re: efivar fails to read variables
Heinrich Schuchardt
2034705 at bugs.launchpad.net
Fri Sep 8 12:25:51 UTC 2023
The problem is due to the kernel not supporting the deprecated statfs()
call on the efivarfs file system.
To demonstrate this I have created the following program (statfs.c):
#include <sys/vfs.h>
#include <stdio.h>
int main(int argc, char *argv[])
{
struct statfs s;
int ret;
if (argc < 2) {
printf("usage: %s <dirpath>\n", argv[0]);
return 1;
}
ret = statfs(argv[1], &s);
if (ret == -1) {
perror("statfs");
return 1;
} else {
printf("%s type: 0x%llx\n", argv[1],
(unsigned long long)s.f_type);
}
return 0;
}
When I run it I get the following output:
$ ./statfs /sys/firmware/efi
/sys/firmware/efi type: 0x62656572
$ ./statfs /sys/firmware/efi/efivars/
statfs: Invalid argument
$ mount | grep efivarfs
efivarfs on /sys/firmware/efi/efivars type efivarfs (ro,nosuid,nodev,noexec,relatime)
Though efivarfs is mounted on /sys/firmware/efi/efivars the statfs call
fails.
** Also affects: linux-meta-riscv (Ubuntu)
Importance: Undecided
Status: New
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to efivar in Ubuntu.
https://bugs.launchpad.net/bugs/2034705
Title:
efivar fails to read variables
Status in efivar package in Ubuntu:
New
Status in linux-meta-riscv package in Ubuntu:
New
Bug description:
On riscv64 StarFive VisionFive 2 with U-Boot v2023.10-rc4 and kernel
6.5.0-2-generic we see this output:
root at ubuntu-server:/var# ls /sys/firmware/efi/efivars/
AuditMode-8be4df61-93ca-11d2-aa0d-00e098032b8c
DeployedMode-8be4df61-93ca-11d2-aa0d-00e098032b8c
OsIndicationsSupported-8be4df61-93ca-11d2-aa0d-00e098032b8c
PlatformLang-8be4df61-93ca-11d2-aa0d-00e098032b8c
PlatformLangCodes-8be4df61-93ca-11d2-aa0d-00e098032b8c
SecureBoot-8be4df61-93ca-11d2-aa0d-00e098032b8c
SetupMode-8be4df61-93ca-11d2-aa0d-00e098032b8c
VendorKeys-8be4df61-93ca-11d2-aa0d-00e098032b8c
root at ubuntu-server:/var# efivar -l
efivar: error listing variables: Function not implemented
root at ubuntu-server:/var# efibootmgr -v
EFI variables are not supported on this system.
Expected behavior would be to display the variables.
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/efivar/+bug/2034705/+subscriptions
More information about the foundations-bugs
mailing list