]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
analyze: show priority in 'nvpcrs' output
authorLennart Poettering <lennart@amutable.com>
Thu, 21 May 2026 12:20:37 +0000 (14:20 +0200)
committerLennart Poettering <lennart@amutable.com>
Thu, 21 May 2026 14:09:25 +0000 (16:09 +0200)
src/analyze/analyze-nvpcrs.c

index c3967ca01a581d4f451d8870d6c5d95e6dbf47c8..dde31be0732c4536954c710be0c6cd8c6ff45da8 100644 (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;