提交 f3502e73 编写于 作者: V vit9696

OpenCorePlatform: Implement OEM SN, MLB, UUID reading

closes acidanthera/bugtracker#1469
上级 06155057
......@@ -2,6 +2,7 @@ OpenCore Changelog
==================
#### v0.6.7
- Fixed ocvalidate return code to be non-zero when issues are found
- Added `OEM` values to `PlatformInfo` in `Automatic` mode
#### v0.6.6
- Added keyboard and pointer entry scroll support in OpenCanopy
......
......@@ -4789,16 +4789,31 @@ be used. Version with macOS specific enhancements can be downloaded from
\textbf{Type}: \texttt{plist\ string}\\
\textbf{Failsafe}: Empty (OEM specified or not installed)\\
\textbf{Description}: Refer to SMBIOS \texttt{SystemSerialNumber}.
Specify \texttt{OEM} value to extract current value from SMBIOS
and use it throughout the sections. This feature can only be
used on Mac-compatible firmwares.
\item
\texttt{SystemUUID}\\
\textbf{Type}: \texttt{plist\ string}, GUID\\
\textbf{Failsafe}: Empty (OEM specified or not installed)\\
\textbf{Description}: Refer to SMBIOS \texttt{SystemUUID}.
Specify \texttt{OEM} value to extract current value from SMBIOS
and use it throughout the sections. Since not all firmwares
have valid (and unique) values, this feature is not applicable
to some setups, and may provide unexpected results. It is highly
recommended to specify the UUID explicitly. Refer to
\texttt{UseRawUuidEncoding} to determine how SMBIOS value is parsed.
\item
\texttt{MLB}\\
\textbf{Type}: \texttt{plist\ string}\\
\textbf{Failsafe}: Empty (OEM specified or not installed)\\
\textbf{Description}: Refer to SMBIOS \texttt{BoardSerialNumber}.
Specify \texttt{OEM} value to extract current value from SMBIOS
and use it throughout the sections. This feature can only be
used on Mac-compatible firmwares.
\item
\texttt{ROM}\\
\textbf{Type}: \texttt{plist\ data}, 6 bytes\\
......
\documentclass[]{article}
%DIF LATEXDIFF DIFFERENCE FILE
%DIF DEL PreviousConfiguration.tex Wed Feb 3 11:12:00 2021
%DIF ADD ../Configuration.tex Fri Feb 12 10:24:39 2021
%DIF DEL PreviousConfiguration.tex Sat Feb 6 18:51:55 2021
%DIF ADD ../Configuration.tex Sat Feb 13 15:51:31 2021
\usepackage{lmodern}
\usepackage{amssymb,amsmath}
......@@ -3196,7 +3196,7 @@ entry choice will update till next manual reconfiguration.
external and internal icons to be indistinguishable. }\DIFdelend \DIFaddbegin \emph{\DIFadd{Note 1}}\DIFadd{: Apple's boot picker partially supports placing a volume icon file
at the operating system's }\texttt{\DIFadd{Data}} \DIFadd{volume root (}\texttt{\DIFadd{/System/Volumes/Data/}} \DIFadd{when
mounted at default location within macOS). This approach is broken: that file is not
accessible either by OpenCanopy or by Apple's own boot picker when FaultVault 2 is
accessible either by OpenCanopy or by Apple's own boot picker when FileVault 2 is
enabled, which should be most people's default choice. Therefore OpenCanopy does not
try to support it. You may place a volume icon file at }\texttt{\DIFadd{Preboot}} \DIFadd{root for
compatibility with both the Apple and OpenCanopy boot pickers, or use the }\texttt{\DIFadd{Preboot}}
......@@ -4878,17 +4878,35 @@ be used. Version with macOS specific enhancements can be downloaded from
\textbf{Type}: \texttt{plist\ string}\\
\textbf{Failsafe}: \DIFaddbegin \DIFadd{Empty (}\DIFaddend OEM specified or not installed\DIFaddbegin \DIFadd{)}\DIFaddend \\
\textbf{Description}: Refer to SMBIOS \texttt{SystemSerialNumber}.
\item
\DIFaddbegin
\DIFadd{Specify }\texttt{\DIFadd{OEM}} \DIFadd{value to extract current value from SMBIOS
and use it throughout the sections. This feature can only be
used on Mac-compatible firmwares.
}\DIFaddend \item
\texttt{SystemUUID}\\
\textbf{Type}: \texttt{plist\ string}, GUID\\
\textbf{Failsafe}: \DIFaddbegin \DIFadd{Empty (}\DIFaddend OEM specified or not installed\DIFaddbegin \DIFadd{)}\DIFaddend \\
\textbf{Description}: Refer to SMBIOS \texttt{SystemUUID}.
\item
\DIFaddbegin
\DIFadd{Specify }\texttt{\DIFadd{OEM}} \DIFadd{value to extract current value from SMBIOS
and use it throughout the sections. Since not all firmwares
have valid (and unique) values, this feature is not applicable
to some setups, and may provide unexpected results. It is highly
recommended to specify the UUID explicitly. Refer to
}\texttt{\DIFadd{UseRawUuidEncoding}} \DIFadd{to determine how SMBIOS value is parsed.
}\DIFaddend \item
\texttt{MLB}\\
\textbf{Type}: \texttt{plist\ string}\\
\textbf{Failsafe}: \DIFaddbegin \DIFadd{Empty (}\DIFaddend OEM specified or not installed\DIFaddbegin \DIFadd{)}\DIFaddend \\
\textbf{Description}: Refer to SMBIOS \texttt{BoardSerialNumber}.
\item
\DIFaddbegin
\DIFadd{Specify }\texttt{\DIFadd{OEM}} \DIFadd{value to extract current value from SMBIOS
and use it throughout the sections. This feature can only be
used on Mac-compatible firmwares.
}\DIFaddend \item
\texttt{ROM}\\
\textbf{Type}: \texttt{plist\ data}, 6 bytes\\
\textbf{Failsafe}: \DIFaddbegin \DIFadd{Empty (}\DIFaddend OEM specified or not installed\DIFaddbegin \DIFadd{)}\DIFaddend \\
......@@ -6919,9 +6937,9 @@ While newer operating systems can be downloaded over the internet,
older operating systems did not have installation media for every minor
release\DIFdelbegin \DIFdel{, so to get a compatible distribution one may have to }\DIFdelend \DIFaddbegin \DIFadd{. For compatible distributions of such, }\DIFaddend download a device-specific
image and \DIFdelbegin \DIFdel{mod }\DIFdelend \DIFaddbegin \DIFadd{modify }\DIFaddend it if necessary. \DIFdelbegin \DIFdel{To get the }\DIFdelend \DIFaddbegin \DIFadd{Visit this archived Apple Support
}\href{https://web.archive.org/web/20170705003629/https://support.apple.com/en-us/HT204319}{article}
}\href{https://web.archive.org/web/20170705003629/https://support.apple.com/en-us/HT204319}{\DIFadd{article}}
\DIFadd{for a }\DIFaddend list of the bundled device-specific builds for legacy operating systems\DIFdelbegin \DIFdel{one can visit this archived Apple Support
}%DIFDELCMD < \href{https://web.archive.org/web/20170705003629/https://support.apple.com/en-us/HT204319}{article}%%%
}\href{https://web.archive.org/web/20170705003629/https://support.apple.com/en-us/HT204319}{\DIFdel{article}}%DIFAUXCMD
\DIFdel{.
Since it is not always }\DIFdelend \DIFaddbegin \DIFadd{.
However, as this may not always be }\DIFaddend accurate, the latest versions are listed below.
......
......@@ -15,6 +15,16 @@
#ifndef OC_MAC_INFO_LIB_H
#define OC_MAC_INFO_LIB_H
//
// Maximum characters for valid Mac-like product name.
//
#define OC_OEM_NAME_MAX 48
//
// Maximum characters for valid Mac-like serial name.
//
#define OC_OEM_SERIAL_MAX 16
typedef struct MAC_INFO_DATA_SMBIOS_ {
//
// Type 0
......@@ -71,6 +81,12 @@ typedef struct MAC_INFO_DATA_DATAHUB_ {
CONST UINT8 *SmcPlatform;
} MAC_INFO_DATA_DATAHUB;
typedef struct MAC_INFO_DATA_OEM_ {
CHAR8 SystemSerialNumber[OC_OEM_SERIAL_MAX];
CHAR8 BoardSerialNumber[OC_OEM_SERIAL_MAX];
EFI_GUID SystemUuid;
} MAC_INFO_DATA_OEM;
typedef struct MAC_INFO_DATA_ {
//
// DataHub data.
......@@ -80,6 +96,10 @@ typedef struct MAC_INFO_DATA_ {
// SMBIOS data.
//
MAC_INFO_DATA_SMBIOS Smbios;
//
// Serial data.
//
MAC_INFO_DATA_OEM Oem;
} MAC_INFO_DATA;
/**
......
......@@ -21,6 +21,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include <Library/OcCpuLib.h>
#include <Library/OcFileLib.h>
#include <Library/OcMacInfoLib.h>
#include <IndustryStandard/AppleSmBios.h>
#include <Guid/OcSmBios.h>
......@@ -31,11 +32,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
//
#define OC_SMBIOS_VENDOR_NAME "Acidanthera"
//
// Maximum characters for valid Mac-like OEM name.
//
#define OC_SMBIOS_OEM_NAME_MAX 48
typedef struct OC_SMBIOS_MEMORY_DEVICE_DATA_ {
//
// Strings.
......@@ -241,13 +237,26 @@ OcSmbiosCreate (
@param[in,out] SmbiosTable SMBIOS Table handle.
@param[out] ProductName Export SMBIOS Type 1 product name,
requiring OC_SMBIOS_OEM_NAME_MAX bytes.
requiring OC_OEM_NAME_MAX bytes.
@param[out] SerialNumber Export SMBIOS Type 1 product serial,
requiring OC_OEM_SERIAL_MAX bytes.
@param[out] SystemUuid Export SMBIOS Type 1 system UUID.
UUID is always returned in RAW format.
@param[out] BoardSerialNumber Export SMBIOS Type 2 board serial,
requiring OC_OEM_SERIAL_MAX bytes.
@param[out] UuidIsRawEncoded Pass FALSE to assume SMBIOS stores
SystemUuid in Little Endian format
and needs byte-swap.
@param[in] UseVariableStorage Export OEM information to NVRAM.
**/
VOID
OcSmbiosExtractOemInfo (
IN OC_SMBIOS_TABLE *SmbiosTable,
OUT CHAR8 *ProductName OPTIONAL,
OUT CHAR8 *ProductName OPTIONAL,
OUT CHAR8 *SerialNumber OPTIONAL,
OUT EFI_GUID *SystemUuid OPTIONAL,
OUT CHAR8 *BoardSerialNumber OPTIONAL,
IN BOOLEAN UuidIsRawEncoded,
IN BOOLEAN UseVariableStorage
);
......
......@@ -33,7 +33,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include <Guid/AppleVariable.h>
STATIC CHAR8 mCurrentSmbiosProductName[OC_SMBIOS_OEM_NAME_MAX];
STATIC CHAR8 mCurrentSmbiosProductName[OC_OEM_NAME_MAX];
STATIC
VOID
......@@ -135,11 +135,12 @@ OcPlatformUpdateDataHub (
Data.PlatformName = MacInfo->DataHub.PlatformName;
Data.SystemProductName = MacInfo->DataHub.SystemProductName;
if (OC_BLOB_GET (&Config->PlatformInfo.Generic.SystemSerialNumber)[0] != '\0') {
Data.SystemSerialNumber = OC_BLOB_GET (&Config->PlatformInfo.Generic.SystemSerialNumber);
if (MacInfo->Oem.SystemSerialNumber[0] != '\0') {
Data.SystemSerialNumber = MacInfo->Oem.SystemSerialNumber;
}
if (!EFI_ERROR (OcAsciiStrToRawGuid (OC_BLOB_GET (&Config->PlatformInfo.Generic.SystemUuid), &Uuid))) {
if (!IsZeroGuid (&MacInfo->Oem.SystemUuid)) {
CopyGuid (&Uuid, &MacInfo->Oem.SystemUuid);
Data.SystemUUID = &Uuid;
}
......@@ -318,23 +319,20 @@ OcPlatformUpdateSmbios (
Data.SystemProductName = MacInfo->Smbios.SystemProductName;
Data.SystemVersion = MacInfo->Smbios.SystemVersion;
if (OC_BLOB_GET (&Config->PlatformInfo.Generic.SystemSerialNumber)[0] != '\0') {
Data.SystemSerialNumber = OC_BLOB_GET (&Config->PlatformInfo.Generic.SystemSerialNumber);
if (MacInfo->Oem.SystemSerialNumber[0] != '\0') {
Data.SystemSerialNumber = MacInfo->Oem.SystemSerialNumber;
}
if (Config->PlatformInfo.UseRawUuidEncoding) {
Status = OcAsciiStrToRawGuid (
OC_BLOB_GET (&Config->PlatformInfo.Generic.SystemUuid),
&Uuid
);
} else {
Status = AsciiStrToGuid (
OC_BLOB_GET (&Config->PlatformInfo.Generic.SystemUuid),
&Uuid
);
}
if (!EFI_ERROR (Status)) {
if (!IsZeroGuid (&MacInfo->Oem.SystemUuid)) {
CopyGuid (&Uuid, &MacInfo->Oem.SystemUuid);
if (!Config->PlatformInfo.UseRawUuidEncoding) {
//
// Change from RAW to LE.
//
Uuid.Data1 = SwapBytes32 (Uuid.Data1);
Uuid.Data2 = SwapBytes16 (Uuid.Data2);
Uuid.Data3 = SwapBytes16 (Uuid.Data3);
}
Data.SystemUUID = &Uuid;
}
......@@ -345,16 +343,16 @@ OcPlatformUpdateSmbios (
Data.BoardProduct = MacInfo->Smbios.BoardProduct;
Data.BoardVersion = MacInfo->Smbios.BoardVersion;
if (OC_BLOB_GET (&Config->PlatformInfo.Generic.Mlb)[0] != '\0') {
Data.BoardSerialNumber = OC_BLOB_GET (&Config->PlatformInfo.Generic.Mlb);
if (MacInfo->Oem.BoardSerialNumber[0] != '\0') {
Data.BoardSerialNumber = MacInfo->Oem.BoardSerialNumber;
}
Data.BoardAssetTag = MacInfo->Smbios.BoardAssetTag;
Data.BoardLocationInChassis = MacInfo->Smbios.BoardLocationInChassis;
Data.ChassisVersion = MacInfo->Smbios.ChassisVersion;
if (OC_BLOB_GET (&Config->PlatformInfo.Generic.SystemSerialNumber)[0] != '\0') {
Data.ChassisSerialNumber = OC_BLOB_GET (&Config->PlatformInfo.Generic.SystemSerialNumber);
if (MacInfo->Oem.SystemSerialNumber[0] != '\0') {
Data.ChassisSerialNumber = MacInfo->Oem.SystemSerialNumber;
}
Data.ChassisAssetTag = MacInfo->Smbios.ChassisAssetTag;
......@@ -406,7 +404,7 @@ OcPlatformUpdateSmbios (
if (MacInfo->DataHub.SmcRevision != NULL) {
OcSmbiosGetSmcVersion (MacInfo->DataHub.SmcRevision, SmcVersion);
Data.SmcVersion = SmcVersion;
Data.SmcVersion = SmcVersion;
}
}
......@@ -484,7 +482,6 @@ OcPlatformUpdateNvram (
UINTN MlbSize;
CONST UINT8 *Rom;
UINTN RomSize;
CONST CHAR8 *AsciiUuid;
EFI_GUID Uuid;
UINT64 ExFeatures;
UINT64 ExFeaturesMask;
......@@ -494,11 +491,11 @@ OcPlatformUpdateNvram (
if (MacInfo == NULL) {
Bid = OC_BLOB_GET (&Config->PlatformInfo.Nvram.Bid);
BidSize = Config->PlatformInfo.Nvram.Bid.Size - 1;
Mlb = OC_BLOB_GET (&Config->PlatformInfo.Nvram.Mlb);
Mlb = MacInfo->Oem.BoardSerialNumber;
MlbSize = Config->PlatformInfo.Nvram.Mlb.Size - 1;
Rom = &Config->PlatformInfo.Nvram.Rom[0];
RomSize = sizeof (Config->PlatformInfo.Nvram.Rom);
AsciiUuid = OC_BLOB_GET (&Config->PlatformInfo.Nvram.SystemUuid);
CopyGuid (&Uuid, &MacInfo->Oem.SystemUuid);
ExFeatures = Config->PlatformInfo.Nvram.FirmwareFeatures;
ExFeaturesMask = Config->PlatformInfo.Nvram.FirmwareFeaturesMask;
} else {
......@@ -508,7 +505,10 @@ OcPlatformUpdateNvram (
MlbSize = Config->PlatformInfo.Generic.Mlb.Size - 1;
Rom = &Config->PlatformInfo.Generic.Rom[0];
RomSize = sizeof (Config->PlatformInfo.Generic.Rom);
AsciiUuid = OC_BLOB_GET (&Config->PlatformInfo.Generic.SystemUuid);
Status = OcAsciiStrToRawGuid (OC_BLOB_GET (&Config->PlatformInfo.Generic.SystemUuid), &Uuid);
if (EFI_ERROR (Status)) {
ZeroMem (&Uuid, sizeof (Uuid));
}
ExFeatures = MacInfo->Smbios.FirmwareFeatures;
ExFeaturesMask = MacInfo->Smbios.FirmwareFeaturesMask;
......@@ -609,8 +609,7 @@ OcPlatformUpdateNvram (
// system-id is only visible in BS scope and may be used by EfiBoot
// in macOS 11.0 to generate x86legacy ApECID from the first 8 bytes.
//
Status = OcAsciiStrToRawGuid (AsciiUuid, &Uuid);
if (!EFI_ERROR (Status)) {
if (!IsZeroGuid (&Uuid)) {
Status = gRT->SetVariable (
L"system-id",
&gAppleVendorVariableGuid,
......@@ -697,12 +696,21 @@ OcLoadPlatformSupport (
EFI_STATUS Status;
OC_SMBIOS_TABLE SmbiosTable;
BOOLEAN ExposeOem;
BOOLEAN UseOemSerial;
BOOLEAN UseOemUuid;
BOOLEAN UseOemBoardSerial;
if (Config->PlatformInfo.Automatic) {
GetMacInfo (OC_BLOB_GET (&Config->PlatformInfo.Generic.SystemProductName), &InfoData);
UsedMacInfo = &InfoData;
UseOemSerial = AsciiStrCmp (OC_BLOB_GET (&Config->PlatformInfo.Generic.SystemSerialNumber), "OEM") == 0;
UseOemUuid = AsciiStrCmp (OC_BLOB_GET (&Config->PlatformInfo.Generic.SystemUuid), "OEM") == 0;
UseOemBoardSerial = AsciiStrCmp (OC_BLOB_GET (&Config->PlatformInfo.Generic.Mlb), "OEM") == 0;
} else {
UsedMacInfo = NULL;
UsedMacInfo = NULL;
UseOemSerial = FALSE;
UseOemUuid = FALSE;
UseOemBoardSerial = FALSE;
}
ExposeOem = (Config->Misc.Security.ExposeSensitiveData & OCS_EXPOSE_OEM_INFO) != 0;
......@@ -713,10 +721,39 @@ OcLoadPlatformSupport (
OcSmbiosExtractOemInfo (
&SmbiosTable,
mCurrentSmbiosProductName,
UseOemSerial ? InfoData.Oem.SystemSerialNumber : NULL,
UseOemUuid ? &InfoData.Oem.SystemUuid : NULL,
UseOemBoardSerial ? InfoData.Oem.BoardSerialNumber : NULL,
Config->PlatformInfo.UseRawUuidEncoding,
ExposeOem
);
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 (!UseOemBoardSerial) {
AsciiStrCpyS (
InfoData.Oem.BoardSerialNumber,
OC_OEM_SERIAL_MAX,
OC_BLOB_GET (&Config->PlatformInfo.Generic.Mlb)
);
}
}
SmbiosUpdateMode = OcSmbiosGetUpdateMode (
OC_BLOB_GET (&Config->PlatformInfo.UpdateSmbiosMode)
);
......
......@@ -2005,7 +2005,11 @@ OcSmbiosCreate (
VOID
OcSmbiosExtractOemInfo (
IN OC_SMBIOS_TABLE *SmbiosTable,
OUT CHAR8 *ProductName OPTIONAL,
OUT CHAR8 *ProductName OPTIONAL,
OUT CHAR8 *SerialNumber OPTIONAL,
OUT EFI_GUID *SystemUuid OPTIONAL,
OUT CHAR8 *BoardSerialNumber OPTIONAL,
IN BOOLEAN UuidIsRawEncoded,
IN BOOLEAN UseVariableStorage
)
{
......@@ -2013,6 +2017,11 @@ OcSmbiosExtractOemInfo (
CONST CHAR8 *SmProductName;
CONST CHAR8 *SmManufacturer;
CONST CHAR8 *SmBoard;
CONST CHAR8 *SmTmp;
UINTN Index;
UINT32 MinCount;
UINT32 MaxCount;
UINT8 *UuidWalker;
APPLE_SMBIOS_STRUCTURE_POINTER Original;
SmProductName = NULL;
......@@ -2020,8 +2029,57 @@ OcSmbiosExtractOemInfo (
SmBoard = NULL;
Original = SmbiosGetOriginalStructure (SMBIOS_TYPE_SYSTEM_INFORMATION, 1);
if (Original.Raw != NULL && SMBIOS_ACCESSIBLE (Original, Standard.Type1->ProductName)) {
SmProductName = SmbiosGetString (Original, Original.Standard.Type1->ProductName);
if (Original.Raw != NULL) {
if (SMBIOS_ACCESSIBLE (Original, Standard.Type1->ProductName)) {
SmProductName = SmbiosGetString (Original, Original.Standard.Type1->ProductName);
if (SmProductName != NULL && ProductName != NULL) {
Status = AsciiStrCpyS (ProductName, OC_OEM_NAME_MAX, SmProductName);
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_INFO, "OCSMB: Failed to copy SMBIOS product name %a\n", SmProductName));
}
}
}
if (SerialNumber != NULL && SMBIOS_ACCESSIBLE (Original, Standard.Type1->SerialNumber)) {
SmTmp = SmbiosGetString (Original, Original.Standard.Type1->SerialNumber);
if (SmTmp != NULL) {
Status = AsciiStrCpyS (SerialNumber, OC_OEM_SERIAL_MAX, SmTmp);
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_INFO, "OCSMB: Failed to copy SMBIOS product serial %a\n", SmTmp));
}
}
}
if (SystemUuid != NULL && SMBIOS_ACCESSIBLE (Original, Standard.Type1->Uuid)) {
MinCount = 0;
MaxCount = 0;
UuidWalker = (UINT8 *) &Original.Standard.Type1->Uuid;
for (Index = 0; Index < sizeof (Original.Standard.Type1->Uuid); ++Index) {
if (UuidWalker[Index] == 0x00) {
++MinCount;
} else if (UuidWalker[Index] == 0xFF) {
++MaxCount;
}
}
if (MinCount < 4 && MaxCount < 4) {
CopyGuid (SystemUuid, &Original.Standard.Type1->Uuid);
//
// Convert LE to RAW (assuming SMBIOS stores in LE format).
//
if (!UuidIsRawEncoded) {
SystemUuid->Data1 = SwapBytes32 (SystemUuid->Data1);
SystemUuid->Data2 = SwapBytes16 (SystemUuid->Data2);
SystemUuid->Data3 = SwapBytes16 (SystemUuid->Data3);
}
} else {
DEBUG ((
DEBUG_WARN,
"OCSMB: Ignoring UUID %g due to low entropy\n",
&Original.Standard.Type1->Uuid
));
}
}
}
Original = SmbiosGetOriginalStructure (SMBIOS_TYPE_BASEBOARD_INFORMATION, 1);
......@@ -2032,6 +2090,15 @@ OcSmbiosExtractOemInfo (
if (SMBIOS_ACCESSIBLE (Original, Standard.Type2->ProductName)) {
SmBoard = SmbiosGetString (Original, Original.Standard.Type2->ProductName);
}
if (BoardSerialNumber != NULL && SMBIOS_ACCESSIBLE (Original, Standard.Type2->SerialNumber)) {
SmTmp = SmbiosGetString (Original, Original.Standard.Type2->SerialNumber);
if (SmTmp != NULL) {
Status = AsciiStrCpyS (BoardSerialNumber, OC_OEM_SERIAL_MAX, SmTmp);
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_INFO, "OCSMB: Failed to copy SMBIOS board serial %a\n", SmTmp));
}
}
}
}
DEBUG ((
......@@ -2043,9 +2110,9 @@ OcSmbiosExtractOemInfo (
));
if (ProductName != NULL && SmProductName != NULL) {
Status = AsciiStrCpyS (ProductName, OC_SMBIOS_OEM_NAME_MAX, SmProductName);
Status = AsciiStrCpyS (ProductName, OC_OEM_NAME_MAX, SmProductName);
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_INFO, "OC: Failed to copy SMBIOS product name %a\n", SmProductName));
DEBUG ((DEBUG_INFO, "OCSMB: Failed to copy SMBIOS product name %a\n", SmProductName));
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册