diff --git a/lib/libefivar/efivar-dp-format.c b/lib/libefivar/efivar-dp-format.c --- a/lib/libefivar/efivar-dp-format.c +++ b/lib/libefivar/efivar-dp-format.c @@ -1944,7 +1944,7 @@ 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 @@ 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 @@ 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); + } } /**