OpenCore  1.0.4
OpenCore Bootloader
Loading...
Searching...
No Matches
BootEntryInfo.c File Reference
#include "BootManagementInternal.h"
#include <Guid/AppleBless.h>
#include <IndustryStandard/AppleDiskLabel.h>
#include <IndustryStandard/AppleIcon.h>
#include <Library/BaseLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/OcDebugLogLib.h>
#include <Library/DevicePathLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/OcDevicePathLib.h>
#include <Library/OcFileLib.h>
#include <Library/OcStringLib.h>
#include <Library/OcXmlLib.h>
#include <Library/PrintLib.h>
#include <Library/UefiBootServicesTableLib.h>

Go to the source code of this file.

Functions

EFI_STATUS InternalReadBootEntryFile (IN EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *FileSystem, IN CONST CHAR16 *DirectoryName, IN CONST CHAR16 *Filename, IN UINT32 MaxFileSize, IN UINT32 MinFileSize, OUT VOID **FileData, OUT UINT32 *DataSize OPTIONAL)
 
CHAR16 * InternalGetAppleDiskLabel (IN EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *FileSystem, IN CONST CHAR16 *BootDirectoryName, IN CONST CHAR16 *LabelFilename)
 
CHAR8 * InternalGetContentFlavour (IN EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *FileSystem, IN CONST CHAR16 *BootDirectoryName)
 
STATIC EFI_STATUS GetAppleVersionFromPlist (IN CHAR8 *SystemVersionData, IN UINT32 SystemVersionDataSize, OUT CHAR8 *AppleVersion)
 
STATIC CHAR16 * InternalGetAppleRecoveryName (IN CHAR8 *Version)
 
STATIC EFI_STATUS InternalGetAppleVersion (IN EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *FileSystem, IN CONST CHAR16 *DirectoryName, OUT CHAR8 *AppleVersion)
 
EFI_STATUS InternalGetRecoveryOsBooter (IN EFI_HANDLE Device, OUT EFI_DEVICE_PATH_PROTOCOL **FilePath, IN BOOLEAN Basic)
 
EFI_STATUS EFIAPI OcGetBootEntryLabelImage (IN OC_PICKER_CONTEXT *Context, IN OC_BOOT_ENTRY *BootEntry, IN UINT8 Scale, OUT VOID **ImageData, OUT UINT32 *DataLength)
 
EFI_STATUS EFIAPI OcGetBootEntryIcon (IN OC_PICKER_CONTEXT *Context, IN OC_BOOT_ENTRY *BootEntry, OUT VOID **ImageData, OUT UINT32 *DataLength)
 
EFI_STATUS EFIAPI InternalGetBootEntryFile (IN EFI_DEVICE_PATH_PROTOCOL *DevicePath, IN CONST CHAR16 *FileName, IN CONST CHAR16 *DebugBootEntryName, IN CONST CHAR8 *DebugFileType, IN UINT32 MaxFileSize, IN UINT32 MinFileSize, OUT VOID **FileData, OUT UINT32 *DataLength OPTIONAL, IN BOOLEAN SearchAtLeaf, IN BOOLEAN SearchAtRoot)
 
EFI_STATUS EFIAPI OcGetBootEntryFileFromDevicePath (IN EFI_DEVICE_PATH_PROTOCOL *DevicePath, IN CONST CHAR16 *FileName, IN CONST CHAR8 *DebugFileType, IN UINT32 MaxFileSize, IN UINT32 MinFileSize, OUT VOID **FileData, OUT UINT32 *DataLength OPTIONAL, IN BOOLEAN SearchAtLeaf, IN BOOLEAN SearchAtRoot)
 
EFI_STATUS EFIAPI OcGetBootEntryFile (IN OC_BOOT_ENTRY *BootEntry, IN CONST CHAR16 *FileName, IN CONST CHAR8 *DebugFileType, IN UINT32 MaxFileSize, IN UINT32 MinFileSize, OUT VOID **FileData, OUT UINT32 *DataLength OPTIONAL, IN BOOLEAN SearchAtLeaf, IN BOOLEAN SearchAtRoot)
 
