OpenCore
1.0.4
OpenCore Bootloader
|
#include <Protocol/AppleBootPolicy.h>
Go to the source code of this file.
Functions | |
APPLE_BOOT_POLICY_PROTOCOL * | OcAppleBootPolicyInstallProtocol (IN BOOLEAN Reinstall) |
EFI_STATUS | OcGetBooterFromPredefinedPathList (IN EFI_HANDLE Device, IN EFI_FILE_PROTOCOL *Root, IN CONST CHAR16 **PredefinedPaths, IN UINTN NumPredefinedPaths, OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath OPTIONAL, IN CHAR16 *Prefix OPTIONAL) |
EFI_STATUS | OcBootPolicyGetBootFile (IN EFI_HANDLE Device, IN CONST CHAR16 **PredefinedPaths, IN UINTN NumPredefinedPaths, IN OUT EFI_DEVICE_PATH_PROTOCOL **FilePath) |
EFI_STATUS | OcBootPolicyGetBootFileEx (IN EFI_HANDLE Device, IN CONST CHAR16 **PredefinedPaths, IN UINTN NumPredefinedPaths, OUT EFI_DEVICE_PATH_PROTOCOL **FilePath) |
EFI_STATUS | OcBootPolicyDevicePathToDirPath (IN EFI_DEVICE_PATH_PROTOCOL *DevicePath, OUT CHAR16 **BootPathName, OUT EFI_SIMPLE_FILE_SYSTEM_PROTOCOL **FileSystem) |
EFI_STATUS | OcBootPolicyDevicePathToFilePath (IN EFI_DEVICE_PATH_PROTOCOL *DevicePath, OUT CHAR16 **BootPathName) |
EFI_STATUS | OcBootPolicyGetApfsRecoveryFilePath (IN EFI_DEVICE_PATH_PROTOCOL *DevicePath, IN CONST CHAR16 *PathName, IN CONST CHAR16 **PredefinedPaths, IN UINTN NumPredefinedPaths, OUT CHAR16 **FullPathName, OUT EFI_FILE_PROTOCOL **Root, OUT EFI_HANDLE *DeviceHandle) |
EFI_STATUS | OcBootPolicyGetAllApfsRecoveryFilePath (IN EFI_HANDLE Handle OPTIONAL, OUT VOID **Volumes, OUT UINTN *NumberOfEntries) |
Variables | |
CONST CHAR16 * | gAppleBootPolicyPredefinedPaths [] |
CONST UINTN | gAppleBootPolicyNumPredefinedPaths |
CONST UINTN | gAppleBootPolicyCoreNumPredefinedPaths |
Copyright (C) 2019, vit9696. All rights reserved.
All rights reserved.
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.
Definition in file OcAppleBootPolicyLib.h.
APPLE_BOOT_POLICY_PROTOCOL * OcAppleBootPolicyInstallProtocol | ( | IN BOOLEAN | Reinstall | ) |
Install and initialise Apple Boot policy protocol.
[in] | Reinstall | Overwrite installed protocol. |
installed | or located protocol or NULL. |
Definition at line 1716 of file OcAppleBootPolicyLib.c.
EFI_STATUS OcBootPolicyDevicePathToDirPath | ( | IN EFI_DEVICE_PATH_PROTOCOL * | DevicePath, |
OUT CHAR16 ** | BootPathName, | ||
OUT EFI_SIMPLE_FILE_SYSTEM_PROTOCOL ** | FileSystem ) |
Retrieves folder and file system associated with DevicePath.
[in] | DevicePath | The device path to describe. |
[out] | BootPathName | A pointer into which the folder portion of DevicePath is returned. When EFI_SUCCESS is returned, caller is responsible for freeing this pool memory. |
[out] | FileSystem | A pointer into which the simple file system for the folder is returned. |
EFI_SUCCESS | The operation has been completed successfully. |
other | DevicePath is not a valid file path. |
Definition at line 1088 of file OcAppleBootPolicyLib.c.
EFI_STATUS OcBootPolicyDevicePathToFilePath | ( | IN EFI_DEVICE_PATH_PROTOCOL * | DevicePath, |
OUT CHAR16 ** | BootPathName ) |
Retrieves file path associated with DevicePath.
[in] | DevicePath | The device path to describe. |
[out] | BootPathName | A pointer into which the file path for DevicePath is returned. When EFI_SUCCESS is returned, caller is responsible for freeing this pool memory. |
EFI_SUCCESS | The operation has been completed successfully. |
other | DevicePath is not a valid file path. |
Definition at line 1127 of file OcAppleBootPolicyLib.c.
EFI_STATUS OcBootPolicyGetAllApfsRecoveryFilePath | ( | IN EFI_HANDLE Handle | OPTIONAL, |
OUT VOID ** | Volumes, | ||
OUT UINTN * | NumberOfEntries ) |
Definition at line 1471 of file OcAppleBootPolicyLib.c.
EFI_STATUS OcBootPolicyGetApfsRecoveryFilePath | ( | IN EFI_DEVICE_PATH_PROTOCOL * | DevicePath, |
IN CONST CHAR16 * | PathName, | ||
IN CONST CHAR16 ** | PredefinedPaths, | ||
IN UINTN | NumPredefinedPaths, | ||
OUT CHAR16 ** | FullPathName, | ||
OUT EFI_FILE_PROTOCOL ** | Root, | ||
OUT EFI_HANDLE * | DeviceHandle ) |
Retrieves path info for the APFS Recovery volume associated with the APFS volume given by DevicePath.
[in] | DevicePath | The device path to the APFS recovery volume. |
[in] | PathName | The file path to open. |
[in] | PredefinedPaths | An array of file paths to scan for if no file was blessed. |
[in] | NumPredefinedPaths | The number of paths in PredefinedPaths. |
[out] | FullPathName | A pointer into which the full file path for DevicePath and PathName is returned. |
[out] | Root | A pointer into which the opened Recovery volume root protocol is returned. |
[out] | DeviceHandle | A pointer into which the device handle of DevicePath is returned. |
EFI_SUCCESS | The operation has been completed successfully. |
EFI_NOT_FOUND | The file path could not be found. |
other | An unexpected error has occured. |
Definition at line 1227 of file OcAppleBootPolicyLib.c.
EFI_STATUS OcBootPolicyGetBootFile | ( | IN EFI_HANDLE | Device, |
IN CONST CHAR16 ** | PredefinedPaths, | ||
IN UINTN | NumPredefinedPaths, | ||
IN OUT EFI_DEVICE_PATH_PROTOCOL ** | FilePath ) |
Locates the bootable file of the given volume. Prefered are the values blessed, though if unavailable, hard-coded names are being verified and used if existing.
The blessed paths are to be determined by the HFS Driver via EFI_FILE_PROTOCOL.GetInfo(). The related identifier definitions are to be found in AppleBless.h.
[in] | Device | The device's Handle to perform the search on. |
[in] | PredefinedPaths | An array of file paths to scan for if no file was blessed. |
[in] | NumPredefinedPaths | The number of paths in PredefinedPaths. |
[out] | FilePath | A pointer to the device path pointer to set to the file path of the boot file. |
EFI_NOT_FOUND | A bootable file could not be found on the given volume. |
EFI_OUT_OF_RESOURCES | The memory necessary to complete the operation could not be allocated. |
EFI_SUCCESS | The operation completed successfully and the BootFilePath Buffer has been filled. |
other | The status of an operation used to complete this operation is returned. |
Definition at line 876 of file OcAppleBootPolicyLib.c.
EFI_STATUS OcBootPolicyGetBootFileEx | ( | IN EFI_HANDLE | Device, |
IN CONST CHAR16 ** | PredefinedPaths, | ||
IN UINTN | NumPredefinedPaths, | ||
OUT EFI_DEVICE_PATH_PROTOCOL ** | FilePath ) |
Please refer to OcBootPolicyGetBootFile. This function extends the functionality by supporting the APFS Preboot scheme.
[in] | Device | The device's Handle to perform the search on. |
[in] | PredefinedPaths | An array of file paths to scan for if no file was blessed. |
[in] | NumPredefinedPaths | The number of paths in PredefinedPaths. |
[out] | FilePath | A pointer to the device path pointer to set to the file path of the boot file. |
EFI_NOT_FOUND | A bootable file could not be found on the given volume. |
EFI_OUT_OF_RESOURCES | The memory necessary to complete the operation could not be allocated. |
EFI_SUCCESS | The operation completed successfully and the BootFilePath Buffer has been filled. |
other | The status of an operation used to complete this operation is returned. |
Definition at line 950 of file OcAppleBootPolicyLib.c.
EFI_STATUS OcGetBooterFromPredefinedPathList | ( | IN EFI_HANDLE | Device, |
IN EFI_FILE_PROTOCOL * | Root, | ||
IN CONST CHAR16 ** | PredefinedPaths, | ||
IN UINTN | NumPredefinedPaths, | ||
OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath | OPTIONAL, | ||
IN CHAR16 *Prefix | OPTIONAL ) |
Definition at line 364 of file OcAppleBootPolicyLib.c.
|
extern |
Core Apple Boot Policy predefined booter paths.
Definition at line 83 of file OcAppleBootPolicyLib.c.
|
extern |
All Apple Boot Policy predefined booter paths.
Definition at line 80 of file OcAppleBootPolicyLib.c.
|
extern |
An array of file paths to search for in case no file is blessed. On Apple Macs this list includes:
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:
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.
Definition at line 74 of file OcAppleBootPolicyLib.c.