While the EFI spec allows numbers to be in many forms, libefivar

produces hex numbers for the dsn. Since that come is from EDK2, change
this for symmetry, by generating the dsn as a hex number.

Noticed by: gpart list | grep efimedia | awk -F: '{print $2;}' | \
	sed -e 's/^ *//g;s/,,/,/' | grep MBR | efidp -p | efidp -f
Sponsored by: Netflix
This commit is contained in:
Warner Losh 2017-11-21 06:12:21 +00:00
parent 2ab9683565
commit fdcf0c7477

View File

@ -322,7 +322,7 @@ g_part_mbr_dumpconf(struct g_part_table *basetable, struct g_part_entry *baseent
if (entry->ent.dp_flag & 0x80)
sbuf_printf(sb, "%s<attrib>active</attrib>\n", indent);
dsn = le32dec(table->mbr + DOSDSNOFF);
sbuf_printf(sb, "%s<efimedia>HD(%d,MBR,%d,%#jx,%#jx)", indent,
sbuf_printf(sb, "%s<efimedia>HD(%d,MBR,%#08x,%#jx,%#jx)", indent,
entry->base.gpe_index, dsn, (intmax_t)entry->base.gpe_start,
(intmax_t)(entry->base.gpe_end - entry->base.gpe_start + 1));
sbuf_printf(sb, "</efimedia>\n");