Skip to content

Commit

Permalink
MdePkg: UefiDevicePathLib: Add Display Only format for Hard Drive.
Browse files Browse the repository at this point in the history
Ref: UEFI Specification Version 2.1 (Errata D) (released October 2008)

Signed-off-by: Huang Yuqi <[email protected]>
  • Loading branch information
huangyq13 authored and mergify[bot] committed Dec 25, 2024
1 parent f39b121 commit 9e65374
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions MdePkg/Library/UefiDevicePathLib/DevicePathToText.c
Original file line number Diff line number Diff line change
Expand Up @@ -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])))
Expand All @@ -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])
Expand All @@ -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);
}
}

/**
Expand Down

0 comments on commit 9e65374

Please sign in to comment.