diff --git a/OpenCorePkg b/OpenCorePkg index 718db6190..beafbb0b5 160000 --- a/OpenCorePkg +++ b/OpenCorePkg @@ -1 +1 @@ -Subproject commit 718db6190f93bacd4a4e19c96baed3cfd8070286 +Subproject commit beafbb0b50bf7d35f64347fba0908d7b62db0d1e diff --git a/rEFIt_UEFI/Platform/Settings.h b/rEFIt_UEFI/Platform/Settings.h index 4d890409e..0c881e141 100755 --- a/rEFIt_UEFI/Platform/Settings.h +++ b/rEFIt_UEFI/Platform/Settings.h @@ -2645,11 +2645,11 @@ printf("%s", ""); // If CustomUuid is defined, return false by default // If SmUUID is defined, return true by default. XBool ShouldInjectSystemID() { - if ( SystemParameters.CustomUuid.notNull() && SystemParameters.CustomUuid.notNull() ) { + if ( SystemParameters.CustomUuid.notNull() /*&& SystemParameters.CustomUuid.notNull()*/ ) { if ( SystemParameters._InjectSystemID == 2 ) return false; else return SystemParameters._InjectSystemID != 0; } - if ( Smbios.SmUUID.isNull() || Smbios.SmUUID.isNull() ) return false; + if ( Smbios.SmUUID.isNull() /* || Smbios.SmUUID.isNull() */) return false; if ( SystemParameters._InjectSystemID == 2 ) return true; return SystemParameters._InjectSystemID != 0; } diff --git a/rEFIt_UEFI/Platform/guid.cpp b/rEFIt_UEFI/Platform/guid.cpp index 256f97d14..622ec4a4f 100644 --- a/rEFIt_UEFI/Platform/guid.cpp +++ b/rEFIt_UEFI/Platform/guid.cpp @@ -193,14 +193,14 @@ F0 00 00 00 | .... // return returnValue; //} // -//XString8 GuidLEToXString8(const EFI_GUID& Guid) -//{ -// XString8 returnValue; -// returnValue.S8Printf("%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X", -// Guid.Data1, Guid.Data2, Guid.Data3, Guid.Data4[0], Guid.Data4[1], -// Guid.Data4[2], Guid.Data4[3], Guid.Data4[4], Guid.Data4[5], Guid.Data4[6], Guid.Data4[7]); -// return returnValue; -//} +XString8 GuidLEToXString8(const EFI_GUID& Guid) +{ + XString8 returnValue; + returnValue.S8Printf("%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X", + Guid.Data1, Guid.Data2, Guid.Data3, Guid.Data4[0], Guid.Data4[1], + Guid.Data4[2], Guid.Data4[3], Guid.Data4[4], Guid.Data4[5], Guid.Data4[6], Guid.Data4[7]); + return returnValue; +} diff --git a/rEFIt_UEFI/Platform/guid.h b/rEFIt_UEFI/Platform/guid.h index d28ffef78..5accf531f 100644 --- a/rEFIt_UEFI/Platform/guid.h +++ b/rEFIt_UEFI/Platform/guid.h @@ -229,7 +229,7 @@ extern "C" { //XString8 GuidBeToXString8(const EFI_GUID& Guid); // not used //XStringW GuidBeToXStringW(const EFI_GUID& Guid); // not used -//XString8 GuidLEToXString8(const EFI_GUID& Guid); +XString8 GuidLEToXString8(const EFI_GUID& Guid); //XStringW GuidLEToXStringW(const EFI_GUID& Guid); diff --git a/rEFIt_UEFI/Platform/smbios.cpp b/rEFIt_UEFI/Platform/smbios.cpp index 49165f99e..2d3712393 100755 --- a/rEFIt_UEFI/Platform/smbios.cpp +++ b/rEFIt_UEFI/Platform/smbios.cpp @@ -499,7 +499,7 @@ void GetTableType1(SmbiosDiscoveredSettings* smbiosSettings) return; } - //smbiosSettings.SmUUID = GuidLEToXString8(SmbiosTable.Type1->Uuid); // is this is a bug, this uuid might be BE, not LE, or should we use the "variant" field + // smbiosSettings.SmUUID = GuidLEToXString8(SmbiosTable.Type1->Uuid); // is this is a bug, this uuid might be BE, not LE, or should we use the "variant" field s = GetSmbiosString(SmbiosTable, SmbiosTable.Type1->ProductName); smbiosSettings->OEMProductFromSmbios.strncpy(s, iStrLen(s, 64)); //strncpy take care of ending zero @@ -515,10 +515,14 @@ EFI_GUID getSmUUIDFromSmbios() DBG("SmbiosTable: Type 1 (System Information) not found!\n"); return nullGuid; } + EFI_GUID TmpGuid; -//// XString8 g = GuidBeToXString8(SmbiosTable.Type1->Uuid); // should we use the "variant" field to know if it's LE or BE -// XString8 g = GuidLEToXString8(SmbiosTable.Type1->Uuid); // 2021-04 : this is a bug, the UUID will be swapped (read as a LE, sent as a BE). I leave for now because it doesn't really matter. - return SmbiosTable.Type1->Uuid; +// XString8 g = GuidBeToXString8(SmbiosTable.Type1->Uuid); // should we use the "variant" field to know if it's LE or BE + XString8 g1 = GuidLEToXString8(SmbiosTable.Type1->Uuid); // This is the difference between PC and Mac. the UUID will be swapped (read as a LE, sent as a BE). + + DBG("got LE smUUID as:%s\n", g1.c_str()); + TmpGuid.takeValueFromBE(g1); + return TmpGuid; } void PatchTableType1(const SmbiosInjectedSettings& smbiosSettings)