From: longpanda Date: Sun, 8 May 2022 03:41:12 +0000 (+0800) Subject: Fix a bug when boot in F2 browser mode if the computer has more than one disks with... X-Git-Tag: v1.0.75~8 X-Git-Url: https://glassweightruler.freedombox.rocks/gitweb/Ventoy.git/commitdiff_plain/fe137522ad3d3aebe600c08c29a4c73d69c71a23?ds=sidebyside Fix a bug when boot in F2 browser mode if the computer has more than one disks with same size. --- diff --git a/EDK2/edk2_mod/edk2-edk2-stable201911/MdeModulePkg/Application/Ventoy/Ventoy.c b/EDK2/edk2_mod/edk2-edk2-stable201911/MdeModulePkg/Application/Ventoy/Ventoy.c index 67e6881..8341f31 100644 --- a/EDK2/edk2_mod/edk2-edk2-stable201911/MdeModulePkg/Application/Ventoy/Ventoy.c +++ b/EDK2/edk2_mod/edk2-edk2-stable201911/MdeModulePkg/Application/Ventoy/Ventoy.c @@ -577,7 +577,8 @@ STATIC EFI_STATUS EFIAPI ventoy_find_iso_disk(IN EFI_HANDLE ImageHandle) continue; } - if (CompareMem(g_chain->os_param.vtoy_disk_guid, pBuffer + 0x180, 16) == 0) + if (CompareMem(g_chain->os_param.vtoy_disk_guid, pBuffer + 0x180, 16) == 0 && + CompareMem(g_chain->os_param.vtoy_disk_signature, pBuffer + 0x1b8, 4) == 0) { pMBR = (MBR_HEAD *)pBuffer; if (g_os_param_reserved[6] == 0 && pMBR->PartTbl[0].FsFlag != 0xEE) @@ -599,7 +600,7 @@ STATIC EFI_STATUS EFIAPI ventoy_find_iso_disk(IN EFI_HANDLE ImageHandle) Handles[i], EFI_OPEN_PROTOCOL_GET_PROTOCOL); - debug("Find Ventoy Disk Handle:%p DP:%s", Handles[i], + debug("Find Ventoy Disk Sig Handle:%p DP:%s", Handles[i], ConvertDevicePathToText(gBlockData.pDiskDevPath, FALSE, FALSE)); break; } diff --git a/EDK2/edk2_mod/edk2-edk2-stable201911/MdeModulePkg/Application/Ventoy/Ventoy.h b/EDK2/edk2_mod/edk2-edk2-stable201911/MdeModulePkg/Application/Ventoy/Ventoy.h index 30ed3c5..0e2b3fa 100644 --- a/EDK2/edk2_mod/edk2-edk2-stable201911/MdeModulePkg/Application/Ventoy/Ventoy.h +++ b/EDK2/edk2_mod/edk2-edk2-stable201911/MdeModulePkg/Application/Ventoy/Ventoy.h @@ -98,7 +98,9 @@ typedef struct ventoy_os_param UINT64 vtoy_reserved[4]; // Internal use by ventoy - UINT8 reserved[31]; + UINT8 vtoy_disk_signature[4]; + + UINT8 reserved[27]; }ventoy_os_param; #pragma pack() diff --git a/INSTALL/ventoy/ventoy_aa64.efi b/INSTALL/ventoy/ventoy_aa64.efi index e240dbb..2082337 100644 Binary files a/INSTALL/ventoy/ventoy_aa64.efi and b/INSTALL/ventoy/ventoy_aa64.efi differ diff --git a/INSTALL/ventoy/ventoy_ia32.efi b/INSTALL/ventoy/ventoy_ia32.efi index dad50d6..dd1b9ec 100644 Binary files a/INSTALL/ventoy/ventoy_ia32.efi and b/INSTALL/ventoy/ventoy_ia32.efi differ diff --git a/INSTALL/ventoy/ventoy_x64.efi b/INSTALL/ventoy/ventoy_x64.efi index 3facee7..24c3765 100644 Binary files a/INSTALL/ventoy/ventoy_x64.efi and b/INSTALL/ventoy/ventoy_x64.efi differ