mirror of
https://git.proxmox.com/git/fwupd
synced 2025-08-06 11:07:37 +00:00
Record the TPM version when reporting a UEFI update
Fixes https://github.com/fwupd/fwupd/issues/2391
This commit is contained in:
parent
b814af80ef
commit
e80547e8fc
@ -605,6 +605,7 @@ fu_plugin_dell_add_tpm_model (FuDevice *dev, GError **error)
|
||||
"failed to read TPM vendor string");
|
||||
return FALSE;
|
||||
}
|
||||
fu_device_set_metadata (dev, "TpmFamily", family);
|
||||
|
||||
/* these are not guaranteed by spec and may be NULL */
|
||||
vendor2 = fu_plugin_dell_get_tpm_capability (ctx, TPM2_PT_VENDOR_STRING_2);
|
||||
@ -744,6 +745,8 @@ fu_plugin_dell_detect_tpm (FuPlugin *plugin, GError **error)
|
||||
if (!fu_device_setup (dev, error))
|
||||
return FALSE;
|
||||
fu_plugin_device_register (plugin, dev);
|
||||
fu_plugin_add_report_metadata (plugin, "TpmFamily",
|
||||
fu_device_get_metadata (dev, "TpmFamily"));
|
||||
|
||||
/* build alternate device node */
|
||||
if (can_switch_modes) {
|
||||
|
@ -29,9 +29,12 @@ void
|
||||
fu_plugin_device_added (FuPlugin *plugin, FuDevice *dev)
|
||||
{
|
||||
FuPluginData *data = fu_plugin_get_data (plugin);
|
||||
const gchar *family = fu_tpm_device_get_family (FU_TPM_DEVICE (dev));
|
||||
|
||||
data->has_tpm = TRUE;
|
||||
if (g_strcmp0 (fu_tpm_device_get_family (FU_TPM_DEVICE (dev)), "2.0") == 0)
|
||||
if (g_strcmp0 (family, "2.0") == 0)
|
||||
data->has_tpm_v20 = TRUE;
|
||||
fu_plugin_add_report_metadata (plugin, "TpmFamily", family);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -38,7 +38,9 @@ fu_plugin_init (FuPlugin *plugin)
|
||||
FuPluginData *data = fu_plugin_alloc_data (plugin, sizeof (FuPluginData));
|
||||
data->bgrt = fu_uefi_bgrt_new ();
|
||||
fu_plugin_add_rule (plugin, FU_PLUGIN_RULE_RUN_AFTER, "upower");
|
||||
fu_plugin_add_rule (plugin, FU_PLUGIN_RULE_METADATA_SOURCE, "tpm");
|
||||
fu_plugin_add_rule (plugin, FU_PLUGIN_RULE_METADATA_SOURCE, "tpm_eventlog");
|
||||
fu_plugin_add_rule (plugin, FU_PLUGIN_RULE_METADATA_SOURCE, "dell");
|
||||
fu_plugin_set_build_hash (plugin, FU_BUILD_HASH);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user