Skip to content

Commit

Permalink
[driver] Accept any valid disk as system disk during text-mode setup
Browse files Browse the repository at this point in the history
Modified-by: Michael Brown <mbrown@fensystems.co.uk>
Signed-off-by: Michael Brown <mbrown@fensystems.co.uk>
  • Loading branch information
TalAloni authored and mcb30 committed Oct 9, 2011
1 parent 99490e2 commit 55a35cd
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/driver/sanbootconf.c
Expand Up @@ -20,6 +20,7 @@
#include <initguid.h>
#include <wdmsec.h>
#include <ntdddisk.h>
#include <coguid.h>
#include "sanbootconf.h"
#include "acpi.h"
#include "ibft.h"
Expand Down Expand Up @@ -380,24 +381,30 @@ static NTSTATUS check_system_disk ( PUNICODE_STRING name,
if ( ! NT_SUCCESS ( status ) )
goto err_fetch_partition_info;

/* Check for a matching disk signature */
/* Check for a matching disk signature. If no system disk is
* defined (e.g. during text-mode setup), then treat any valid
* disk as having a matching signature.
*/
status = STATUS_UNSUCCESSFUL;
switch ( info.PartitionStyle ) {
case PARTITION_STYLE_MBR:
DbgPrint ( " MBR %08lx: \"%wZ\"\n",
info.Mbr.Signature, name );
if ( boot_info->SystemDeviceIsGpt )
goto err_not_system_disk;
if ( info.Mbr.Signature != boot_info->SystemDeviceSignature )
if ( ( boot_info->SystemDeviceSignature != 0 ) &&
( boot_info->SystemDeviceSignature != info.Mbr.Signature ))
goto err_not_system_disk;
break;
case PARTITION_STYLE_GPT:
DbgPrint ( " GPT " GUID_FMT ": \"%wZ\"\n",
GUID_ARGS ( info.Gpt.DiskId ), name );
if ( ! boot_info->SystemDeviceIsGpt )
goto err_not_system_disk;
if ( ! IsEqualGUID ( &info.Gpt.DiskId,
&boot_info->SystemDeviceGuid ) )
if ( ( ! IsEqualGUID ( &boot_info->SystemDeviceGuid,
&GUID_NULL ) ) &&
( ! IsEqualGUID ( &boot_info->SystemDeviceGuid,
&info.Gpt.DiskId ) ) )
goto err_not_system_disk;
break;
default:
Expand Down

0 comments on commit 55a35cd

Please sign in to comment.