mirror of
https://github.com/CloverHackyColor/CloverBootloader.git
synced 2024-11-27 12:15:19 +01:00
ROM setting can now be string or data, like it was before.
This commit is contained in:
parent
74a5477c26
commit
a721bb0a29
@ -2808,7 +2808,7 @@ GetEarlyUserSettings (
|
||||
const TagStruct* Prop = RtVariablesDict->propertyForKey("ROM");
|
||||
if (Prop != NULL) {
|
||||
if ( !Prop->isString() ) {
|
||||
MsgLog("ATTENTION : property not string in ROM\n");
|
||||
// that's ok. Property can be data, but not when the value is 'UseMacAddr0' or 'UseMacAddr1';
|
||||
}else{
|
||||
if ((Prop->getString()->stringValue().equalIC("UseMacAddr0")) ||
|
||||
(Prop->getString()->stringValue().equalIC("UseMacAddr1"))) {
|
||||
@ -4821,7 +4821,6 @@ EFI_STATUS
|
||||
GetUserSettings(const TagDict* CfgDict)
|
||||
{
|
||||
EFI_STATUS Status = EFI_NOT_FOUND;
|
||||
BOOLEAN IsValidCustomUUID = FALSE;
|
||||
|
||||
if (CfgDict != NULL) {
|
||||
DbgHeader ("GetUserSettings");
|
||||
@ -5761,25 +5760,23 @@ GetUserSettings(const TagDict* CfgDict)
|
||||
// ROM: <data>bin data</data> or <string>base 64 encoded bin data</string>
|
||||
const TagStruct* Prop = RtVariablesDict->propertyForKey("ROM");
|
||||
if (Prop != NULL) {
|
||||
if ( !Prop->isString() ) {
|
||||
MsgLog("ATTENTION : property not string in RtVariables/ROM\n");
|
||||
}else{
|
||||
if (Prop->getString()->stringValue().equalIC("UseMacAddr0")) {
|
||||
gSettings.RtROM = &gLanMac[0][0];
|
||||
gSettings.RtROMLen = 6;
|
||||
} else if (Prop->getString()->stringValue().equalIC("UseMacAddr1")) {
|
||||
gSettings.RtROM = &gLanMac[1][0];
|
||||
gSettings.RtROMLen = 6;
|
||||
} else {
|
||||
UINTN ROMLength = 0;
|
||||
gSettings.RtROM = GetDataSetting (RtVariablesDict, "ROM", &ROMLength);
|
||||
gSettings.RtROMLen = ROMLength;
|
||||
}
|
||||
if ( Prop->isString() && Prop->getString()->stringValue().equalIC("UseMacAddr0") ) {
|
||||
gSettings.RtROM = &gLanMac[0][0];
|
||||
gSettings.RtROMLen = 6;
|
||||
} else if ( Prop->isString() && Prop->getString()->stringValue().equalIC("UseMacAddr1") ) {
|
||||
gSettings.RtROM = &gLanMac[1][0];
|
||||
gSettings.RtROMLen = 6;
|
||||
} else if ( Prop->isString() || Prop->isData() ) { // GetDataSetting accept both
|
||||
UINTN ROMLength = 0;
|
||||
gSettings.RtROM = GetDataSetting(RtVariablesDict, "ROM", &ROMLength);
|
||||
gSettings.RtROMLen = ROMLength;
|
||||
} else {
|
||||
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;
|
||||
}
|
||||
if (gSettings.RtROM == NULL || gSettings.RtROMLen == 0) {
|
||||
gSettings.RtROM = NULL;
|
||||
gSettings.RtROMLen = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@ -5896,6 +5893,7 @@ GetUserSettings(const TagDict* CfgDict)
|
||||
if ( !Prop->isString() ) {
|
||||
MsgLog("ATTENTION : property not string in SystemParameters/CustomUUID\n");
|
||||
}else{
|
||||
BOOLEAN IsValidCustomUUID = FALSE;
|
||||
if (IsValidGuidAsciiString(Prop->getString()->stringValue())) {
|
||||
gSettings.CustomUuid = Prop->getString()->stringValue();
|
||||
DBG("Converted CustomUUID %ls\n", gSettings.CustomUuid.wc_str());
|
||||
@ -5905,7 +5903,7 @@ GetUserSettings(const TagDict* CfgDict)
|
||||
// if CustomUUID specified, then default for InjectSystemID=FALSE
|
||||
// to stay compatibile with previous Clover behaviour
|
||||
gSettings.InjectSystemID = FALSE;
|
||||
// DBG("The UUID is valid\n");
|
||||
DBG("The UUID is valid\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -570,27 +570,27 @@ public:
|
||||
UINTN MaxSlide;
|
||||
|
||||
|
||||
SETTINGS_DATA() : VendorName{0}, RomVersion{0}, EfiVersion{0}, ReleaseDate{0}, ManufactureName{0}, ProductName{0}, VersionNr{0}, SerialNr{0}, SmUUID({0,0,0,{0}}),
|
||||
SmUUIDConfig(0), pad0{0}, FamilyName{0}, OEMProduct{0}, OEMVendor{0}, BoardManufactureName{0}, BoardSerialNumber{0}, BoardNumber{0}, LocationInChassis{0},
|
||||
BoardVersion{0}, OEMBoard{0}, BoardType(0), pad1(0), Mobile(0), ChassisType(0), ChassisManufacturer{0}, ChassisAssetTag{0}, CpuFreqMHz(0),
|
||||
BusSpeed(0), Turbo(0), EnabledCores(0), UserChange(0), QEMU(0), SmbiosVersion(0), Attribute(0), pad17{0}, MemoryManufacturer{0},
|
||||
MemorySerialNumber{0}, MemoryPartNumber{0}, MemorySpeed{0}, CpuType(0), QPI(0), SetTable132(0), TrustSMBIOS(0), InjectMemoryTables(0), XMPDetection(0),
|
||||
UseARTFreq(0), PlatformFeature(0), NoRomInfo(0), Language{0}, BootArgs{0}, CustomUuid{0}, DefaultVolume(0), DefaultLoader(0), LastBootedVolume(0),
|
||||
SETTINGS_DATA() : VendorName(), RomVersion(), EfiVersion(), ReleaseDate(), ManufactureName(), ProductName(), VersionNr(), SerialNr(), SmUUID({0,0,0,{0}}),
|
||||
SmUUIDConfig(0), pad0{0}, FamilyName(), OEMProduct(), OEMVendor(), BoardManufactureName(), BoardSerialNumber(), BoardNumber(), LocationInChassis(),
|
||||
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(),
|
||||
MemorySerialNumber(), MemoryPartNumber(), MemorySpeed(), CpuType(0), QPI(0), SetTable132(0), TrustSMBIOS(0), InjectMemoryTables(0), XMPDetection(0),
|
||||
UseARTFreq(0), PlatformFeature(0), NoRomInfo(0), Language(), BootArgs(), CustomUuid(), DefaultVolume(), DefaultLoader(), LastBootedVolume(0),
|
||||
SkipHibernateTimeout(0), IntelMaxBacklight(0), VendorEDID(0), ProductEDID(0), BacklightLevel(0), BacklightLevelConfig(0), IntelBacklight(0), MemoryFix(0), WithKexts(0),
|
||||
WithKextsIfNoFakeSMC(0), FakeSMCFound(0), NoCaches(0), Debug(0), pad22{0}, DefaultBackgroundColor(0), ResetAddr(0), ResetVal(0), NoASPM(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),
|
||||
FixHeaders(0), C3Latency(0), smartUPS(0), PatchNMI(0), EnableC7(0), SavingMode(0), DsdtName{0}, 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),
|
||||
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),
|
||||
LpcTune(0), DropOEM_DSM(0), CustomEDID(0), CustomEDIDsize(0), EdidFixHorizontalSyncPulseWidth(0), EdidFixVideoInputSignal(0), FBName{0}, VideoPorts(0), NvidiaGeneric(0),
|
||||
LpcTune(0), DropOEM_DSM(0), CustomEDID(0), CustomEDIDsize(0), EdidFixHorizontalSyncPulseWidth(0), EdidFixVideoInputSignal(0), FBName(), VideoPorts(0), NvidiaGeneric(0),
|
||||
NvidiaNoEFI(0), NvidiaSingle(0), VRAM(0), Dcfg{0}, NVCAP{0}, BootDisplay(0), NvidiaWeb(0), pad41{0}, DualLink(0),
|
||||
IgPlatform(0), SecureBootWhiteListCount(0), SecureBootBlackListCount(0), SecureBootWhiteList(0), SecureBootBlackList(0), SecureBoot(0), SecureBootSetupMode(0), SecureBootPolicy(0), HDAInjection(0),
|
||||
HDALayoutId(0), USBInjection(0), USBFixOwnership(0), InjectClockID(0), HighCurrent(0), NameEH00(0), NameXH00(0), LANInjection(0), HDMIInjection(0),
|
||||
LegacyBoot{0}, LegacyBiosDefaultEntry(0), HWP(0), TDP(0), HWPValue(0), HVHideStrings(), KernelAndKextPatches(), KextPatchesAllowed(0),
|
||||
KernelPatchesAllowed(0), AirportBridgeDeviceName{0}, KbdPrevLang(0), PointerEnabled(0), PointerSpeed(0), DoubleClickTime(0), PointerMirror(0), CustomBoot(0), CustomLogo(0),
|
||||
RefCLK(0), RtMLB(0), RtROM(0), RtROMLen(0), CsrActiveConfig(0), BooterConfig(0), BooterCfgStr{0}, DisableCloverHotkeys(0), NeverDoRecovery(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),
|
||||
RefCLK(0), RtMLB(), RtROM(0), RtROMLen(0), CsrActiveConfig(0), BooterConfig(0), BooterCfgStr(), DisableCloverHotkeys(0), NeverDoRecovery(0),
|
||||
ConfigName{0}, /*MainConfigName(0),*/ BlackListCount(0), BlackList(0), RPlt{0}, RBr{0}, EPCI{0}, REV{0}, Rtc8Allowed(0),
|
||||
ForceHPET(0), ResetHDA(0), PlayAsync(0), DisableFunctions(0), PatchDsdtNum(0), PatchDsdtFind(0), LenToFind(0), PatchDsdtReplace(0), LenToReplace(0), DebugDSDT(0), SlpWak(0), UseIntelHDMI(0),
|
||||
AFGLowPowerState(0), PNLF_UID(0), ACPIDropTables(0), DisableEntryScan(0), DisableToolScan(0), KernelScan(0), LinuxScan(0), CustomEntries(0),
|
||||
|
@ -1379,18 +1379,18 @@ VOID PatchTableType17()
|
||||
DBG("SmbiosTable.Type17->SerialNumber = %s\n", gRAM.User[UserIndex].SerialNo);
|
||||
DBG("SmbiosTable.Type17->PartNumber = %s\n", gRAM.User[UserIndex].PartNo);
|
||||
|
||||
if (iStrLen(gRAM.User[UserIndex].Vendor, 64) > 0) {
|
||||
if (gRAM.User[UserIndex].Vendor && iStrLen(gRAM.User[UserIndex].Vendor, 64) > 0) {
|
||||
UpdateSmbiosString(newSmbiosTable, &newSmbiosTable.Type17->Manufacturer, LString8(gRAM.User[UserIndex].Vendor));
|
||||
} else {
|
||||
|
||||
UpdateSmbiosString(newSmbiosTable, &newSmbiosTable.Type17->Manufacturer, unknown);
|
||||
}
|
||||
if (iStrLen(gRAM.User[UserIndex].SerialNo, 64) > 0) {
|
||||
if (gRAM.User[UserIndex].SerialNo && iStrLen(gRAM.User[UserIndex].SerialNo, 64) > 0) {
|
||||
UpdateSmbiosString(newSmbiosTable, &newSmbiosTable.Type17->SerialNumber, LString8(gRAM.User[UserIndex].SerialNo));
|
||||
} else {
|
||||
UpdateSmbiosString(newSmbiosTable, &newSmbiosTable.Type17->SerialNumber, unknown);
|
||||
}
|
||||
if (iStrLen(gRAM.User[UserIndex].PartNo, 64) > 0) {
|
||||
if (gRAM.User[UserIndex].PartNo && iStrLen(gRAM.User[UserIndex].PartNo, 64) > 0) {
|
||||
UpdateSmbiosString(newSmbiosTable, &newSmbiosTable.Type17->PartNumber, LString8(gRAM.User[UserIndex].PartNo));
|
||||
} else {
|
||||
UpdateSmbiosString(newSmbiosTable, &newSmbiosTable.Type17->PartNumber, unknown);
|
||||
|
Loading…
Reference in New Issue
Block a user