summaryrefslogtreecommitdiffstats
path: root/MdePkg
diff options
context:
space:
mode:
authorHuang Yuqi <huangyq13@lenovo.com>2024-12-19 12:45:55 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2024-12-25 07:11:33 +0000
commit9e6537469d4700d9d793ee21e9c2f2e7ddbb2176 (patch)
treea3b0378b8cf08f2946c72244c79aa9136dbf4b58 /MdePkg
parentf39b1210660bd8b9a0ec5c6e415673c2ca6dbafd (diff)
downloadedk2-9e6537469d4700d9d793ee21e9c2f2e7ddbb2176.tar.gz
MdePkg: UefiDevicePathLib: Add Display Only format for Hard Drive.
Ref: UEFI Specification Version 2.1 (Errata D) (released October 2008) Signed-off-by: Huang Yuqi <huangyq13@lenovo.com>
Diffstat (limited to 'MdePkg')
-rw-r--r--MdePkg/Library/UefiDevicePathLib/DevicePathToText.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/MdePkg/Library/UefiDevicePathLib/DevicePathToText.c b/MdePkg/Library/UefiDevicePathLib/DevicePathToText.c
index e827daed5a..b0d5829e05 100644
--- a/MdePkg/Library/UefiDevicePathLib/DevicePathToText.c
+++ b/MdePkg/Library/UefiDevicePathLib/DevicePathToText.c
@@ -1882,7 +1882,7 @@ DevPathToTextHardDrive (
case SIGNATURE_TYPE_MBR:
UefiDevicePathLibCatPrint (
Str,
- L"HD(%d,%s,0x%08x,",
+ L"HD(%d,%s,0x%08x",
Hd->PartitionNumber,
L"MBR",
*((UINT32 *)(&(Hd->Signature[0])))
@@ -1892,7 +1892,7 @@ DevPathToTextHardDrive (
case SIGNATURE_TYPE_GUID:
UefiDevicePathLibCatPrint (
Str,
- L"HD(%d,%s,%g,",
+ L"HD(%d,%s,%g",
Hd->PartitionNumber,
L"GPT",
(EFI_GUID *)&(Hd->Signature[0])
@@ -1902,14 +1902,18 @@ DevPathToTextHardDrive (
default:
UefiDevicePathLibCatPrint (
Str,
- L"HD(%d,%d,0,",
+ L"HD(%d,%d,0",
Hd->PartitionNumber,
Hd->SignatureType
);
break;
}
- UefiDevicePathLibCatPrint (Str, L"0x%lx,0x%lx)", Hd->PartitionStart, Hd->PartitionSize);
+ if (DisplayOnly) {
+ UefiDevicePathLibCatPrint (Str, L")");
+ } else {
+ UefiDevicePathLibCatPrint (Str, L",0x%lx,0x%lx)", Hd->PartitionStart, Hd->PartitionSize);
+ }
}
/**