Skip to content

Commit

Permalink
OcMainLib: Add large basesystem support to AdviseFeatures
Browse files Browse the repository at this point in the history
  • Loading branch information
vit9696 committed Sep 22, 2021
1 parent 0767313 commit 1cb8490
Show file tree
Hide file tree
Showing 10 changed files with 32 additions and 13 deletions.
1 change: 1 addition & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ OpenCore Changelog
- Added Linux detection optional log detail
- Fixed CPU core count detection for more legacy CPUs
- Added ability to fully override autodetect Linux boot options
- Added large BaseSystem support in `AdviseFeatures`

#### v0.7.3
- Improved SSDT-PNLF compatibility with CFL+ graphics
Expand Down
Binary file modified Docs/Configuration.pdf
Binary file not shown.
3 changes: 3 additions & 0 deletions Docs/Configuration.tex
Original file line number Diff line number Diff line change
Expand Up @@ -5083,6 +5083,9 @@ \subsection{Generic Properties}\label{platforminfogeneric}
a drive with an EFI partition that is the first partition on the disk.
\item \texttt{FW\_FEATURE\_SUPPORTS\_APFS} (\texttt{0x00080000})
- Without this bit, it is not possible to install macOS on an APFS disk.
\item \texttt{FW\_FEATURE\_SUPPORTS\_LARGE\_BASESYSTEM} (\texttt{0x800000000})
- Without this bit, it is not possible to install macOS versions with large
BaseSystem images, such as macOS 12.
\end{itemize}

\emph{Note}: On most newer firmwares these bits are already set, the option
Expand Down
Binary file modified Docs/Differences/Differences.pdf
Binary file not shown.
21 changes: 14 additions & 7 deletions Docs/Differences/Differences.tex
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
\documentclass[]{article}
%DIF LATEXDIFF DIFFERENCE FILE
%DIF DEL PreviousConfiguration.tex Sun Sep 19 11:04:31 2021
%DIF ADD ../Configuration.tex Sun Sep 19 18:07:47 2021
%DIF DEL PreviousConfiguration.tex Sun Sep 12 01:31:15 2021
%DIF ADD ../Configuration.tex Wed Sep 22 18:46:43 2021

