Blob Blame History Raw
From 93684aeb12cf96e5bfefa405940c3010f60161b1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ulrich=20M=C3=BCller?= <ulm@gentoo.org>
Date: Sat, 14 Jul 2018 09:09:31 +0200
Subject: [PATCH] libparted: Fix ending CHS address in PMBR.

According to the UEFI specification version 2.7, Section 5.2.3,
Table 16, the ending CHS address in the protective MBR should be set
to 0xFFFFFF. This also agrees with the behaviour of fdisk from
util-linux-2.32.
---
 libparted/labels/gpt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libparted/labels/gpt.c b/libparted/labels/gpt.c
index 4f922b2..6f92a34 100644
--- a/libparted/labels/gpt.c
+++ b/libparted/labels/gpt.c
@@ -1144,7 +1144,7 @@ _write_pmbr (PedDevice *dev, bool pmbr_boot)
   pmbr->Signature = PED_CPU_TO_LE16 (MSDOS_MBR_SIGNATURE);
   pmbr->PartitionRecord[0].OSType = EFI_PMBR_OSTYPE_EFI;
   pmbr->PartitionRecord[0].StartSector = 2;
-  pmbr->PartitionRecord[0].EndHead = 0xFE;
+  pmbr->PartitionRecord[0].EndHead = 0xFF;
   pmbr->PartitionRecord[0].EndSector = 0xFF;
   pmbr->PartitionRecord[0].EndTrack = 0xFF;
   pmbr->PartitionRecord[0].StartingLBA = PED_CPU_TO_LE32 (1);
-- 
2.17.2