From a59cecd89ddfd7e4b84e57032538fd915a2d468d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Tue, 24 Nov 2020 04:34:56 +0100 Subject: [PATCH] [SETUPLIB] Add two hacks in partlist.c for temporarily setting consistently the disk partition style. Add two hacks in UpdateDiskLayout() and WritePartitions() so that the disk partition style is consistently set to a known value MBR, especially when that disk was previously new and uninitialized (RAW). A proper fix will be developed later when support for GPT is added. --- base/setup/lib/utils/partlist.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/base/setup/lib/utils/partlist.c b/base/setup/lib/utils/partlist.c index 6682f0a36a8..008dd9947a9 100644 --- a/base/setup/lib/utils/partlist.c +++ b/base/setup/lib/utils/partlist.c @@ -2881,6 +2881,9 @@ UpdateDiskLayout( } } + // HACK: See the FIXMEs in WritePartitions(): (Re)set the PartitionStyle to MBR. + DiskEntry->DiskStyle = PARTITION_STYLE_MBR; + DiskEntry->Dirty = TRUE; #ifdef DUMP_PARTITION_TABLE @@ -3926,6 +3929,9 @@ WritePartitions( // DiskEntry->NoMbr was TRUE (instead of NewDisk). // + // HACK: Parts of FIXMEs described above: (Re)set the PartitionStyle to MBR. + DiskEntry->DiskStyle = PARTITION_STYLE_MBR; + /* The layout has been successfully updated, the disk is not dirty anymore */ DiskEntry->Dirty = FALSE;