mirror of
https://git.proxmox.com/git/fwupd
synced 2025-05-15 15:54:47 +00:00
uefi: Check the filesystem type when checking the ESP
This commit is contained in:
parent
99b0b1be04
commit
03aead9fe7
@ -275,6 +275,7 @@ fu_uefi_read_file_as_uint64 (const gchar *path, const gchar *attr_name)
|
||||
gboolean
|
||||
fu_uefi_check_esp_path (const gchar *path, GError **error)
|
||||
{
|
||||
const gchar *fs_types[] = { "vfat", "ntfs", "exfat", NULL };
|
||||
g_autoptr(GUnixMountEntry) mount = g_unix_mount_at (path, NULL);
|
||||
if (mount == NULL) {
|
||||
g_set_error (error,
|
||||
@ -290,6 +291,15 @@ fu_uefi_check_esp_path (const gchar *path, GError **error)
|
||||
"%s is read only", path);
|
||||
return FALSE;
|
||||
}
|
||||
if (!g_strv_contains (fs_types, g_unix_mount_get_fs_type (mount))) {
|
||||
g_autofree gchar *supported = g_strjoinv ("|", (gchar **) fs_types);
|
||||
g_set_error (error,
|
||||
FWUPD_ERROR,
|
||||
FWUPD_ERROR_NOT_SUPPORTED,
|
||||
"%s has an invalid type, expected %s",
|
||||
path, supported);
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user