\usepackage{lmodern}
\usepackage{amssymb,amsmath}
Expand Down Expand Up @@ -4136,10 +4136,14 @@ \subsection{Security Properties}\label{miscsecurityprops}
can be found in the \href{https://habr.com/post/273497/}{Taming UEFI SecureBoot}
paper (in Russian).

\emph{Note 2}: \texttt{vault.plist} and \texttt{vault.sig} are used regardless of
this option when \texttt{vault.plist} is present or a public key is embedded into
\texttt{OpenCore.efi}. Setting this option will only ensure configuration sanity,
and abort the boot process otherwise.
\emph{Note 2}: \DIFdelbegin \texttt{\DIFdel{vault.plist}} %DIFAUXCMD
\DIFdel{and }\texttt{\DIFdel{vault.sig}} %DIFAUXCMD
\DIFdel{are used regardless }\DIFdelend \DIFaddbegin \DIFadd{Regardless }\DIFaddend of this option\DIFdelbegin \DIFdel{when }\DIFdelend \DIFaddbegin \DIFadd{, }\DIFaddend \texttt{vault.plist} is \DIFdelbegin \DIFdel{present or }\DIFdelend \DIFaddbegin \DIFadd{always used when
present, and both }\texttt{\DIFadd{vault.plist}} \DIFadd{and }\texttt{\DIFadd{vault.sig}} \DIFadd{are used and required
when }\DIFaddend a public key is embedded into \texttt{OpenCore.efi}\DIFdelbegin \DIFdel{. Setting this option will only ensure configuration sanity, and }\DIFdelend \DIFaddbegin \DIFadd{, and errors will }\DIFaddend abort the
boot process \DIFdelbegin \DIFdel{otherwise. }\DIFdelend \DIFaddbegin \DIFadd{in either case. Setting this option allows OpenCore to warn the user if
the configuration is not as required to achieve an expected higher security level.
}\DIFaddend

\item
\texttt{ScanPolicy}\\
Expand Down Expand Up @@ -5152,7 +5156,10 @@ \subsection{Generic Properties}\label{platforminfogeneric}
a drive with an EFI partition that is the first partition on the disk.
\item \texttt{FW\_FEATURE\_SUPPORTS\_APFS} (\texttt{0x00080000})
- Without this bit, it is not possible to install macOS on an APFS disk.
\end{itemize}
\DIFaddbegin \item \texttt{\DIFadd{FW\_FEATURE\_SUPPORTS\_LARGE\_BASESYSTEM}} \DIFadd{(}\texttt{\DIFadd{0x800000000}}\DIFadd{)
- Without this bit, it is not possible to install macOS versions with large
BaseSystem images, such as macOS 12.
}\DIFaddend \end{itemize}

\emph{Note}: On most newer firmwares these bits are already set, the option
may be necessary when "upgrading" the firmware with new features.
Expand Down
Binary file modified Docs/Errata/Errata.pdf
Binary file not shown.
2 changes: 1 addition & 1 deletion Docs/Sample.plist
Original file line number Diff line number Diff line change
Expand Up @@ -1215,7 +1215,7 @@
<key>Generic</key>
<dict>
<key>AdviseFeatures</key>
<false/>
<true/>
<key>MLB</key>
<string>M0000000000000001</string>
<key>MaxBIOSVersion</key>
Expand Down
2 changes: 1 addition & 1 deletion Docs/SampleCustom.plist
Original file line number Diff line number Diff line change
Expand Up @@ -1243,7 +1243,7 @@
<key>Generic</key>
<dict>
<key>AdviseFeatures</key>
<false/>
<true/>
<key>MLB</key>
<string></string>
<key>MaxBIOSVersion</key>
Expand Down
4 changes: 4 additions & 0 deletions Include/Apple/IndustryStandard/AppleFeatures.h
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,10 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
// See: https://github.com/Piker-Alpha/macosxbootloader/blob/1abba11e3b792dd29c2a08c410c122efd1d19e98/src/boot/AcpiUtils.cpp#L152
//
#define FW_FEATURE_DISABLE_BOOTSCRIPT_WORKAROUND 0x80000000U // 31
//
// Supports large BaseSystem. Checked by patchd. Required by macOS 12.
//
#define FW_FEATURE_SUPPORTS_LARGE_BASESYSTEM 0x800000000U // 35

//
// OEM Platform Feature Information - Platform feature bits
Expand Down
12 changes: 8 additions & 4 deletions Library/OcMainLib/OpenCorePlatform.c
Original file line number Diff line number Diff line change
Expand Up @@ -371,10 +371,12 @@ OcPlatformUpdateSmbios (
if (Config->PlatformInfo.Generic.AdviseFeatures) {
Data.FirmwareFeatures |= FW_FEATURE_SUPPORTS_CSM_LEGACY_MODE
| FW_FEATURE_SUPPORTS_UEFI_WINDOWS_BOOT
| FW_FEATURE_SUPPORTS_APFS;
| FW_FEATURE_SUPPORTS_APFS
| FW_FEATURE_SUPPORTS_LARGE_BASESYSTEM;
Data.FirmwareFeaturesMask |= FW_FEATURE_SUPPORTS_CSM_LEGACY_MODE
| FW_FEATURE_SUPPORTS_UEFI_WINDOWS_BOOT
| FW_FEATURE_SUPPORTS_APFS;
| FW_FEATURE_SUPPORTS_APFS
| FW_FEATURE_SUPPORTS_LARGE_BASESYSTEM;
}

//
Expand Down Expand Up @@ -538,10 +540,12 @@ OcPlatformUpdateNvram (
if (Config->PlatformInfo.Generic.AdviseFeatures) {
ExFeatures |= FW_FEATURE_SUPPORTS_CSM_LEGACY_MODE
| FW_FEATURE_SUPPORTS_UEFI_WINDOWS_BOOT
| FW_FEATURE_SUPPORTS_APFS;
| FW_FEATURE_SUPPORTS_APFS
| FW_FEATURE_SUPPORTS_LARGE_BASESYSTEM;
ExFeaturesMask |= FW_FEATURE_SUPPORTS_CSM_LEGACY_MODE
| FW_FEATURE_SUPPORTS_UEFI_WINDOWS_BOOT
| FW_FEATURE_SUPPORTS_APFS;
| FW_FEATURE_SUPPORTS_APFS
| FW_FEATURE_SUPPORTS_LARGE_BASESYSTEM;
}
}

Expand Down

0 comments on commit 1cb8490

Please sign in to comment.