Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
btwise
OpenCorePKG_MOD
提交
e5a85b17
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,发现更多精彩内容 >>
提交
e5a85b17
编写于
8月 20, 2020
作者:
V
vit9696
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
OcBootManagementLib: Implement 11.0 recovery compatibility
上级
47a341f8
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
73 addition
and
1 deletion
+73
-1
Include/Acidanthera/Library/OcAppleSecureBootLib.h
Include/Acidanthera/Library/OcAppleSecureBootLib.h
+22
-0
Library/OcAppleSecureBootLib/OcAppleSecureBootLib.c
Library/OcAppleSecureBootLib/OcAppleSecureBootLib.c
+37
-0
Library/OcBootManagementLib/DmgBootSupport.c
Library/OcBootManagementLib/DmgBootSupport.c
+13
-1
Library/OcBootManagementLib/OcBootManagementLib.inf
Library/OcBootManagementLib/OcBootManagementLib.inf
+1
-0
未找到文件。
Include/Acidanthera/Library/OcAppleSecureBootLib.h
浏览文件 @
e5a85b17
...
...
@@ -47,4 +47,26 @@ OcAppleSecureBootInstallProtocol (
IN
BOOLEAN
SbWinPolicyValid
);
/**
Report DMG loading to Apple Secure Boot protocol.
@param[in] LoadingDmg TRUE after loading DMG.
@retval EFI_SUCCESS on success.
**/
EFI_STATUS
OcAppleSecureBootSetDmgLoading
(
IN
BOOLEAN
LoadingDmg
);
/**
Get DMG loading status on Apple Secure Boot protocol.
@retval TRUE when loading DMG.
**/
BOOLEAN
OcAppleSecureBootGetDmgLoading
(
VOID
);
#endif // OC_APPLE_SECURE_BOOT_LIB_H
Library/OcAppleSecureBootLib/OcAppleSecureBootLib.c
浏览文件 @
e5a85b17
...
...
@@ -33,6 +33,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include <Library/UefiBootServicesTableLib.h>
#include <Library/UefiRuntimeServicesTableLib.h>
STATIC
BOOLEAN
mDmgLoading
=
FALSE
;
STATIC
BOOLEAN
mSbAvailable
=
TRUE
;
STATIC
UINT8
mSbPolicy
=
AppleImg4SbModeMedium
;
...
...
@@ -1039,3 +1040,39 @@ OcAppleSecureBootInstallProtocol (
return
&
SecureBoot
;
}
EFI_STATUS
OcAppleSecureBootSetDmgLoading
(
IN
BOOLEAN
LoadingDmg
)
{
EFI_STATUS
Status
;
APPLE_SECURE_BOOT_PROTOCOL
*
SecureBoot
;
Status
=
gBS
->
LocateProtocol
(
&
gAppleSecureBootProtocolGuid
,
NULL
,
(
VOID
**
)
&
SecureBoot
);
if
(
!
EFI_ERROR
(
Status
))
{
mDmgLoading
=
LoadingDmg
;
if
(
LoadingDmg
)
{
DEBUG
((
DEBUG_INFO
,
"OCB: Disabling secure boot for Apple images
\n
"
));
SecureBoot
->
SetAvailability
(
SecureBoot
,
FALSE
);
}
else
{
DEBUG
((
DEBUG_INFO
,
"OCB: Reenabling secure boot after Apple images
\n
"
));
SecureBoot
->
SetAvailability
(
SecureBoot
,
FALSE
);
}
}
return
Status
;
}
BOOLEAN
OcAppleSecureBootGetDmgLoading
(
VOID
)
{
return
mDmgLoading
;
}
Library/OcBootManagementLib/DmgBootSupport.c
浏览文件 @
e5a85b17
...
...
@@ -16,6 +16,7 @@
#include <Guid/FileInfo.h>
#include <Library/OcAppleSecureBootLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/DebugLib.h>
#include <Library/DevicePathLib.h>
...
...
@@ -473,7 +474,13 @@ InternalLoadDmg (
);
Context
->
DevicePath
=
DevPath
;
if
(
DevPath
==
NULL
)
{
if
(
DevPath
!=
NULL
)
{
//
// If we succeeded, we need to disable Apple Secure Boot, as DMG images
// are currently only verified with the chunklist.
//
OcAppleSecureBootSetDmgLoading
(
TRUE
);
}
else
{
DEBUG
((
DEBUG_INFO
,
"OCB: Failed to retrieve boot file from DMG
\n
"
));
OcAppleDiskImageFreeFile
(
Context
->
DmgContext
);
...
...
@@ -501,5 +508,10 @@ InternalUnloadDmg (
OcAppleDiskImageFreeContext
(
DmgLoadContext
->
DmgContext
);
FreePool
(
DmgLoadContext
->
DmgContext
);
DmgLoadContext
->
DevicePath
=
NULL
;
//
// This code should never execute, as with Apple Secure Boot
// it should always reboot on failure, but just in case.
//
OcAppleSecureBootSetDmgLoading
(
FALSE
);
}
}
Library/OcBootManagementLib/OcBootManagementLib.inf
浏览文件 @
e5a85b17
...
...
@@ -102,6 +102,7 @@
OcAppleDiskImageLib
OcAppleKeyMapLib
OcAppleKeysLib
OcAppleSecureBootLib
OcConsoleLib
OcCryptoLib
OcDevicePathLib
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录