STATIC CHAR8 * InternalAddAppleVersion (IN CHAR8 *Flavour, IN CHAR8 *Version)
 
EFI_STATUS InternalDescribeBootEntry (IN OC_BOOT_CONTEXT *BootContext, IN OUT OC_BOOT_ENTRY *BootEntry)
 

Detailed Description

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 BootEntryInfo.c.

Function Documentation

◆ GetAppleVersionFromPlist()

STATIC EFI_STATUS GetAppleVersionFromPlist ( IN CHAR8 * SystemVersionData,
IN UINT32 SystemVersionDataSize,
OUT CHAR8 * AppleVersion )

Definition at line 151 of file BootEntryInfo.c.

◆ InternalAddAppleVersion()

STATIC CHAR8 * InternalAddAppleVersion ( IN CHAR8 * Flavour,
IN CHAR8 * Version )

Definition at line 628 of file BootEntryInfo.c.

◆ InternalDescribeBootEntry()

EFI_STATUS InternalDescribeBootEntry ( IN OC_BOOT_CONTEXT * BootContext,
IN OUT OC_BOOT_ENTRY * BootEntry )

Describe boot entry contents by setting fields other than DevicePath.

Parameters
[in]BootContextBoot context.
[in,out]BootEntryLocated boot entry.
Return values
EFI_SUCCESSThe entry point is described successfully.

Definition at line 692 of file BootEntryInfo.c.

◆ InternalGetAppleDiskLabel()

CHAR16 * InternalGetAppleDiskLabel ( IN EFI_SIMPLE_FILE_SYSTEM_PROTOCOL * FileSystem,
IN CONST CHAR16 * BootDirectoryName,
IN CONST CHAR16 * LabelFilename )

Definition at line 86 of file BootEntryInfo.c.

◆ InternalGetAppleRecoveryName()

STATIC CHAR16 * InternalGetAppleRecoveryName ( IN CHAR8 * Version)

Definition at line 209 of file BootEntryInfo.c.

◆ InternalGetAppleVersion()

STATIC EFI_STATUS InternalGetAppleVersion ( IN EFI_SIMPLE_FILE_SYSTEM_PROTOCOL * FileSystem,
IN CONST CHAR16 * DirectoryName,
OUT CHAR8 * AppleVersion )

Definition at line 232 of file BootEntryInfo.c.

◆ InternalGetBootEntryFile()

EFI_STATUS EFIAPI InternalGetBootEntryFile ( IN EFI_DEVICE_PATH_PROTOCOL * DevicePath,
IN CONST CHAR16 * FileName,
IN CONST CHAR16 * DebugBootEntryName,
IN CONST CHAR8 * DebugFileType,
IN UINT32 MaxFileSize,
IN UINT32 MinFileSize,
OUT VOID ** FileData,
OUT UINT32 *DataLength OPTIONAL,
IN BOOLEAN SearchAtLeaf,
IN BOOLEAN SearchAtRoot )

Definition at line 443 of file BootEntryInfo.c.

◆ InternalGetContentFlavour()

CHAR8 * InternalGetContentFlavour ( IN EFI_SIMPLE_FILE_SYSTEM_PROTOCOL * FileSystem,
IN CONST CHAR16 * BootDirectoryName )

Definition at line 122 of file BootEntryInfo.c.

◆ InternalGetRecoveryOsBooter()

EFI_STATUS InternalGetRecoveryOsBooter ( IN EFI_HANDLE Device,
OUT EFI_DEVICE_PATH_PROTOCOL ** FilePath,
IN BOOLEAN Basic )

Definition at line 263 of file BootEntryInfo.c.

◆ InternalReadBootEntryFile()

EFI_STATUS InternalReadBootEntryFile ( IN EFI_SIMPLE_FILE_SYSTEM_PROTOCOL * FileSystem,
IN CONST CHAR16 * DirectoryName,
IN CONST CHAR16 * Filename,
IN UINT32 MaxFileSize,
IN UINT32 MinFileSize,
OUT VOID ** FileData,
OUT UINT32 *DataSize OPTIONAL )

Definition at line 34 of file BootEntryInfo.c.

