提交 bf94146f 编写于 作者: V vit9696

OpenCorePlatform: Added setting of `system-id` NVRAM variable

上级 aea1c578
......@@ -25,6 +25,7 @@ OpenCore Changelog
- Added workaround for read-only errors on some X299 boards
- Added support for `x86legacy` Secure Boot model
- Added missing Secure Boot NVRAM variables required by 11.0
- Added setting of `system-id` NVRAM variable
#### v0.6.2
- Updated builtin firmware versions for SMBIOS and the rest
......
......@@ -4506,7 +4506,7 @@ be used. Version with macOS specific enhancements can be downloaded from
\textbf{Failsafe}: Not installed\\
\textbf{Description}: Sets \texttt{system-id} in
\texttt{gEfiMiscSubClassGuid}. Value found on Macs is equal to SMBIOS
\texttt{SystemUUID}.
\texttt{SystemUUID} (with swapped byte order).
\item
\texttt{BoardProduct}\\
\textbf{Type}: \texttt{plist\ string}\\
......@@ -4913,6 +4913,15 @@ be used. Version with macOS specific enhancements can be downloaded from
\item \texttt{4D1EDE05-38C7-4A6A-9CC6-4BCCA8B38C14:ExtendedFirmwareFeaturesMask}
\end{itemize}
\item
\texttt{SystemUUID}\\
\textbf{Type}: \texttt{plist\ string}\\
\textbf{Failsafe}: Not installed\\
\textbf{Description}: Specifies the value of NVRAM variable
\texttt{4D1EDE05-38C7-4A6A-9CC6-4BCCA8B38C14:system-id}
for boot services only. Value found on Macs is equal to SMBIOS
\texttt{SystemUUID}.
\end{enumerate}
\subsection{SMBIOS Properties}\label{platforminfosmbios}
......
\documentclass[]{article}
%DIF LATEXDIFF DIFFERENCE FILE
%DIF DEL PreviousConfiguration.tex Wed Oct 7 12:20:52 2020
%DIF ADD ../Configuration.tex Sun Nov 1 05:03:35 2020
%DIF ADD ../Configuration.tex Sun Nov 1 12:43:59 2020
\usepackage{lmodern}
\usepackage{amssymb,amsmath}
......@@ -4591,7 +4591,7 @@ be used. Version with macOS specific enhancements can be downloaded from
\textbf{Failsafe}: Not installed\\
\textbf{Description}: Sets \texttt{system-id} in
\texttt{gEfiMiscSubClassGuid}. Value found on Macs is equal to SMBIOS
\texttt{SystemUUID}.
\texttt{SystemUUID} \DIFaddbegin \DIFadd{(with swapped byte order)}\DIFaddend .
\item
\texttt{BoardProduct}\\
\textbf{Type}: \texttt{plist\ string}\\
......@@ -5016,7 +5016,17 @@ be used. Version with macOS specific enhancements can be downloaded from
\item \texttt{4D1EDE05-38C7-4A6A-9CC6-4BCCA8B38C14:ExtendedFirmwareFeaturesMask}
\end{itemize}
\end{enumerate}
\DIFaddbegin \item
\texttt{\DIFadd{SystemUUID}}\\
\textbf{\DIFadd{Type}}\DIFadd{: }\texttt{\DIFadd{plist\ string}}\\
\textbf{\DIFadd{Failsafe}}\DIFadd{: Not installed}\\
\textbf{\DIFadd{Description}}\DIFadd{: Specifies the value of NVRAM variable
}\texttt{\DIFadd{4D1EDE05-38C7-4A6A-9CC6-4BCCA8B38C14:system-id}}
\DIFadd{for boot services only. Value found on Macs is equal to SMBIOS
}\texttt{\DIFadd{SystemUUID}}\DIFadd{.
}
\DIFaddend \end{enumerate}
\subsection{SMBIOS Properties}\label{platforminfosmbios}
......
......@@ -1086,6 +1086,8 @@
<string>M0000000000000001</string>
<key>ROM</key>
<data>ESIzRFVm</data>
<key>SystemUUID</key>
<string>00000000-0000-0000-0000-000000000000</string>
</dict>
<key>SMBIOS</key>
<dict>
......
......@@ -471,6 +471,7 @@ typedef enum {
#define OC_PLATFORM_NVRAM_CONFIG_FIELDS(_, __) \
_(OC_STRING , Bid , , OC_STRING_CONSTR ("", _, __) , OC_DESTR (OC_STRING) ) \
_(OC_STRING , Mlb , , OC_STRING_CONSTR ("", _, __) , OC_DESTR (OC_STRING) ) \
_(OC_STRING , SystemUuid , , OC_STRING_CONSTR ("", _, __) , OC_DESTR (OC_STRING) ) \
_(UINT8 , Rom , [6] , {0} , () ) \
_(UINT64 , FirmwareFeatures , , 0 , () ) \
_(UINT64 , FirmwareFeaturesMask , , 0 , () )
......
......@@ -549,7 +549,8 @@ mPlatformConfigurationNvramSchema[] = {
OC_SCHEMA_DATAF_IN ("FirmwareFeatures", OC_GLOBAL_CONFIG, PlatformInfo.Nvram.FirmwareFeatures),
OC_SCHEMA_DATAF_IN ("FirmwareFeaturesMask", OC_GLOBAL_CONFIG, PlatformInfo.Nvram.FirmwareFeaturesMask),
OC_SCHEMA_STRING_IN ("MLB", OC_GLOBAL_CONFIG, PlatformInfo.Nvram.Mlb),
OC_SCHEMA_DATAF_IN ("ROM", OC_GLOBAL_CONFIG, PlatformInfo.Nvram.Rom)
OC_SCHEMA_DATAF_IN ("ROM", OC_GLOBAL_CONFIG, PlatformInfo.Nvram.Rom),
OC_SCHEMA_STRING_IN ("SystemUUID", OC_GLOBAL_CONFIG, PlatformInfo.Nvram.SystemUuid),
};
STATIC
......
......@@ -452,6 +452,8 @@ OcPlatformUpdateNvram (
UINTN MlbSize;
CONST UINT8 *Rom;
UINTN RomSize;
CONST CHAR8 *AsciiUuid;
EFI_GUID Uuid;
UINT64 ExFeatures;
UINT64 ExFeaturesMask;
UINT32 Features;
......@@ -464,6 +466,7 @@ OcPlatformUpdateNvram (
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);
ExFeatures = Config->PlatformInfo.Nvram.FirmwareFeatures;
ExFeaturesMask = Config->PlatformInfo.Nvram.FirmwareFeaturesMask;
} else {
......@@ -473,6 +476,7 @@ 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);
ExFeatures = MacInfo->Smbios.FirmwareFeatures;
ExFeaturesMask = MacInfo->Smbios.FirmwareFeaturesMask;
......@@ -569,6 +573,32 @@ 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.
//
if (AsciiUuid[0] != '\0') {
Status = AsciiStrToGuid (AsciiUuid, &Uuid);
} else {
Status = EFI_INVALID_PARAMETER;
}
if (!EFI_ERROR (Status)) {
Status = gRT->SetVariable (
L"system-id",
&gAppleVendorVariableGuid,
EFI_VARIABLE_BOOTSERVICE_ACCESS,
sizeof (Uuid),
&Uuid
);
DEBUG ((
EFI_ERROR (Status) ? DEBUG_WARN : DEBUG_INFO,
"OC: Setting system-id %g - %r\n",
&Uuid,
Status
));
}
if (ExFeatures != 0 || ExFeaturesMask != 0) {
Status = gRT->SetVariable (
L"FirmwareFeatures",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册