diff options
author | Jose Luis Duran <jlduran@FreeBSD.org> | 2025-02-20 20:10:44 +0000 |
---|---|---|
committer | Jose Luis Duran <jlduran@FreeBSD.org> | 2025-02-20 20:14:26 +0000 |
commit | 39d58c816068178515af0718c47f4f64d1cffc1d (patch) | |
tree | cac946d615ec800c63623763b6c1a9f045ab29c6 /lib | |
parent | 05653fc774ffc97856507b871d05d7a232e899a5 (diff) |
libefivar: Add Display Only format for Hard Drive
Ref: UEFI Specification Version 2.1 (Errata D) (released October 2008)
Reviewed by: imp, emaste
Approved by: emaste (mentor)
Obtained from: https://github.com/tianocore/edk2/commit/9e6537469d4700d9d793ee21e9c2f2e7ddbb2176
Differential Revision: https://reviews.freebsd.org/D49060
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libefivar/efivar-dp-format.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/libefivar/efivar-dp-format.c b/lib/libefivar/efivar-dp-format.c index b4300573e41c..3fa2833a7e7a 100644 --- a/lib/libefivar/efivar-dp-format.c +++ b/lib/libefivar/efivar-dp-format.c @@ -1944,7 +1944,7 @@ DevPathToTextHardDrive ( case SIGNATURE_TYPE_MBR: UefiDevicePathLibCatPrint ( Str, - "HD(%d,%s,0x%08x,", + "HD(%d,%s,0x%08x", Hd->PartitionNumber, "MBR", // *((UINT32 *)(&(Hd->Signature[0]))) @@ -1955,7 +1955,7 @@ DevPathToTextHardDrive ( case SIGNATURE_TYPE_GUID: UefiDevicePathLibCatPrint ( Str, - "HD(%d,%s,%36s,", + "HD(%d,%s,%36s", Hd->PartitionNumber, "GPT", G(&(Hd->Signature[0])) @@ -1965,14 +1965,18 @@ DevPathToTextHardDrive ( default: UefiDevicePathLibCatPrint ( Str, - "HD(%d,%d,0,", + "HD(%d,%d,0", Hd->PartitionNumber, Hd->SignatureType ); break; } - UefiDevicePathLibCatPrint (Str, "0x%lx,0x%lx)", Hd->PartitionStart, Hd->PartitionSize); + if (DisplayOnly) { + UefiDevicePathLibCatPrint (Str, ")"); + } else { + UefiDevicePathLibCatPrint (Str, ",0x%lx,0x%lx)", Hd->PartitionStart, Hd->PartitionSize); + } } /** |