Record the TPM version when reporting a UEFI update

Fixes https://github.com/fwupd/fwupd/issues/2391
This commit is contained in:
Richard Hughes 2020-10-22 14:14:51 +01:00
parent b814af80ef
commit e80547e8fc
3 changed files with 9 additions and 1 deletions

View File

@ -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) {

View File

@ -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

View File

@ -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);
}