Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
btwise
OpenCorePKG_MOD
提交
afd98238
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,发现更多精彩内容 >>
提交
afd98238
编写于
5月 24, 2020
作者:
D
Download-Fritz
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
OcBootManagementLib: Set 'Windows' name based on booter name
上级
bffded3a
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
57 addition
and
14 deletion
+57
-14
Include/Acidanthera/Library/OcBootManagementLib.h
Include/Acidanthera/Library/OcBootManagementLib.h
+8
-2
Library/OcBootManagementLib/BootEntryInfo.c
Library/OcBootManagementLib/BootEntryInfo.c
+5
-4
Library/OcBootManagementLib/BootEntryManagement.c
Library/OcBootManagementLib/BootEntryManagement.c
+7
-3
Library/OcBootManagementLib/OcBootManagementLib.c
Library/OcBootManagementLib/OcBootManagementLib.c
+3
-1
Library/OcBootManagementLib/PolicyManagement.c
Library/OcBootManagementLib/PolicyManagement.c
+30
-4
Library/OcDevicePathLib/OcDevicePathLib.c
Library/OcDevicePathLib/OcDevicePathLib.c
+4
-0
未找到文件。
Include/Acidanthera/Library/OcBootManagementLib.h
浏览文件 @
afd98238
...
...
@@ -170,6 +170,10 @@ typedef struct OC_BOOT_ENTRY_ {
//
BOOLEAN
IsFolder
;
//
// Set when this entry refers to a generic booter (e.g. BOOTx64.EFI).
//
BOOLEAN
IsGeneric
;
//
// Should make this option default boot option.
//
BOOLEAN
SetDefault
;
...
...
@@ -1005,14 +1009,16 @@ OcGetFileSystemPolicyType (
@param[in] DevicePath Device path.
@param[out] IsFolder Device path represents directory, optional.
@param[out] IsGeneric Device path represents generic booter, optional.
@retval entry type for potentially known bootloaders.
@retval OC_BOOT_UNKNOWN for unknown bootloaders.
**/
OC_BOOT_ENTRY_TYPE
OcGetBootDevicePathType
(
IN
EFI_DEVICE_PATH_PROTOCOL
*
DevicePath
,
OUT
BOOLEAN
*
IsFolder
OPTIONAL
IN
EFI_DEVICE_PATH_PROTOCOL
*
DevicePath
,
OUT
BOOLEAN
*
IsFolder
OPTIONAL
,
OUT
BOOLEAN
*
IsGeneric
OPTIONAL
);
/**
...
...
Library/OcBootManagementLib/BootEntryInfo.c
浏览文件 @
afd98238
...
...
@@ -540,17 +540,18 @@ InternalDescribeBootEntry (
//
// Windows boot entry may have a custom name, so ensure OC_BOOT_WINDOWS is set correctly.
//
if
(
BootEntry
->
Type
==
OC_BOOT_UNKNOWN
)
{
if
(
BootEntry
->
Type
==
OC_BOOT_UNKNOWN
&&
BootEntry
->
IsGeneric
)
{
DEBUG
((
DEBUG_INFO
,
"OCB: Trying to detect Microsoft BCD
\n
"
));
Status
=
ReadFileSize
(
FileSystem
,
L"
\\
EFI
\\
Microsoft
\\
Boot
\\
BCD"
,
&
BcdSize
);
if
(
!
EFI_ERROR
(
Status
))
{
BootEntry
->
Type
=
OC_BOOT_WINDOWS
;
if
(
BootEntry
->
Name
==
NULL
)
{
BootEntry
->
Name
=
AllocateCopyPool
(
sizeof
(
L"Windows"
),
L"Windows"
);
}
}
}
if
(
BootEntry
->
Type
==
OC_BOOT_WINDOWS
&&
BootEntry
->
Name
==
NULL
)
{
BootEntry
->
Name
=
AllocateCopyPool
(
sizeof
(
L"Windows"
),
L"Windows"
);
}
if
(
BootEntry
->
Name
==
NULL
)
{
BootEntry
->
Name
=
GetVolumeLabel
(
FileSystem
);
if
(
BootEntry
->
Name
!=
NULL
...
...
Library/OcBootManagementLib/BootEntryManagement.c
浏览文件 @
afd98238
...
...
@@ -270,10 +270,11 @@ RegisterBootOption (
DEBUG
((
DEBUG_INFO
,
"OCB: Registering entry %s (T:%d|F:%d|E:%d) - %s
\n
"
,
"OCB: Registering entry %s (T:%d|F:%d|
G:%d|
E:%d) - %s
\n
"
,
BootEntry
->
Name
,
BootEntry
->
Type
,
BootEntry
->
IsFolder
,
BootEntry
->
IsGeneric
,
BootEntry
->
IsExternal
,
OC_HUMAN_STRING
(
TextDevicePath
)
));
...
...
@@ -349,8 +350,9 @@ AddBootEntryOnFileSystem (
OC_BOOT_ENTRY
*
ExistingEntry
;
CHAR16
*
TextDevicePath
;
BOOLEAN
IsFolder
;
BOOLEAN
IsGeneric
;
EntryType
=
OcGetBootDevicePathType
(
DevicePath
,
&
IsFolder
);
EntryType
=
OcGetBootDevicePathType
(
DevicePath
,
&
IsFolder
,
&
IsGeneric
);
DEBUG_CODE_BEGIN
();
...
...
@@ -358,9 +360,10 @@ AddBootEntryOnFileSystem (
DEBUG
((
DEBUG_INFO
,
"OCB: Adding entry type (T:%u|F:%d) - %s
\n
"
,
"OCB: Adding entry type (T:%u|F:%d
|G:%d
) - %s
\n
"
,
EntryType
,
IsFolder
,
IsGeneric
,
OC_HUMAN_STRING
(
TextDevicePath
)
));
...
...
@@ -462,6 +465,7 @@ AddBootEntryOnFileSystem (
BootEntry
->
DevicePath
=
DevicePath
;
BootEntry
->
Type
=
EntryType
;
BootEntry
->
IsFolder
=
IsFolder
;
BootEntry
->
IsGeneric
=
IsGeneric
;
BootEntry
->
IsExternal
=
RecoveryPart
?
FileSystem
->
RecoveryFs
->
External
:
FileSystem
->
External
;
Status
=
InternalDescribeBootEntry
(
BootEntry
);
...
...
Library/OcBootManagementLib/OcBootManagementLib.c
浏览文件 @
afd98238
...
...
@@ -626,11 +626,13 @@ OcRunBootPicker (
if
(
!
EFI_ERROR
(
Status
))
{
DEBUG
((
DEBUG_INFO
,
"OCB: Should boot from %u. %s (T:%d|F:%d|DEF:%d)
\n
"
,
"OCB: Should boot from %u. %s (T:%d|F:%d|
G:%d|E:%d|
DEF:%d)
\n
"
,
Chosen
->
EntryIndex
,
Chosen
->
Name
,
Chosen
->
Type
,
Chosen
->
IsFolder
,
Chosen
->
IsGeneric
,
Chosen
->
IsExternal
,
Chosen
->
SetDefault
));
...
...
Library/OcBootManagementLib/PolicyManagement.c
浏览文件 @
afd98238
...
...
@@ -257,7 +257,8 @@ InternalCheckScanPolicy (
OC_BOOT_ENTRY_TYPE
OcGetBootDevicePathType
(
IN
EFI_DEVICE_PATH_PROTOCOL
*
DevicePath
,
OUT
BOOLEAN
*
IsFolder
OPTIONAL
OUT
BOOLEAN
*
IsFolder
OPTIONAL
,
OUT
BOOLEAN
*
IsGeneric
OPTIONAL
)
{
EFI_DEVICE_PATH_PROTOCOL
*
CurrNode
;
...
...
@@ -295,6 +296,10 @@ OcGetBootDevicePathType (
Type
=
OC_BOOT_APPLE_RECOVERY
;
}
else
if
(
OcStrStrLength
(
LastNode
->
PathName
,
PathLen
,
L"EFI
\\
APPLE"
,
L_STR_LEN
(
L"EFI
\\
APPLE"
))
!=
NULL
)
{
//
// FIXME: Support separate file path nodes. Potentially introduce a
// retrieval function that uses a preallocated buffer.
//
Type
=
OC_BOOT_APPLE_FW_UPDATE
;
}
}
...
...
@@ -317,17 +322,20 @@ OcGetBootDevicePathType (
//
STATIC
CONST
CHAR16
*
Bootloaders
[]
=
{
L"boot.efi"
,
L"tmbootpicker.efi"
L"tmbootpicker.efi"
,
L"bootmgfw.efi"
};
STATIC
CONST
UINTN
BootloaderLengths
[]
=
{
L_STR_LEN
(
L"boot.efi"
),
L_STR_LEN
(
L"tmbootpicker.efi"
)
L_STR_LEN
(
L"tmbootpicker.efi"
),
L_STR_LEN
(
L"bootmgfw.efi"
)
};
STATIC
CONST
OC_BOOT_ENTRY_TYPE
BootloaderTypes
[]
=
{
OC_BOOT_APPLE_OS
,
OC_BOOT_APPLE_TIME_MACHINE
OC_BOOT_APPLE_TIME_MACHINE
,
OC_BOOT_WINDOWS
};
for
(
Index
=
0
;
Index
<
ARRAY_SIZE
(
Bootloaders
);
++
Index
)
{
...
...
@@ -345,6 +353,24 @@ OcGetBootDevicePathType (
}
}
CONST
CHAR16
*
GenericBootloader
=
&
EFI_REMOVABLE_MEDIA_FILE_NAME
[
L_STR_LEN
(
L"
\\
EFI
\\
BOOT
\\
"
)];
CONST
UINTN
GenericBootloaderLength
=
L_STR_LEN
(
EFI_REMOVABLE_MEDIA_FILE_NAME
)
-
L_STR_LEN
(
L"
\\
EFI
\\
BOOT
\\
"
);
if
(
IsGeneric
!=
NULL
)
{
*
IsGeneric
=
FALSE
;
if
(
PathLen
>=
GenericBootloaderLength
)
{
RestLen
=
PathLen
-
GenericBootloaderLength
;
if
((
RestLen
==
0
||
LastNode
->
PathName
[
RestLen
-
1
]
==
L'\\'
)
&&
CompareMem
(
&
LastNode
->
PathName
[
RestLen
],
GenericBootloader
,
GenericBootloaderLength
*
sizeof
(
LastNode
->
PathName
[
0
]))
==
0
)
{
*
IsGeneric
=
TRUE
;
}
}
}
return
OC_BOOT_UNKNOWN
;
}
...
...
Library/OcDevicePathLib/OcDevicePathLib.c
浏览文件 @
afd98238
...
...
@@ -891,6 +891,10 @@ OcFileDevicePathFullName (
ASSERT
(
IsDevicePathValid
(
&
FilePath
->
Header
,
0
));
ASSERT
(
PathNameSize
==
OcFileDevicePathFullNameSize
(
&
FilePath
->
Header
));
//
// FIXME: Insert separators between nodes if not present already.
//
do
{
PathLen
=
OcFileDevicePathNameLen
(
FilePath
);
CopyMem
(
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录