mirror of
https://git.proxmox.com/git/fwupd
synced 2025-08-07 16:06:06 +00:00
trivial: fu-common: fix fallback for esp-path if udisks missing
Fixes: #2803
This commit is contained in:
parent
378b00018b
commit
be220a4f56
@ -2772,13 +2772,19 @@ fu_common_get_esp_for_path (const gchar *esp_path, GError **error)
|
|||||||
{
|
{
|
||||||
g_autofree gchar *basename = NULL;
|
g_autofree gchar *basename = NULL;
|
||||||
g_autoptr(GPtrArray) volumes = 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 (esp_path != NULL, NULL);
|
||||||
g_return_val_if_fail (error == NULL || *error == NULL, NULL);
|
g_return_val_if_fail (error == NULL || *error == NULL, NULL);
|
||||||
|
|
||||||
volumes = fu_common_get_volumes_by_kind (FU_VOLUME_KIND_ESP, error);
|
volumes = fu_common_get_volumes_by_kind (FU_VOLUME_KIND_ESP, &error_local);
|
||||||
if (volumes == NULL)
|
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;
|
return NULL;
|
||||||
|
}
|
||||||
basename = g_path_get_basename (esp_path);
|
basename = g_path_get_basename (esp_path);
|
||||||
for (guint i = 0; i < volumes->len; i++) {
|
for (guint i = 0; i < volumes->len; i++) {
|
||||||
FuVolume *vol = g_ptr_array_index (volumes, i);
|
FuVolume *vol = g_ptr_array_index (volumes, i);
|
||||||
|
Loading…
Reference in New Issue
Block a user