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 Kernel Packages, which is subscribed to linux-meta-riscv 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@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@ubuntu-server:/var# efivar -l efivar: error listing variables: Function not implemented root@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 -- Mailing list: https://launchpad.net/~kernel-packages Post to : kernel-packages@lists.launchpad.net Unsubscribe : https://launchpad.net/~kernel-packages More help : https://help.launchpad.net/ListHelp