提交 02602c8a 编写于 作者: V vit9696

OcAppleBootPolicyLib: Added first-class Windows support to bless model

上级 507f4f29
......@@ -39,6 +39,7 @@ OpenCore Changelog
- Added serial port initialisation for serial debug logging
- Disabled empty debug log file creation to avoid ESP cluttering
- Added `TscSyncTimeout` quirk to workaround debug kernel assertions
- Added first-class Windows support to bless model
#### v0.5.8
- Fixed invalid CPU object reference in SSDT-PLUG
......
......@@ -2254,10 +2254,11 @@ entry choice will update till next manual reconfiguration.
Designed to be filled with \texttt{plist\ string} entries containing
absolute UEFI paths to customised bootloaders, for example,
\texttt{\textbackslash EFI\textbackslash Microsoft\textbackslash Boot\textbackslash bootmgfw.efi}
for Microsoft bootloader. This allows unusual boot paths to be automaticlly
\texttt{\textbackslash EFI\textbackslash debian\textbackslash grubx64.efi}
for Debian bootloader. This allows unusual boot paths to be automaticlly
discovered by the boot picker. Designwise they are equivalent to predefined blessed path, such as
\texttt{\textbackslash System\textbackslash Library\textbackslash CoreServices\textbackslash boot.efi},
\texttt{\textbackslash System\textbackslash Library\textbackslash CoreServices\textbackslash boot.efi}
or \texttt{\textbackslash EFI\textbackslash Microsoft\textbackslash Boot\textbackslash bootmgfw.efi},
but unlike predefined bless paths they have highest priority.
\item
......@@ -5366,10 +5367,6 @@ functioning. Feature highlights:
\begin{itemize}
\item MBR (Master Boot Record) installations are legacy and will not be supported.
\item To install Windows, macOS, and OpenCore on the same drive you can specify
Windows bootloader path
(\texttt{\textbackslash EFI\textbackslash Microsoft\textbackslash Boot\textbackslash bootmgfw.efi})
in \texttt{BlessOverride} section.
\item All the modifications applied (to ACPI, NVRAM, SMBIOS, etc.) are supposed
to be operating system agnostic, i.e. apply equally regardless of the OS booted.
This enables Boot Camp software experience on Windows.
......
/** @file
Copyright (c) 2020, vit9696. All rights reserved.
SPDX-License-Identifier: BSD-3-Clause
**/
#ifndef MICROSOFT_WINDOWS_H
#define MICROSOFT_WINDOWS_H
///
/// Windows bootloader path.
/// REF: https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/bcd-system-store-settings-for-uefi
///
#define MS_BOOTER_DEFAULT_FILE_NAME L"\\EFI\\Microsoft\\Boot\\bootmgfw.efi"
#endif // MICROSOFT_WINDOWS_H
......@@ -13,6 +13,7 @@
**/
#include <AppleMacEfi.h>
#include <MicrosoftWindows.h>
#include <Guid/AppleApfsInfo.h>
#include <Guid/AppleBless.h>
......@@ -48,18 +49,38 @@ typedef struct {
///
/// An array of file paths to search for in case no file is blessed.
/// On Apple Macs this list includes:
/// 1. APPLE_BOOTER_DEFAULT_FILE_NAME -- \System\Library\CoreServices\boot.efi
/// 2. APPLE_REMOVABLE_MEDIA_FILE_NAME -- \EFI\APPLE\X64\BOOT.EFI
/// 3. EFI_REMOVABLE_MEDIA_FILE_NAME -- \EFI\BOOT\BOOTX64.EFI
/// 4. APPLE_BOOTER_ROOT_FILE_NAME -- \boot.efi
///
/// Since in real world only 1st and 3rd entries are used, we do not include
/// 2nd and 4th until further notice. However, we do include a custom entry
/// for Windows, for the reason OpenCore, unlike Apple EFI, may override
/// BOOTx64.efi, and this is not the case for Apple EFI. So we end up with:
/// 1. APPLE_BOOTER_DEFAULT_FILE_NAME -- \System\Library\CoreServices\boot.efi
/// 2. MS_BOOTER_DEFAULT_FILE_NAME -- \EFI\Microsoft\Boot\bootmgfw.efi
/// 3. EFI_REMOVABLE_MEDIA_FILE_NAME -- \EFI\BOOT\BOOTX64.EFI
///
/// This resolves a problem when Windows installer does not replace our BOOTx64.efi
/// file with Windows file and then NVRAM reset or Boot Camp software reboot to macOS
/// results in the removal of the Windows boot entry from NVRAM making Windows
/// disappear from the list of OpenCore entries without BlessOverride.
///
/// Linux and related entries are not present here, because they have fine working
/// software for boot management and do not use BOOTx64.efi in the first place.
///
GLOBAL_REMOVE_IF_UNREFERENCED CONST CHAR16 *gAppleBootPolicyPredefinedPaths[] = {
APPLE_BOOTER_DEFAULT_FILE_NAME,
APPLE_REMOVABLE_MEDIA_FILE_NAME,
EFI_REMOVABLE_MEDIA_FILE_NAME,
APPLE_BOOTER_ROOT_FILE_NAME
MS_BOOTER_DEFAULT_FILE_NAME,
EFI_REMOVABLE_MEDIA_FILE_NAME
};
GLOBAL_REMOVE_IF_UNREFERENCED CONST UINTN gAppleBootPolicyNumPredefinedPaths =
ARRAY_SIZE (gAppleBootPolicyPredefinedPaths);
GLOBAL_REMOVE_IF_UNREFERENCED CONST UINTN gAppleBootPolicyCoreNumPredefinedPaths = 1;
GLOBAL_REMOVE_IF_UNREFERENCED CONST UINTN gAppleBootPolicyCoreNumPredefinedPaths = 2;
EFI_STATUS
EFIAPI
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册