From be220a4f562c7dd1ee9e15abeccb6f8277b16616 Mon Sep 17 00:00:00 2001 From: Mario Limonciello Date: Wed, 10 Feb 2021 10:39:58 -0600 Subject: [PATCH] trivial: fu-common: fix fallback for esp-path if udisks missing Fixes: #2803 --- libfwupdplugin/fu-common.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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);