mirror of
https://github.com/CloverHackyColor/CloverBootloader.git
synced 2024-11-10 09:40:53 +01:00
SmUUID wasn't injected if smbios info were in smbios.plist.
This commit is contained in:
parent
b592a62d6f
commit
29bdb1bdcd
@ -747,7 +747,7 @@ EFI_STATUS
|
|||||||
IN EFI_GUID *VendorGuid,
|
IN EFI_GUID *VendorGuid,
|
||||||
IN UINT32 Attributes,
|
IN UINT32 Attributes,
|
||||||
IN UINTN DataSize,
|
IN UINTN DataSize,
|
||||||
IN VOID *Data
|
IN JCONST VOID *Data
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@ EFI_GUID *APFSPartitionUUIDExtract(
|
|||||||
}
|
}
|
||||||
if (DevicePathType(DevicePath) == MEDIA_DEVICE_PATH && DevicePathSubType (DevicePath) == MEDIA_VENDOR_DP) {
|
if (DevicePathType(DevicePath) == MEDIA_DEVICE_PATH && DevicePathSubType (DevicePath) == MEDIA_VENDOR_DP) {
|
||||||
//Check that vendor-assigned GUID defines APFS Container Partition
|
//Check that vendor-assigned GUID defines APFS Container Partition
|
||||||
if ( GuidLEToXString8((EFI_GUID *)((UINT8 *)DevicePath+0x04)).equalIC(ApfsSignatureUUID) ) {
|
if ( GuidLEToXString8(*(EFI_GUID *)((UINT8 *)DevicePath+0x04)).equalIC(ApfsSignatureUUID) ) {
|
||||||
return (EFI_GUID *)((UINT8 *)DevicePath+0x14);
|
return (EFI_GUID *)((UINT8 *)DevicePath+0x14);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -65,7 +65,7 @@ XString8 APFSPartitionUUIDExtractAsXString8(
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
EFI_GUID* uuid = APFSPartitionUUIDExtract(DevicePath);
|
EFI_GUID* uuid = APFSPartitionUUIDExtract(DevicePath);
|
||||||
if ( uuid ) return GuidLEToXString8(uuid);
|
if ( uuid ) return GuidLEToXString8(*uuid);
|
||||||
return ""_XS8;
|
return ""_XS8;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ constexpr LString8 ApfsSignatureUUID = "BE74FCF7-0B7C-49F3-9147-01F4042E6842";
|
|||||||
* OUT: EFI_GUID
|
* OUT: EFI_GUID
|
||||||
* returns null if it is not APFS part
|
* returns null if it is not APFS part
|
||||||
*/
|
*/
|
||||||
EFI_GUID *APFSPartitionUUIDExtract(
|
EFI_GUID* APFSPartitionUUIDExtract(
|
||||||
IN EFI_DEVICE_PATH_PROTOCOL *DevicePath
|
IN EFI_DEVICE_PATH_PROTOCOL *DevicePath
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -97,7 +97,7 @@ typedef struct {
|
|||||||
UINT32 EFIAPI
|
UINT32 EFIAPI
|
||||||
CopyRecord(IN PLATFORM_DATA_RECORD *Rec,
|
CopyRecord(IN PLATFORM_DATA_RECORD *Rec,
|
||||||
IN CONST CHAR16 *Name,
|
IN CONST CHAR16 *Name,
|
||||||
IN VOID *Val,
|
IN const VOID *Val,
|
||||||
IN UINT32 ValLen)
|
IN UINT32 ValLen)
|
||||||
{
|
{
|
||||||
CopyMem(&Rec->Hdr, &mCpuDataRecordHeader, sizeof(EFI_SUBCLASS_TYPE1_HEADER));
|
CopyMem(&Rec->Hdr, &mCpuDataRecordHeader, sizeof(EFI_SUBCLASS_TYPE1_HEADER));
|
||||||
@ -114,7 +114,7 @@ CopyRecord(IN PLATFORM_DATA_RECORD *Rec,
|
|||||||
EFI_STATUS EFIAPI
|
EFI_STATUS EFIAPI
|
||||||
LogDataHub(IN EFI_GUID *TypeGuid,
|
LogDataHub(IN EFI_GUID *TypeGuid,
|
||||||
IN CONST CHAR16 *Name,
|
IN CONST CHAR16 *Name,
|
||||||
IN VOID *Data,
|
IN const VOID *Data,
|
||||||
IN UINT32 DataSize)
|
IN UINT32 DataSize)
|
||||||
{
|
{
|
||||||
UINT32 RecordSize;
|
UINT32 RecordSize;
|
||||||
@ -214,6 +214,9 @@ SetVariablesForOSX(LOADER_ENTRY *Entry)
|
|||||||
UINT64 os_version = AsciiOSVersionToUint64(Entry->OSVersion);
|
UINT64 os_version = AsciiOSVersionToUint64(Entry->OSVersion);
|
||||||
CHAR8 *PlatformLang;
|
CHAR8 *PlatformLang;
|
||||||
|
|
||||||
|
EFI_GUID uuid;
|
||||||
|
gSettings.getUUID(&uuid);
|
||||||
|
|
||||||
//
|
//
|
||||||
// firmware Variables
|
// firmware Variables
|
||||||
//
|
//
|
||||||
@ -225,8 +228,8 @@ SetVariablesForOSX(LOADER_ENTRY *Entry)
|
|||||||
SetNvramVariable(L"system-id",
|
SetNvramVariable(L"system-id",
|
||||||
&gEfiAppleNvramGuid,
|
&gEfiAppleNvramGuid,
|
||||||
EFI_VARIABLE_BOOTSERVICE_ACCESS,
|
EFI_VARIABLE_BOOTSERVICE_ACCESS,
|
||||||
sizeof(gUuid),
|
sizeof(uuid),
|
||||||
&gUuid);
|
&uuid);
|
||||||
|
|
||||||
Attributes = EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS;
|
Attributes = EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS;
|
||||||
|
|
||||||
@ -241,12 +244,12 @@ SetVariablesForOSX(LOADER_ENTRY *Entry)
|
|||||||
gSettings.RtMLB);
|
gSettings.RtMLB);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gSettings.RtROM != NULL) {
|
if (gSettings.RtROM.notEmpty()) {
|
||||||
SetNvramVariable(L"ROM",
|
SetNvramVariable(L"ROM",
|
||||||
&gEfiAppleNvramGuid,
|
&gEfiAppleNvramGuid,
|
||||||
Attributes,
|
Attributes,
|
||||||
gSettings.RtROMLen,
|
gSettings.RtROM.size(),
|
||||||
gSettings.RtROM);
|
gSettings.RtROM.vdata());
|
||||||
}
|
}
|
||||||
|
|
||||||
SetNvramVariable(L"FirmwareFeatures",
|
SetNvramVariable(L"FirmwareFeatures",
|
||||||
@ -310,11 +313,11 @@ SetVariablesForOSX(LOADER_ENTRY *Entry)
|
|||||||
|
|
||||||
// we should have two UUID: platform and system
|
// we should have two UUID: platform and system
|
||||||
// NO! Only Platform is the best solution
|
// NO! Only Platform is the best solution
|
||||||
if (!gSettings.InjectSystemID) {
|
if (!gSettings.ShouldInjectSystemID()) {
|
||||||
if (gSettings.SmUUIDConfig) {
|
if (gSettings.SmUUID.notEmpty()) {
|
||||||
SetNvramVariable(L"platform-uuid", &gEfiAppleBootGuid, Attributes, 16, &gUuid);
|
SetNvramVariable(L"platform-uuid", &gEfiAppleBootGuid, Attributes, sizeof(uuid), &uuid);
|
||||||
} else {
|
} else {
|
||||||
AddNvramVariable(L"platform-uuid", &gEfiAppleBootGuid, Attributes, 16, &gUuid);
|
AddNvramVariable(L"platform-uuid", &gEfiAppleBootGuid, Attributes, sizeof(uuid), &uuid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -507,8 +510,10 @@ SetupDataForOSX(BOOLEAN Hibernate)
|
|||||||
LogDataHubXStringW(&gEfiMiscSubClassGuid, L"Model", ProductName);
|
LogDataHubXStringW(&gEfiMiscSubClassGuid, L"Model", ProductName);
|
||||||
LogDataHubXStringW(&gEfiMiscSubClassGuid, L"SystemSerialNumber", SerialNumber);
|
LogDataHubXStringW(&gEfiMiscSubClassGuid, L"SystemSerialNumber", SerialNumber);
|
||||||
|
|
||||||
if (gSettings.InjectSystemID) {
|
if (gSettings.ShouldInjectSystemID()) {
|
||||||
LogDataHub(&gEfiMiscSubClassGuid, L"system-id", &gUuid, sizeof(EFI_GUID));
|
EFI_GUID uuid;
|
||||||
|
gSettings.getUUID(&uuid);
|
||||||
|
LogDataHub(&gEfiMiscSubClassGuid, L"system-id", &uuid, sizeof(uuid));
|
||||||
}
|
}
|
||||||
|
|
||||||
LogDataHub(&gEfiProcessorSubClassGuid, L"clovergui-revision", &Revision, sizeof(UINT32));
|
LogDataHub(&gEfiProcessorSubClassGuid, L"clovergui-revision", &Revision, sizeof(UINT32));
|
||||||
|
@ -394,7 +394,7 @@ GetSleepImageLocation(IN REFIT_VOLUME *Volume, REFIT_VOLUME **SleepImageVolume,
|
|||||||
// find sleep image entry from plist
|
// find sleep image entry from plist
|
||||||
Status = egLoadFile(Volume->RootDir, PrefName, &PrefBuffer, &PrefBufferLen);
|
Status = egLoadFile(Volume->RootDir, PrefName, &PrefBuffer, &PrefBufferLen);
|
||||||
if (EFI_ERROR(Status)) {
|
if (EFI_ERROR(Status)) {
|
||||||
XStringW PrefName3 = SWPrintf("\\Library\\Preferences\\com.apple.PowerManagement.%ls.plist", GuidBeToStr(&gUuid).wc_str());
|
XStringW PrefName3 = SWPrintf("\\Library\\Preferences\\com.apple.PowerManagement.%s.plist", gSettings.getUUID().c_str());
|
||||||
Status = egLoadFile(Volume->RootDir, PrefName3.wc_str(), &PrefBuffer, &PrefBufferLen);
|
Status = egLoadFile(Volume->RootDir, PrefName3.wc_str(), &PrefBuffer, &PrefBufferLen);
|
||||||
if (EFI_ERROR(Status)) {
|
if (EFI_ERROR(Status)) {
|
||||||
Status = egLoadFile(Volume->RootDir, PrefName2, &PrefBuffer, &PrefBufferLen);
|
Status = egLoadFile(Volume->RootDir, PrefName2, &PrefBuffer, &PrefBufferLen);
|
||||||
@ -920,7 +920,7 @@ IsOsxHibernated (IN LOADER_ENTRY *Entry)
|
|||||||
if (EFI_ERROR(Status)) {
|
if (EFI_ERROR(Status)) {
|
||||||
DBG(" cant convert Str %ls to GUID\n", Ptr);
|
DBG(" cant convert Str %ls to GUID\n", Ptr);
|
||||||
} else {
|
} else {
|
||||||
XStringW TmpStr = GuidLEToXStringW(&TmpGuid);
|
XStringW TmpStr = GuidLEToXStringW(TmpGuid);
|
||||||
//DBG("got the guid %ls\n", TmpStr);
|
//DBG("got the guid %ls\n", TmpStr);
|
||||||
memcpy((VOID*)Ptr, TmpStr.wc_str(), TmpStr.sizeInBytes());
|
memcpy((VOID*)Ptr, TmpStr.wc_str(), TmpStr.sizeInBytes());
|
||||||
}
|
}
|
||||||
|
@ -236,7 +236,7 @@ AddNvramVariable (
|
|||||||
IN EFI_GUID *VendorGuid,
|
IN EFI_GUID *VendorGuid,
|
||||||
IN UINT32 Attributes,
|
IN UINT32 Attributes,
|
||||||
IN UINTN DataSize,
|
IN UINTN DataSize,
|
||||||
IN VOID *Data
|
IN const VOID *Data
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
VOID *OldData;
|
VOID *OldData;
|
||||||
@ -1232,7 +1232,7 @@ FindStartupDiskVolume (
|
|||||||
EFI_DEVICE_PATH *MediaPath = Clover_FindDevicePathNodeWithType(DevicePath, MEDIA_DEVICE_PATH, MEDIA_VENDOR_DP);
|
EFI_DEVICE_PATH *MediaPath = Clover_FindDevicePathNodeWithType(DevicePath, MEDIA_DEVICE_PATH, MEDIA_VENDOR_DP);
|
||||||
if (MediaPath) {
|
if (MediaPath) {
|
||||||
EFI_GUID *MediaPathGuid = (EFI_GUID *)&((VENDOR_DEVICE_PATH_WITH_DATA*)MediaPath)->VendorDefinedData;
|
EFI_GUID *MediaPathGuid = (EFI_GUID *)&((VENDOR_DEVICE_PATH_WITH_DATA*)MediaPath)->VendorDefinedData;
|
||||||
XStringW MediaPathGuidStr = GuidLEToXStringW(MediaPathGuid);
|
XStringW MediaPathGuidStr = GuidLEToXStringW(*MediaPathGuid);
|
||||||
// DBG(" checking '%ls'\n", MediaPathGuidStr.wc_str());
|
// DBG(" checking '%ls'\n", MediaPathGuidStr.wc_str());
|
||||||
if (StrStr(gEfiBootLoaderPath, MediaPathGuidStr.wc_str())) {
|
if (StrStr(gEfiBootLoaderPath, MediaPathGuidStr.wc_str())) {
|
||||||
DBG(" - found entry %lld. '%ls', Volume '%ls', '%ls'\n", Index, LoaderEntry.Title.s(), Volume->VolName.wc_str(), LoaderPath.wc_str());
|
DBG(" - found entry %lld. '%ls', Volume '%ls', '%ls'\n", Index, LoaderEntry.Title.s(), Volume->VolName.wc_str(), LoaderPath.wc_str());
|
||||||
|
@ -45,7 +45,7 @@ AddNvramVariable (
|
|||||||
IN EFI_GUID *VendorGuid,
|
IN EFI_GUID *VendorGuid,
|
||||||
IN UINT32 Attributes,
|
IN UINT32 Attributes,
|
||||||
IN UINTN DataSize,
|
IN UINTN DataSize,
|
||||||
IN VOID *Data
|
IN const VOID *Data
|
||||||
);
|
);
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
AddNvramXString8 (
|
AddNvramXString8 (
|
||||||
|
@ -25,9 +25,12 @@ static void panic_(const char* format, VA_LIST va)
|
|||||||
#endif
|
#endif
|
||||||
;
|
;
|
||||||
|
|
||||||
|
extern void egSetGraphicsModeEnabled(BOOLEAN);
|
||||||
|
|
||||||
#define FATAL_ERROR_MSG "\nA fatal error happened. System halted.\n"
|
#define FATAL_ERROR_MSG "\nA fatal error happened. System halted.\n"
|
||||||
static void panic_(const char* format, VA_LIST va)
|
static void panic_(const char* format, VA_LIST va)
|
||||||
{
|
{
|
||||||
|
egSetGraphicsModeEnabled(false);
|
||||||
if ( format ) {
|
if ( format ) {
|
||||||
vprintf(format, va);
|
vprintf(format, va);
|
||||||
#ifdef DEBUG_ON_SERIAL_PORT
|
#ifdef DEBUG_ON_SERIAL_PORT
|
||||||
|
@ -135,8 +135,6 @@ CONST CHAR8* gFirmwareBuildDate = "unknown";
|
|||||||
CONST CHAR8* gBuildInfo = NULL;
|
CONST CHAR8* gBuildInfo = NULL;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
EFI_GUID gUuid;
|
|
||||||
|
|
||||||
EMU_VARIABLE_CONTROL_PROTOCOL *gEmuVariableControl = NULL;
|
EMU_VARIABLE_CONTROL_PROTOCOL *gEmuVariableControl = NULL;
|
||||||
|
|
||||||
extern BOOLEAN NeedPMfix;
|
extern BOOLEAN NeedPMfix;
|
||||||
@ -4297,8 +4295,7 @@ ParseSMBIOSSettings(
|
|||||||
MsgLog("ATTENTION : property not string in SmUUID\n");
|
MsgLog("ATTENTION : property not string in SmUUID\n");
|
||||||
}else{
|
}else{
|
||||||
if (IsValidGuidAsciiString(Prop->getString()->stringValue())) {
|
if (IsValidGuidAsciiString(Prop->getString()->stringValue())) {
|
||||||
StrToGuidLE(Prop->getString()->stringValue(), &gSettings.SmUUID);
|
gSettings.SmUUID = Prop->getString()->stringValue();
|
||||||
gSettings.SmUUIDConfig = TRUE;
|
|
||||||
} else {
|
} else {
|
||||||
DBG("Error: invalid SmUUID '%s' - should be in the format XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n", Prop->getString()->stringValue().c_str());
|
DBG("Error: invalid SmUUID '%s' - should be in the format XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n", Prop->getString()->stringValue().c_str());
|
||||||
}
|
}
|
||||||
@ -5863,29 +5860,23 @@ GetUserSettings(const TagDict* CfgDict)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// RtVariables
|
// RtVariables
|
||||||
|
gSettings.RtROM.setEmpty();
|
||||||
const TagDict* RtVariablesDict = CfgDict->dictPropertyForKey("RtVariables");
|
const TagDict* RtVariablesDict = CfgDict->dictPropertyForKey("RtVariables");
|
||||||
if (RtVariablesDict != NULL) {
|
if (RtVariablesDict != NULL) {
|
||||||
// ROM: <data>bin data</data> or <string>base 64 encoded bin data</string>
|
// ROM: <data>bin data</data> or <string>base 64 encoded bin data</string>
|
||||||
const TagStruct* Prop = RtVariablesDict->propertyForKey("ROM");
|
const TagStruct* Prop = RtVariablesDict->propertyForKey("ROM");
|
||||||
if (Prop != NULL) {
|
if (Prop != NULL) {
|
||||||
if ( Prop->isString() && Prop->getString()->stringValue().equalIC("UseMacAddr0") ) {
|
if ( Prop->isString() && Prop->getString()->stringValue().equalIC("UseMacAddr0") ) {
|
||||||
gSettings.RtROM = &gLanMac[0][0];
|
gSettings.RtROM.ncpy(&gLanMac[0][0], 6);
|
||||||
gSettings.RtROMLen = 6;
|
|
||||||
} else if ( Prop->isString() && Prop->getString()->stringValue().equalIC("UseMacAddr1") ) {
|
} else if ( Prop->isString() && Prop->getString()->stringValue().equalIC("UseMacAddr1") ) {
|
||||||
gSettings.RtROM = &gLanMac[1][0];
|
gSettings.RtROM.ncpy(&gLanMac[1][0], 6);
|
||||||
gSettings.RtROMLen = 6;
|
|
||||||
} else if ( Prop->isString() || Prop->isData() ) { // GetDataSetting accept both
|
} else if ( Prop->isString() || Prop->isData() ) { // GetDataSetting accept both
|
||||||
UINTN ROMLength = 0;
|
UINTN ROMLength = 0;
|
||||||
gSettings.RtROM = GetDataSetting(RtVariablesDict, "ROM", &ROMLength);
|
VOID* ROM = GetDataSetting(RtVariablesDict, "ROM", &ROMLength);
|
||||||
gSettings.RtROMLen = ROMLength;
|
gSettings.RtROM.ncpy(ROM, ROMLength);
|
||||||
} else {
|
} else {
|
||||||
MsgLog("MALFORMED PLIST : property not string or data in RtVariables/ROM\n");
|
MsgLog("MALFORMED PLIST : property not string or data in RtVariables/ROM\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gSettings.RtROM == NULL || gSettings.RtROMLen == 0) {
|
|
||||||
gSettings.RtROM = NULL;
|
|
||||||
gSettings.RtROMLen = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// MLB: <string>some value</string>
|
// MLB: <string>some value</string>
|
||||||
@ -5972,9 +5963,10 @@ GetUserSettings(const TagDict* CfgDict)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gSettings.RtROM == NULL) {
|
if (gSettings.RtROM.isEmpty()) {
|
||||||
gSettings.RtROM = (UINT8*)&gSettings.SmUUID.Data4[2];
|
EFI_GUID uuid;
|
||||||
gSettings.RtROMLen = 6;
|
StrToGuidLE(gSettings.SmUUID, &uuid);
|
||||||
|
gSettings.RtROM.ncpy(&uuid.Data4[2], 6);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gSettings.RtMLB.isEmpty()) {
|
if (gSettings.RtMLB.isEmpty()) {
|
||||||
@ -5984,8 +5976,7 @@ GetUserSettings(const TagDict* CfgDict)
|
|||||||
// if CustomUUID and InjectSystemID are not specified
|
// if CustomUUID and InjectSystemID are not specified
|
||||||
// then use InjectSystemID=TRUE and SMBIOS UUID
|
// then use InjectSystemID=TRUE and SMBIOS UUID
|
||||||
// to get Chameleon's default behaviour (to make user's life easier)
|
// to get Chameleon's default behaviour (to make user's life easier)
|
||||||
CopyMem((VOID*)&gUuid, (VOID*)&gSettings.SmUUID, sizeof(EFI_GUID));
|
// CopyMem((VOID*)&gUuid, (VOID*)&gSettings.SmUUID, sizeof(EFI_GUID));
|
||||||
gSettings.InjectSystemID = TRUE;
|
|
||||||
|
|
||||||
// SystemParameters again - values that can depend on previous params
|
// SystemParameters again - values that can depend on previous params
|
||||||
const TagDict* SystemParametersDict = CfgDict->dictPropertyForKey("SystemParameters");
|
const TagDict* SystemParametersDict = CfgDict->dictPropertyForKey("SystemParameters");
|
||||||
@ -6002,30 +5993,39 @@ GetUserSettings(const TagDict* CfgDict)
|
|||||||
if ( !Prop->isString() ) {
|
if ( !Prop->isString() ) {
|
||||||
MsgLog("ATTENTION : property not string in SystemParameters/CustomUUID\n");
|
MsgLog("ATTENTION : property not string in SystemParameters/CustomUUID\n");
|
||||||
}else{
|
}else{
|
||||||
BOOLEAN IsValidCustomUUID = FALSE;
|
|
||||||
if (IsValidGuidAsciiString(Prop->getString()->stringValue())) {
|
if (IsValidGuidAsciiString(Prop->getString()->stringValue())) {
|
||||||
gSettings.CustomUuid = Prop->getString()->stringValue();
|
gSettings.CustomUuid = Prop->getString()->stringValue();
|
||||||
DBG("Converted CustomUUID %ls\n", gSettings.CustomUuid.wc_str());
|
// if CustomUUID specified, then default for InjectSystemID=FALSE
|
||||||
Status = StrToGuidLE(gSettings.CustomUuid, &gUuid);
|
// to stay compatibile with previous Clover behaviour
|
||||||
if (!EFI_ERROR(Status)) {
|
DBG("The UUID is valid\n");
|
||||||
IsValidCustomUUID = TRUE;
|
}else{
|
||||||
// if CustomUUID specified, then default for InjectSystemID=FALSE
|
|
||||||
// to stay compatibile with previous Clover behaviour
|
|
||||||
gSettings.InjectSystemID = FALSE;
|
|
||||||
DBG("The UUID is valid\n");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!IsValidCustomUUID) {
|
|
||||||
DBG("Error: invalid CustomUUID '%s' - should be in the format XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n", Prop->getString()->stringValue().c_str());
|
DBG("Error: invalid CustomUUID '%s' - should be in the format XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n", Prop->getString()->stringValue().c_str());
|
||||||
|
gSettings.CustomUuid = {0};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//else gUuid value from SMBIOS
|
//else gUuid value from SMBIOS
|
||||||
// DBG("Finally use %s\n", strguid(&gUuid));
|
// DBG("Finally use %s\n", strguid(&gUuid));
|
||||||
|
|
||||||
|
gSettings.InjectSystemID_ = 2;
|
||||||
Prop = SystemParametersDict->propertyForKey("InjectSystemID");
|
Prop = SystemParametersDict->propertyForKey("InjectSystemID");
|
||||||
gSettings.InjectSystemID = gSettings.InjectSystemID ? !IsPropertyNotNullAndFalse(Prop) : IsPropertyNotNullAndTrue(Prop);
|
if ( Prop ) {
|
||||||
|
if ( Prop->isBool() ) gSettings.InjectSystemID_ = Prop->getBool()->boolValue();
|
||||||
|
else if ( Prop->isString() ) {
|
||||||
|
// TODO a function that takes a string and return if it's true or false
|
||||||
|
if ( Prop->getString()->stringValue().equalIC("true") ) gSettings.InjectSystemID_ = 1;
|
||||||
|
else if ( Prop->getString()->stringValue()[0] == 'y' ) gSettings.InjectSystemID_ = 1;
|
||||||
|
else if ( Prop->getString()->stringValue()[0] == 'Y' ) gSettings.InjectSystemID_ = 1;
|
||||||
|
else if ( Prop->getString()->stringValue().equalIC("false") ) gSettings.InjectSystemID_ = 0;
|
||||||
|
else if ( Prop->getString()->stringValue().equalIC("n") ) gSettings.InjectSystemID_ = 0;
|
||||||
|
else if ( Prop->getString()->stringValue().equalIC("N") ) gSettings.InjectSystemID_ = 0;
|
||||||
|
else {
|
||||||
|
DBG("MALFORMED PLIST : SMBIOS/InjectSystemID must be true, yes, false, no, or non existant");
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
DBG("MALFORMED PLIST : SMBIOS/InjectSystemID must be <true/>, <false/> or non existant");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Prop = SystemParametersDict->propertyForKey("NvidiaWeb");
|
Prop = SystemParametersDict->propertyForKey("NvidiaWeb");
|
||||||
gSettings.NvidiaWeb = IsPropertyNotNullAndTrue(Prop);
|
gSettings.NvidiaWeb = IsPropertyNotNullAndTrue(Prop);
|
||||||
@ -8230,7 +8230,7 @@ checkOffset(RomVersion);
|
|||||||
WriteOldFixLengthString(VersionNr, 64);
|
WriteOldFixLengthString(VersionNr, 64);
|
||||||
WriteOldFixLengthString(SerialNr, 64);
|
WriteOldFixLengthString(SerialNr, 64);
|
||||||
xb.ncat(&SmUUID, sizeof(SmUUID));
|
xb.ncat(&SmUUID, sizeof(SmUUID));
|
||||||
xb.cat(SmUUIDConfig);
|
xb.cat((BOOLEAN)SmUUID.notEmpty());
|
||||||
xb.ncat(&pad0, sizeof(pad0));
|
xb.ncat(&pad0, sizeof(pad0));
|
||||||
//CHAR8 Uuid[64]);
|
//CHAR8 Uuid[64]);
|
||||||
//CHAR8 SKUNumber[64]);
|
//CHAR8 SKUNumber[64]);
|
||||||
@ -8290,7 +8290,7 @@ checkOffset(BootArgs);
|
|||||||
WriteOldFixLengthString(BootArgs, 256);
|
WriteOldFixLengthString(BootArgs, 256);
|
||||||
xb.memsetAtPos(xb.size(), 0, 1);
|
xb.memsetAtPos(xb.size(), 0, 1);
|
||||||
checkOffset(CustomUuid);
|
checkOffset(CustomUuid);
|
||||||
WriteOldFixLengthString(CustomUuid, 40);
|
WriteOldFixLengthString(XStringW(CustomUuid), 40);
|
||||||
xb.ncat(&pad20, sizeof(pad20));
|
xb.ncat(&pad20, sizeof(pad20));
|
||||||
checkOffset(DefaultVolume);
|
checkOffset(DefaultVolume);
|
||||||
xb.cat(uintptr_t(0)); //DefaultVolume was CHAR16*
|
xb.cat(uintptr_t(0)); //DefaultVolume was CHAR16*
|
||||||
@ -8362,7 +8362,7 @@ checkOffset(FixMCFG);
|
|||||||
xb.cat(DeviceRename);
|
xb.cat(DeviceRename);
|
||||||
//Injections
|
//Injections
|
||||||
xb.cat(StringInjector);
|
xb.cat(StringInjector);
|
||||||
xb.cat(InjectSystemID);
|
xb.cat(InjectSystemID_);
|
||||||
xb.cat(NoDefaultProperties);
|
xb.cat(NoDefaultProperties);
|
||||||
xb.cat(ReuseFFFF);
|
xb.cat(ReuseFFFF);
|
||||||
|
|
||||||
@ -8480,9 +8480,12 @@ checkOffset(CustomBoot);
|
|||||||
|
|
||||||
// SysVariables
|
// SysVariables
|
||||||
xb.ncat(&pad30, sizeof(pad30));
|
xb.ncat(&pad30, sizeof(pad30));
|
||||||
|
checkOffset(RtMLB);
|
||||||
xb.cat(uintptr_t(0)); // RtMLB was CHAR8*
|
xb.cat(uintptr_t(0)); // RtMLB was CHAR8*
|
||||||
xb.cat(RtROM);
|
xb.cat(uintptr_t(0)); // RtROM was UINT8*
|
||||||
xb.cat(RtROMLen);
|
checkOffset(RtROMLen);
|
||||||
|
xb.cat(RtROM.size());
|
||||||
|
checkOffset(CsrActiveConfig);
|
||||||
xb.cat(CsrActiveConfig);
|
xb.cat(CsrActiveConfig);
|
||||||
xb.cat(BooterConfig);
|
xb.cat(BooterConfig);
|
||||||
WriteOldFixLengthString(BooterCfgStr, 64);
|
WriteOldFixLengthString(BooterCfgStr, 64);
|
||||||
@ -8638,3 +8641,25 @@ checkOffset(OptionsBits);
|
|||||||
// MsgLog("%s\n", s.c_str());
|
// MsgLog("%s\n", s.c_str());
|
||||||
//}
|
//}
|
||||||
//
|
//
|
||||||
|
|
||||||
|
EFI_GUID nullUUID = {0};
|
||||||
|
|
||||||
|
const XString8& SETTINGS_DATA::getUUID()
|
||||||
|
{
|
||||||
|
if ( CustomUuid.notEmpty() ) return CustomUuid;
|
||||||
|
return SmUUID;
|
||||||
|
}
|
||||||
|
|
||||||
|
const XString8& SETTINGS_DATA::getUUID(EFI_GUID *uuid)
|
||||||
|
{
|
||||||
|
if ( CustomUuid.notEmpty() ) {
|
||||||
|
EFI_STATUS Status = StrToGuidLE(CustomUuid, uuid);
|
||||||
|
if ( EFI_ERROR(Status) ) panic("CustomUuid(%s) is not valid", CustomUuid.c_str()); // we panic, because it's a bug. Validity is checked when imported from settings
|
||||||
|
return CustomUuid;
|
||||||
|
}
|
||||||
|
EFI_STATUS Status = StrToGuidLE(SmUUID, uuid);
|
||||||
|
if ( EFI_ERROR(Status) ) panic("CustomUuid(%s) is not valid", CustomUuid.c_str()); // same as before
|
||||||
|
return SmUUID;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -252,8 +252,7 @@ public:
|
|||||||
XString8 ProductName;
|
XString8 ProductName;
|
||||||
XString8 VersionNr;
|
XString8 VersionNr;
|
||||||
XString8 SerialNr;
|
XString8 SerialNr;
|
||||||
EFI_GUID SmUUID;
|
XString8 SmUUID;
|
||||||
BOOLEAN SmUUIDConfig;
|
|
||||||
CHAR8 pad0[7];
|
CHAR8 pad0[7];
|
||||||
//CHAR8 Uuid;
|
//CHAR8 Uuid;
|
||||||
//CHAR8 SKUNumber;
|
//CHAR8 SKUNumber;
|
||||||
@ -311,7 +310,7 @@ public:
|
|||||||
XString8 Language;
|
XString8 Language;
|
||||||
XString8 BootArgs;
|
XString8 BootArgs;
|
||||||
INT8 pad19[2];
|
INT8 pad19[2];
|
||||||
XStringW CustomUuid;
|
XString8 CustomUuid;
|
||||||
|
|
||||||
INT8 pad20[6];
|
INT8 pad20[6];
|
||||||
XStringW DefaultVolume;
|
XStringW DefaultVolume;
|
||||||
@ -382,7 +381,7 @@ public:
|
|||||||
ACPI_NAME_LIST *DeviceRename;
|
ACPI_NAME_LIST *DeviceRename;
|
||||||
//Injections
|
//Injections
|
||||||
BOOLEAN StringInjector;
|
BOOLEAN StringInjector;
|
||||||
BOOLEAN InjectSystemID;
|
UINT8 InjectSystemID_; // 0=false, 1=true, other value = default.
|
||||||
BOOLEAN NoDefaultProperties;
|
BOOLEAN NoDefaultProperties;
|
||||||
|
|
||||||
BOOLEAN ReuseFFFF;
|
BOOLEAN ReuseFFFF;
|
||||||
@ -502,8 +501,7 @@ public:
|
|||||||
// SysVariables
|
// SysVariables
|
||||||
UINT8 pad30[4];
|
UINT8 pad30[4];
|
||||||
XString8 RtMLB;
|
XString8 RtMLB;
|
||||||
UINT8 *RtROM;
|
XBuffer<UINT8> RtROM;
|
||||||
UINTN RtROMLen;
|
|
||||||
|
|
||||||
UINT32 CsrActiveConfig;
|
UINT32 CsrActiveConfig;
|
||||||
UINT16 BooterConfig;
|
UINT16 BooterConfig;
|
||||||
@ -609,8 +607,8 @@ public:
|
|||||||
XObjArray<MMIOWhiteList> mmioWhiteListArray;
|
XObjArray<MMIOWhiteList> mmioWhiteListArray;
|
||||||
|
|
||||||
|
|
||||||
SETTINGS_DATA() : VendorName(), RomVersion(), EfiVersion(), ReleaseDate(), ManufactureName(), ProductName(), VersionNr(), SerialNr(), SmUUID({0,0,0,{0}}),
|
SETTINGS_DATA() : VendorName(), RomVersion(), EfiVersion(), ReleaseDate(), ManufactureName(), ProductName(), VersionNr(), SerialNr(), SmUUID(),
|
||||||
SmUUIDConfig(0), pad0{0}, FamilyName(), OEMProduct(), OEMVendor(), BoardManufactureName(), BoardSerialNumber(), BoardNumber(), LocationInChassis(),
|
pad0{0}, FamilyName(), OEMProduct(), OEMVendor(), BoardManufactureName(), BoardSerialNumber(), BoardNumber(), LocationInChassis(),
|
||||||
BoardVersion(), OEMBoard(), BoardType(0), pad1(0), Mobile(0), ChassisType(0), ChassisManufacturer(), ChassisAssetTag(), CpuFreqMHz(0),
|
BoardVersion(), OEMBoard(), BoardType(0), pad1(0), Mobile(0), ChassisType(0), ChassisManufacturer(), ChassisAssetTag(), CpuFreqMHz(0),
|
||||||
BusSpeed(0), Turbo(0), EnabledCores(0), UserChange(0), QEMU(0), SmbiosVersion(0), Attribute(0), pad17{0}, MemoryManufacturer(),
|
BusSpeed(0), Turbo(0), EnabledCores(0), UserChange(0), QEMU(0), SmbiosVersion(0), Attribute(0), pad17{0}, MemoryManufacturer(),
|
||||||
MemorySerialNumber(), MemoryPartNumber(), MemorySpeed(), CpuType(0), QPI(0), SetTable132(0), TrustSMBIOS(0), InjectMemoryTables(0), XMPDetection(0),
|
MemorySerialNumber(), MemoryPartNumber(), MemorySpeed(), CpuType(0), QPI(0), SetTable132(0), TrustSMBIOS(0), InjectMemoryTables(0), XMPDetection(0),
|
||||||
@ -620,7 +618,7 @@ public:
|
|||||||
DropSSDT(0), NoOemTableId(0), NoDynamicExtract(0), AutoMerge(0), GeneratePStates(0), GenerateCStates(0), GenerateAPSN(0), GenerateAPLF(0), GeneratePluginType(0),
|
DropSSDT(0), NoOemTableId(0), NoDynamicExtract(0), AutoMerge(0), GeneratePStates(0), GenerateCStates(0), GenerateAPSN(0), GenerateAPLF(0), GeneratePluginType(0),
|
||||||
PLimitDict(0), UnderVoltStep(0), DoubleFirstState(0), SuspendOverride(0), EnableC2(0), EnableC4(0), EnableC6(0), EnableISS(0), SlpSmiEnable(0),
|
PLimitDict(0), UnderVoltStep(0), DoubleFirstState(0), SuspendOverride(0), EnableC2(0), EnableC4(0), EnableC6(0), EnableISS(0), SlpSmiEnable(0),
|
||||||
FixHeaders(0), C3Latency(0), smartUPS(0), PatchNMI(0), EnableC7(0), SavingMode(0), DsdtName(), FixDsdt(0), MinMultiplier(0),
|
FixHeaders(0), C3Latency(0), smartUPS(0), PatchNMI(0), EnableC7(0), SavingMode(0), DsdtName(), FixDsdt(0), MinMultiplier(0),
|
||||||
MaxMultiplier(0), PluginType(0), FixMCFG(0), DeviceRenameCount(0), DeviceRename(0), StringInjector(0), InjectSystemID(0), NoDefaultProperties(0), ReuseFFFF(0),
|
MaxMultiplier(0), PluginType(0), FixMCFG(0), DeviceRenameCount(0), DeviceRename(0), StringInjector(0), InjectSystemID_(0), NoDefaultProperties(0), ReuseFFFF(0),
|
||||||
FakeATI(0), FakeNVidia(0), FakeIntel(0), FakeLAN(0), FakeWIFI(0), FakeSATA(0), FakeXHCI(0), FakeIMEI(0), GraphicsInjector(0),
|
FakeATI(0), FakeNVidia(0), FakeIntel(0), FakeLAN(0), FakeWIFI(0), FakeSATA(0), FakeXHCI(0), FakeIMEI(0), GraphicsInjector(0),
|
||||||
InjectIntel(0), InjectATI(0), InjectNVidia(0), DeInit(0), LoadVBios(0), PatchVBios(0), PatchVBiosBytes(0), PatchVBiosBytesCount(0), InjectEDID(0),
|
InjectIntel(0), InjectATI(0), InjectNVidia(0), DeInit(0), LoadVBios(0), PatchVBios(0), PatchVBiosBytes(0), PatchVBiosBytesCount(0), InjectEDID(0),
|
||||||
LpcTune(0), DropOEM_DSM(0), CustomEDID(0), CustomEDIDsize(0), EdidFixHorizontalSyncPulseWidth(0), EdidFixVideoInputSignal(0), FBName(), VideoPorts(0), NvidiaGeneric(0),
|
LpcTune(0), DropOEM_DSM(0), CustomEDID(0), CustomEDIDsize(0), EdidFixHorizontalSyncPulseWidth(0), EdidFixVideoInputSignal(0), FBName(), VideoPorts(0), NvidiaGeneric(0),
|
||||||
@ -629,7 +627,7 @@ public:
|
|||||||
HDALayoutId(0), USBInjection(0), USBFixOwnership(0), InjectClockID(0), HighCurrent(0), NameEH00(0), NameXH00(0), LANInjection(0), HDMIInjection(0),
|
HDALayoutId(0), USBInjection(0), USBFixOwnership(0), InjectClockID(0), HighCurrent(0), NameEH00(0), NameXH00(0), LANInjection(0), HDMIInjection(0),
|
||||||
LegacyBoot(), LegacyBiosDefaultEntry(0), HWP(0), TDP(0), HWPValue(0), HVHideStrings(), KernelAndKextPatches(), KextPatchesAllowed(0),
|
LegacyBoot(), LegacyBiosDefaultEntry(0), HWP(0), TDP(0), HWPValue(0), HVHideStrings(), KernelAndKextPatches(), KextPatchesAllowed(0),
|
||||||
KernelPatchesAllowed(0), AirportBridgeDeviceName(), KbdPrevLang(0), PointerEnabled(0), PointerSpeed(0), DoubleClickTime(0), PointerMirror(0), CustomBoot(0), CustomLogo(0),
|
KernelPatchesAllowed(0), AirportBridgeDeviceName(), KbdPrevLang(0), PointerEnabled(0), PointerSpeed(0), DoubleClickTime(0), PointerMirror(0), CustomBoot(0), CustomLogo(0),
|
||||||
RefCLK(0), RtMLB(), RtROM(0), RtROMLen(0), CsrActiveConfig(0), BooterConfig(0), BooterCfgStr(), DisableCloverHotkeys(0), NeverDoRecovery(0),
|
RefCLK(0), RtMLB(), RtROM(), CsrActiveConfig(0), BooterConfig(0), BooterCfgStr(), DisableCloverHotkeys(0), NeverDoRecovery(0),
|
||||||
ConfigName{0}, /*MainConfigName(0),*/ /*BlackListCount(0),*/ DisabledDriverArray(), RPlt{0}, RBr{0}, EPCI{0}, REV{0}, Rtc8Allowed(0),
|
ConfigName{0}, /*MainConfigName(0),*/ /*BlackListCount(0),*/ DisabledDriverArray(), RPlt{0}, RBr{0}, EPCI{0}, REV{0}, Rtc8Allowed(0),
|
||||||
ForceHPET(0), ResetHDA(0), PlayAsync(0), DisableFunctions(0), DSDTPatchArray(), DebugDSDT(0), SlpWak(0), UseIntelHDMI(0),
|
ForceHPET(0), ResetHDA(0), PlayAsync(0), DisableFunctions(0), DSDTPatchArray(), DebugDSDT(0), SlpWak(0), UseIntelHDMI(0),
|
||||||
AFGLowPowerState(0), PNLF_UID(0), ACPIDropTables(0), DisableEntryScan(0), DisableToolScan(0), KernelScan(0), LinuxScan(0), CustomEntries(0),
|
AFGLowPowerState(0), PNLF_UID(0), ACPIDropTables(0), DisableEntryScan(0), DisableToolScan(0), KernelScan(0), LinuxScan(0), CustomEntries(0),
|
||||||
@ -644,6 +642,16 @@ public:
|
|||||||
|
|
||||||
~SETTINGS_DATA() {}
|
~SETTINGS_DATA() {}
|
||||||
|
|
||||||
|
const XString8& getUUID();
|
||||||
|
const XString8& getUUID(EFI_GUID* efiGuid);
|
||||||
|
bool ShouldInjectSystemID() {
|
||||||
|
if ( CustomUuid.notEmpty() ){
|
||||||
|
if ( InjectSystemID_ == 2 ) return false;
|
||||||
|
else return InjectSystemID_;
|
||||||
|
}
|
||||||
|
if ( SmUUID.notEmpty() && InjectSystemID_ == 2 ) return false;
|
||||||
|
return InjectSystemID_;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
//#pragma GCC diagnostic ignored "-Wpadded"
|
//#pragma GCC diagnostic ignored "-Wpadded"
|
||||||
@ -803,8 +811,6 @@ extern CONST CHAR8* gBuildInfo;
|
|||||||
extern BOOLEAN ResumeFromCoreStorage;
|
extern BOOLEAN ResumeFromCoreStorage;
|
||||||
extern BOOLEAN gRemapSmBiosIsRequire; // syscl: pass argument for Dell SMBIOS here
|
extern BOOLEAN gRemapSmBiosIsRequire; // syscl: pass argument for Dell SMBIOS here
|
||||||
|
|
||||||
extern EFI_GUID gUuid;
|
|
||||||
|
|
||||||
extern EMU_VARIABLE_CONTROL_PROTOCOL *gEmuVariableControl;
|
extern EMU_VARIABLE_CONTROL_PROTOCOL *gEmuVariableControl;
|
||||||
|
|
||||||
|
|
||||||
|
@ -143,9 +143,9 @@ F0 00 00 00 | ....
|
|||||||
|
|
||||||
|
|
||||||
//Slice - I need GuidBEToStr :(
|
//Slice - I need GuidBEToStr :(
|
||||||
XStringW GuidBeToStr(EFI_GUID *Guid)
|
XStringW GuidBeToStr(const EFI_GUID& Guid)
|
||||||
{
|
{
|
||||||
UINT8 *GuidData = (UINT8 *)Guid;
|
UINT8 *GuidData = (UINT8 *)&Guid;
|
||||||
XStringW Str = SWPrintf("%02X%02X%02X%02X-%02X%02X-%02X%02X-%02X%02X-%02X%02X%02X%02X%02X%02X",
|
XStringW Str = SWPrintf("%02X%02X%02X%02X-%02X%02X-%02X%02X-%02X%02X-%02X%02X%02X%02X%02X%02X",
|
||||||
GuidData[3], GuidData[2], GuidData[1], GuidData[0],
|
GuidData[3], GuidData[2], GuidData[1], GuidData[0],
|
||||||
GuidData[5], GuidData[4],
|
GuidData[5], GuidData[4],
|
||||||
@ -156,21 +156,21 @@ XStringW GuidBeToStr(EFI_GUID *Guid)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
XStringW GuidLEToXStringW(EFI_GUID *Guid)
|
XStringW GuidLEToXStringW(const EFI_GUID& Guid)
|
||||||
{
|
{
|
||||||
XStringW returnValue;
|
XStringW returnValue;
|
||||||
returnValue.SWPrintf("%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X",
|
returnValue.SWPrintf("%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X",
|
||||||
Guid->Data1, Guid->Data2, Guid->Data3, Guid->Data4[0], Guid->Data4[1],
|
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]);
|
Guid.Data4[2], Guid.Data4[3], Guid.Data4[4], Guid.Data4[5], Guid.Data4[6], Guid.Data4[7]);
|
||||||
return returnValue;
|
return returnValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
XString8 GuidLEToXString8(EFI_GUID *Guid)
|
XString8 GuidLEToXString8(const EFI_GUID& Guid)
|
||||||
{
|
{
|
||||||
XString8 returnValue;
|
XString8 returnValue;
|
||||||
returnValue.S8Printf("%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X",
|
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.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]);
|
Guid.Data4[2], Guid.Data4[3], Guid.Data4[4], Guid.Data4[5], Guid.Data4[6], Guid.Data4[7]);
|
||||||
return returnValue;
|
return returnValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,22 +18,22 @@ extern "C" EFI_GUID gEfiMiscSubClassGuid;
|
|||||||
template <typename T, enable_if( is___String(T) )>
|
template <typename T, enable_if( is___String(T) )>
|
||||||
BOOLEAN IsValidGuidAsciiString(const T& Str)
|
BOOLEAN IsValidGuidAsciiString(const T& Str)
|
||||||
{
|
{
|
||||||
UINTN Index;
|
UINTN Index4IsValidGuidAsciiString; // stupid name to avoid warning : Declaration shadows a variable in the global namespace
|
||||||
|
|
||||||
if ( Str.length() != 36 ) {
|
if ( Str.length() != 36 ) {
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (Index = 0; Index < 36; Index++) {
|
for (Index4IsValidGuidAsciiString = 0; Index4IsValidGuidAsciiString < 36; Index4IsValidGuidAsciiString++) {
|
||||||
if (Index == 8 || Index == 13 || Index == 18 || Index == 23) {
|
if (Index4IsValidGuidAsciiString == 8 || Index4IsValidGuidAsciiString == 13 || Index4IsValidGuidAsciiString == 18 || Index4IsValidGuidAsciiString == 23) {
|
||||||
if (Str[Index] != '-') {
|
if (Str[Index4IsValidGuidAsciiString] != '-') {
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!(
|
if (!(
|
||||||
(Str[Index] >= '0' && Str[Index] <= '9')
|
(Str[Index4IsValidGuidAsciiString] >= '0' && Str[Index4IsValidGuidAsciiString] <= '9')
|
||||||
|| (Str[Index] >= 'a' && Str[Index] <= 'f')
|
|| (Str[Index4IsValidGuidAsciiString] >= 'a' && Str[Index4IsValidGuidAsciiString] <= 'f')
|
||||||
|| (Str[Index] >= 'A' && Str[Index] <= 'F')
|
|| (Str[Index4IsValidGuidAsciiString] >= 'A' && Str[Index4IsValidGuidAsciiString] <= 'F')
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@ -54,7 +54,7 @@ StrHToBuf (
|
|||||||
const T& t
|
const T& t
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
UINTN Index;
|
UINTN Index4IsValidGuidAsciiString; // stupid name to avoid warning : Declaration shadows a variable in the global namespace
|
||||||
UINTN StrLength;
|
UINTN StrLength;
|
||||||
UINT8 Digit;
|
UINT8 Digit;
|
||||||
UINT8 Byte;
|
UINT8 Byte;
|
||||||
@ -67,14 +67,14 @@ StrHToBuf (
|
|||||||
//
|
//
|
||||||
StrLength = BufferLength * sizeof (CHAR16);
|
StrLength = BufferLength * sizeof (CHAR16);
|
||||||
|
|
||||||
for(Index = 0; Index < StrLength; Index++) {
|
for(Index4IsValidGuidAsciiString = 0; Index4IsValidGuidAsciiString < StrLength; Index4IsValidGuidAsciiString++) {
|
||||||
|
|
||||||
if ((Str[Index] >= (__typeof__(*Str))'a') && (Str[Index] <= (__typeof__(*Str))'f')) {
|
if ((Str[Index4IsValidGuidAsciiString] >= (__typeof__(*Str))'a') && (Str[Index4IsValidGuidAsciiString] <= (__typeof__(*Str))'f')) {
|
||||||
Digit = (UINT8) (Str[Index] - (__typeof__(*Str))'a' + 0x0A);
|
Digit = (UINT8) (Str[Index4IsValidGuidAsciiString] - (__typeof__(*Str))'a' + 0x0A);
|
||||||
} else if ((Str[Index] >= (__typeof__(*Str))'A') && (Str[Index] <= (__typeof__(*Str))'F')) {
|
} else if ((Str[Index4IsValidGuidAsciiString] >= (__typeof__(*Str))'A') && (Str[Index4IsValidGuidAsciiString] <= (__typeof__(*Str))'F')) {
|
||||||
Digit = (UINT8) (Str[Index] - L'A' + 0x0A);
|
Digit = (UINT8) (Str[Index4IsValidGuidAsciiString] - L'A' + 0x0A);
|
||||||
} else if ((Str[Index] >= (__typeof__(*Str))'0') && (Str[Index] <= (__typeof__(*Str))'9')) {
|
} else if ((Str[Index4IsValidGuidAsciiString] >= (__typeof__(*Str))'0') && (Str[Index4IsValidGuidAsciiString] <= (__typeof__(*Str))'9')) {
|
||||||
Digit = (UINT8) (Str[Index] - (__typeof__(*Str))'0');
|
Digit = (UINT8) (Str[Index4IsValidGuidAsciiString] - (__typeof__(*Str))'0');
|
||||||
} else {
|
} else {
|
||||||
return EFI_INVALID_PARAMETER;
|
return EFI_INVALID_PARAMETER;
|
||||||
}
|
}
|
||||||
@ -83,15 +83,15 @@ StrHToBuf (
|
|||||||
// For odd characters, write the upper nibble for each buffer byte,
|
// For odd characters, write the upper nibble for each buffer byte,
|
||||||
// and for even characters, the lower nibble.
|
// and for even characters, the lower nibble.
|
||||||
//
|
//
|
||||||
if ((Index & 1) == 0) {
|
if ((Index4IsValidGuidAsciiString & 1) == 0) {
|
||||||
Byte = (UINT8) (Digit << 4);
|
Byte = (UINT8) (Digit << 4);
|
||||||
} else {
|
} else {
|
||||||
Byte = Buf[Index / 2];
|
Byte = Buf[Index4IsValidGuidAsciiString / 2];
|
||||||
Byte &= 0xF0;
|
Byte &= 0xF0;
|
||||||
Byte = (UINT8) (Byte | Digit);
|
Byte = (UINT8) (Byte | Digit);
|
||||||
}
|
}
|
||||||
|
|
||||||
Buf[Index / 2] = Byte;
|
Buf[Index4IsValidGuidAsciiString / 2] = Byte;
|
||||||
}
|
}
|
||||||
|
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
@ -173,9 +173,9 @@ StrToGuidLE (
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
XStringW GuidBeToStr(EFI_GUID *Guid);
|
XStringW GuidBeToStr(const EFI_GUID& Guid);
|
||||||
XString8 GuidLEToXString8(EFI_GUID *Guid);
|
XString8 GuidLEToXString8(const EFI_GUID& Guid);
|
||||||
XStringW GuidLEToXStringW(EFI_GUID *Guid);
|
XStringW GuidLEToXStringW(const EFI_GUID& Guid);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -1398,10 +1398,9 @@ VOID GetDefaultSettings()
|
|||||||
gSettings.BacklightLevelConfig = FALSE;
|
gSettings.BacklightLevelConfig = FALSE;
|
||||||
gSettings.TrustSMBIOS = TRUE;
|
gSettings.TrustSMBIOS = TRUE;
|
||||||
|
|
||||||
gSettings.SmUUIDConfig = FALSE;
|
gSettings.SmUUID.setEmpty();
|
||||||
gSettings.DefaultBackgroundColor = 0x80000000; //the value to delete the variable
|
gSettings.DefaultBackgroundColor = 0x80000000; //the value to delete the variable
|
||||||
gSettings.RtROM = NULL;
|
gSettings.RtROM.setEmpty();
|
||||||
gSettings.RtROMLen = 0;
|
|
||||||
gSettings.CsrActiveConfig = 0xFFFF;
|
gSettings.CsrActiveConfig = 0xFFFF;
|
||||||
gSettings.BooterConfig = 0;
|
gSettings.BooterConfig = 0;
|
||||||
// MemSet(gSettings.BooterCfgStr, 64, 0);
|
// MemSet(gSettings.BooterCfgStr, 64, 0);
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
#include "cpu.h"
|
#include "cpu.h"
|
||||||
#include "platformdata.h"
|
#include "platformdata.h"
|
||||||
#include "AcpiPatcher.h"
|
#include "AcpiPatcher.h"
|
||||||
|
#include "guid.h"
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
@ -494,7 +495,7 @@ VOID GetTableType1()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
CopyMem((VOID*)&gSettings.SmUUID, (VOID*)&SmbiosTable.Type1->Uuid, 16);
|
gSettings.SmUUID = GuidLEToXString8(SmbiosTable.Type1->Uuid);
|
||||||
s = GetSmbiosString(SmbiosTable, SmbiosTable.Type1->ProductName);
|
s = GetSmbiosString(SmbiosTable, SmbiosTable.Type1->ProductName);
|
||||||
gSettings.OEMProduct.strncpy(s, iStrLen(s, 64)); //strncpy take care of ending zero
|
gSettings.OEMProduct.strncpy(s, iStrLen(s, 64)); //strncpy take care of ending zero
|
||||||
|
|
||||||
@ -525,8 +526,10 @@ VOID PatchTableType1()
|
|||||||
newSmbiosTable.Type1->WakeUpType = SystemWakeupTypePowerSwitch;
|
newSmbiosTable.Type1->WakeUpType = SystemWakeupTypePowerSwitch;
|
||||||
Once = TRUE;
|
Once = TRUE;
|
||||||
|
|
||||||
if((gSettings.SmUUID.Data3 & 0xF000) != 0) {
|
EFI_GUID SmUUID;
|
||||||
CopyMem((VOID*)&newSmbiosTable.Type1->Uuid, (VOID*)&gSettings.SmUUID, 16);
|
StrToGuidLE(gSettings.SmUUID, &SmUUID);
|
||||||
|
if((SmUUID.Data3 & 0xF000) != 0) {
|
||||||
|
CopyMem((VOID*)&newSmbiosTable.Type1->Uuid, (VOID*)&SmUUID, sizeof(SmUUID));
|
||||||
}
|
}
|
||||||
|
|
||||||
gSettings.ManufactureName.trim();
|
gSettings.ManufactureName.trim();
|
||||||
|
@ -71,7 +71,7 @@ const XIcon& ScanVolumeDefaultIcon(REFIT_VOLUME *Volume, IN UINT8 OSType, IN EFI
|
|||||||
DevicePath = NextDevicePathNode(DevicePath);
|
DevicePath = NextDevicePathNode(DevicePath);
|
||||||
}
|
}
|
||||||
if (DevicePathType(DevicePath) == MEDIA_DEVICE_PATH && DevicePathSubType (DevicePath) == MEDIA_VENDOR_DP) {
|
if (DevicePathType(DevicePath) == MEDIA_DEVICE_PATH && DevicePathSubType (DevicePath) == MEDIA_VENDOR_DP) {
|
||||||
if ( GuidLEToXString8((EFI_GUID *)((UINT8 *)DevicePath+0x04)).equalIC(ApfsSignatureUUID) ) {
|
if ( GuidLEToXString8(*(EFI_GUID *)((UINT8 *)DevicePath+0x04)).equalIC(ApfsSignatureUUID) ) {
|
||||||
IconNum = BUILTIN_ICON_VOL_INTERNAL_APFS;
|
IconNum = BUILTIN_ICON_VOL_INTERNAL_APFS;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user