[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.
This commit is contained in:
Hermès Bélusca-Maïto 2020-11-24 04:34:56 +01:00
parent 05cd77028c
commit a59cecd89d
No known key found for this signature in database
GPG key ID: 3B2539C65E7B93D0

View file

@ -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;