mirror of
https://github.com/CloverHackyColor/CloverBootloader.git
synced 2024-11-10 09:40:53 +01:00
restores old smUUID behavior
Signed-off-by: SergeySlice <sergey.slice@gmail.com>
This commit is contained in:
parent
b8c935a649
commit
04e42c09e7
@ -1 +1 @@
|
||||
Subproject commit 718db6190f93bacd4a4e19c96baed3cfd8070286
|
||||
Subproject commit beafbb0b50bf7d35f64347fba0908d7b62db0d1e
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -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);
|
||||
|
||||
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user