part: Show partition numbers in hex

The 'part' command uses hex for partition numbers, so show them in hex
as well, to avoid confusion.

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass
2025-07-01 20:10:30 -06:00
parent 235585cbc3
commit ed7b88285f
3 changed files with 6 additions and 6 deletions

View File

@@ -54,7 +54,7 @@ static void print_one_part(dos_partition_t *p, lbaint_t ext_part_sector,
lbaint_t lba_start = ext_part_sector + get_unaligned_le32(p->start4);
lbaint_t lba_size = get_unaligned_le32(p->size4);
printf("%3d\t%-10" LBAFlength "u\t%-10" LBAFlength
printf("%3x\t%-10" LBAFlength "u\t%-10" LBAFlength
"u\t%08x-%02x\t%02x%s%s\n",
part_num, lba_start, lba_size, disksig, part_num, p->sys_ind,
(is_extended(p->sys_ind) ? " Extd" : ""),

View File

@@ -240,10 +240,10 @@ static void __maybe_unused part_print_efi(struct blk_desc *desc)
if (!is_pte_valid(&gpt_pte[i]))
continue;
printf("%3d\t0x%08llx\t0x%08llx\t\"%s\"\n", (i + 1),
le64_to_cpu(gpt_pte[i].starting_lba),
le64_to_cpu(gpt_pte[i].ending_lba),
print_efiname(&gpt_pte[i]));
printf("%3x\t0x%08llx\t0x%08llx\t\"%s\"\n", (i + 1),
le64_to_cpu(gpt_pte[i].starting_lba),
le64_to_cpu(gpt_pte[i].ending_lba),
print_efiname(&gpt_pte[i]));
printf("\tattrs:\t0x%016llx\n", gpt_pte[i].attributes.raw);
uuid = (unsigned char *)gpt_pte[i].partition_type_guid.b;
if (IS_ENABLED(CONFIG_PARTITION_TYPE_GUID))

View File

@@ -222,7 +222,7 @@ static void part_print_iso(struct blk_desc *desc)
printf("Part Start Sect x Size Type\n");
i=1;
do {
printf(" %2d %8" LBAFlength "u %8" LBAFlength "u %6ld %.32s\n",
printf(" %2x %8" LBAFlength "u %8" LBAFlength "u %6ld %.32s\n",
i, info.start, info.size, info.blksz, info.type);
i++;
} while (part_get_info_iso_verb(desc, i, &info, 0) != -1);