未验证 提交 c61a0c8e 编写于 作者: V Vitaly Cheptsov 提交者: GitHub

OpenCorePlatform: Fix partial platform data update

上级 4bd7a81d
......@@ -718,66 +718,81 @@ OcLoadPlatformSupport (
ExposeOem = (Config->Misc.Security.ExposeSensitiveData & OCS_EXPOSE_OEM_INFO) != 0;
if (ExposeOem || Config->PlatformInfo.UpdateSmbios) {
Status = OcSmbiosTablePrepare (&SmbiosTable);
if (!EFI_ERROR (Status)) {
OcSmbiosExtractOemInfo (
&SmbiosTable,
mCurrentSmbiosProductName,
UseOemSerial ? InfoData.Oem.SystemSerialNumber : NULL,
UseOemUuid ? &InfoData.Oem.SystemUuid : NULL,
UseOemMlb ? InfoData.Oem.Mlb : NULL,
UseOemRom ? InfoData.Oem.Rom : NULL,
Config->PlatformInfo.UseRawUuidEncoding,
ExposeOem
Status = OcSmbiosTablePrepare (&SmbiosTable);
if (!EFI_ERROR (Status)) {
OcSmbiosExtractOemInfo (
&SmbiosTable,
mCurrentSmbiosProductName,
UseOemSerial ? InfoData.Oem.SystemSerialNumber : NULL,
UseOemUuid ? &InfoData.Oem.SystemUuid : NULL,
UseOemMlb ? InfoData.Oem.Mlb : NULL,
UseOemRom ? InfoData.Oem.Rom : NULL,
Config->PlatformInfo.UseRawUuidEncoding,
ExposeOem
);
} else {
UseOemSerial = FALSE;
UseOemUuid = FALSE;
UseOemMlb = FALSE;
UseOemRom = FALSE;
}
DEBUG ((
DEBUG_INFO,
"OC: PlatformInfo auto %d OEM SN %d OEM UUID %d OEM MLB %d OEM ROM %d\n",
Config->PlatformInfo.Automatic,
UseOemSerial,
UseOemUuid,
UseOemMlb,
UseOemRom
));
if (Config->PlatformInfo.Automatic) {
if (!UseOemSerial) {
AsciiStrCpyS (
InfoData.Oem.SystemSerialNumber,
OC_OEM_SERIAL_MAX,
OC_BLOB_GET (&Config->PlatformInfo.Generic.SystemSerialNumber)
);
}
if (Config->PlatformInfo.UpdateSmbios) {
if (Config->PlatformInfo.Automatic) {
if (!UseOemSerial) {
AsciiStrCpyS (
InfoData.Oem.SystemSerialNumber,
OC_OEM_SERIAL_MAX,
OC_BLOB_GET (&Config->PlatformInfo.Generic.SystemSerialNumber)
);
}
if (!UseOemUuid) {
OcAsciiStrToRawGuid (
OC_BLOB_GET (&Config->PlatformInfo.Generic.SystemUuid),
&InfoData.Oem.SystemUuid
);
}
if (!UseOemMlb) {
AsciiStrCpyS (
InfoData.Oem.Mlb,
OC_OEM_SERIAL_MAX,
OC_BLOB_GET (&Config->PlatformInfo.Generic.Mlb)
);
}
if (!UseOemRom) {
CopyMem (InfoData.Oem.Rom, Config->PlatformInfo.Generic.Rom, OC_OEM_ROM_MAX);
}
}
SmbiosUpdateMode = OcSmbiosGetUpdateMode (
OC_BLOB_GET (&Config->PlatformInfo.UpdateSmbiosMode)
);
OcPlatformUpdateSmbios (
Config,
CpuInfo,
UsedMacInfo,
&SmbiosTable,
SmbiosUpdateMode
);
}
if (!UseOemUuid) {
OcAsciiStrToRawGuid (
OC_BLOB_GET (&Config->PlatformInfo.Generic.SystemUuid),
&InfoData.Oem.SystemUuid
);
}
OcSmbiosTableFree (&SmbiosTable);
} else {
DEBUG ((DEBUG_WARN, "OC: Unable to obtain SMBIOS - %r\n", Status));
if (!UseOemMlb) {
AsciiStrCpyS (
InfoData.Oem.Mlb,
OC_OEM_SERIAL_MAX,
OC_BLOB_GET (&Config->PlatformInfo.Generic.Mlb)
);
}
if (!UseOemRom) {
CopyMem (InfoData.Oem.Rom, Config->PlatformInfo.Generic.Rom, OC_OEM_ROM_MAX);
}
}
if (!EFI_ERROR (Status)) {
if (Config->PlatformInfo.UpdateSMBIOS) {
SmbiosUpdateMode = OcSmbiosGetUpdateMode (
OC_BLOB_GET (&Config->PlatformInfo.UpdateSmbiosMode)
);
OcPlatformUpdateSmbios (
Config,
CpuInfo,
UsedMacInfo,
&SmbiosTable,
SmbiosUpdateMode
);
}
OcSmbiosTableFree (&SmbiosTable);
} else {
DEBUG ((DEBUG_WARN, "OC: Unable to obtain SMBIOS - %r\n", Status));
}
if (Config->PlatformInfo.UpdateDataHub) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册