Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
btwise
OpenCorePKG_MOD
提交
8be51674
O
OpenCorePKG_MOD
项目概览
btwise
/
OpenCorePKG_MOD
通知
26
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
OpenCorePKG_MOD
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
8be51674
编写于
11月 07, 2020
作者:
V
vit9696
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
OcBootManagementLib: Implement RealPath and TextMode for custom entries
closes acidanthera/bugtracker#1081
上级
91306327
变更
22
隐藏空白更改
内联
并排
Showing
22 changed file
with
382 addition
and
107 deletion
+382
-107
Application/Bootstrap/Bootstrap.c
Application/Bootstrap/Bootstrap.c
+1
-1
Changelog.md
Changelog.md
+2
-0
Docs/Configuration.pdf
Docs/Configuration.pdf
+0
-0
Docs/Configuration.tex
Docs/Configuration.tex
+24
-1
Docs/Differences/Differences.pdf
Docs/Differences/Differences.pdf
+0
-0
Docs/Differences/Differences.tex
Docs/Differences/Differences.tex
+30
-2
Docs/Errata/Errata.pdf
Docs/Errata/Errata.pdf
+0
-0
Docs/Sample.plist
Docs/Sample.plist
+14
-0
Docs/SampleCustom.plist
Docs/SampleCustom.plist
+14
-0
Include/Acidanthera/Library/OcBootManagementLib.h
Include/Acidanthera/Library/OcBootManagementLib.h
+21
-4
Include/Acidanthera/Library/OcConfigurationLib.h
Include/Acidanthera/Library/OcConfigurationLib.h
+2
-0
Include/Acidanthera/Library/OcDevicePathLib.h
Include/Acidanthera/Library/OcDevicePathLib.h
+4
-2
Include/Acidanthera/Library/OcStorageLib.h
Include/Acidanthera/Library/OcStorageLib.h
+47
-9
Include/Acidanthera/OpenCore.h
Include/Acidanthera/OpenCore.h
+3
-3
Library/OcBootManagementLib/BootEntryManagement.c
Library/OcBootManagementLib/BootEntryManagement.c
+5
-1
Library/OcBootManagementLib/DefaultEntryChoice.c
Library/OcBootManagementLib/DefaultEntryChoice.c
+11
-11
Library/OcBootManagementLib/PolicyManagement.c
Library/OcBootManagementLib/PolicyManagement.c
+1
-1
Library/OcConfigurationLib/OcConfigurationLib.c
Library/OcConfigurationLib/OcConfigurationLib.c
+19
-1
Library/OcDevicePathLib/OcDevicePathLib.c
Library/OcDevicePathLib/OcDevicePathLib.c
+10
-1
Library/OcStorageLib/OcStorageLib.c
Library/OcStorageLib/OcStorageLib.c
+97
-14
Platform/OpenCore/OpenCore.c
Platform/OpenCore/OpenCore.c
+51
-19
Platform/OpenCore/OpenCoreMisc.c
Platform/OpenCore/OpenCoreMisc.c
+26
-37
未找到文件。
Application/Bootstrap/Bootstrap.c
浏览文件 @
8be51674
...
...
@@ -57,7 +57,7 @@ LoadOpenCore (
Buffer
=
NULL
;
BufferSize
=
0
;
LoaderPath
=
OcCopyDevicePathFullName
(
LoaderDevicePath
);
LoaderPath
=
OcCopyDevicePathFullName
(
LoaderDevicePath
,
NULL
);
*
ImagePath
=
NULL
;
...
...
Changelog.md
浏览文件 @
8be51674
...
...
@@ -6,6 +6,8 @@ OpenCore Changelog
-
Dropped HII services from OpenDuet improving size and performance
-
Fixed patching of injected kexts in mkext
-
Added support for launching from relative paths
-
Added direct path passing for tools via
`RealPath`
-
Allowed launching tools and entries in text mode via
`TextMode`
#### v0.6.3
-
Added support for xml comments in plist files
...
...
Docs/Configuration.pdf
浏览文件 @
8be51674
无法预览此类型文件
Docs/Configuration.tex
浏览文件 @
8be51674
...
...
@@ -3812,8 +3812,31 @@ rm vault.pub
Example:
\texttt
{
OpenShell.efi
}
.
\end
{
itemize
}
\end
{
enumerate
}
\item
\texttt
{
RealPath
}
\\
\textbf
{
Type
}
:
\texttt
{
plist
\
boolean
}
\\
\textbf
{
Failsafe
}
:
\texttt
{
plist
\
boolean
}
\\
\textbf
{
Description
}
: Pass full path to the tool when launching.
Passing tool directory may be unsafe for tool accidentally trying to access
files without checking their integrity and thus should generally be disabled.
Reason to enable this property may include cases where tools cannot work
without external files.
\emph
{
Note
}
: This property is only valid for
\texttt
{
Tools
}
. For
\texttt
{
Entries
}
this property cannot be specified and is always
\texttt
{
true
}
.
\item
\texttt
{
TextMode
}
\\
\textbf
{
Type
}
:
\texttt
{
plist
\
boolean
}
\\
\textbf
{
Failsafe
}
:
\texttt
{
plist
\
boolean
}
\\
\textbf
{
Description
}
: Run the entry in text mode instead of graphics mode.
This setting may be benefitial to some older tools that require text output.
By default all the tools are launched in graphics mode. Read more about text
modes in
\hyperref
[
uefioutputprops
]
{
Output Properties
}
section below.
\end
{
enumerate
}
\section
{
NVRAM
}
\label
{
nvram
}
...
...
Docs/Differences/Differences.pdf
浏览文件 @
8be51674
无法预览此类型文件
Docs/Differences/Differences.tex
浏览文件 @
8be51674
\documentclass
[]
{
article
}
%DIF LATEXDIFF DIFFERENCE FILE
%DIF DEL PreviousConfiguration.tex Wed Nov 4 05:07:23 2020
%DIF ADD ../Configuration.tex
Fri Nov 6 23:16:40
2020
%DIF ADD ../Configuration.tex
Sat Nov 7 04:03:21
2020
\usepackage
{
lmodern
}
\usepackage
{
amssymb,amsmath
}
...
...
@@ -3874,8 +3874,36 @@ rm vault.pub
Example:
\texttt
{
OpenShell.efi
}
.
\end
{
itemize
}
\end
{
enumerate
}
\DIFaddbegin
\item
\texttt
{
\DIFadd
{
RealPath
}}
\\
\textbf
{
\DIFadd
{
Type
}}
\DIFadd
{
:
}
\texttt
{
\DIFadd
{
plist
\
boolean
}}
\\
\textbf
{
\DIFadd
{
Failsafe
}}
\DIFadd
{
:
}
\texttt
{
\DIFadd
{
plist
\
boolean
}}
\\
\textbf
{
\DIFadd
{
Description
}}
\DIFadd
{
: Pass full path to the tool when launching.
}
\DIFadd
{
Passing tool directory may be unsafe for tool accidentally trying to access
files without checking their integrity and thus should generally be disabled.
Reason to enable this property may include cases where tools cannot work
without external files.
}
\emph
{
\DIFadd
{
Note
}}
\DIFadd
{
: This property is only valid for
}
\texttt
{
\DIFadd
{
Tools
}}
\DIFadd
{
. For
}
\texttt
{
\DIFadd
{
Entries
}}
\DIFadd
{
this property cannot be specified and is always
}
\texttt
{
\DIFadd
{
true
}}
\DIFadd
{
.
}
\item
\texttt
{
\DIFadd
{
TextMode
}}
\\
\textbf
{
\DIFadd
{
Type
}}
\DIFadd
{
:
}
\texttt
{
\DIFadd
{
plist
\
boolean
}}
\\
\textbf
{
\DIFadd
{
Failsafe
}}
\DIFadd
{
:
}
\texttt
{
\DIFadd
{
plist
\
boolean
}}
\\
\textbf
{
\DIFadd
{
Description
}}
\DIFadd
{
: Run the entry in text mode instead of graphics mode.
}
\DIFadd
{
This setting may be benefitial to some older tools that require text output.
By default all the tools are launched in graphics mode. Read more about text
modes in
}
\hyperref
[
uefioutputprops
]
{
Output Properties
}
\DIFadd
{
section below.
}
\DIFaddend
\end
{
enumerate
}
\section
{
NVRAM
}
\label
{
nvram
}
...
...
Docs/Errata/Errata.pdf
浏览文件 @
8be51674
无法预览此类型文件
Docs/Sample.plist
浏览文件 @
8be51674
...
...
@@ -768,6 +768,8 @@
<string>
CustomOS
</string>
<key>
Path
</key>
<string>
PciRoot(0x0)/Pci(0x1,0x1)/Pci(0x0,0x0)/NVMe(0x1,11-22-33-44-55-66-77-88)/HD(1,GPT,00000000-0000-0000-0000-000000000000,0x800,0x64000)/\EFI\BOOT\BOOTX64.EFI
</string>
<key>
TextMode
</key>
<false/>
</dict>
</array>
<key>
Security
</key>
...
...
@@ -818,6 +820,10 @@
<string>
UEFI Shell
</string>
<key>
Path
</key>
<string>
OpenShell.efi
</string>
<key>
RealPath
</key>
<false/>
<key>
TextMode
</key>
<false/>
</dict>
<dict>
<key>
Arguments
</key>
...
...
@@ -832,6 +838,10 @@
<string>
memcheck
</string>
<key>
Path
</key>
<string>
memcheck/memcheck.efi
</string>
<key>
RealPath
</key>
<false/>
<key>
TextMode
</key>
<false/>
</dict>
<dict>
<key>
Arguments
</key>
...
...
@@ -846,6 +856,10 @@
<string>
Shutdown
</string>
<key>
Path
</key>
<string>
ResetSystem.efi
</string>
<key>
RealPath
</key>
<false/>
<key>
TextMode
</key>
<false/>
</dict>
</array>
</dict>
...
...
Docs/SampleCustom.plist
浏览文件 @
8be51674
...
...
@@ -768,6 +768,8 @@
<string>
CustomOS
</string>
<key>
Path
</key>
<string>
PciRoot(0x0)/Pci(0x1,0x1)/Pci(0x0,0x0)/NVMe(0x1,11-22-33-44-55-66-77-88)/HD(1,GPT,00000000-0000-0000-0000-000000000000,0x800,0x64000)/\EFI\BOOT\BOOTX64.EFI
</string>
<key>
TextMode
</key>
<false/>
</dict>
</array>
<key>
Security
</key>
...
...
@@ -818,6 +820,10 @@
<string>
UEFI Shell
</string>
<key>
Path
</key>
<string>
OpenShell.efi
</string>
<key>
RealPath
</key>
<false/>
<key>
TextMode
</key>
<false/>
</dict>
<dict>
<key>
Arguments
</key>
...
...
@@ -832,6 +838,10 @@
<string>
memcheck
</string>
<key>
Path
</key>
<string>
memcheck/memcheck.efi
</string>
<key>
RealPath
</key>
<false/>
<key>
TextMode
</key>
<false/>
</dict>
<dict>
<key>
Arguments
</key>
...
...
@@ -846,6 +856,10 @@
<string>
Shutdown
</string>
<key>
Path
</key>
<string>
ResetSystem.efi
</string>
<key>
RealPath
</key>
<false/>
<key>
TextMode
</key>
<false/>
</dict>
</array>
</dict>
...
...
Include/Acidanthera/Library/OcBootManagementLib.h
浏览文件 @
8be51674
...
...
@@ -199,6 +199,14 @@ typedef struct OC_BOOT_ENTRY_ {
//
BOOLEAN
SetDefault
;
//
// Should launch this entry in text mode.
//
BOOLEAN
LaunchInText
;
//
// Should expose real device path when dealing with custom entries.
//
BOOLEAN
ExposeDevicePath
;
//
// Load option data (usually "boot args") size.
//
UINT32
LoadOptionsSize
;
...
...
@@ -403,7 +411,8 @@ EFI_STATUS
IN
OC_BOOT_ENTRY
*
ChosenEntry
,
IN
EFI_HANDLE
ImageHandle
,
OUT
UINTN
*
ExitDataSize
,
OUT
CHAR16
**
ExitData
OPTIONAL
OUT
CHAR16
**
ExitData
OPTIONAL
,
IN
BOOLEAN
LaunchInText
);
/**
...
...
@@ -417,9 +426,9 @@ EFI_STATUS
IN
OC_BOOT_ENTRY
*
ChosenEntry
,
OUT
VOID
**
Data
,
OUT
UINT32
*
DataSize
,
OUT
EFI_DEVICE_PATH_PROTOCOL
**
DevicePath
OPTIONAL
,
OUT
EFI_HANDLE
*
ParentDeviceHandle
OPTIONAL
,
OUT
EFI_DEVICE_PATH_PROTOCOL
**
ParentFilePath
OPTIONAL
OUT
EFI_DEVICE_PATH_PROTOCOL
**
DevicePath
,
OUT
EFI_HANDLE
*
StorageHandle
,
OUT
EFI_DEVICE_PATH_PROTOCOL
**
StoragePath
);
/**
...
...
@@ -462,6 +471,14 @@ typedef struct {
// Whether this entry is a tool.
//
BOOLEAN
Tool
;
//
// Whether it should be started in text mode.
//
BOOLEAN
TextMode
;
//
// Whether we should pass the actual device path (if possible).
//
BOOLEAN
RealPath
;
}
OC_PICKER_ENTRY
;
/**
...
...
Include/Acidanthera/Library/OcConfigurationLib.h
浏览文件 @
8be51674
...
...
@@ -358,6 +358,8 @@ typedef enum {
_(OC_STRING , Comment , , OC_STRING_CONSTR ("", _, __), OC_DESTR (OC_STRING) ) \
_(BOOLEAN , Auxiliary , , FALSE , () ) \
_(BOOLEAN , Enabled , , FALSE , () ) \
_(BOOLEAN , RealPath , , FALSE , () ) \
_(BOOLEAN , TextMode , , FALSE , () ) \
_(OC_STRING , Name , , OC_STRING_CONSTR ("", _, __), OC_DESTR (OC_STRING) ) \
_(OC_STRING , Path , , OC_STRING_CONSTR ("", _, __), OC_DESTR (OC_STRING) )
OC_DECLARE
(
OC_MISC_TOOLS_ENTRY
)
...
...
Include/Acidanthera/Library/OcDevicePathLib.h
浏览文件 @
8be51674
...
...
@@ -189,14 +189,16 @@ OcFileDevicePathFullName (
/**
Retrieves full file path from device path allocating it on pool.
@param[in] DevicePath Device path to extract file path from.
@param[in] DevicePath Device path to extract file path from.
@param[out] FileDevicePath Pointer to file path part of the device path, optional.
@returns Path allocated from pool.
@retval NULL when missing.
**/
CHAR16
*
OcCopyDevicePathFullName
(
IN
EFI_DEVICE_PATH_PROTOCOL
*
DevicePath
IN
EFI_DEVICE_PATH_PROTOCOL
*
DevicePath
,
OUT
EFI_DEVICE_PATH_PROTOCOL
**
FileDevicePath
OPTIONAL
);
/**
...
...
Include/Acidanthera/Library/OcStorageLib.h
浏览文件 @
8be51674
...
...
@@ -65,13 +65,25 @@ typedef struct {
///
EFI_SIMPLE_FILE_SYSTEM_PROTOCOL
*
FileSystem
;
///
///
Storage root owned by context
.
///
Real storage handle for loading
.
///
EFI_FILE_PROTOCOL
*
StorageRoot
;
EFI_HANDLE
StorageHandle
;
///
/// Real file path for file storage, can be missing.
///
EFI_DEVICE_PATH_PROTOCOL
*
StoragePath
;
///
/// Path to the root of file storage on StoragePage.
///
CONST
CHAR16
*
StorageRoot
;
///
/// Storage file instance owned by context.
///
EFI_FILE_PROTOCOL
*
Storage
;
///
/// Device handle with storage (dummy) device path for loading.
///
EFI_HANDLE
StorageHandle
;
EFI_HANDLE
Dummy
StorageHandle
;
///
/// Dummy file path for file storage.
///
...
...
@@ -93,10 +105,12 @@ typedef struct {
/**
Create storage context from UEFI file system at specified path.
@param[out] Context Resulting storage context.
@param[in] FileSystem Storage file system.
@param[in] Path Storage file system path (e.g. L"\\").
@param[in] StorageKey Storage signature verification key, optional.
@param[out] Context Resulting storage context.
@param[in] FileSystem Storage file system.
@param[in] StorageHandle Storage handle, optional.
@param[in] StoragePath Actual storage device path, optional.
@param[in] StorageRoot Storage file system root (e.g. L"\\").
@param[in] StorageKey Storage signature verification key, optional.
@retval EFI_SUCCESS on success.
**/
...
...
@@ -104,8 +118,10 @@ EFI_STATUS
OcStorageInitFromFs
(
OUT
OC_STORAGE_CONTEXT
*
Context
,
IN
EFI_SIMPLE_FILE_SYSTEM_PROTOCOL
*
FileSystem
,
IN
CONST
CHAR16
*
Path
,
IN
OC_RSA_PUBLIC_KEY
*
StorageKey
OPTIONAL
IN
EFI_HANDLE
StorageHandle
OPTIONAL
,
IN
EFI_DEVICE_PATH_PROTOCOL
*
StoragePath
OPTIONAL
,
IN
CONST
CHAR16
*
StorageRoot
,
IN
OC_RSA_PUBLIC_KEY
*
StorageKey
OPTIONAL
);
/**
...
...
@@ -152,4 +168,26 @@ OcStorageReadFileUnicode (
OUT
UINT32
*
FileSize
OPTIONAL
);
/**
Get information about the storage file when possible.
@param[in] Context Storage context.
@param[in] FilePath The full path to the file on the device.
@param[out] DevicePath Full storage file device path.
@param[out] StorageHandle Storage handle.
@param[out] StoragePath Path on the storage.
@param[in] RealPath Provide real paths instead of dummy.
@retval EFI_SUCCESS on success.
**/
EFI_STATUS
OcStorageGetInfo
(
IN
OC_STORAGE_CONTEXT
*
Context
,
IN
CONST
CHAR16
*
FilePath
,
OUT
EFI_DEVICE_PATH_PROTOCOL
**
DevicePath
,
OUT
EFI_HANDLE
*
StorageHandle
,
OUT
EFI_DEVICE_PATH_PROTOCOL
**
StoragePath
,
IN
BOOLEAN
RealPath
);
#endif // OC_STORAGE_LIB_H
Include/Acidanthera/OpenCore.h
浏览文件 @
8be51674
...
...
@@ -282,17 +282,17 @@ OcMiscEarlyInit (
@param[in] Config OpenCore configuration.
@param[in] RootPath Root load path.
@param[in] LoadPath OpenCore loading path.
@param[
out]
LoadHandle OpenCore loading handle.
@param[
in]
LoadHandle OpenCore loading handle.
@retval EFI_SUCCESS on success, informational.
**/
EFI_STATUS
VOID
OcMiscMiddleInit
(
IN
OC_STORAGE_CONTEXT
*
Storage
,
IN
OC_GLOBAL_CONFIG
*
Config
,
IN
CONST
CHAR16
*
RootPath
OPTIONAL
,
IN
EFI_DEVICE_PATH_PROTOCOL
*
LoadPath
OPTIONAL
,
OUT
EFI_HANDLE
*
LoadHandle
IN
EFI_HANDLE
LoadHandle
OPTIONAL
);
/**
...
...
Library/OcBootManagementLib/BootEntryManagement.c
浏览文件 @
8be51674
...
...
@@ -29,6 +29,7 @@
#include <Library/MemoryAllocationLib.h>
#include <Library/OcBootManagementLib.h>
#include <Library/OcDevicePathLib.h>
#include <Library/OcConsoleLib.h>
#include <Library/OcFileLib.h>
#include <Library/OcStringLib.h>
#include <Library/UefiBootServicesTableLib.h>
...
...
@@ -595,6 +596,9 @@ AddBootEntryFromCustomEntry (
}
}
BootEntry
->
LaunchInText
=
CustomEntry
->
TextMode
;
BootEntry
->
ExposeDevicePath
=
CustomEntry
->
RealPath
;
BootEntry
->
LoadOptionsSize
=
(
UINT32
)
AsciiStrLen
(
CustomEntry
->
Arguments
);
if
(
BootEntry
->
LoadOptionsSize
>
0
)
{
BootEntry
->
LoadOptions
=
AllocateCopyPool
(
...
...
@@ -1924,7 +1928,7 @@ OcLoadBootEntry (
&
DmgLoadContext
);
if
(
!
EFI_ERROR
(
Status
))
{
Status
=
Context
->
StartImage
(
BootEntry
,
EntryHandle
,
NULL
,
NULL
);
Status
=
Context
->
StartImage
(
BootEntry
,
EntryHandle
,
NULL
,
NULL
,
BootEntry
->
LaunchInText
);
if
(
EFI_ERROR
(
Status
))
{
DEBUG
((
DEBUG_WARN
,
"OCB: StartImage failed - %r
\n
"
,
Status
));
//
...
...
Library/OcBootManagementLib/DefaultEntryChoice.c
浏览文件 @
8be51674
...
...
@@ -1082,8 +1082,8 @@ InternalLoadBootEntry (
EFI_STATUS
Status
;
EFI_STATUS
OptionalStatus
;
EFI_DEVICE_PATH_PROTOCOL
*
DevicePath
;
EFI_HANDLE
ParentDevic
eHandle
;
EFI_DEVICE_PATH_PROTOCOL
*
ParentFil
ePath
;
EFI_HANDLE
Storag
eHandle
;
EFI_DEVICE_PATH_PROTOCOL
*
Storag
ePath
;
CHAR16
*
UnicodeDevicePath
;
EFI_LOADED_IMAGE_PROTOCOL
*
LoadedImage
;
VOID
*
EntryData
;
...
...
@@ -1104,10 +1104,10 @@ InternalLoadBootEntry (
ZeroMem
(
DmgLoadContext
,
sizeof
(
*
DmgLoadContext
));
EntryData
=
NULL
;
EntryDataSize
=
0
;
ParentDevic
eHandle
=
NULL
;
ParentFilePath
=
NULL
;
EntryData
=
NULL
;
EntryDataSize
=
0
;
Storag
eHandle
=
NULL
;
StoragePath
=
NULL
;
if
(
BootEntry
->
IsFolder
)
{
if
(
Context
->
DmgLoading
==
OcDmgLoadingDisabled
)
{
...
...
@@ -1128,8 +1128,8 @@ InternalLoadBootEntry (
&
EntryData
,
&
EntryDataSize
,
&
DevicePath
,
&
ParentDevic
eHandle
,
&
ParentFil
ePath
&
Storag
eHandle
,
&
Storag
ePath
);
if
(
EFI_ERROR
(
Status
))
{
...
...
@@ -1215,12 +1215,12 @@ InternalLoadBootEntry (
// fields to our custom device path, so we fix it up here.
// REF: https://github.com/acidanthera/bugtracker/issues/712
//
if
(
LoadedImage
->
DeviceHandle
==
NULL
&&
ParentDevic
eHandle
!=
NULL
)
{
if
(
LoadedImage
->
DeviceHandle
==
NULL
&&
Storag
eHandle
!=
NULL
)
{
if
(
LoadedImage
->
FilePath
!=
NULL
)
{
FreePool
(
LoadedImage
->
FilePath
);
}
LoadedImage
->
DeviceHandle
=
ParentDevic
eHandle
;
LoadedImage
->
FilePath
=
DuplicateDevicePath
(
ParentFilePath
)
;
LoadedImage
->
DeviceHandle
=
Storag
eHandle
;
LoadedImage
->
FilePath
=
StoragePath
;
}
}
}
...
...
Library/OcBootManagementLib/PolicyManagement.c
浏览文件 @
8be51674
...
...
@@ -296,7 +296,7 @@ OcGetBootDevicePathType (
*
IsFolder
=
FALSE
;
}
Path
=
OcCopyDevicePathFullName
(
DevicePath
);
Path
=
OcCopyDevicePathFullName
(
DevicePath
,
NULL
);
if
(
Path
==
NULL
)
{
return
OC_BOOT_UNKNOWN
;
}
...
...
Library/OcConfigurationLib/OcConfigurationLib.c
浏览文件 @
8be51674
...
...
@@ -413,6 +413,22 @@ mMiscConfigurationSecuritySchema[] = {
OC_SCHEMA_STRING_IN
(
"Vault"
,
OC_GLOBAL_CONFIG
,
Misc
.
Security
.
Vault
),
};
STATIC
OC_SCHEMA
mMiscEntriesSchemaEntry
[]
=
{
OC_SCHEMA_STRING_IN
(
"Arguments"
,
OC_MISC_TOOLS_ENTRY
,
Arguments
),
OC_SCHEMA_BOOLEAN_IN
(
"Auxiliary"
,
OC_MISC_TOOLS_ENTRY
,
Auxiliary
),
OC_SCHEMA_STRING_IN
(
"Comment"
,
OC_MISC_TOOLS_ENTRY
,
Comment
),
OC_SCHEMA_BOOLEAN_IN
(
"Enabled"
,
OC_MISC_TOOLS_ENTRY
,
Enabled
),
OC_SCHEMA_STRING_IN
(
"Name"
,
OC_MISC_TOOLS_ENTRY
,
Name
),
OC_SCHEMA_STRING_IN
(
"Path"
,
OC_MISC_TOOLS_ENTRY
,
Path
),
OC_SCHEMA_BOOLEAN_IN
(
"TextMode"
,
OC_MISC_TOOLS_ENTRY
,
TextMode
),
};
STATIC
OC_SCHEMA
mMiscEntriesSchema
=
OC_SCHEMA_DICT
(
NULL
,
mMiscEntriesSchemaEntry
);
STATIC
OC_SCHEMA
mMiscToolsSchemaEntry
[]
=
{
...
...
@@ -422,6 +438,8 @@ mMiscToolsSchemaEntry[] = {
OC_SCHEMA_BOOLEAN_IN
(
"Enabled"
,
OC_MISC_TOOLS_ENTRY
,
Enabled
),
OC_SCHEMA_STRING_IN
(
"Name"
,
OC_MISC_TOOLS_ENTRY
,
Name
),
OC_SCHEMA_STRING_IN
(
"Path"
,
OC_MISC_TOOLS_ENTRY
,
Path
),
OC_SCHEMA_BOOLEAN_IN
(
"RealPath"
,
OC_MISC_TOOLS_ENTRY
,
RealPath
),
OC_SCHEMA_BOOLEAN_IN
(
"TextMode"
,
OC_MISC_TOOLS_ENTRY
,
TextMode
),
};
STATIC
...
...
@@ -434,7 +452,7 @@ mMiscConfigurationSchema[] = {
OC_SCHEMA_ARRAY_IN
(
"BlessOverride"
,
OC_GLOBAL_CONFIG
,
Misc
.
BlessOverride
,
&
mMiscBlessOverrideSchema
),
OC_SCHEMA_DICT
(
"Boot"
,
mMiscConfigurationBootSchema
),
OC_SCHEMA_DICT
(
"Debug"
,
mMiscConfigurationDebugSchema
),
OC_SCHEMA_ARRAY_IN
(
"Entries"
,
OC_GLOBAL_CONFIG
,
Misc
.
Entries
,
&
mMisc
Tool
sSchema
),
OC_SCHEMA_ARRAY_IN
(
"Entries"
,
OC_GLOBAL_CONFIG
,
Misc
.
Entries
,
&
mMisc
Entrie
sSchema
),
OC_SCHEMA_DICT
(
"Security"
,
mMiscConfigurationSecuritySchema
),
OC_SCHEMA_ARRAY_IN
(
"Tools"
,
OC_GLOBAL_CONFIG
,
Misc
.
Tools
,
&
mMiscToolsSchema
),
};
...
...
Library/OcDevicePathLib/OcDevicePathLib.c
浏览文件 @
8be51674
...
...
@@ -1119,7 +1119,8 @@ OcFileDevicePathFullName (
CHAR16
*
OcCopyDevicePathFullName
(
IN
EFI_DEVICE_PATH_PROTOCOL
*
DevicePath
IN
EFI_DEVICE_PATH_PROTOCOL
*
DevicePath
,
OUT
EFI_DEVICE_PATH_PROTOCOL
**
FileDevicePath
OPTIONAL
)
{
CHAR16
*
Path
;
...
...
@@ -1128,9 +1129,17 @@ OcCopyDevicePathFullName (
Path
=
NULL
;
if
(
FileDevicePath
!=
NULL
)
{
*
FileDevicePath
=
NULL
;
}
for
(
CurrNode
=
DevicePath
;
!
IsDevicePathEnd
(
CurrNode
);
CurrNode
=
NextDevicePathNode
(
CurrNode
))
{
if
((
DevicePathType
(
CurrNode
)
==
MEDIA_DEVICE_PATH
)
&&
(
DevicePathSubType
(
CurrNode
)
==
MEDIA_FILEPATH_DP
))
{
if
(
FileDevicePath
!=
NULL
)
{
*
FileDevicePath
=
CurrNode
;
}
//
// Perform copying of all the underlying nodes due to potential unaligned access.
//
...
...
Library/OcStorageLib/OcStorageLib.c
浏览文件 @
8be51674
...
...
@@ -21,6 +21,7 @@
#include <Library/DebugLib.h>
#include <Library/DevicePathLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/OcDevicePathLib.h>
#include <Library/OcStringLib.h>
#include <Library/OcStorageLib.h>
#include <Library/UefiBootServicesTableLib.h>
...
...
@@ -215,8 +216,10 @@ EFI_STATUS
OcStorageInitFromFs
(
OUT
OC_STORAGE_CONTEXT
*
Context
,
IN
EFI_SIMPLE_FILE_SYSTEM_PROTOCOL
*
FileSystem
,
IN
CONST
CHAR16
*
Path
,
IN
OC_RSA_PUBLIC_KEY
*
StorageKey
OPTIONAL
IN
EFI_HANDLE
StorageHandle
OPTIONAL
,
IN
EFI_DEVICE_PATH_PROTOCOL
*
StoragePath
OPTIONAL
,
IN
CONST
CHAR16
*
StorageRoot
,
IN
OC_RSA_PUBLIC_KEY
*
StorageKey
OPTIONAL
)
{
EFI_STATUS
Status
;
...
...
@@ -228,7 +231,7 @@ OcStorageInitFromFs (
ASSERT
(
Context
!=
NULL
);
ASSERT
(
FileSystem
!=
NULL
);
ASSERT
(
Path
!=
NULL
);
ASSERT
(
StorageRoot
!=
NULL
);
ZeroMem
(
Context
,
sizeof
(
*
Context
));
...
...
@@ -242,8 +245,8 @@ OcStorageInitFromFs (
Status
=
SafeFileOpen
(
RootVolume
,
&
Context
->
Storage
Root
,
(
CHAR16
*
)
Path
,
&
Context
->
Storage
,
(
CHAR16
*
)
StorageRoot
,
EFI_FILE_MODE_READ
,
0
);
...
...
@@ -251,7 +254,7 @@ OcStorageInitFromFs (
RootVolume
->
Close
(
RootVolume
);
if
(
EFI_ERROR
(
Status
))
{
DEBUG
((
DEBUG_INFO
,
"OCST: Directory %s cannot be opened - %r
\n
"
,
Path
,
Status
));
DEBUG
((
DEBUG_INFO
,
"OCST: Directory %s cannot be opened - %r
\n
"
,
StorageRoot
,
Status
));
return
Status
;
}
...
...
@@ -287,11 +290,14 @@ OcStorageInitFromFs (
}
gBS
->
InstallProtocolInterface
(
&
Context
->
StorageHandle
,
&
Context
->
Dummy
StorageHandle
,
&
gEfiDevicePathProtocolGuid
,
EFI_NATIVE_INTERFACE
,
&
mDummyBootDevicePath
);
Context
->
StorageHandle
=
StorageHandle
;
Context
->
StoragePath
=
StoragePath
;
Context
->
StorageRoot
=
StorageRoot
;
Context
->
DummyDevicePath
=
&
mDummyBootDeviceFilePath
.
Vendor
.
Header
;
Context
->
DummyFilePath
=
&
mDummyBootDeviceFilePath
.
VendorFile
.
Header
;
...
...
@@ -311,9 +317,9 @@ OcStorageFree (
IN
OUT
OC_STORAGE_CONTEXT
*
Context
)
{
if
(
Context
->
Storage
Root
!=
NULL
)
{
Context
->
Storage
Root
->
Close
(
Context
->
StorageRoot
);
Context
->
Storage
Root
=
NULL
;
if
(
Context
->
Storage
!=
NULL
)
{
Context
->
Storage
->
Close
(
Context
->
Storage
);
Context
->
Storage
=
NULL
;
}
if
(
Context
->
HasVault
)
{
...
...
@@ -345,12 +351,12 @@ OcStorageExistsFileUnicode (
return
TRUE
;
}
if
(
Context
->
Storage
Root
==
NULL
)
{
if
(
Context
->
Storage
==
NULL
)
{
return
FALSE
;
}
Status
=
SafeFileOpen
(
Context
->
Storage
Root
,
Context
->
Storage
,
&
File
,
(
CHAR16
*
)
FilePath
,
EFI_FILE_MODE_READ
,
...
...
@@ -393,7 +399,7 @@ OcStorageReadFileUnicode (
return
NULL
;
}
if
(
Context
->
Storage
Root
==
NULL
)
{
if
(
Context
->
Storage
==
NULL
)
{
//
// TODO: expand support for other contexts.
//
...
...
@@ -401,7 +407,7 @@ OcStorageReadFileUnicode (
}
Status
=
SafeFileOpen
(
Context
->
Storage
Root
,
Context
->
Storage
,
&
File
,
(
CHAR16
*
)
FilePath
,
EFI_FILE_MODE_READ
,
...
...
@@ -449,3 +455,80 @@ OcStorageReadFileUnicode (
return
FileBuffer
;
}
EFI_STATUS
OcStorageGetInfo
(
IN
OC_STORAGE_CONTEXT
*
Context
,
IN
CONST
CHAR16
*
FilePath
,
OUT
EFI_DEVICE_PATH_PROTOCOL
**
DevicePath
OPTIONAL
,
OUT
EFI_HANDLE
*
StorageHandle
OPTIONAL
,
OUT
EFI_DEVICE_PATH_PROTOCOL
**
StoragePath
OPTIONAL
,
IN
BOOLEAN
RealPath
)
{
CHAR16
*
FullPath
;
UINTN
RootLength
;
UINTN
FileSize
;
if
(
RealPath
&&
Context
->
StorageHandle
!=
NULL
&&
Context
->
StorageRoot
!=
NULL
&&
Context
->
StoragePath
!=
NULL
)
{
//
// Set the storage handle right away.
//
*
StorageHandle
=
Context
->
StorageHandle
;
//
// Prepare file path.
//
RootLength
=
StrLen
(
Context
->
StorageRoot
);
FileSize
=
StrSize
(
FilePath
);
FullPath
=
AllocatePool
(
RootLength
*
sizeof
(
CHAR16
)
+
sizeof
(
CHAR16
)
+
FileSize
);
if
(
FullPath
==
NULL
)
{
return
EFI_OUT_OF_RESOURCES
;
}
CopyMem
(
&
FullPath
[
0
],
Context
->
StorageRoot
,
RootLength
*
sizeof
(
CHAR16
));
FullPath
[
RootLength
]
=
'\\'
;
CopyMem
(
&
FullPath
[
RootLength
+
1
],
FilePath
,
FileSize
);
//
// Set joint device path.
//
*
DevicePath
=
AppendFileNameDevicePath
(
Context
->
StoragePath
,
FullPath
);
if
(
*
DevicePath
==
NULL
)
{
FreePool
(
FullPath
);
return
EFI_OUT_OF_RESOURCES
;
}
//
// Set onstorage path.
//
*
StoragePath
=
FileDevicePath
(
NULL
,
FullPath
);
if
(
*
StoragePath
==
NULL
)
{
FreePool
(
*
DevicePath
);
FreePool
(
FullPath
);
return
EFI_OUT_OF_RESOURCES
;
}
return
EFI_SUCCESS
;
}
*
StorageHandle
=
Context
->
DummyStorageHandle
;
*
DevicePath
=
DuplicateDevicePath
(
Context
->
DummyDevicePath
);
if
(
*
DevicePath
==
NULL
)
{
return
EFI_OUT_OF_RESOURCES
;
}
*
StoragePath
=
DuplicateDevicePath
(
Context
->
DummyFilePath
);
if
(
*
StoragePath
==
NULL
)
{
FreePool
(
*
DevicePath
);
return
EFI_OUT_OF_RESOURCES
;
}
return
EFI_SUCCESS
;
}
Platform/OpenCore/OpenCore.c
浏览文件 @
8be51674
...
...
@@ -62,11 +62,15 @@ mOpenCorePrivilege;
STATIC
EFI_HANDLE
mLoadHandle
;
mStorageHandle
;
STATIC
EFI_DEVICE_PATH_PROTOCOL
*
mStoragePath
;
STATIC
CHAR16
*
m
RootPath
;
m
StorageRoot
;
STATIC
EFI_STATUS
...
...
@@ -75,13 +79,16 @@ OcStartImage (
IN
OC_BOOT_ENTRY
*
Chosen
,
IN
EFI_HANDLE
ImageHandle
,
OUT
UINTN
*
ExitDataSize
,
OUT
CHAR16
**
ExitData
OPTIONAL
OUT
CHAR16
**
ExitData
OPTIONAL
,
IN
BOOLEAN
LaunchInText
)
{
EFI_STATUS
Status
;
EFI_CONSOLE_CONTROL_SCREEN_MODE
OldMode
;
OldMode
=
OcConsoleControlSetMode
(
EfiConsoleControlScreenGraphics
);
OldMode
=
OcConsoleControlSetMode
(
LaunchInText
?
EfiConsoleControlScreenText
:
EfiConsoleControlScreenGraphics
);
Status
=
gBS
->
StartImage
(
ImageHandle
,
...
...
@@ -124,7 +131,7 @@ OcMain (
DEBUG
((
DEBUG_INFO
,
"OC: OcLoadNvramSupport...
\n
"
));
OcLoadNvramSupport
(
Storage
,
&
mOpenCoreConfiguration
);
DEBUG
((
DEBUG_INFO
,
"OC: OcMiscMiddleInit...
\n
"
));
OcMiscMiddleInit
(
Storage
,
&
mOpenCoreConfiguration
,
m
RootPath
,
LoadPath
,
&
mLoad
Handle
);
OcMiscMiddleInit
(
Storage
,
&
mOpenCoreConfiguration
,
m
StorageRoot
,
LoadPath
,
mStorage
Handle
);
DEBUG
((
DEBUG_INFO
,
"OC: OcLoadUefiSupport...
\n
"
));
OcLoadUefiSupport
(
Storage
,
&
mOpenCoreConfiguration
,
&
mOpenCoreCpuInfo
);
DEBUG
((
DEBUG_INFO
,
"OC: OcLoadAcpiSupport...
\n
"
));
...
...
@@ -157,7 +164,7 @@ OcMain (
Privilege
,
OcStartImage
,
mOpenCoreConfiguration
.
Uefi
.
Quirks
.
RequestBootVarRouting
,
m
Load
Handle
m
Storage
Handle
);
}
...
...
@@ -170,7 +177,9 @@ OcBootstrapRerun (
IN
EFI_DEVICE_PATH_PROTOCOL
*
LoadPath
OPTIONAL
)
{
EFI_STATUS
Status
;
EFI_STATUS
Status
;
EFI_DEVICE_PATH_PROTOCOL
*
RemainingPath
;
UINTN
StoragePathSize
;
DEBUG
((
DEBUG_INFO
,
"OC: ReRun executed!
\n
"
));
...
...
@@ -183,36 +192,59 @@ OcBootstrapRerun (
// Calculate root path (never freed).
//
if
(
LoadPath
!=
NULL
)
{
ASSERT
(
m
RootPath
==
NULL
);
m
RootPath
=
OcCopyDevicePathFullName
(
Load
Path
);
ASSERT
(
m
StorageRoot
==
NULL
);
m
StorageRoot
=
OcCopyDevicePathFullName
(
LoadPath
,
&
Remaining
Path
);
//
// Skipping this or later failing to call UnicodeGetParentDirectory means
// we got valid path to the root of the partition. This happens when
// OpenCore.efi was loaded from e.g. firmware and then bootstrapped
// on a different partition.
//
if
(
m
RootPath
!=
NULL
)
{
if
(
UnicodeGetParentDirectory
(
m
RootPath
))
{
if
(
m
StorageRoot
!=
NULL
)
{
if
(
UnicodeGetParentDirectory
(
m
StorageRoot
))
{
//
// This means we got valid path to ourselves.
//
DEBUG
((
DEBUG_INFO
,
"OC: Got launch root path %s
\n
"
,
m
RootPath
));
DEBUG
((
DEBUG_INFO
,
"OC: Got launch root path %s
\n
"
,
m
StorageRoot
));
}
else
{
FreePool
(
m
RootPath
);
m
RootPath
=
NULL
;
FreePool
(
m
StorageRoot
);
m
StorageRoot
=
NULL
;
}
}
}
if
(
mRootPath
==
NULL
)
{
mRootPath
=
OPEN_CORE_ROOT_PATH
;
DEBUG
((
DEBUG_INFO
,
"OC: Got default root path %s
\n
"
,
mRootPath
));
if
(
mStorageRoot
==
NULL
)
{
mStorageRoot
=
OPEN_CORE_ROOT_PATH
;
RemainingPath
=
NULL
;
DEBUG
((
DEBUG_INFO
,
"OC: Got default root path %s
\n
"
,
mStorageRoot
));
}
//
// Calculate storage path.
//
if
(
RemainingPath
!=
NULL
)
{
StoragePathSize
=
(
UINTN
)
RemainingPath
-
(
UINTN
)
LoadPath
;
mStoragePath
=
AllocatePool
(
StoragePathSize
+
END_DEVICE_PATH_LENGTH
);
if
(
mStoragePath
!=
NULL
)
{
CopyMem
(
mStoragePath
,
LoadPath
,
StoragePathSize
);
SetDevicePathEndNode
((
UINT8
*
)
mStoragePath
+
StoragePathSize
);
}
}
else
{
mStoragePath
=
NULL
;
}
gBS
->
LocateDevicePath
(
&
gEfiSimpleFileSystemProtocolGuid
,
&
LoadPath
,
&
mStorageHandle
);
Status
=
OcStorageInitFromFs
(
&
mOpenCoreStorage
,
FileSystem
,
mRootPath
,
mStorageHandle
,
mStoragePath
,
mStorageRoot
,
mOpenCoreVaultKey
);
...
...
@@ -242,7 +274,7 @@ OcGetLoadHandle (
IN
OC_BOOTSTRAP_PROTOCOL
*
This
)
{
return
m
Load
Handle
;
return
m
Storage
Handle
;
}
STATIC
...
...
Platform/OpenCore/OpenCoreMisc.c
浏览文件 @
8be51674
...
...
@@ -170,9 +170,9 @@ OcToolLoadEntry (
IN
OC_BOOT_ENTRY
*
ChosenEntry
,
OUT
VOID
**
Data
,
OUT
UINT32
*
DataSize
,
OUT
EFI_DEVICE_PATH_PROTOCOL
**
DevicePath
OPTIONAL
,
OUT
EFI_HANDLE
*
ParentDeviceHandle
OPTIONAL
,
OUT
EFI_DEVICE_PATH_PROTOCOL
**
ParentFilePath
OPTIONAL
OUT
EFI_DEVICE_PATH_PROTOCOL
**
DevicePath
,
OUT
EFI_HANDLE
*
StorageHandle
,
OUT
EFI_DEVICE_PATH_PROTOCOL
**
StoragePath
)
{
EFI_STATUS
Status
;
...
...
@@ -211,16 +211,18 @@ OcToolLoadEntry (
return
EFI_NOT_FOUND
;
}
if
(
DevicePath
!=
NULL
)
{
*
DevicePath
=
Storage
->
DummyDevicePath
;
}
if
(
ParentDeviceHandle
!=
NULL
)
{
*
ParentDeviceHandle
=
Storage
->
StorageHandle
;
}
if
(
ParentFilePath
!=
NULL
)
{
*
ParentFilePath
=
Storage
->
DummyFilePath
;
Status
=
OcStorageGetInfo
(
Storage
,
ToolPath
,
DevicePath
,
StorageHandle
,
StoragePath
,
ChosenEntry
->
ExposeDevicePath
);
if
(
!
EFI_ERROR
(
Status
))
{
DEBUG
((
DEBUG_INFO
,
"OC: Returning tool %s
\n
"
,
ToolPath
));
DebugPrintDevicePath
(
DEBUG_INFO
,
"OC: Tool path"
,
*
DevicePath
);
DebugPrintDevicePath
(
DEBUG_INFO
,
"OC: Storage path"
,
*
StoragePath
);
}
return
EFI_SUCCESS
;
...
...
@@ -583,49 +585,36 @@ OcMiscEarlyInit (
return
EFI_SUCCESS
;
}
EFI_STATUS
VOID
OcMiscMiddleInit
(
IN
OC_STORAGE_CONTEXT
*
Storage
,
IN
OC_GLOBAL_CONFIG
*
Config
,
IN
CONST
CHAR16
*
RootPath
OPTIONAL
,
IN
EFI_DEVICE_PATH_PROTOCOL
*
LoadPath
OPTIONAL
,
OUT
EFI_HANDLE
*
LoadHandle
IN
EFI_HANDLE
LoadHandle
OPTIONAL
)
{
EFI_STATUS
Status
;
CONST
CHAR8
*
BootProtect
;
UINT32
BootProtectFlag
;
CHAR16
*
BootstrapPath
;
UINTN
BootstrapSize
;
EFI_HANDLE
OcHandle
;
if
((
Config
->
Misc
.
Security
.
ExposeSensitiveData
&
OCS_EXPOSE_BOOT_PATH
)
!=
0
)
{
OcStoreLoadPath
(
LoadPath
);
}
OcHandle
=
NULL
;
if
(
LoadPath
!=
NULL
)
{
Status
=
gBS
->
LocateDevicePath
(
&
gEfiSimpleFileSystemProtocolGuid
,
&
LoadPath
,
&
OcHandle
);
}
else
{
Status
=
EFI_UNSUPPORTED
;
}
BootProtect
=
OC_BLOB_GET
(
&
Config
->
Misc
.
Security
.
BootProtect
);
DEBUG
((
DEBUG_INFO
,
"OC: LoadHandle %p with BootProtect in %a mode
- %r
\n
"
,
OcHandle
,
BootProtect
,
Status
));
DEBUG
((
DEBUG_INFO
,
"OC: LoadHandle %p with BootProtect in %a mode
\n
"
,
LoadHandle
,
BootProtect
));
BootProtectFlag
=
Config
->
Uefi
.
Quirks
.
RequestBootVarRouting
?
OC_BOOT_PROTECT_VARIABLE_NAMESPACE
:
0
;
if
(
Oc
Handle
!=
NULL
&&
AsciiStrCmp
(
BootProtect
,
"Bootstrap"
)
==
0
)
{
if
(
Load
Handle
!=
NULL
&&
AsciiStrCmp
(
BootProtect
,
"Bootstrap"
)
==
0
)
{
ASSERT
(
RootPath
!=
NULL
);
BootstrapSize
=
StrSize
(
RootPath
)
+
StrSize
(
OPEN_CORE_BOOTSTRAP_PATH
);
BootstrapPath
=
AllocatePool
(
BootstrapSize
);
if
(
BootstrapPath
!=
NULL
)
{
UnicodeSPrint
(
BootstrapPath
,
BootstrapSize
,
L"%s
\\
%s"
,
RootPath
,
OPEN_CORE_BOOTSTRAP_PATH
);
OcRegisterBootOption
(
L"OpenCore"
,
Oc
Handle
,
BootstrapPath
);
OcRegisterBootOption
(
L"OpenCore"
,
Load
Handle
,
BootstrapPath
);
BootProtectFlag
=
OC_BOOT_PROTECT_VARIABLE_BOOTSTRAP
;
FreePool
(
BootstrapPath
);
}
...
...
@@ -642,15 +631,11 @@ OcMiscMiddleInit (
&
BootProtectFlag
);
*
LoadHandle
=
OcHandle
;
DEBUG_CODE_BEGIN
();
if
(
Oc
Handle
!=
NULL
&&
Config
->
Misc
.
Debug
.
SysReport
)
{
ProduceDebugReport
(
Oc
Handle
);
if
(
Load
Handle
!=
NULL
&&
Config
->
Misc
.
Debug
.
SysReport
)
{
ProduceDebugReport
(
Load
Handle
);
}
DEBUG_CODE_END
();
return
Status
;
}
EFI_STATUS
...
...
@@ -872,6 +857,8 @@ OcMiscBoot (
Context
->
CustomEntries
[
EntryIndex
].
Arguments
=
OC_BLOB_GET
(
&
Config
->
Misc
.
Entries
.
Values
[
Index
]
->
Arguments
);
Context
->
CustomEntries
[
EntryIndex
].
Auxiliary
=
Config
->
Misc
.
Entries
.
Values
[
Index
]
->
Auxiliary
;
Context
->
CustomEntries
[
EntryIndex
].
Tool
=
FALSE
;
Context
->
CustomEntries
[
EntryIndex
].
TextMode
=
Config
->
Misc
.
Entries
.
Values
[
Index
]
->
TextMode
;
Context
->
CustomEntries
[
EntryIndex
].
RealPath
=
TRUE
;
///< Always true for entries
++
EntryIndex
;
}
}
...
...
@@ -888,6 +875,8 @@ OcMiscBoot (
Context
->
CustomEntries
[
EntryIndex
].
Arguments
=
OC_BLOB_GET
(
&
Config
->
Misc
.
Tools
.
Values
[
Index
]
->
Arguments
);
Context
->
CustomEntries
[
EntryIndex
].
Auxiliary
=
Config
->
Misc
.
Tools
.
Values
[
Index
]
->
Auxiliary
;
Context
->
CustomEntries
[
EntryIndex
].
Tool
=
TRUE
;
Context
->
CustomEntries
[
EntryIndex
].
TextMode
=
Config
->
Misc
.
Tools
.
Values
[
Index
]
->
TextMode
;
Context
->
CustomEntries
[
EntryIndex
].
RealPath
=
Config
->
Misc
.
Tools
.
Values
[
Index
]
->
RealPath
;
++
EntryIndex
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录