]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
commands/efi/lsefisystab: Print the UEFI specification revision in human readable...
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Fri, 14 Jul 2023 06:12:30 +0000 (08:12 +0200)
committerDaniel Kiper <daniel.kiper@oracle.com>
Thu, 12 Oct 2023 15:22:45 +0000 (17:22 +0200)
E.g. 2.10 instead of 00020064 and 2.3.1 instead of 0002001f.

See UEFI 2.10 specification, chapter 4.2.1 EFI_TABLE_HEADER.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
grub-core/commands/efi/lsefisystab.c

index 79ccee12a47843266cc1ac920f38bab3e30351a5..ffb24fc3b64d183a44f17b668d08d18b8d460de4 100644 (file)
@@ -64,12 +64,18 @@ grub_cmd_lsefisystab (struct grub_command *cmd __attribute__ ((unused)),
                      char **args __attribute__ ((unused)))
 {
   const grub_efi_system_table_t *st = grub_efi_system_table;
+  const grub_efi_uint32_t major_rev = st->hdr.revision >> 16;
+  const grub_efi_uint32_t minor_rev_upper = (st->hdr.revision & 0xffff) / 10;
+  const grub_efi_uint32_t minor_rev_lower = (st->hdr.revision & 0xffff) % 10;
   grub_efi_configuration_table_t *t;
   unsigned int i;
 
   grub_printf ("Address: %p\n", st);
-  grub_printf ("Signature: %016" PRIxGRUB_UINT64_T " revision: %08x\n",
-              st->hdr.signature, st->hdr.revision);
+  grub_printf ("Signature: %016" PRIxGRUB_UINT64_T " revision: %u.%u",
+              st->hdr.signature, major_rev, minor_rev_upper);
+  if (minor_rev_lower)
+     grub_printf (".%u", minor_rev_lower);
+  grub_printf ("\n");
   {
     char *vendor;
     grub_uint16_t *vendor_utf16;