提交 82e8f5ef 编写于 作者: V vit9696

OcSmbiosLib: Fixed `Custom` `UpdateSMBIOSMode` modifying SMBIOSv3 table

上级 29bd5732
......@@ -3,6 +3,9 @@ OpenCore Changelog
#### v0.5.8
- Fixed invalid CPU object reference in SSDT-PLUG
- Fixed incorrect utilities and resources packaging
- Fixed `Custom` `UpdateSMBIOSMode` modifying SMBIOSv3 table
- Updated docs to cover separating SMBIOS via `UpdateSMBIOSMode`
#### v0.5.7
- Added TimeMachine detection to picker
......
......@@ -3312,14 +3312,19 @@ be used. Version with macOS specific enhancements can be downloaded from
gEfiSmbiosTable3Guid data if it fits new size. Abort with
unspecified state otherwise.
\item
\texttt{Custom} --- Write first SMBIOS table
(\texttt{gEfiSmbiosTableGuid}) to \texttt{gOcCustomSmbiosTableGuid}
\texttt{Custom} --- Write SMBIOS tables
(\texttt{gEfiSmbios(3)TableGuid}) to \texttt{gOcCustomSmbios(3)TableGuid}
to workaround firmwares overwriting SMBIOS contents at
ExitBootServices. Otherwise equivalent to \texttt{Create}. Requires
patching AppleSmbios.kext and AppleACPIPlatform.kext to read from
another GUID: \texttt{"EB9D2D31"} - \texttt{"EB9D2D35"} (in ASCII),
done automatically by \texttt{CustomSMBIOSGuid} quirk.
\end{itemize}
\emph{Note}: A side effect of using \texttt{Custom} approach is making
SMBIOS updates exclusive to macOS, avoiding a collission with existing
Windows activation and custom OEM software but potentially breaking
Apple-specific tools.
\item
\texttt{Generic}\\
\textbf{Type}: \texttt{plist\ dictonary}\\
......@@ -4904,7 +4909,8 @@ functioning. Feature highlights:
\item Windows may need to be reactivated. To avoid it consider
setting SystemUUID to the original firmware UUID. Be warned,
on old firmwares it may be invalid, i.e. not random. In case you still have issues,
consider using HWID or KMS38 license. The nuances of Windows activation are out of the
consider using HWID or KMS38 license or making the use \texttt{Custom}
\texttt{UpdateSMBIOSMode}. Other nuances of Windows activation are out of the
scope of this document and can be found online.
\end{itemize}
......
\documentclass[]{article}
%DIF LATEXDIFF DIFFERENCE FILE
%DIF DEL PreviousConfiguration.tex Mon Apr 6 16:12:47 2020
%DIF ADD ../Configuration.tex Mon Apr 6 16:16:32 2020
%DIF DEL PreviousConfiguration.tex Tue Apr 7 19:32:13 2020
%DIF ADD ../Configuration.tex Thu Apr 9 20:48:13 2020
\usepackage{lmodern}
\usepackage{amssymb,amsmath}
......@@ -3372,15 +3372,22 @@ be used. Version with macOS specific enhancements can be downloaded from
gEfiSmbiosTable3Guid data if it fits new size. Abort with
unspecified state otherwise.
\item
\texttt{Custom} --- Write first SMBIOS table
(\texttt{gEfiSmbiosTableGuid}) to \texttt{gOcCustomSmbiosTableGuid}
\texttt{Custom} --- Write \DIFdelbegin \DIFdel{first SMBIOS table
(}\DIFdelend \DIFaddbegin \DIFadd{SMBIOS tables
(}\DIFaddend \texttt{\DIFdelbegin \DIFdel{gEfiSmbiosTableGuid}\DIFdelend \DIFaddbegin \DIFadd{gEfiSmbios(3)TableGuid}\DIFaddend }) to \texttt{\DIFdelbegin \DIFdel{gOcCustomSmbiosTableGuid}\DIFdelend \DIFaddbegin \DIFadd{gOcCustomSmbios(3)TableGuid}\DIFaddend }
to workaround firmwares overwriting SMBIOS contents at
ExitBootServices. Otherwise equivalent to \texttt{Create}. Requires
patching AppleSmbios.kext and AppleACPIPlatform.kext to read from
another GUID: \texttt{"EB9D2D31"} - \texttt{"EB9D2D35"} (in ASCII),
done automatically by \texttt{CustomSMBIOSGuid} quirk.
\end{itemize}
\item
\DIFaddbegin
\emph{\DIFadd{Note}}\DIFadd{: A side effect of using }\texttt{\DIFadd{Custom}} \DIFadd{approach is making
SMBIOS updates exclusive to macOS, avoiding a collission with existing
Windows activation and custom OEM software but potentially breaking
Apple-specific tools.
}\DIFaddend \item
\texttt{Generic}\\
\textbf{Type}: \texttt{plist\ dictonary}\\
\textbf{Optional}: When \texttt{Automatic} is \texttt{false}\\
......@@ -4964,7 +4971,8 @@ functioning. Feature highlights:
\item Windows may need to be reactivated. To avoid it consider
setting SystemUUID to the original firmware UUID. Be warned,
on old firmwares it may be invalid, i.e. not random. In case you still have issues,
consider using HWID or KMS38 license. The nuances of Windows activation are out of the
consider using HWID or KMS38 license \DIFdelbegin \DIFdel{. The }\DIFdelend \DIFaddbegin \DIFadd{or making the use }\texttt{\DIFadd{Custom}}
\texttt{\DIFadd{UpdateSMBIOSMode}}\DIFadd{. Other }\DIFaddend nuances of Windows activation are out of the
scope of this document and can be found online.
\end{itemize}
......
/** @file
OpenCore custom SMBIOS GUID identifiers.
Copyright (c) 2019, vit9696. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#ifndef OC_SMBIOS_H
#define OC_SMBIOS_H
///
/// This GUID is used for storing SMBIOS data when the firmware overwrites SMBIOS data at original
/// GUID at ExitBootServices, like it happens on some Dell computers.
/// Found by David Passmore. Guid matches syscl's implementation in Clover.
/// See: https://sourceforge.net/p/cloverefiboot/tickets/203/#c070
///
#define OC_CUSTOM_SMBIOS_TABLE_GUID \
{ 0xEB9D2D35, 0x2D88, 0x11D3, \
{ 0x9A, 0x16, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D } }
///
/// For macOS it is currently irrelevant whether SMBIOSv3 GUID is used.
/// However, Windows tools (e.g. Dell Updater) may still use this GUID,
/// and therefore will see the custom SMBIOS we crafted.
/// This is undesired when using custom SMBIOS GUID namespace to make
/// SMBIOS specific to macOS.
///
#define OC_CUSTOM_SMBIOS3_TABLE_GUID \
{ 0xF2FD1545, 0x9794, 0x4A2C, \
{ 0x99, 0x2E, 0xE5, 0xBB, 0xCF, 0x20, 0xE3, 0x94 } }
///
/// Exported GUID identifiers.
///
extern EFI_GUID gOcCustomSmbiosTableGuid;
extern EFI_GUID gOcCustomSmbios3TableGuid;
#endif // OC_SMBIOS_GUID_H
......@@ -21,19 +21,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include <Library/OcCpuLib.h>
#include <IndustryStandard/AppleSmBios.h>
//
// This GUID is used for storing SMBIOS data when the firmware overwrites SMBIOS data at original
// GUID at ExitBootServices, like it happens on some Dell computers.
// Found by David Passmore. Guid matches syscl's implementation in Clover.
// See: https://sourceforge.net/p/cloverefiboot/tickets/203/#c070
//
#define OC_CUSTOM_SMBIOS_TABLE_GUID \
{ \
0xeb9d2d35, 0x2d88, 0x11d3, {0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \
}
extern EFI_GUID gOcCustomSmbiosTableGuid;
#include <Guid/OcSmBios.h>
//
// We use this vendor name to spoof SMBIOS data on request.
......
......@@ -44,6 +44,7 @@
gEfiSmbiosTableGuid
gEfiSmbios3TableGuid
gOcCustomSmbiosTableGuid
gOcCustomSmbios3TableGuid
gOcVendorVariableGuid
[Protocols]
......
......@@ -1538,7 +1538,7 @@ SmbiosTableApply (
} else {
if (TableEntryPoint3 != NULL) {
Status = gBS->InstallConfigurationTable (
&gEfiSmbios3TableGuid,
Mode == OcSmbiosUpdateCustom ? &gOcCustomSmbios3TableGuid : &gEfiSmbios3TableGuid,
TableEntryPoint3
);
......
......@@ -32,8 +32,12 @@
## OcSupport package token space guid
gOpenCorePkgTokenSpaceGuid = { 0x38D40CB0, 0x7E37, 0x4CAA, { 0x91, 0xD3, 0x00, 0x47, 0x70, 0xA8, 0x73, 0x77 }}
## Include/Guid/OcSmBios.h
gOcCustomSmbiosTableGuid = { 0xEB9D2D35, 0x2D88, 0x11D3, { 0x9A, 0x16, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D }}
## Include/Guid/OcSmBios.h
gOcCustomSmbios3TableGuid = { 0xF2FD1545, 0x9794, 0x4A2C, { 0x99, 0x2E, 0xE5, 0xBB, 0xCF, 0x20, 0xE3, 0x94 }}
gMePavpProtocolGuid = { 0xFBF6FCF1, 0x96CF, 0x4E2E, { 0xA6, 0xA6, 0x1B, 0xAB, 0x8C, 0xBE, 0x36, 0xB1 }}
gMeFpfProtocolGuid = { 0x3893448C, 0xEAB6, 0x4F4C, { 0xB2, 0x3C, 0x57, 0xC2, 0xC4, 0x65, 0x8D, 0xFC }}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册