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.
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);
perror( "statfs" );
return 1;
printf( "%s type: 0x%llx\n", argv[1],
(unsigned long long)s.f_type);
if (ret == -1) {
} else {
}
return 0;
}
When I run it I get the following output:
$ ./statfs /sys/firmware/efi efi/efivars/ efi/efivars type efivarfs (ro,nosuid, nodev,noexec, relatime)
/sys/firmware/efi type: 0x62656572
$ ./statfs /sys/firmware/
statfs: Invalid argument
$ mount | grep efivarfs
efivarfs on /sys/firmware/
Though efivarfs is mounted on /sys/firmware/ efi/efivars the statfs call fails.