diff --git a/libfwupdplugin/fu-common.c b/libfwupdplugin/fu-common.c index b62c30753..b21168d52 100644 --- a/libfwupdplugin/fu-common.c +++ b/libfwupdplugin/fu-common.c @@ -2772,13 +2772,19 @@ fu_common_get_esp_for_path (const gchar *esp_path, GError **error) { g_autofree gchar *basename = NULL; g_autoptr(GPtrArray) volumes = NULL; + g_autoptr(GError) error_local = NULL; g_return_val_if_fail (esp_path != NULL, NULL); g_return_val_if_fail (error == NULL || *error == NULL, NULL); - volumes = fu_common_get_volumes_by_kind (FU_VOLUME_KIND_ESP, error); - if (volumes == NULL) + volumes = fu_common_get_volumes_by_kind (FU_VOLUME_KIND_ESP, &error_local); + if (volumes == NULL) { + /* check if it's a valid directory already */ + if (g_file_test (esp_path, G_FILE_TEST_IS_DIR)) + return fu_volume_new_from_mount_path (esp_path); + g_propagate_error (error, g_steal_pointer (&error_local)); return NULL; + } basename = g_path_get_basename (esp_path); for (guint i = 0; i < volumes->len; i++) { FuVolume *vol = g_ptr_array_index (volumes, i);