◆ OcGetBootEntryFile()

EFI_STATUS EFIAPI OcGetBootEntryFile ( IN OC_BOOT_ENTRY * BootEntry,
IN CONST CHAR16 * FileName,
IN CONST CHAR8 * DebugFileType,
IN UINT32 MaxFileSize,
IN UINT32 MinFileSize,
OUT VOID ** FileData,
OUT UINT32 *DataLength OPTIONAL,
IN BOOLEAN SearchAtLeaf,
IN BOOLEAN SearchAtRoot )

Read boot entry meta-data file. Validates that boot entry is external tool or OS type.

Parameters
[in]BootEntryBoot entry.
[in]FileNameFile name to search for.
[in]DebugFileTypeBrief description of file for use in debug messages.
[in]MaxFileSizeMaximum allowed file size (inclusive).
[in]MinFileSizeMinimum allowed file size (inclusive).
[out]FileDataReturned file data.
[out]DataLengthReturned data length.
[in]SearchAtLeafSearch next to boot file (or in boot folder) first.
[in]SearchAtRootAfter SearchAtLeaf (if specified), search at OC-specific GUID sub-folder location (if present), then at FS root.
Return values
EFI_SUCCESSBoot entry was correct type, file was located, validated against allowed length, and returned.
otherBoot entry was incorrect type, or file could not be located, or had invalid length.

Definition at line 593 of file BootEntryInfo.c.

◆ OcGetBootEntryFileFromDevicePath()

EFI_STATUS EFIAPI OcGetBootEntryFileFromDevicePath ( IN EFI_DEVICE_PATH_PROTOCOL * DevicePath,
IN CONST CHAR16 * FileName,
IN CONST CHAR8 * DebugFileType,
IN UINT32 MaxFileSize,
IN UINT32 MinFileSize,
OUT VOID ** FileData,
OUT UINT32 *DataLength OPTIONAL,
IN BOOLEAN SearchAtLeaf,
IN BOOLEAN SearchAtRoot )

Read boot entry meta-data file from boot entry device path. May be used before before OC_BOOT_ENTRY struct is created.

Parameters
[in]DevicePathBoot entry device path.
[in]FileNameFile name to search for.
[in]DebugFileTypeBrief description of file for use in debug messages.
[in]MaxFileSizeMaximum allowed file size (inclusive).
[in]MinFileSizeMinimum allowed file size (inclusive).
[out]FileDataReturned file data.
[out]DataLengthReturned data length.
[in]SearchAtLeafSearch next to boot file (or in boot folder) first.
[in]SearchAtRootAfter SearchAtLeaf (if specified), search at OC-specific GUID sub-folder location (if present), then at FS root.
Return values
EFI_SUCCESSFile was located, validated against allowed length, and returned.
otherFile could not be located, or had invalid length.

Definition at line 565 of file BootEntryInfo.c.

◆ OcGetBootEntryIcon()

EFI_STATUS EFIAPI OcGetBootEntryIcon ( IN OC_PICKER_CONTEXT * Context,
IN OC_BOOT_ENTRY * BootEntry,
OUT VOID ** ImageData,
OUT UINT32 * DataLength )

Get '.VolumeIcon.icns' file contents, if exists.

Parameters
[in]BootEntryLocated boot entry.
[out]ImageDataFile contents.
[out]DataLengthFile length.
Return values
EFI_SUCCESSThe file was read successfully.

Definition at line 420 of file BootEntryInfo.c.

◆ OcGetBootEntryLabelImage()

EFI_STATUS EFIAPI OcGetBootEntryLabelImage ( IN OC_PICKER_CONTEXT * Context,
IN OC_BOOT_ENTRY * BootEntry,
IN UINT8 Scale,
OUT VOID ** ImageData,
OUT UINT32 * DataLength )

Get '.disk_label' or '.disk_label_2x' file contents, if exists.

Parameters
[in]BootEntryLocated boot entry.
[in]ScaleUser interface scale.
[out]ImageDataFile contents.
[out]DataLengthFile length.
Return values
EFI_SUCCESSThe file was read successfully.

Definition at line 396 of file BootEntryInfo.c.