+ struct statfs s;
+
+ assert(efi_mount);
+
+ if (!efi_mount->guid) {
+ pb_debug_fn("guid not set\n");
+ return false;
+ }
+
+ if (access(efi_mount->path, R_OK | W_OK)) {
+ pb_debug_fn("Can't access %s\n", efi_mount->path);
+ return false;
+ }
+
+ memset(&s, '\0', sizeof(s));
+ if (statfs(efi_mount->path, &s)) {
+ pb_debug_fn("statfs failed: %s: (%d) %s\n", efi_mount->path,
+ errno, strerror(errno));
+ return false;
+ }
+
+ if (check_magic && s.f_type != EFIVARFS_MAGIC) {
+ pb_debug_fn("Bad magic = 0x%lx\n", (unsigned long)s.f_type);
+ return false;
+ }