OpenCore
1.0.4
OpenCore Bootloader
|
#include "LinuxBootInternal.h"
#include <Uefi.h>
#include <Guid/Gpt.h>
#include <Library/BaseLib.h>
#include <Library/DevicePathLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/OcBootManagementLib.h>
#include <Library/OcDebugLogLib.h>
#include <Library/OcFileLib.h>
#include <Library/OcFlexArrayLib.h>
#include <Library/OcStringLib.h>
#include <Library/PrintLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Protocol/OcBootEntry.h>
Go to the source code of this file.
Macros | |
#define | GRUB_DEFAULT_FILE L"\\etc\\default\\grub" |
#define | OS_RELEASE_FILE L"\\etc\\os-release" |
#define | AUTODETECT_DIR L"\\boot" |
#define | ROOT_DIR L"\\" |
#define | ROOT_FS_FILE L"\\bin\\sh" |
Functions | |
STATIC EFI_STATUS | ProcessVmlinuzFile (EFI_FILE_HANDLE Directory, EFI_FILE_INFO *FileInfo, UINTN FileInfoSize, VOID *Context OPTIONAL) |
STATIC EFI_STATUS | CreateAsciiRelativePath (CHAR8 **Dest, CHAR16 *DirectoryPath, UINTN DirectoryPathLength, CHAR16 *FilePath, UINTN FilePathLength) |
STATIC EFI_STATUS | CreateRootPartuuid (CHAR8 **Dest) |
STATIC VOID | AutodetectTitle (VOID) |
STATIC EFI_STATUS | LoadOsRelease (IN CONST EFI_FILE_PROTOCOL *RootDirectory, IN CONST BOOLEAN IsStandaloneBoot) |
STATIC EFI_STATUS | LoadDefaultGrub (IN CONST EFI_FILE_PROTOCOL *RootDirectory, IN CONST BOOLEAN IsStandaloneBoot) |
STATIC VOID | LoadAppleDiskLabel (IN CONST EFI_FILE_PROTOCOL *VmlinuzDirectory) |
STATIC VOID | FreeEtcFiles (VOID) |
STATIC EFI_STATUS | InsertOption (IN CONST UINTN InsertIndex, IN OC_FLEX_ARRAY *Options, IN CONST VOID *Value, IN CONST OC_STRING_FORMAT StringFormat) |
STATIC EFI_STATUS | AddOption (IN OC_FLEX_ARRAY *Options, IN CONST VOID *Value, IN CONST OC_STRING_FORMAT StringFormat) |
EFI_STATUS | InsertRootOption (IN OC_FLEX_ARRAY *Options) |
STATIC VOID | GetCurrentPartuuidAutoOpts (VOID) |
EFI_STATUS | InternalPreloadAutoOpts (IN OC_FLEX_ARRAY *Options) |
STATIC EFI_STATUS | AutodetectBootOptions (IN CONST BOOLEAN IsRescue, IN CONST BOOLEAN IsStandaloneBoot, IN OC_FLEX_ARRAY *Options) |
STATIC EFI_STATUS | GenerateEntriesForVmlinuzFiles (IN CHAR16 *DirectoryPath, IN CONST BOOLEAN IsStandaloneBoot) |
STATIC EFI_STATUS | AutodetectLinuxAtDirectory (IN EFI_FILE_PROTOCOL *RootDirectory, IN EFI_FILE_PROTOCOL *VmlinuzDirectory, IN CHAR16 *AutodetectDir, IN CONST BOOLEAN IsStandaloneBoot, OUT OC_PICKER_ENTRY **Entries, OUT UINTN *NumEntries) |
STATIC EFI_STATUS | DoAutodetectLinux (IN EFI_FILE_PROTOCOL *RootDirectory, IN EFI_FILE_PROTOCOL *VmlinuzDirectory, IN CHAR16 *AutodetectDir, IN CONST BOOLEAN IsStandaloneBoot, OUT OC_PICKER_ENTRY **Entries, OUT UINTN *NumEntries) |
EFI_STATUS | InternalAutodetectLinux (IN EFI_FILE_PROTOCOL *RootDirectory, OUT OC_PICKER_ENTRY **Entries, OUT UINTN *NumEntries) |
Variables | |
STATIC OC_FLEX_ARRAY * | mVmlinuzFiles |
STATIC OC_FLEX_ARRAY * | mInitrdFiles |
STATIC OC_FLEX_ARRAY * | mEtcOsReleaseOptions |
STATIC CHAR8 * | mEtcOsReleaseFileContents |
STATIC CHAR8 * | mPrettyName |
STATIC CHAR8 * | mDiskLabel |
STATIC OC_FLEX_ARRAY * | mEtcDefaultGrubOptions |
STATIC CHAR8 * | mEtcDefaultGrubFileContents |
STATIC OC_FLEX_ARRAY * | mPerPartuuidAutoOpts |
STATIC CHAR16 * | mCurrentPartuuidAutoOpts |
STATIC CHAR16 * | mCurrentPartuuidAutoOptsPlus |
STATIC CHAR16 * | mGlobalAutoOpts |
STATIC CHAR16 * | mGlobalAutoOptsPlus |
vmlinuz and initramfs/initrd autodetect.
Copyright (c) 2021, Mike Beaton. All rights reserved.
SPDX-License-Identifier: BSD-3-Clause
Definition in file Autodetect.c.
#define AUTODETECT_DIR L"\\boot" |
Definition at line 27 of file Autodetect.c.
#define GRUB_DEFAULT_FILE L"\\etc\\default\\grub" |
Definition at line 25 of file Autodetect.c.
#define OS_RELEASE_FILE L"\\etc\\os-release" |
Definition at line 26 of file Autodetect.c.
#define ROOT_DIR L"\\" |
Definition at line 28 of file Autodetect.c.
#define ROOT_FS_FILE L"\\bin\\sh" |
Definition at line 29 of file Autodetect.c.
STATIC EFI_STATUS AddOption | ( | IN OC_FLEX_ARRAY * | Options, |
IN CONST VOID * | Value, | ||
IN CONST OC_STRING_FORMAT | StringFormat ) |
Definition at line 434 of file Autodetect.c.
STATIC EFI_STATUS AutodetectBootOptions | ( | IN CONST BOOLEAN | IsRescue, |
IN CONST BOOLEAN | IsStandaloneBoot, | ||
IN OC_FLEX_ARRAY * | Options ) |
Definition at line 565 of file Autodetect.c.
STATIC EFI_STATUS AutodetectLinuxAtDirectory | ( | IN EFI_FILE_PROTOCOL * | RootDirectory, |
IN EFI_FILE_PROTOCOL * | VmlinuzDirectory, | ||
IN CHAR16 * | AutodetectDir, | ||
IN CONST BOOLEAN | IsStandaloneBoot, | ||
OUT OC_PICKER_ENTRY ** | Entries, | ||
OUT UINTN * | NumEntries ) |
Definition at line 889 of file Autodetect.c.
STATIC VOID AutodetectTitle | ( | VOID | ) |
Definition at line 198 of file Autodetect.c.
STATIC EFI_STATUS CreateAsciiRelativePath | ( | CHAR8 ** | Dest, |
CHAR16 * | DirectoryPath, | ||
UINTN | DirectoryPathLength, | ||
CHAR16 * | FilePath, | ||
UINTN | FilePathLength ) |
Definition at line 144 of file Autodetect.c.
STATIC EFI_STATUS CreateRootPartuuid | ( | CHAR8 ** | Dest | ) |
Definition at line 171 of file Autodetect.c.
STATIC EFI_STATUS DoAutodetectLinux | ( | IN EFI_FILE_PROTOCOL * | RootDirectory, |
IN EFI_FILE_PROTOCOL * | VmlinuzDirectory, | ||
IN CHAR16 * | AutodetectDir, | ||
IN CONST BOOLEAN | IsStandaloneBoot, | ||
OUT OC_PICKER_ENTRY ** | Entries, | ||
OUT UINTN * | NumEntries ) |
Definition at line 995 of file Autodetect.c.
STATIC VOID FreeEtcFiles | ( | VOID | ) |
Definition at line 359 of file Autodetect.c.
STATIC EFI_STATUS GenerateEntriesForVmlinuzFiles | ( | IN CHAR16 * | DirectoryPath, |
IN CONST BOOLEAN | IsStandaloneBoot ) |
Definition at line 755 of file Autodetect.c.
STATIC VOID GetCurrentPartuuidAutoOpts | ( | VOID | ) |
Definition at line 466 of file Autodetect.c.
STATIC EFI_STATUS InsertOption | ( | IN CONST UINTN | InsertIndex, |
IN OC_FLEX_ARRAY * | Options, | ||
IN CONST VOID * | Value, | ||
IN CONST OC_STRING_FORMAT | StringFormat ) |
Definition at line 388 of file Autodetect.c.
EFI_STATUS InsertRootOption | ( | IN OC_FLEX_ARRAY * | Options | ) |
Definition at line 444 of file Autodetect.c.
EFI_STATUS InternalAutodetectLinux | ( | IN EFI_FILE_PROTOCOL * | RootDirectory, |
OUT OC_PICKER_ENTRY ** | Entries, | ||
OUT UINTN * | NumEntries ) |
Definition at line 1019 of file Autodetect.c.
EFI_STATUS InternalPreloadAutoOpts | ( | IN OC_FLEX_ARRAY * | Options | ) |
Definition at line 489 of file Autodetect.c.
STATIC VOID LoadAppleDiskLabel | ( | IN CONST EFI_FILE_PROTOCOL * | VmlinuzDirectory | ) |
Definition at line 337 of file Autodetect.c.
STATIC EFI_STATUS LoadDefaultGrub | ( | IN CONST EFI_FILE_PROTOCOL * | RootDirectory, |
IN CONST BOOLEAN | IsStandaloneBoot ) |
Definition at line 297 of file Autodetect.c.
STATIC EFI_STATUS LoadOsRelease | ( | IN CONST EFI_FILE_PROTOCOL * | RootDirectory, |
IN CONST BOOLEAN | IsStandaloneBoot ) |
Definition at line 237 of file Autodetect.c.
STATIC EFI_STATUS ProcessVmlinuzFile | ( | EFI_FILE_HANDLE | Directory, |
EFI_FILE_INFO * | FileInfo, | ||
UINTN | FileInfoSize, | ||
VOID *Context | OPTIONAL ) |
Definition at line 85 of file Autodetect.c.
STATIC CHAR16* mCurrentPartuuidAutoOpts |
Definition at line 69 of file Autodetect.c.
STATIC CHAR16* mCurrentPartuuidAutoOptsPlus |
Definition at line 73 of file Autodetect.c.
STATIC CHAR8* mDiskLabel |
Definition at line 53 of file Autodetect.c.
STATIC CHAR8* mEtcDefaultGrubFileContents |
Definition at line 61 of file Autodetect.c.
STATIC OC_FLEX_ARRAY* mEtcDefaultGrubOptions |
Definition at line 57 of file Autodetect.c.
STATIC CHAR8* mEtcOsReleaseFileContents |
Definition at line 45 of file Autodetect.c.
STATIC OC_FLEX_ARRAY* mEtcOsReleaseOptions |
Definition at line 41 of file Autodetect.c.
STATIC CHAR16* mGlobalAutoOpts |
Definition at line 77 of file Autodetect.c.
STATIC CHAR16* mGlobalAutoOptsPlus |
Definition at line 81 of file Autodetect.c.
STATIC OC_FLEX_ARRAY* mInitrdFiles |
Definition at line 37 of file Autodetect.c.
STATIC OC_FLEX_ARRAY* mPerPartuuidAutoOpts |
Definition at line 65 of file Autodetect.c.
STATIC CHAR8* mPrettyName |
Definition at line 49 of file Autodetect.c.
STATIC OC_FLEX_ARRAY* mVmlinuzFiles |
Definition at line 33 of file Autodetect.c.