analyze: show priority in 'nvpcrs' output

This commit is contained in:
Lennart Poettering
2026-05-21 16:09:25 +02:00
parent 2de1322dc2
commit 2fca7519a4
+5 -3
View File
@@ -43,6 +43,7 @@ static int add_nvpcr_to_table(Tpm2Context **c, Table *t, const char *name) {
t,
TABLE_STRING, name,
TABLE_UINT32_HEX_0x, nv_index,
TABLE_UINT64, priority,
TABLE_STRING, h);
if (r < 0)
return table_log_add_error(r);
@@ -62,16 +63,17 @@ int verb_nvpcrs(int argc, char *argv[], uintptr_t _data, void *userdata) {
if (!have_tpm2)
log_notice("System lacks full TPM2 support, not showing NvPCR state.");
table = table_new("name", "nvindex", "value");
table = table_new("name", "nvindex", "priority", "value");
if (!table)
return log_oom();
(void) table_set_align_percent(table, table_get_cell(table, 0, 1), 100);
(void) table_set_align_percent(table, table_get_cell(table, 0, 2), 100);
table_set_ersatz_string(table, TABLE_ERSATZ_DASH);
(void) table_set_sort(table, (size_t) 0);
(void) table_set_sort(table, (size_t) 2, (size_t) 0);
if (!have_tpm2)
(void) table_hide_column_from_display(table, (size_t) 2);
(void) table_hide_column_from_display(table, (size_t) 3);
if (strv_isempty(strv_skip(argv, 1))) {
_cleanup_strv_free_ char **l = NULL;