mirror of
https://git.proxmox.com/git/fwupd
synced 2025-05-31 02:35:37 +00:00
uefi: Do not set the release version
Instead, put the failing version number in the error message where it belongs.
This commit is contained in:
parent
0de86eca3d
commit
c8d028207f
@ -106,7 +106,6 @@ fu_plugin_get_results (FuPlugin *plugin, FuDevice *device, GError **error)
|
|||||||
guint32 status = 0;
|
guint32 status = 0;
|
||||||
guint32 version = 0;
|
guint32 version = 0;
|
||||||
time_t when = 0;
|
time_t when = 0;
|
||||||
g_autofree gchar *version_str = NULL;
|
|
||||||
g_autoptr(fwup_resource_iter) iter = NULL;
|
g_autoptr(fwup_resource_iter) iter = NULL;
|
||||||
|
|
||||||
/* get the hardware we're referencing */
|
/* get the hardware we're referencing */
|
||||||
@ -122,15 +121,21 @@ fu_plugin_get_results (FuPlugin *plugin, FuDevice *device, GError **error)
|
|||||||
fu_device_get_guid_default (device));
|
fu_device_get_guid_default (device));
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
version_str = g_strdup_printf ("%u", version);
|
|
||||||
fu_device_set_update_version (device, version_str);
|
|
||||||
if (status == FWUP_LAST_ATTEMPT_STATUS_SUCCESS) {
|
if (status == FWUP_LAST_ATTEMPT_STATUS_SUCCESS) {
|
||||||
fu_device_set_update_state (device, FWUPD_UPDATE_STATE_SUCCESS);
|
fu_device_set_update_state (device, FWUPD_UPDATE_STATE_SUCCESS);
|
||||||
} else {
|
} else {
|
||||||
|
g_autofree gchar *err_msg = NULL;
|
||||||
|
g_autofree gchar *version_str = g_strdup_printf ("%u", version);
|
||||||
fu_device_set_update_state (device, FWUPD_UPDATE_STATE_FAILED);
|
fu_device_set_update_state (device, FWUPD_UPDATE_STATE_FAILED);
|
||||||
tmp = fwup_last_attempt_status_to_string (status);
|
tmp = fwup_last_attempt_status_to_string (status);
|
||||||
if (tmp != NULL)
|
if (tmp == NULL) {
|
||||||
fu_device_set_update_error (device, tmp);
|
err_msg = g_strdup_printf ("failed to update to %s",
|
||||||
|
version_str);
|
||||||
|
} else {
|
||||||
|
err_msg = g_strdup_printf ("failed to update to %s: %s",
|
||||||
|
version_str, tmp);
|
||||||
|
}
|
||||||
|
fu_device_set_update_error (device, err_msg);
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user